PR badges: background prefetch & cache (git-log style)#125
Merged
Conversation
added 10 commits
July 9, 2026 21:22
Mirrors the PR #113 git-log caching pattern for the PR badge path, which today caps at 10 open PRs and never drains further pages.
Task-by-task plan implementing the approved design: shared idle-schedule util extraction, background drain loop, Rust freshness-signal command (REST + gh CLI paths), TS wrapper, dev-server route, and in-memory cache wiring with invalidation.
… prefetchOpenPrs() call
added 7 commits
July 10, 2026 10:31
Reuses the already-built but unwired getPRCount()/ghPrCount() forge abstraction as a cheap, per-repo-open ping — independent of the branch-badge prefetch/cache work.
…vigated away from
…he loaded branch-badge list
…e correct forge, not always GitHub
…t work Multi-forge freshness parity, cursor-based PR-list pagination (already flagged in-code as Phase 2/v2.9), and a dock badge staleness indicator — all deliberately deferred, none blocking PR #125.
devlint
pushed a commit
that referenced
this pull request
Jul 10, 2026
Combines the previously separate v3.5 (secrets scanner) and v3.6 (PR Review 2.0) roadmap items into a single release, plus PR badge background prefetch/cache, dock PR count, repo-tab reorder a11y fix, and the File Explorer Save button move already merged to main. - CHANGELOG.md: renamed Unreleased to 3.5.0, folded in the three extra merged PRs (#125, #122, #121) - ROADMAP.md: moved v3.5/v3.6 to Shipped as one entry, renumbered every future planned version down by one to close the gap - website/changelog.md: narrative mirror entry for v3.5.0 - New blog post (PR Review 2.0 + secrets scanner), wired into the blog index, sidebar, and homepage teaser; homepage hero-announce banner updated in all 5 locales - New "Support GitWand" sponsor section on the homepage, all 5 locales - Fixed a stale usePrPanel.test.ts mock missing detectClaudeCli (broke after PR Review 2.0 wired useReviewIntelligence into the usePrPanel import chain) - Version bump via ./scripts/bump-version.sh 3.5.0 disabled
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.
Summary
ensurePrsLoaded()fetched exactly one page and never drained further).getPRCount()call fired at repo-open — independent of the branch-badge list above, which only populates on user interaction (branch popover / graph mode). Manually verified live against this repo (devlint/GitWand): dock badge showed the exact real count immediately at repo-open, with zero prior interaction.Changes
Branch-badge prefetch & cache:
apps/desktop/src/utils/idleSchedule.ts(new) — sharedwhenIdle()extracted fromuseGitRepo.ts.apps/desktop/src/composables/usePrPanel.ts— background drain loop (prefetchOpenPrs), in-memoryPR_LIST_CACHE, freshness-signal fast path inensurePrsLoaded(), cache invalidation increatePr()/mergePr().apps/desktop/src-tauri/src/{types.rs,commands/gh.rs,commands/github_api.rs,lib.rs}— newPrFreshnessSignal+gh_pr_freshness_signalTauri command (REST/token andghCLI paths).apps/desktop/src/utils/backend-pr.ts—ghPrFreshnessSignal()typed wrapper.apps/desktop/dev-server.mjs— matching/api/gh-pr-freshnessroute for browser dev-mode.Dock badge count addendum:
apps/desktop/src/composables/usePrPanel.ts—dockPrCount/refreshDockPrCount(), wired into thecwdwatcher (seeded from the cached remote so the correct forge resolves, not always GitHub), with a staleness guard against a repo-switch-mid-fetch race.apps/desktop/src/App.vue,apps/desktop/src/components/PrListSidebar.vue— redirect the existing (previously mis-wired):pr-countdock binding, wire the PR view's refresh button to refresh both the list and the dock count.Docs:
docs/superpowers/specs/2026-07-09-pr-badge-prefetch-design.md,docs/superpowers/plans/2026-07-09-pr-badge-prefetch.md,docs/superpowers/specs/2026-07-10-pr-dock-badge-count-design.md,docs/superpowers/plans/2026-07-10-pr-dock-badge-count.md.Implemented via subagent-driven-development: 9 tasks total across both features, each with an independent implementer + reviewer pass, 3 fix rounds, plus a dedicated final whole-branch review for each feature.
Test plan
cargo test(apps/desktop/src-tauri): 145/145 passingpnpm test(apps/desktop): 428/428 passingpnpm build(apps/desktop): clean, vue-tsc 0 errorsdev-server.mjsreal-boot smoke test: new routes confirmed in startup logpnpm dev:web+ chrome-devtools against this repo: dock badge shows the true open-PR count (6) immediately at repo-open with no prior interaction, matchinggh pr listexactly; refresh button updates both list and badge; zero new console errors