fix: stop native tooltips overlapping custom popovers#27
Merged
Conversation
The pr-review-status badge set a native `title` and also opened a click popover; on hover the browser tooltip overlapped the open popover. The star/fork/watch counters carry GitHub's own `title` (the exact count), which overlapped our hover popup. - pr-review-status: drop the `title` on badges that have a popover (the popover is the richer summary). Keep the `title` only on badges with no expandable details. - watch-fork-star: stash and remove the counter's native `title` on mouseenter, restore on mouseleave / cleanup. Our popup opens before the browser's title delay, so the native tooltip never shows. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Address two review findings on the unresolved-review-thread popover: - The list-page query (FETCH_PR_REVIEW_STATUSES) now fetches counts only (totalCount + per-thread isResolved). The heavy path/author/body detail query runs lazily, one PR at a time, only when a badge's popover is first opened (new FETCH_PR_REVIEW_THREAD_DETAILS), capped at MAX_REVIEW_THREADS. The popover shows a loading state and degrades to a retryable "couldn't load" message on failure; the count badge no longer depends on the detail fetch, so a failed/slow detail query never blanks the row. - Popover rows now carry the full path on aria-label instead of a native title, so hovering a truncated path no longer spawns a browser tooltip over the custom popover. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
两处「原生 tooltip 叠加在自定义浮层上、遮挡视线」的问题:
title,又有 click 出来的详情 popover;并且 popover 内每行的文件路径<span>也带原生title。hover 时浏览器原生 tooltip 会盖在打开的 popover 上。<span>自带 GitHub 的原生title(精确数字,如title="1,234"配可见的1.2k),和我们 hover 弹出的人员 popup 叠加。(经 Chrome 实测确认,叠加来自 counter 自身的title,不是按钮的<tool-tip>。)另外,pr-review-status 的列表查询此前会为列表里每个 PR、每条线程贪婪拉取 path/line/author/bodyText/url:在 review 线程多的仓库可能产生超大 GraphQL 响应、触发成本/超时限制,而一旦报错,整个 review 状态 UI 会静默消失(降不到计数)。
改动
title(popover 本身就是更丰富的摘要)。aria-label承载(读屏可读),不再用title,从根上消除浮层内部的原生 tooltip 叠加。FETCH_PR_REVIEW_STATUSES改为只取计数(totalCount+ 每条线程isResolved)。沉重的线程详情改为按需、单 PR 拉取:只在某个 badge 的 popover 首次点开时请求(新增FETCH_PR_REVIEW_THREAD_DETAILS),以MAX_REVIEW_THREADS=100封顶。popover 打开时显示 Loading,失败/为空时降级为可重试的「Couldn't load thread details.」;计数 badge 不再依赖详情请求,详情挂掉也不会让整行空白。mouseenter时把 counter 的原生title暂存到data-bg-wfs-title并摘除,mouseleave/cleanup还原。因为 popup 在 300ms 弹出、早于浏览器原生 title 延迟,原生 tooltip 不会闪现。保留aria-label(读屏无障碍)。测试
pnpm test182 passed。新增/更新断言:title;popover 行用aria-label而非title。bodyText/comments(;approve 清缓存同时覆盖新增的reviewdetails。审计
全项目其余
title(commit-tags / pr-collapse-expand / better-top-repos / diff-stats / pr-branch-names)所在元素都没有会同时出现的自定义浮层,不存在叠加;pr-approve-now是居中模态弹窗,不锚定、不叠加。同类问题仅这两处。🤖 Generated with Claude Code