Repository navigation
[Bugfix #400] Fix Work page startup latency and tab switch delay - #404
Merged
waleedkadous merged 1 commit intoFeb 17, 2026
Merged
Conversation
Two root causes fixed:
1. WorkView unmounted on tab switch (App.tsx): Conditional rendering
`{activeTab?.type === 'work' && <WorkView />}` destroyed component
state every tab switch. Now uses CSS display toggle (matching the
terminal persistence pattern from Bugfix #205) to keep useOverview()
state alive across tab switches — making switches instant.
2. Sequential GitHub API calls (overview.ts): Three `gh` CLI calls
(PRs, issues, recently closed) ran sequentially, taking 3-9s on
cold cache. Now uses Promise.all() to run them in parallel,
reducing cold-cache latency to ~1-3s.
waleedkadous
deleted the
builder/bugfix-400-work-page-5-7-second-startup-l
branch
February 17, 2026 17:27
waleedkadous
added a commit
that referenced
this pull request
Feb 17, 2026
findWorkspaceRoot() in config.ts always resolved worktree paths back to the main repo via getMainRepoFromWorktree(). This caused any codev tooling running inside a builder worktree to write files to the main tree instead of the worktree, leading to "untracked files would be overwritten by merge" errors after merging builder PRs (#404, #406, #370, #383). Fix: When in a worktree, find the worktree root first (via .git marker), then check if it has its own codev/ directory. Builder worktrees are full git checkouts with their own codev/, so we return the worktree root. Only fall back to the main repo if the worktree lacks codev/.
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
The Work page had 5-7 second startup latency due to two issues: WorkView unmounting on tab switch (losing all cached data), and sequential GitHub API calls on the server. Fixed both.
Fixes #400
Root Cause
Client-side:
WorkViewwas conditionally rendered ({activeTab?.type === 'work' && <WorkView />}), causing it to unmount every tab switch and re-fetch all data from scratch on return.Server-side: Three GitHub CLI calls (
gh pr list,gh issue list,gh issue list --state closed) ran sequentially inOverviewCache.getOverview(), taking 3-9 seconds on cold cache.Fix
Persist WorkView with CSS
display: nonetoggle (matching Bugfix Terminal renders garbled output when revisiting existing tabs #205 terminal persistence pattern), keepinguseOverview()state alive across tab switches.Parallelize GitHub API calls using
Promise.all(), reducing cold-cache latency from ~5-7s to ~1-3s.Test Plan
Net diff: 49 additions, 10 deletions (well under 300 LOC threshold)