Repository navigation
Handle transient mobile read failures - #401
Merged
Merged
Conversation
ymichael
force-pushed
the
bb/mobile-background-browser-issue-thr_u7qgtzgiqc
branch
from
June 25, 2026 21:22
910b6c1 to
578eefb
Compare
ymichael
added a commit
that referenced
this pull request
Oct 9, 2026
…hat, and palette (#5264) ## Human comments ## What was wrong One user action stepped through several different loading placeholders because every layer of a lazily loaded surface drew its own placeholder and only started its async work after the layer above it mounted. Expanding a settled edit row showed "Loading details..." (the deferred-content fetch from #5240), then the diff block chunk skeleton, then the card header with a viewport-gated skeleton, then the bb-diff chunk skeleton, then the Pierre worker pool skeleton, then a plain diff, then the highlighted diff. Opening a thread, a file preview, the diff panel, side chat, and the Cmd+K thread search had the same pattern. Some placeholders also showed wrong data while loading: the diff toolbar said "No changes", the info tab said "No thread details available.", and the side chat composer showed the provider's default model before the thread's own model. ## What changed Timeline rows (`ThreadTimelineRows.tsx`, `timeline-row-body-preload.ts`, `ExpandableTimelineRow.tsx`, `disclosure.tsx`): - Rows preload their body on hover (80 ms dwell), press, or focus: the deferred detail query (`prefetchThreadTimelineTurnSummaryDetails`), the renderer chunks, and the diff worker pool. - An expanded row body shows one bordered placeholder (`TimelineRowBodyPlaceholder`, fades in after 150 ms) until its content and renderers are ready. "Loading turn details..." and "Loading subagent activity..." are unchanged. - The worker pool gate (`ThreadDetailWorkerPoolProvider`) now waits for `pool.initialize()`; Pierre renders nothing before that. - The timeline diff card renders without waiting for an intersection callback (`renderBeforeVisible`). - `defineSplit` exposes `isLoaded()`; `useRequirePierreWorkerPool(required)` and `useRequestPierreWorkerPool()` added. Thread open (`route-loading-skeleton.tsx`, `ThreadTimelineLoadingSkeleton.tsx`, `ThreadTimelineSurface.tsx`, `App.tsx`, `LazyThreadDetailView.tsx`, `ThreadDetailView.tsx`): - Thread route skeletons include the timeline skeleton, and the timeline shows its skeleton immediately when it replaces a route skeleton instead of going blank for 200 ms. - The info tab shows its metadata skeleton until the thread bootstrap settles. File preview (`FilePreviewChrome.tsx`, `lazySecondaryPanelComponents.tsx`, `ThreadStorageFilePreview.tsx`): - Chunk fallbacks and the cold panel placeholder draw the same header and source skeleton as the loading preview. Preview tab chunks preload with the panel, and opening a preview starts the source renderer chunk and code workers alongside the file request. Diff panel (`ThreadSecondaryPanelTabContent.tsx`, `ThreadSecondaryPanel.tsx`, `GitDiffToolbar.tsx`, `GitDiffCardBody.tsx`): - "Checking Git support…" and the file-list wait show the same skeleton cards, now shaped like the real cards. The toolbar shows a skeleton instead of "No changes" while files load. The automatic context prefetch no longer flashes "Expand context" / "Loading context…" (a user-requested expansion still shows it). The diff renderer chunk and workers start when the panel opens. Code hosts (`DiffHost.tsx`, `SourceCodeHost.tsx`): the `fallback` prop is removed; both always show their own skeleton while the renderer chunk loads, so the plugin SDK `Diff` and `SourceCode` components show a skeleton instead of rendering nothing first. Side chat (`ThreadChatLoading.tsx`, `LazyPluginThreadChat.tsx`, `PluginThreadChat.tsx`, `PluginPanelActions.tsx`, `EmbeddedThreadChat.tsx`): - The chat chunk fallback and the thread wait render the leading content (the "Replying to" anchor) with the same timeline skeleton the loaded chat uses. - Plugin panel tabs render nothing instead of "This plugin tab is not available…" until plugin frontends settle. - The composer shows the model picker's loading state until the thread's default execution options resolve. Sending was already blocked in that window, so this only removes the wrong label. - The timeline controller (`useThreadTimelineController.ts`) no longer puts an already-loaded empty timeline back into the loading state on background refetches; only a timeline with no data yet (first load, or the retry after a failed read from #401) reports loading. New side chats are empty, so each refetch while the thread provisioned brought the skeleton back. - `FollowUpPromptBox` starts expanded when its editor will autofocus on mount (fine pointers), instead of mounting compact and animating open one frame later. - Short-lived status in empty chats: the working indicator on an empty timeline (`ThreadTimelineSurface`) and the embedded composer's "Provisioning thread..." placeholder (`EmbeddedThreadChat`) appear only once that state has lasted 1.5 s (`useSustainedFlag`). A new side chat used to flash "Provisioning thread..." then "Working..." for about a second. Timelines with rows still show the working indicator immediately. Command palette (`CommandPalette.tsx`, `ThreadSearchPalettePlaceholder.tsx`): thread search preloads, and its fallback is the real search shell instead of a bare "Loading threads" line. No server, daemon wire, CLI, or plugin SDK source changes; `HOST_DAEMON_PROTOCOL_VERSION` is untouched. Remaining: diffs still render plain text before syntax colours arrive (Pierre's worker flow; changing it affects every diff surface), and the diff panel shows one ~24 ms frame where only the first card has mounted. ## How you verified - `pnpm exec turbo run typecheck lint test --filter='...[origin/main]'`: 14/14 tasks pass (`@bb/app` 5577 tests). - New tests, each failing before the change: - `ThreadTimelineRows.deferred-details.test.tsx`: pressing a collapsed deferred row starts its detail request before expansion. - `ThreadDetailWorkerPoolProvider.test.tsx`: consumers stay waiting until the pool's highlighter has initialized. - `GitDiffToolbar.test.tsx`: the summary does not say "No changes" while the file list is loading. - `useThreadTimelineController.test.tsx`: "still reports timelineLoading while refetching an empty timeline" now asserts the opposite (a loaded empty timeline stays out of the loading state while refetching); the #401 error-retry test still passes unchanged. - `useSustainedFlag.test.tsx`: the flag turns on only after the full delay and restarts the delay each time it turns on again. - `FollowUpPromptBox.test.tsx`: the composer starts expanded on fine pointers and compact on coarse pointers; mobile tests now use a coarse pointer. - Updated tests for the changed placeholders: `LazyTerminalOutputBlock`, `CodeHosts.cold-load`, `DiffFileCard`, `plugin-slot-mounts`, `ThreadSecondaryPanel.collapseControl`. - Manual, on a `pnpm start:worktree` instance with a Claude Code fixture thread: recorded painted frames with CDP screencast at 300 ms network latency before and after, and screenshotted every new loading state by holding its request open. Time until content: edit row diff 2.4 s → 1.5 s, file preview 0.70 s → 0.37 s, diff panel 2.1 s → 0.4 s; thread open, side chat, and Cmd+K go from 2–4 visually different placeholders to one. > AGENT GENERATED 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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
Validation
Note: lint exits successfully and still reports the existing app warning set.