Skip to content

feat(hovercard): match GitHub native issue row hover UI#34

Merged
fathiraz merged 4 commits into
mainfrom
feat/issue-hovercard-github-ui
May 28, 2026
Merged

feat(hovercard): match GitHub native issue row hover UI#34
fathiraz merged 4 commits into
mainfrom
feat/issue-hovercard-github-ui

Conversation

@fathiraz

@fathiraz fathiraz commented May 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • Restructure project table row hover previews to follow GitHub's issue hovercard shell (repo, title + number, Open/Closed, body excerpt)
  • Mount hovercards from a shared shadow host with a trigger registry instead of per-row React roots
  • Append tooltips to the extension hovercard portal so theming and z-index stay consistent on GitHub Projects
  • Include issue state in preview GraphQL payloads and schemas for accurate Open/Closed badges

Changes

Hovercard infrastructure

  • Add hovercard-factory, portal target, and trigger registry modules
  • Wire shared hovercard host in content UI setup/teardown

Row preview UI

  • Rework RowHoverCard layout, loading skeleton timing, and Tippy arrow styling for rgp-card
  • Simplify hierarchy injection to register title-cell triggers and clean up on row removal

Background / API

  • Extend item preview handler and GraphQL query with issue state

Screenshot

Screenshot 2026-05-29 at 02 18 53

Test plan

  • Open a GitHub Project table view with the extension loaded
  • Hover a row title cell and confirm hovercard matches GitHub shell (repo link, title, #, Open/Closed, excerpt)
  • Confirm optional project block shows status/sprint/priority/assignees/labels/hierarchy when present
  • Verify hovercard renders inside extension shadow UI (no broken Primer tokens or clipped panel)
  • Smoke test hierarchy chip injection after scrolling virtualized rows (no duplicate tooltips)

Summary by cubic

Rebuilt the project row hovercard to match GitHub’s issue hovercard and render from a shared shadow portal for correct theming and z-index on Projects. Adds Open/Closed badge, body excerpt, and hardens trigger cleanup and CSS injection for reliable previews.

  • New Features

    • GitHub-style issue hovercard: repo path, title + number, Open/Closed badge, body excerpt.
    • Optional project block: status, sprint, priority, assignees, labels, parent/sub-issues, blocking links.
    • Hovercards and tooltips append to the extension portal for correct theme and z-index on Projects.
  • Refactors

    • Shared hovercard host with a trigger registry replaces per-row React roots.
    • Inject Tippy CSS and card theme into the portal’s shadow root after mount; arrow enabled and styled to match GitHub.
    • Keys: portals keyed by trigger id + itemId to remount on recycled rows; row instances keyed by itemId; host torn down last (LIFO).
    • Strengthened trigger lifecycle with per-registration tokens and row tracking; remove stale bindings when item id or title cell changes.
    • Preview GraphQL and schemas now include state; tuned layout and loading skeleton timing.

Written for commit d58a5e1. Summary will update on new commits.

Review in cubic

Mount hovercards from a shared shadow host and trigger registry so
previews append inside extension UI instead of per-row React roots.
Show repo, title, Open/Closed state, body excerpt, then project fields;
fetch issue state through the preview GraphQL path.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor auto review

No actionable issues found on changed lines.

No actionable issues found.

Generated automatically when this PR was submitted using Cursor CLI with --model auto.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 13 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/lib/hovercard-factory.tsx Outdated
Comment thread src/features/content-ui.tsx Outdated
- Use itemId as React key so recycled table rows reset fetch state
- Destroy hovercard host after queue/toast/onboarding UIs (LIFO)

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 issues found across 13 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/features/hierarchy-chip-tooltip.tsx">

<violation number="1" location="src/features/hierarchy-chip-tooltip.tsx:332">
P3: Project field-detection logic is duplicated between `ProjectBlock` and `hasProjectBlock`, creating drift risk and inconsistent rendering conditions.</violation>
</file>

<file name="src/features/hierarchy-injections.tsx">

<violation number="1" location="src/features/hierarchy-injections.tsx:18">
P2: Rows are marked as seen before validity checks, which prevents cleanup for recycled rows and can leave stale hovercard trigger registrations.</violation>
</file>

<file name="src/lib/hovercard-trigger-registry.ts">

<violation number="1" location="src/lib/hovercard-trigger-registry.ts:41">
P2: Cleanup deletes by element key only, so stale teardown can remove a newer trigger registration for the same row element.</violation>
</file>

<file name="src/lib/hovercard-factory.tsx">

<violation number="1" location="src/lib/hovercard-factory.tsx:38">
P2: React list key uses `itemId` instead of unique trigger `id`, which can collide for multiple active triggers and cause stale/misbound hovercards.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/features/hierarchy-injections.tsx Outdated
Comment thread src/lib/hovercard-trigger-registry.ts
Comment thread src/lib/hovercard-factory.tsx Outdated
Comment thread src/features/hierarchy-chip-tooltip.tsx

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 13 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/lib/tippy-utils.ts
Inject Tippy and card theme styles into the hovercard append target's
shadow root so row previews render correctly inside the CSUI host.

Harden hovercard registration teardown with per-registration tokens,
key the portal list by trigger id, and remove stale hierarchy row
hover bindings when the title cell or item id is invalid.

Extract shared project-block metadata for visibility checks and add
unit tests for shadow injection and cleanup paths.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 8 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread src/lib/hovercard-factory.tsx Outdated
Comment thread src/features/hierarchy-chip-tooltip.tsx Outdated
Run ensureTippyCss and ensureRgpCardTheme in useLayoutEffect so styles
attach once appendTarget is stable instead of during render.

Include itemId in hovercard portal keys so React remounts when the
triggered row changes.
@fathiraz fathiraz merged commit 7bdf0a5 into main May 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant