Repository navigation
feat(items): show the GitHub preview card when hovering an item's PR or issue link chip - #48003
Conversation
…or issue link chip
…ry line, not its last-known state
…y in every layout - Checks show only when confirmed for the PR the lookup returned - In the +N list the card opens beside the list, above the popover, so Retry takes the click - The card never runs past the window: it scrolls, and long labels truncate
…d keeps to the window and its own layer - A focused chip or +N row whose card failed takes R to retry; the key is shown and announced - An open card picks its side again when the window resizes - Only a card over the +N popover sits above popovers - The loaded card shows no CI: the lookup carries none, and the chip's reading may be stale - Full repo name and labels on hover
… until it answers - While a retry runs the failed card keeps its layout and its (inert) Retry, so the pointer and focus stay on it and no neighbouring row's card takes over - R is the card's while it has failed or is retrying, never typed into the item's draft; a held key retries once - Fixture data moves to bot-item-link-chips-fixture-data.tsx, with a held lookup and the pane's type-to-comment handler for probing
Once R retried a failed GitHub card, its auto-repeats are swallowed until keyup (or blur), even after the retry answers, so they never type into the item's draft.
- Pending Retry uses the link-muted Button variant instead of raw classes - The link card scrolls in an inner scrollbar-sleek wrapper, not on HoverCardContent itself - sideWithRoom takes a minimal box reader, so its test needs no cast - Fixture data file renamed to bot-item-link-chips-fixtures.tsx (test-only name)
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
ELI5
On a bot item's page, hovering a PR or issue link chip now shows the same GitHub preview card that PR and issue links in chat already show, instead of a one-line dark tooltip.
What Changed
Before: hovering or focusing a PR/issue chip in the item header showed a plain tooltip: title · state · checks · repo.
After: the chip opens the existing chat GitHub card (
NativeChatLinkPeek): repo and number, state badge, title, labels, author, last update and diff size. It keeps the card's open delay and dismissal; the card opens below the chip and flips when there's no room. File, command and web chips keep their tooltip. With no repo or host to read GitHub through, a GitHub chip keeps its tooltip too.NativeChatLinkPeekProvider, pinned to the bot's own host, so a folder with the same id on another paired host can't answer the bot's links.NativeChatLinkPeekgains opt-in props for this (side,githubFallback,githubFailedFallback,retryKey,overPopover). Chat links pass none and behave as before, except for the two that every link card gets: a retry keeps its layout, and the card is capped at the window's height.Why
The owner asked for the item page's PR chip to show the GitHub preview on hover. Reusing the chat card keeps one GitHub preview across the app instead of building a second one. Checked against how comparable products handle this (open delay, hovering into the card, placement).
Linked Issue
None (maintainer change).
Visual Proof
Seeded component fixtures with invented data only.
Failed lookup, with the R hint:
"+N" row card, beside the list:
Testing
The fixtures in
BotItemLinkChips.fixture.tsx(data inbot-item-link-chips-fixture-data.tsx) were driven withpage.mouseandpage.keyboard, with a lookup that can be held, failed or answered on demand, and with the item pane's type-to-comment handler mounted. Checked:Unit tests:
link-peek-side.test.ts(which side has room) andhas-github-link-peek.test.ts(a chip drops its tooltip exactly when the card shows).Performance
None, because the card only renders while a link is hovered or focused, and the lookup is the existing cached GitHub preview read that chat links already use. The header adds one context provider per item page (a store selector memoized on its inputs); the resize listener exists only while a "+N" card is open.
Risk
The riskiest part is the shared
NativeChatLinkPeek, used by every chat link. Chat links pass none of the new props, so the only changes they see are that a retry keeps the failed layout until it answers and that the card is capped to the window's height. If something went wrong, item chips would fall back to no preview or their tooltip, and chat link cards could misplace a Retry. A plain revert backs it out; nothing is persisted.Level: Low