Skip to content

feat: Watch/Fork/Star hover popup#10

Merged
rrbe merged 5 commits intomainfrom
worktree-watch-fork-star-list
Apr 15, 2026
Merged

feat: Watch/Fork/Star hover popup#10
rrbe merged 5 commits intomainfrom
worktree-watch-fork-star-list

Conversation

@rrbe
Copy link
Copy Markdown
Owner

@rrbe rrbe commented Apr 14, 2026

Summary

  • Hover over Watch, Fork, or Star count numbers on repo pages to preview the list in a popup
  • Shows user avatars + names for watchers/stargazers, repo info for forks
  • Skeleton loading animation while fetching data
  • Data cached via service worker (5min TTL)
  • "View all" link at popup footer to jump to full GitHub page
  • Toggle in settings under Repository group

Fix: in-place popup attachment

  • Attach popups directly to counter elements instead of wrapping them, fixing Watch popup (React component broke with DOM wrapping)
  • Override pointer-events: none on Primer React CounterLabel so hover events fire
  • Attach to both starred/unstarred star counters so popup works regardless of toggle state
  • Add explicit popup hover listeners for smoother mouse transitions

Refactor: code quality cleanup

  • Extract escapeHtml to shared src/lib/utils.ts, remove duplicates from commit-tags and popup feature
  • Merge identical renderStargazers/renderWatchers into unified renderUserList
  • Escape all interpolated innerHTML values (login, avatarUrl, etc.) to close XSS surface
  • Remove unused PopupConfig.type field
  • Share fetched star data between starred/unstarred counter popups to avoid redundant API calls

Test plan

  • Reload extension, navigate to a repo page
  • Hover over Watch count → popup shows watchers list
  • Hover over Fork count → popup shows fork repos
  • Hover over Star count → popup shows stargazers
  • Star/unstar a repo, verify popup still works after toggle
  • Move mouse from counter to popup without it closing
  • Move mouse away → popup closes after 200ms
  • Toggle off in settings → popups removed
  • Test on light and dark themes
  • Verify commit tags still render correctly (shared escapeHtml)

🤖 Generated with Claude Code

rrbe and others added 5 commits April 15, 2026 00:42
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Hover over the count numbers on repo pages to see a popup with
watchers, stargazers, or forks. Includes skeleton loading, 5min
cache via service worker, and "View all" links to full pages.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Merge origin/main into worktree-watch-fork-star-list, keeping both
watch-fork-star-popup (this branch) and pr-collapse-expand (main)
features in content.ts and content.css.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Don't move DOM elements — add class + popup directly to counter
  elements, fixing Watch popup (React component broke with wrapCounter)
- Override pointer-events: none on Primer React CounterLabel so hover
  events actually fire on the Watch counter
- Attach popup to ALL star counters (both starred/unstarred forms)
  so popup works regardless of star toggle state
- Remove global "already injected" guard that blocked re-injection
- Add explicit popup mouseenter/mouseleave for robust hover transitions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nerHTML

- Extract escapeHtml to shared src/lib/utils.ts, remove duplicates
  from commit-tags.ts and watch-fork-star-popup.ts
- Merge identical renderStargazers/renderWatchers into renderUserList
- Escape all interpolated values in innerHTML (login, avatarUrl,
  ownerAvatarUrl, fullName) to close XSS surface
- Remove unused PopupConfig.type field
- Share fetched star data between starred/unstarred counter popups

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rrbe rrbe merged commit 21b54b8 into main Apr 15, 2026
@rrbe rrbe deleted the worktree-watch-fork-star-list branch April 15, 2026 03:16
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