Skip to content

fix(ui): preserve keyboard intent when recovering hovercard focus - #169073

Merged
steipete merged 1 commit into
mainfrom
fix/solid-viewer-focus-origin
Oct 11, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/solid-viewer-focus-origin

Conversation

@steipete

@steipete steipete commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

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

Proof Result
Existing keyboard-exit regression extended to focus before mounting Fails before the fix: the card remains after focus moves outside
pnpm test ui/src/components/link-reader-hovercard-interactions.test.ts --maxWorkers=1 41 passed; 3.58 s wrapper wall time
pnpm test ui/src/app/native-link-routing.test.ts --maxWorkers=1 16 passed; 3.30 s
pnpm test ui/src/components/link-reader-hovercard-seeds.test.ts --maxWorkers=1 11 passed; 2.69 s
Focused lint, formatting, git diff --check Passed
Independent Codex review No actionable P0–P2 findings

Production 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.

@clawsweeper

clawsweeper Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 11, 2026
@clawsweeper

clawsweeper Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

The 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.

  • Before: Recovery applies the 250 ms hover delay and records pointer intent, leaving the card open after focus leaves.
  • After: Recovery uses keyboard intent without the hover delay, and the card dismisses after focus leaves.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused owner-level repair with useful regression coverage and green exact-head CI; behavior evidence remains at the component harness boundary.
Proof confidence 🦐 gold shrimp (3/6) The host identifies this as maintainer-authored and outside the ordinary contributor-proof gate; the focused component regression supports the changed behavior, while the inspected historical images cover other scenarios.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A keyboard-opened preview can remain visible after focus leaves when its source link received focus before provider mounting.
Reason: This maintainer-authored correction restores the established keyboard contract without adding settings, public APIs, or competing owners.

Regression provenance

Regression provenance — verified: source commit 6d01bf549cb3 by Peter Steinberger; canonical PR #168790 (blame-to-merge-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
Reviewed head: 9169cc55638c86d4a62d450f19bbacbb241a46ce

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied evidence does not show the pre-mount focus, preview entry, and outside-focus dismissal sequence in Chromium and WebKit, including the ordinary-page focus-visible rule.
Agent review details

How this fits together

The 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]
Loading

Technical review

Best 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

  • Mount-time focus recovery keeps the original intent (6d01bf5: Recover focused caller nodes after the Solid bridge mounts while preserving existing viewer interactions.)
  • Pointer and keyboard lifecycle keeps the original intent (fix(ui): GitHub link hovercard closes before the pointer can reach it #124274: Keep pointer traversal reachable and provide keyboard entry, traversal, and dismissal without reopening.)
  • Consolidated interaction tests keeps the original intent (1ab7e49: Consolidate repeated fixtures while retaining distinct focus and accessibility regressions.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 6d01bf5 adds ui/src/components/link-reader-hovercard-owner.ts:290 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 6d01bf549cb3; files: ui/src/components/link-reader-hovercard-owner.ts)

PR surface

Source 0, Tests +5. Total +5 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 12 12 0
Tests 1 45 40 +5
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 57 52 +5

Review metrics

Metric Value Why it matters
Production versus test growth Production +0 net lines; tests +5 net lines The repair reuses existing activation logic and adds one distinct mounting case to the existing regression table.

Root-cause cluster

Relationship: canonical
Canonical: #169073
Summary: This PR owns the isolated recovered-focus defect explicitly deferred from the merged viewer migration.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This repairs a bounded Control UI keyboard accessibility regression without changing configuration or stored data.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Verify pre-mount keyboard focus and subsequent dismissal in Chromium and WebKit, including the ordinary-page focus-visible rule.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-11T10:59:30.249Z sha 9169cc5 :: needs maintainer review before merge. :: none

Reviewed October 11, 2026, 7:10 AM ET / 11:10 UTC (Revision 2).

@steipete
steipete merged commit 99d173f into main Oct 11, 2026
93 checks passed
@steipete
steipete deleted the fix/solid-viewer-focus-origin branch October 11, 2026 11:14
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant