Skip to content
This repository was archived by the owner on Nov 7, 2026. It is now read-only.

fix(hud): wrap long handoff prompts and grow the card within the viewport - #107

Merged
kitlangton merged 1 commit into
mainfrom
fix/handoff-copy-wrap
Oct 25, 2026
Merged

kitlangton merged 1 commit into
mainfrom
fix/handoff-copy-wrap

Conversation

@kitlangton

@kitlangton kitlangton commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Why

A long handoff() message rendered on a single line with an ellipsis, so the person being asked to act couldn't read the instructions. In the Problems TestFlight flow, the card read "Sign in with your PERSONAL Apple account (Ch..." and hid exactly the part that said which account to use.

What Changes

The unfolded card now sizes itself to its content:

  • The prompt wraps across as many lines as it needs, keeps explicit line breaks, and switches to left alignment once it spans more than one line. Short prompts stay centered at the original 324×82 size.
  • The card grows downward to fit. Width is capped at min(324px, viewport − 16px) and height at the viewport minus the island's top offset, margin and shadow room. If the text is still taller than that, only the prompt scrolls; the Continue/Allow row stays pinned and visible.
  • The size is re-measured when the message changes during a handoff and when the window is resized, and the springs retarget smoothly. The canvas grows with the card and shrinks back once it folds.

Before (1280×800):

After (1280×800):

Tab request at 320px wide:

Very long prompt in a 360px-tall viewport (the prompt scrolls and Continue stays reachable):

The island stylesheet moved from the content script into extension/src/dynamic-island-gpu.ts (islandStyleSheet), so the harness below renders exactly what ships.

Verification

./node_modules/.bin/tsc --noEmit --noUnusedLocals --noUnusedParameters
./node_modules/.bin/knip
./node_modules/.bin/vitest run --maxWorkers=3
./node_modules/.bin/tsx scripts/build-extension.ts --outdir <tmp>

Typecheck, Knip and jscpd are clean, and all 993 tests pass. I also ran a headless Chromium harness that mounts the real DynamicIslandRig and stylesheet, measures the shadow DOM, then clicks the first button:

Case Viewport Card Prompt Button in viewport and clickable
Long handoff 1280×800 324×140 fits, wrapped yes
Long handoff 360×740 324×140 fits, wrapped yes
Short handoff 1280×800 324×82 single line, centered yes
Tab request 320×640 304×91 fits, wrapped yes
6× long message 1280×360 324×316 scrolls yes

Switching from a short message to a long one mid-handoff grows the card (and canvas) from 82px to 140px, and folding back restores the 128px canvas. I haven't verified this live in the extension: deploying needs an extension reload, and that is waiting on a pending handoff in another session.

@kitlangton
kitlangton force-pushed the fix/handoff-copy-wrap branch from c96c7bd to fdd2b53 Compare October 25, 2026 22:37
@kitlangton
kitlangton merged commit 9ea31dc into main Oct 25, 2026
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant