Skip to content

fix(ui): GitHub link hovercard closes before the pointer can reach it - #124274

Merged
vyctorbrzezowski merged 4 commits into
mainfrom
brzezowski/hovercard-hover-intent
Aug 16, 2026
Merged

vyctorbrzezowski merged 4 commits into
mainfrom
brzezowski/hovercard-hover-intent

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Aug 15, 2026 •

Copy link
Copy Markdown
Member

Fixes #124270

What Problem This Solves

Fixes an issue where users hovering a GitHub issue or pull request link in Control UI chat could see the preview card but never reach it. The card disappeared the moment the pointer left the link, so moving toward the card destroyed it before the pointer could cross the gap, and its title, author, and diffstat could not be selected or copied. Once the card was reachable, its title still had no way to open the linked issue or pull request.

Why This Change Was Made

Hover intent now spans both surfaces the feature owns. The provider tracks pointer presence over the link, over the card, and focus, and dismissal runs through a single scheduleClose path that waits out a bounded 120ms traversal grace and then re-checks all tracked surfaces before closing. Because the card is portaled to document.body, outside the provider element, it reports its own hover through its own pointerenter/pointerleave listeners; the provider's delegated listeners could never have observed it. The card also stops declaring pointer-events: none, which had made it inert to the pointer regardless of lifecycle logic and blocked text selection.

The card's title is now an <a> reusing the exact href the card was activated with (the same GitHubLinkTarget the provider already parsed and validated; no new URL parsing was added), with target="_blank" and the shared buildExternalLinkRel()/EXTERNAL_LINK_TARGET helpers from ui/src/lib/external-link.ts, matching how other external links in Control UI open. Because the card is portaled outside the provider's delegated focusin/focusout listeners, focus landing on that link needed its own direct tracking (cardFocusInside), mirroring the existing pointerenter/pointerleave pattern on the card. That focus hold is released whenever the pointer leaves the card after a pointer-initiated open, so clicking the title link (which focuses it) can never leave a hover-opened card stuck open after the mouse moves away; the card still closes on pointer-out with no click-outside required. Keyboard-opened cards (tab focus on the source link) are unaffected: focus-out still closes them as before.

This follows the pattern the Control UI already uses for rich tooltips (ui/src/components/tooltip.ts, shouldRemainOpen / maybeClose); that logic lives inside a Lit component bound to the Web Awesome tooltip and its touch/skip-delay semantics, so it is applied here rather than extracted, which would have cost more surface than it saved.

Non-goals and preserved behavior: Escape, click-on-the-source-link, focus-out, viewport scroll/resize repositioning, and the route-removal observer dismiss exactly as before. A pending open that ends before the card exists is still cancelled immediately, so a link the pointer already left never flashes a card. The close timer is cleared on every close and on disconnect, so no timer outlives the element.

Scope note: two commits, one lifecycle

This PR is two commits, not one. The first restores reachability: hover intent across the link and the portaled card, with a bounded traversal grace. The second is a small, separate capability I added at the maintainer's request while the traversal fix was already touching this exact focus/pointer state machine: making the card's title a real, clickable link to the issue or pull request, since a reachable, selectable card that still could not be opened felt like an unfinished half of the fix. It reuses the already-validated href and the repo's existing external-link helpers, and needed only one more piece of state (cardFocusInside) layered onto the same lifecycle the first commit built, which is why it rides in this PR instead of a follow-up: splitting it out would mean re-deriving the shared traversal/focus contract in a second PR.

User Impact

Users can now move the pointer from a GitHub link onto its preview card and keep it open, select and copy the title, author, or diffstat, and read the preview at their own pace. The card's title is now a real link to the issue or pull request, opening in a new tab. The card dismisses when the pointer leaves both the link and the card, whether or not the title link was clicked first. Keyboard users are unaffected: focus still opens the card and Escape still closes it immediately.

Evidence

Unit-level lifecycle proof (jsdom)

Regression test stays open while the pointer travels from the link onto the card in ui/src/components/github-link-hovercard.test.ts drives the real lifecycle: hover the link, leave the link with the card as relatedTarget, assert the card survives the grace window, enter the card and assert it survives ten grace windows, then leave the card and assert it closes and restores aria-describedby.

closes on pointer-out even after the title link inside the card was clicked covers the added contract: pointer opens the card, pointer moves onto the card, the title link is clicked and focused, then the pointer leaves the card — the card still closes after the grace period with no click-outside needed. The existing renders and caches pull request details test also now asserts the title renders as an <a> with the activation href, target="_blank", and rel containing noopener noreferrer.

Verified failing before the fix by restoring the previous immediate-dismiss path in handlePointerOut:

 × stays open while the pointer travels from the link onto the card 4ms
AssertionError: expected null to be <div …(10)>…(3)</div> // Object.is equality
      Tests  1 failed | 10 passed (11)

With the fix in place:

$ LC_ALL=en_US.UTF-8 node scripts/run-vitest.mjs ui/src/components/github-link-hovercard.test.ts
 Test Files  1 passed (1)
      Tests  12 passed (12)

Real-browser proof (Chromium, e2e)

The unit tests above dispatch synthetic pointer events; they cannot show the pointer physically crossing the gap between the link and the card. ui/src/e2e/github-link-hovercard.e2e.test.ts already drove a real Chromium page with real mouse geometry for preview rendering and source-link navigation, so this PR extends it with two more real-browser cases instead of adding a second harness:

  • keeps the card open while the pointer crosses the gap onto it, then closes once it leaves both — hovers the real link, waits for the card, then drives page.mouse.move through real intermediate coordinates off the link, through the unowned strip below it, and onto the card body, asserting the card survives every step. It then holds the pointer on the card and confirms the card stays open, and finally moves the pointer off both surfaces with no click and confirms the card closes on its own after the traversal grace period.
  • opens the linked pull request when the card's title link is clicked — opens the card by hover, clicks the title anchor inside the portaled card, and asserts the resulting popup navigates to the exact pull request URL, mirroring the existing pullLink.click() popup assertion for the source link.
$ LC_ALL=en_US.UTF-8 node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/github-link-hovercard.e2e.test.ts
 Test Files  1 passed (1)
      Tests  3 passed (3)

Run three times in a row locally with no flakes (real Chromium, no synthetic/mocked pointer events for the traversal or click).

Changed-file gates green on the touched files (node scripts/check-changed.mjs -- ..., exit 0), including the Knip production and full-tree unused-export scans, the coercion helper guard, and format-changed-files.

Autoreview (.agents/skills/autoreview/scripts/autoreview --mode uncommitted) run clean before this push, with no accepted or actionable findings remaining.

Production LOC delta is now +102/-6 across github-link-hovercard.runtime.ts and components.css, of which roughly ten lines are the invariant comments this repo asks for at cross-path lifecycle sites; tests add +217/-4 (unit tests +99/-3, e2e +118/-1 for the two cases above plus their shared setup helper). The growth is the hover-intent capability itself (tracked surfaces, a grace timer, and cleanup) plus the title-link capability described in the scope note above, neither of which any existing shared helper covers.

ClawSweeper's "Before merge" checklist on this PR:

  • Production LOC growth for a bug fix (P1): the base fix's growth is inherent to portaling hover intent across an element the provider cannot otherwise observe; the title-link increment's further growth is new capability (a real link plus its focus contract), not bug-fix padding — see the LOC note above and the scope note.
  • Real-browser proof of the link-to-card pointer traversal (P1): added above — two new real-Chromium e2e cases in ui/src/e2e/github-link-hovercard.e2e.test.ts drive the actual pointer crossing and the title-link click/navigation, run three times locally with no flakes.
  • No separate ClawSweeper fix job should be created (P2): no action needed, this PR already owns the repair.

Update: the card is now an interactive popover, not a tooltip

The review was right that a focusable link inside role="tooltip" is not a coherent contract. The tooltip semantics were the wrong half to keep, so they are gone and the card now declares what it actually is.

Semantics. The card is a non-modal role="dialog" with an accessible name in every render state (loading, unavailable, and the full preview). The trigger link carries aria-haspopup="dialog" plus aria-expanded, flipping to true with aria-controls once the card exists, and the whole set is removed on close. That replaces the previous aria-describedby save/restore dance, which would have flattened the card's now-interactive content into a description string. This matches the pattern already used for non-modal popovers in ui/src/components/terminal/terminal-session-picker.ts (trigger aria-expanded/aria-haspopup="dialog"/aria-controls, surface role="dialog" + aria-label).

Keyboard. The card is portaled to document.body, so it has no neighbour in the tab sequence and could never be reached by Tab on its own. Tab from the trigger now forwards focus into the card, Tab moves between the card's own links natively, and Tab past either edge — or Escape from anywhere inside — returns focus to the trigger with the card closed. The returned focus is guarded so the card the user just dismissed cannot reopen under them. Focus leaving both the trigger and the card still closes it.

More of the card is now interactive, which is the substance behind the semantics change: the title and the owner/repo #number reference open the item, the author avatar and login open that profile, and a pull request's diff-size chip deep-links to the files-changed view. Issues have no files view, so their comment count stays plain text. All of them open in a new tab through the same EXTERNAL_LINK_TARGET / buildExternalLinkRel() helpers. The title keeps the card's only underline; the rest stay quiet until hovered or focused.

Pointer behavior is unchanged. The traversal grace period and its repair are untouched: leaving both the link and the card still dismisses it after 120ms, with no click required to close.

Visual proof

Pointer-opened card:

GitHub hovercard open under the pointer

Keyboard focus inside the card (Tab from the link, then Tab to the title link):

Keyboard focus ring on the hovercard title link

Validation for this change

Unit (ui/src/components/github-link-hovercard.test.ts, 15 passing) adds moves keyboard focus through the card's links and hands it back at the edges, closes on Escape from inside the card and returns focus to the link, and closes once focus leaves both the link and the card, and extends the existing preview case to assert role="dialog", the trigger's popup attributes, and every card link's href/target/rel. Against the pre-change runtime these fail for the intended reasons:

 × renders and caches pull request details without changing the link
   AssertionError: expected 'tooltip' to be 'dialog'
 × moves keyboard focus into the card and hands it back ...
 × closes once focus leaves both the link and the card
      Tests  3 failed | 11 passed (14)

Real Chromium (ui/src/e2e/github-link-hovercard.e2e.test.ts, 4 passing) adds exposes the card as a dialog whose title link Tab reaches and Escape leaves, which reads the real accessibility tree with page.getByRole("dialog"), walks Tab through repo → title → author, presses Escape, and asserts focus returns to the trigger without the card reopening. The click case now also asserts the files chip's popup lands on /pull/99816/files, and that the repo, author, and files links report text-decoration-line: none while hovered whereas the title reports underline.

$ LC_ALL=en_US.UTF-8 node scripts/run-vitest.mjs ui/src/components/github-link-hovercard.test.ts
      Tests  15 passed (15)

$ LC_ALL=en_US.UTF-8 node scripts/run-vitest.mjs ui/src/e2e/github-link-hovercard.e2e.test.ts
      Tests  4 passed (4)

node scripts/check-changed.mjs -- <touched files> green (UI typecheck, oxlint, UI stylelint, i18n verify, Knip unused-export scans), and autoreview --mode uncommitted clean with no accepted or actionable findings.

This lands as a third commit on the branch; the scope note above describes the first two.

@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review August 15, 2026 20:20
@openclaw-barnacle openclaw-barnacle Bot added the maintainer Maintainer-authored PR label Aug 15, 2026
@vyctorbrzezowski vyctorbrzezowski self-assigned this Aug 15, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 15, 2026
@clawsweeper

clawsweeper Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 7:57 PM ET / 23:57 UTC.

ClawSweeper review

What this changes

Repairs Control UI GitHub preview-card hover traversal, makes the preview keyboard-operable as a dialog, and adds navigable item, author, and pull-request-files links.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open. Current main still dismisses the portaled preview immediately and makes it pointer-inert; this PR repairs that owner boundary and resolves the prior interactive-tooltip concern. A maintainer should confirm the intentional expansion from a reachability fix to a multi-link dialog before landing.

Priority: P2
Reviewed head: 7b93f643c271f2849b4598dd8dbad6d812ac149d
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Strong direct UI proof and a coherent lifecycle repair support a good patch, with the expanded interaction scope still needing maintainer confirmation.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The PR supplies direct screenshots plus reported real-Chromium pointer, keyboard, and navigation coverage showing the after-fix behavior.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): The PR supplies direct screenshots plus reported real-Chromium pointer, keyboard, and navigation coverage showing the after-fix behavior.
Evidence reviewed 7 items Current-main defect: The active-link pointer-out path clears pointer state and immediately closes the card, so there is no traversal interval to a card positioned elsewhere.
Portal and pointer boundary: Current main appends the card to document.body while its stylesheet sets pointer-events: none, confirming why delegated provider events cannot make the card reachable.
Entry point and Gateway owner: The app shell wraps chat in the hovercard provider, whose preview request is served by the Control UI Gateway handler.
Findings None None.
Security None None.

How this fits together

Control UI detects GitHub item links in chat, requests preview data through the Gateway, and renders a card outside the chat tree. The changed provider coordinates pointer and keyboard state between the source link and that portaled card.

flowchart LR
  A[Chat GitHub link] --> B[Hovercard provider]
  B --> C[Gateway preview request]
  C --> D[Portaled preview card]
  A --> E[Pointer and keyboard state]
  E --> B
  D --> F[Open item or profile links]
Loading

Decision needed

Question Recommendation
Should this bug-fix PR retain the new multi-link interactive dialog, or be narrowed to pointer reachability and selectable preview text? Keep the interactive dialog: Accept the item, author, and files links as the intended Control UI preview interaction and land after exact-head checks pass.

Why: The reported defect is established, but the four new navigation destinations and dialog focus contract add a user-facing capability beyond restoring reachability.

Before merge

  • Resolve merge risk (P1) - The branch adds a net 192 production lines and changes the preview from descriptive content into a multi-link dialog; that broader interaction scope needs maintainer acceptance even though the traversal repair itself is sound.
Agent review details

Security

None.

PR surface

Source +192, Tests +307. Total +499 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 3 232 40 +192
Tests 2 372 65 +307
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 604 105 +499

Review metrics

Metric Value Why it matters
Production versus test LOC production +232/-40; tests +372/-65 The net production growth is chiefly the new dialog/navigation lifecycle, not only the bounded hover repair.

Merge-risk options

Maintainer options:

  1. Confirm the interactive preview scope (recommended)
    Accept the new dialog and navigation destinations as intentional product behavior, then use green exact-head UI checks as the landing gate.
  2. Reduce the interaction surface
    Retain the pointer-traversal repair but remove the added destinations if the preview should remain descriptive rather than navigational.

Technical review

Best possible solution:

Keep the portal-boundary traversal repair; retain the interactive dialog only after confirming the added in-card navigation is intended, then land from a green exact head.

Do we have a high-confidence way to reproduce the issue?

Yes—source reproduction is high-confidence: current main closes on source-link pointer-out while the card is portaled outside the provider and cannot receive pointer events.

Is this the best way to solve the issue?

Yes for the reachability defect: tracking intent at both the source and portaled-card boundary is the maintainable repair. The added navigation destinations require product confirmation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 5626a79cc836.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR supplies direct screenshots plus reported real-Chromium pointer, keyboard, and navigation coverage showing the after-fix behavior.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR supplies direct screenshots plus reported real-Chromium pointer, keyboard, and navigation coverage showing the after-fix behavior.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • remove rating: 🦞 diamond lobster: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: The PR repairs a repeatable Control UI interaction failure but does not indicate crash, data loss, or a release-blocking path.
  • merge-risk: 🚨 other: Merging changes the preview's user interaction model from descriptive hover content to a keyboard-operable multi-link dialog.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The PR supplies direct screenshots plus reported real-Chromium pointer, keyboard, and navigation coverage showing the after-fix behavior.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR supplies direct screenshots plus reported real-Chromium pointer, keyboard, and navigation coverage showing the after-fix behavior.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The PR supplies direct screenshots plus reported real-Chromium pointer, keyboard, and navigation coverage showing the after-fix behavior.

Evidence

What I checked:

Likely related people:

  • Josh Lehman: Current-main blame for the hovercard lifecycle and styling lines points to the same recent commit. (role: recent area contributor; confidence: medium; commits: 8cfcc3155a55; files: ui/src/components/github-link-hovercard.runtime.ts, ui/src/styles/components.css)

Rank-up moves

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

  • Confirm whether the new multi-link dialog is intended product behavior.
  • Land only after the exact-head UI checks are green.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-08-15T20:26:25.928Z sha a0bb729 :: needs maintainer review before merge. :: none
  • reviewed August 15, 2026, 4:38 PM ET / 20:38 UTC sha unknown :: needs maintainer review before merge. :: none
  • reviewed 2026-08-15T20:47:38.730Z sha 840bb97 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-15T21:27:11.394Z sha fdd42c9 :: found issues before merge. :: [P2] Remove interactive content from the tooltip

@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Aug 15, 2026
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Added the real-browser proof this review asked for. ui/src/e2e/github-link-hovercard.e2e.test.ts now has two new Chromium cases alongside the existing preview/navigation coverage:

  • keeps the card open while the pointer crosses the gap onto it, then closes once it leaves both drives real page.mouse.move coordinates from the link, through the gap, onto the card, and confirms the card survives the whole crossing, then confirms it closes on its own once the pointer leaves both surfaces with no click involved.
  • opens the linked pull request when the card's title link is clicked opens the card by hover, clicks the title anchor inside the portaled card, and asserts the popup navigates to the exact pull request URL, mirroring the existing source-link click assertion.

All three tests in that file (the original plus these two) pass, run three times locally with no flakes. PR body updated with the run output and a scope note on the title-link commit.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Took the second option from the review: the card is an accessible interactive popover now, and the tooltip contract is gone.

The finding was right that a focusable anchor inside role="tooltip" is incoherent. Removing the link was the wrong half to drop, though: the card now carries several destinations a reader actually wants, and deleting them to preserve descriptive semantics would trade real capability for a label. The semantics moved to match the content instead.

What changed in ui/src/components/github-link-hovercard.runtime.ts:

  • role="tooltip" and aria-live="polite" are gone. The card is a non-modal role="dialog" with an accessible name in every render state (loading, unavailable, full preview).
  • The trigger link carries aria-haspopup="dialog" and aria-expanded as soon as it is recognized, flipping to true with aria-controls once the card exists; the whole set is removed on close. This replaces the old aria-describedby save/restore, which would have flattened interactive content into a description string. Same wiring the Control UI already uses for non-modal popovers in ui/src/components/terminal/terminal-session-picker.ts.
  • Keyboard path: the card is portaled to document.body, so it has no neighbour in the tab sequence and Tab alone could never reach it. Tab from the trigger forwards focus into the card, Tab moves between the card's own links natively, and Tab past either edge — or Escape from anywhere inside — returns focus to the trigger with the card closed. The returned focus is guarded so the dismissed card cannot reopen under the user. Focus leaving both surfaces still closes it.
  • The card is genuinely multi-link now, which is the substance behind the semantics change: the title and the owner/repo #number reference open the item, the author avatar and login open that profile, and a pull request's diff-size chip deep-links to the files-changed view. Issues have no files view, so their comment count stays plain text. All of them use the existing EXTERNAL_LINK_TARGET / buildExternalLinkRel() helpers, so target="_blank" and noopener noreferrer hold everywhere. The title keeps the card's only underline.

Pointer behavior is unchanged. The traversal grace repair is untouched: leaving both the link and the card dismisses it after the 120ms grace, and nothing requires a click to close.

Proof. The visual gap the review flagged is closed — the PR body now carries a pointer-opened card screenshot and a keyboard-focus-inside-the-card screenshot, both captured from the real Chromium e2e run. Unit coverage is 15 passing, including keyboard traverse, Escape-returns-focus, focus-leaves-both, and the role/aria-*/href/target/rel assertions; the semantics and keyboard cases fail against the previous runtime for the intended reasons (expected 'tooltip' to be 'dialog', and Tab never entering the card). Real-Chromium coverage is 4 passing and includes a new case that reads the accessibility tree with page.getByRole("dialog"), walks Tab through repo → title → author, and asserts Escape returns focus to the trigger without reopening; the click case also asserts the files chip lands on /pull/99816/files and that only the title underlines on hover. node scripts/check-changed.mjs is green on the touched files.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

Hover intent now spans the link and the portaled card: leaving one for the other keeps the card open through a bounded traversal grace, and only leaving both dismisses it. The card also receives pointer events again, so its text can be selected. Escape, click, focus, viewport, and route-removal dismissals are unchanged, and the close timer is cleared on every close and disconnect.
The preview card's title now renders as an <a> reusing the exact
activation href, opening in a new tab like other external Control UI
links (buildExternalLinkRel/EXTERNAL_LINK_TARGET). Because the card is
portaled to document.body outside the provider's delegated focus
listeners, focus landing on the title link needed its own tracking,
mirroring the existing pointerenter/pointerleave pattern; that focus
hold releases once the pointer leaves the card after a pointer-initiated
open, so clicking the title link can never leave a hover-opened card
stuck open with the mouse gone.
…eal Chromium

Extends the existing github-link-hovercard e2e test with two cases: one
drives real page.mouse.move coordinates from the source link, across the
gap, onto the portaled card, and confirms it stays open and only closes
once the pointer leaves both surfaces; the other clicks the card's title
link and confirms the resulting popup navigates to the item URL.
The card declared role="tooltip" while owning a focusable title link. ARIA
tooltips are descriptive text: their content is flattened and unreachable, so
the link existed for the pointer only. Drop the tooltip contract instead of the
link, and give the card the popover semantics its content already needs.

The card is now a non-modal role="dialog" named by every render state, and the
trigger carries aria-haspopup/aria-expanded/aria-controls in place of the old
aria-describedby juggling. Because the card is portaled to document.body it has
no tab-sequence neighbour, so Tab from the trigger forwards into it, Tab moves
between its links natively, and Tab past either edge or Escape returns focus to
the trigger with the card closed and no reopen.

The card's other references are links too: the repo reference and the title open
the item, the author opens their profile, and a pull request's diff-size chip
deep-links to the files-changed view. The title keeps the card's only underline;
the rest stay quiet until hovered or focused. Pointer behavior is unchanged -
leaving both the link and the card still dismisses it after the traversal grace
period, with no click required.
@vyctorbrzezowski
vyctorbrzezowski force-pushed the brzezowski/hovercard-hover-intent branch from e7526a8 to 7b93f64 Compare August 15, 2026 23:51
@clawsweeper clawsweeper Bot added proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Aug 15, 2026
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Closing out the two rank-up moves from the latest review.

The multi-link dialog is the intended product behavior. The interaction model is a deliberate call, not a side effect of the traversal repair: the preview stays interactive, and the card's references become the destinations a reader is already looking for — the title and owner/repo #number open the item, the author opens that profile, and a pull request's diff-size chip deep-links to the files-changed view. Once the card owns controls, role="tooltip" was the incoherent half, so the semantics moved to a non-modal dialog with a real keyboard path rather than the capability being removed. That is also where the production LOC goes: the interaction model plus its focus contract, not padding around the bug fix. The pointer contract is deliberately untouched — leaving both surfaces still dismisses the card after the 120ms grace, with no click needed.

Exact-head UI checks are green. Run 31915778148 is green on 7b93f643c271f2849b4598dd8dbad6d812ac149d. The first attempt tripped ui/src/e2e/config-safe-write.e2e.test.ts, a known flake unrelated to this change (no hovercard path touched); the rerun passed and the gate is green.

The branch is also rebased onto current main, which resolved a textual conflict in ui/src/components/github-link-target.ts where #124252 landed isGitHubItemRootPath in the same spot. Both helpers now sit side by side, and they agree: that commit's point is that a GitHub URL may carry a trailing segment, query, or fragment, which is exactly why the files-changed link is rebuilt from the parsed owner/repo/number instead of appending to the source href.

@vyctorbrzezowski
vyctorbrzezowski merged commit 38e0ae6 into main Aug 16, 2026
314 of 316 checks passed
@vyctorbrzezowski
vyctorbrzezowski deleted the brzezowski/hovercard-hover-intent branch August 16, 2026 00:05
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 16, 2026
…openclaw#124274)

* fix(ui): keep the GitHub hovercard open while the pointer reaches it

Hover intent now spans the link and the portaled card: leaving one for the other keeps the card open through a bounded traversal grace, and only leaving both dismisses it. The card also receives pointer events again, so its text can be selected. Escape, click, focus, viewport, and route-removal dismissals are unchanged, and the close timer is cleared on every close and disconnect.

* fix(ui): make the GitHub hovercard title a navigable link

The preview card's title now renders as an <a> reusing the exact
activation href, opening in a new tab like other external Control UI
links (buildExternalLinkRel/EXTERNAL_LINK_TARGET). Because the card is
portaled to document.body outside the provider's delegated focus
listeners, focus landing on the title link needed its own tracking,
mirroring the existing pointerenter/pointerleave pattern; that focus
hold releases once the pointer leaves the card after a pointer-initiated
open, so clicking the title link can never leave a hover-opened card
stuck open with the mouse gone.

* test(ui): prove hovercard pointer traversal and title-link click in real Chromium

Extends the existing github-link-hovercard e2e test with two cases: one
drives real page.mouse.move coordinates from the source link, across the
gap, onto the portaled card, and confirms it stays open and only closes
once the pointer leaves both surfaces; the other clicks the card's title
link and confirms the resulting popup navigates to the item URL.

* fix(ui): make the GitHub hovercard an accessible interactive popover

The card declared role="tooltip" while owning a focusable title link. ARIA
tooltips are descriptive text: their content is flattened and unreachable, so
the link existed for the pointer only. Drop the tooltip contract instead of the
link, and give the card the popover semantics its content already needs.

The card is now a non-modal role="dialog" named by every render state, and the
trigger carries aria-haspopup/aria-expanded/aria-controls in place of the old
aria-describedby juggling. Because the card is portaled to document.body it has
no tab-sequence neighbour, so Tab from the trigger forwards into it, Tab moves
between its links natively, and Tab past either edge or Escape returns focus to
the trigger with the card closed and no reopen.

The card's other references are links too: the repo reference and the title open
the item, the author opens their profile, and a pull request's diff-size chip
deep-links to the files-changed view. The title keeps the card's only underline;
the rest stay quiet until hovered or focused. Pointer behavior is unchanged -
leaving both the link and the card still dismisses it after the traversal grace
period, with no click required.
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 maintainer Maintainer-authored PR merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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.

[Bug]: GitHub link hovercard dismisses before the pointer can reach the card

1 participant