Repository navigation
Show agent tabs at once with loading skeletons - #48
Merged
Merged
Conversation
Clicking Chat, Note or Dashboard kept the previous page on screen until the destination's loader finished. Each tab route now shows its pending component immediately (pendingMs 0) with a skeleton that matches its layout, while the loader fetches in the background. Revisits still render cached data at once and revalidate. This replaces the background preloading from #47: data now loads on click, as requested. Skeletons fade in after 150 ms so fast loads don't flash. Co-Authored-By: Claude Opus 5.5 (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.
Requested by Scott · project thread
Why
Tab switches between Chat, Note and Dashboard are client-side, but TanStack Router keeps the previous page on screen until the destination's loader resolves (and only shows a pending component after
defaultPendingMs, 1 s). So a click looked like nothing happened until the data came back. #47 hid that by preloading every tab in the background. The behaviour we want instead: switch immediately, start loading on click, and show a skeleton until the data arrives.What changed
pendingMs: 0,pendingMinMs: 0and apendingComponent, which TanStack Router renders as soon as the navigation starts while the loader runs.AgentHeader(so the segmented control is live right away) plus a skeleton in that tab's layout: chat bubbles and composer, note paper lines, and dashboard cards with the side chat.components/ui/skeleton.tsx(Skeleton,SkeletonGroup). Groups arerole="status"witharia-busy, and fade in after 150 ms so quick loads don't flash. The pulse stops under reduced motion.AgentHeaderand its 30-minute cache settings. Revisits within the router's default 5-minute cache still render cached data at once and revalidate in the background. Make agent tab switches render from cache #47's memoized conversation rows and note snapshot handling stay.Deferred loader data (
<Await>) was the other option. It broke route type inference for the conversation and dashboard snapshots, and it would re-suspend (and flash a skeleton) on every background revalidation. Pending components avoid both problems.Measurements
Production build on the dev data copy. Headless Chrome with 300 ms of added network latency, first visit to each tab:
With 2 s of latency the skeleton still appears in 40–70 ms. That time is client work, not network.
Testing
pnpm test(429 pass),tsc --noEmit,biome check.🤖 Generated with Claude Code