Repository navigation
fix(ui): preserve keyboard intent when recovering hovercard focus - #169073
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThe PR makes hovercard focus recovered after mounting use the ordinary keyboard activation and dismissal rules. Example: Focus #99815 before its registered preview provider mounts, enter the card with Tab, then focus an outside button.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Regression provenanceRegression provenance — verified: source commit Merge readiness✅ Ready for maintainer review Keep this PR open: it fixes a current-main keyboard dismissal regression through the existing focus owner, with no actionable correctness findings. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Control UI hovercard owner receives link focus and pointer events, resolves preview targets, loads metadata through the existing Gateway client, and manages the shared portaled card. flowchart LR
A[Focused link] --> B[Solid bridge mounting]
B --> C[Hovercard owner]
D[Pointer and focus events] --> C
C --> E[Gateway preview request]
E --> F[Portaled preview card]
C --> F
F --> G[Keyboard traversal and dismissal]
Technical reviewBest possible solution: Use the existing keyboard activation owner for mount recovery while preserving pointer timing and shared dismissal. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the pre-mount focus-to-pointer-intent failure, and the author reports the extended regression failing before the fix; no target code was executed during this review. Is this the best way to solve the issue? The patch corrects the intent producer by sharing the ordinary focus path, including the existing focus-visible rule, without adding another dismissal mechanism. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 86f4a215920c. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource 0, Tests +5. Total +5 across 2 files. Added test files: 0. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 11, 2026, 7:10 AM ET / 11:10 UTC (Revision 2). |
|
Merged via squash.
|
…enclaw#169073) Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Follow-up to #168790. When a link receives focus before its already-registered hovercard provider mounts, focus recovery used the pointer activation body. The card opened with a hover delay and stayed open after keyboard focus left it because it retained pointer intent.
User Impact
Recovered keyboard focus now follows the same immediate activation, focus-visible rule, and dismissal path as an ordinary focus event. Pointer hovering keeps its existing delay and behavior.
Evidence
pnpm test ui/src/components/link-reader-hovercard-interactions.test.ts --maxWorkers=1pnpm test ui/src/app/native-link-routing.test.ts --maxWorkers=1pnpm test ui/src/components/link-reader-hovercard-seeds.test.ts --maxWorkers=1git diff --checkProduction LOC is unchanged; tests grow by five lines. This is a behavior-only correction to the viewer migration; its inspected visual pairs remain in #168790. The single Testbox attempt for that lane never admitted a runner and created no lease. Heavy validation uses PR CI.
Exact-head CI run 38133681023 is green on
9169cc55638c86d4a62d450f19bbacbb241a46ce, including the required types, lint, ratchets, UI unit and UI E2E checks.