Skip to content

bugs-tab - Show the tab first, hide it when there are no bugs - #10349

Draft
fregante wants to merge 6 commits into
mainfrom
claude/bugs-tab-always-show
Draft

fregante wants to merge 6 commits into
mainfrom
claude/bugs-tab-always-show

Conversation

@fregante

Copy link
Copy Markdown
Member

Depends on #10336, which should be merged first. Its commit is the first one here, because its branch is in a fork and can't be stacked on natively.

Before, the Bugs tab was only added after an API call showed that the repo had bugs, then its count was fetched again and updated. Now:

  • The tab is added immediately on every repo, with the cached count if there is one. It's hidden when the count is 0, and updated once the count is known. A repo whose cached count is 0 starts hidden, to avoid a flash of the tab on every page load.
  • extensible-nav addTab takes after instead of before. If the tab to follow is missing, the tab is not added. The Bugs tab uses after: 'issues', so it's never shown when Issues are disabled. This replaces the asLongAs check, which was always true because it wrapped a promise in Boolean().
  • Overrides now also apply to added tabs, with href as a new overridable property, so the tab's link and visibility are updated with overrideTab.
  • One request instead of two in most repos. The first query now looks up the bug labels and also counts (label:bug OR type:Bug). A label that doesn't exist doesn't affect the search results, so that count is exact when the repo has a bug label or no bug label at all. Only repos with another bug label name (like Type: Bug) need a second request. The typeBug, per-label and issues counts are gone.
  • The exact-bugs cache and the exactCount > 0 assertion are gone. They only existed for the second fetch.

AI-assisted (Claude Code).

Test URLs

Co-authored-by: Claude <noreply@anthropic.com>

Copilot AI 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.

🟡 Changes recommended

The unchanged bugs cache can retain an old lower-bound count after an upgrade, undercounting bugs until revalidation; the cache namespace needs versioning to force recomputation.

1 open issue
What changed in this PR

This PR makes the Bugs tab appear before its API count resolves, then updates or hides it based on the result. It also extends the shared navigation store to support this behavior.

Changes:

  • Initialize the Bugs tab from cached data, hide zero-count tabs, and place it after Issues.
  • Combine label discovery and bug counting into one request for most repositories.
  • Apply overrides to added tabs and update navigation-store tests.
File Description
source/​features/​bugs-tab.tsx Adds immediate tab rendering, cached visibility, and streamlined counting.
source/​features/​bugs-tab.gql Combines label lookup with an advanced-search count.
source/​components/​extensible-nav-store.ts Adds after-anchor insertion and overrides for extra tabs.
source/​components/​extensible-nav-store.test.ts Updates insertion tests and covers extra-tab overrides.

Review effort: Balanced

Comment thread source/features/bugs-tab.tsx Resolved
fregante and others added 3 commits November 2, 2026 16:20

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants