feat(ui): Figma Snapshot PAT error deep-links to token settings (#1399)#1547
Merged
Conversation
…1399) A failed Figma snapshot caused by a PAT/credential problem previously rendered a plain red error with no path to fix it — the operator had to hunt through Settings to find the Figma access-token field. The assertive error card now renders an "Open Figma access token settings" action for credential errors (FIGMA_TOKEN_MISSING/INVALID/EXPIRED/REVOKED/ INSUFFICIENT_SCOPE). Clicking it opens Settings → Models → the gateway-setup dialog with the Figma access-token field focused. Cross-window navigation uses a small gatewaySetupBus (module-level latch + CustomEvent, mirroring activityBus): the Settings window is a singleton tool window and openWindow does not merge cfg into an already-open instance, so a cfg deep-link would be dropped. The latch covers "Settings just opened" (read on mount); the event covers "Settings already open" (live listener); exactly one path claims each request. The dialog open is deferred until config has resolved without error so it never flashes first-run wording. The browser tier still never holds or transmits the PAT (resolved server-side); only the error code and a contentless request signal cross the boundary. Regenerated the #1300 visual-regression / a11y / editor-fidelity proofs for the additive .figma-snapshot-error-action CSS (verdicts unchanged, SHA pin only). Refs #1399 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…rman-f136b9 # Conflicts: # docs/design-system/evidence/1300/a11y/a11y-proof.json # docs/design-system/evidence/1300/consolidated-fidelity-proof.json # docs/design-system/evidence/1300/editor/editor-fidelity-proof.json
…9' into claude/ecstatic-lichterman-f136b9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A failed Figma snapshot caused by a PAT/credential problem previously rendered a plain red error with no path to fix it — the operator had to hunt through Settings to find the Figma access-token field.
The assertive error card now renders an "Open Figma access token settings" action for credential errors (
FIGMA_TOKEN_MISSING/INVALID/EXPIRED/REVOKED/INSUFFICIENT_SCOPE). Clicking it opens Settings → Models → the gateway-setup dialog with the Figma access-token field focused.Cross-window navigation uses a small
gatewaySetupBus(module-level latch +CustomEvent, mirroring the existingactivityBus). The Settings window is a singleton tool window andopenWindowdoes not mergecfginto an already-open instance, so a cfg-based deep-link would be dropped. The latch covers "Settings just opened" (read on mount); the event covers "Settings already open" (live listener); exactly one path claims each request. Dialog open is deferred until config has resolved without error so it never flashes first-run wording or focuses the wrong field.The browser tier still never holds or transmits the PAT (resolved server-side); only the error code and a content-free request signal cross the window boundary.
Refs #1399
Scope
Reuse And No-Duplication
Reuse evidence: reuses the existing
GatewaySetupDialogFigma section (the only place the PAT can be entered, server-side security invariant), the existingSettingsPanelsetup-open path, the existing assertive error-card pattern inFigmaSnapshotWindow, and mirrors the existingactivityBuscross-tree messaging pattern rather than adding a new subsystem.Product Impact
Verification
Required:
Local verification:
13 new tests cover: the bus (latch one-shot + event), all five PAT codes rendering the action and invoking the callback, the missing-callback and non-PAT negative cases, both window states (latch-on-mount + live-event), the no-spurious-open case, the load-failure deferral + retry, and a jest-axe scan of the action button inside
role="alert".Reuse / gap rationale:
Select only what applies:
Not applicable rationale:
Review And Closure
An adversarial multi-lens review (correctness/race, a11y, security/boundaries, tests) was run; all four real findings were fixed in this branch (latch mutual-exclusion guard, defer-on-
modelError, jest-axe coverage of the PAT button, focus-rationale comment). Security and architecture-boundary lenses came back clean. UsesRefs #1399(notResolves) — leaving issue closure to the maintainer per the owner-review-gated workflow.Risk Notes
#1300evidence proofs (SHA pin + sub-perceptual PNG deltas), matching the convention of priorglobals.csscommits; verdicts are unchanged (PASS).