Files
loki/scripts/test/widget-sheet.ts
T
CatoandClaude 8757d532b6 feat(widget): fixes go as one change, watch sees what taps do, ◎ shows Loki (#1112)
The owner, on loki.orangecat.ch from a phone (2026-10-09): "if it proposes
five fixes and I click fix, where is it going? … how do I keep track?",
"I don't know when it's noticing something", "it should be easy to draw
its attention", and the panel still had a lot going on.

- Suggested changes are ONE decision (widget/suggestions.ts): every row
  ticked, a tap unticks, "Build these 3 as one change →" files one note —
  one agent, one PR, one row in Your changes. It used to be a Build per
  row: N runs queued in the project's one lane with nothing saying so.
  The owner's builds start without a confirmation card ("Edit first"
  opens it); a visitor's still confirm.
- Your changes: one summary line that opens ("1 building · 1 in line ·
  1 live"); each row is its own link. A change waiting behind another
  reads "In line" (owner-view.ts), not "Starting".
- Watch sees what a tap DID: for 1.5 s after a tap on a button or link it
  waits for the page to change, ask the server or navigate, notes which
  ("↳ It asked the server"), and says at once — after one tap, not three
  — when nothing visibly happened.
- ◎ beside the launcher while watching: point at anything on the page,
  the panel opens with it attached.
- Phone sheet (widget/sheet.ts): drag the top up for full screen, down to
  peek at the page, further to put it away.
- Shorter greeting.
- Tests: widget-suggestions, widget-sheet, widget-changes (summary, In
  line), widget-thoughts (results); watch-browser covers the tap results
  and the one-change build. Unit 360/360; watch/embed/host-avoid browser
  suites pass locally.


Claude-Session: https://claude.ai/code/session_011L2dmcydDLYAiNQwK4XcF4

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-09 05:33:56 -07:00

20 lines
901 B
TypeScript

/**
* The phone sheet's thumb rules: up grows it, down shrinks it, a long pull
* down puts it away, a small wobble changes nothing.
*
* Run: npx tsx scripts/test/widget-sheet.ts
*/
import assert from "node:assert/strict";
import { sheetSnap } from "../../widget/sheet";
assert.equal(sheetSnap("auto", -80), "full", "drag up: the whole screen");
assert.equal(sheetSnap("auto", 80), "peek", "drag down: a peek at the page");
assert.equal(sheetSnap("peek", 80), "close", "down from a peek: put away");
assert.equal(sheetSnap("auto", 200), "close", "a long pull down: put away");
assert.equal(sheetSnap("full", 200), "peek", "a long pull from full lands on a peek, not gone");
assert.equal(sheetSnap("auto", 20), "auto", "a wobble changes nothing");
assert.equal(sheetSnap("full", -80), "full");
assert.equal(sheetSnap("peek", -80), "auto");
console.log("✓ widget sheet: thumb sizes the panel");