Skip to content

web: token / sign-in (chrome polish) - #110

Merged
Code4me2 merged 2 commits into
mainfrom
cursor/web-token-sign-in-4302
Sep 1, 2026
Merged

Code4me2 merged 2 commits into
mainfrom
cursor/web-token-sign-in-4302

Conversation

@Code4me2

@Code4me2 Code4me2 commented Sep 1, 2026 •

Copy link
Copy Markdown
Member

Chrome polish leftover: token persistence, the App gate, NoToken copy, and SignInDialog’s device-code poll/cancel. Branched from current main (e84dc7b, squash of #108). Web-only.

A sibling agent owns keyboard/a11y (#102 #65 #91 #64 #68 #82 #84 #67 #87). This PR does not touch TreeRow, ProjectTree, Viewport tabindex/skip links, Popover’s focus trap, Button min-width/resting chrome, or Inspector tab ARIA.

Closes

#47, #80, #73, #76.

Verified against current main + INTERFACE.md

Issue bodies are 2026-09-01 field notes. Rechecked on e84dc7b:

Not restacked: quiet rail (#107 / #55 compact chip), well leftovers (#108), pin honesty (#106).

What changed

  • Token the page was given survives reload via sessionStorage. workspaceToken() re-reads storage when the in-memory hold is empty. A ?r= cache-buster and a workspace route (explode t=) do not eat it.
  • A 401 that drops the token notifies the App gate. This tab remounts the no-token panel (data-token-absence="unauthorized") instead of leaving a live-looking shell. A fresh QueryClient is created per hold.
  • NoToken copy states the page has no token held, not that it was opened without one. Live 401 uses §2.4 unauthorized.
  • One recovery field on that panel (Reload drops the #t= workspace token #47): paste a #t= address or the token itself. Not a settings app, not a credential prompt.
  • While a device-code or authorize-url flow is open, the dialog polls loginStatus until complete or a named failure, then onSignedIn / onClose. Dismiss (Escape, overlay) calls cancelLogin. Paste-path completeLogin is unchanged. Popover’s focus trap is unused except as the existing dialog host.

Locked decisions (not reopened)

Out of this PR

Tests

Local web/: pnpm typecheck, pnpm lint, and pnpm test all pass (41 files, 661 tests). Coverage for token surviving reload, 401 remounting NoToken in-tab, NoToken copy not blaming open-without, device-code poll-to-complete, dismiss calling cancelLogin. Existing e2e selectors ([data-testid="no-token"], data-signin-*) not weakened.

Built web/ and opened the preview at 1280×800 without a live heph serve. The absence panel states no token held and offers the single paste field. Holding a pasted #t= remounts the shell in this tab (502s are expected with no API). Live 401 remount and device-code poll are pinned in unit tests.

NoToken panel: no token held, single paste field
After paste, the gate remounts the workspace shell

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

cursoragent and others added 2 commits September 1, 2026 16:50
Keep the workspace token across reload, remount NoToken on a live 401,
stop blaming the operator for a dropped hold, and poll/cancel device-code
sign-in. Closes #47, #80, #73, #76.

Co-authored-by: Vel <Code4me2@users.noreply.github.com>
Avoid a render-time ref write (react-hooks/refs). cancelLogin is
idempotent, so dismiss can call it whether a flow was started or not.

Co-authored-by: Vel <Code4me2@users.noreply.github.com>
@Code4me2
Code4me2 merged commit 772fef3 into main Sep 1, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants