Paint git-diff and host chrome from cached environment - #11
Merged
Conversation
ThreadDetailView waited on bootstrap before useEnvironment and useHosts, so a thread that already had environmentId (create cache or a sibling thread in the same workspace) still hid the git-diff tab and host label. Enable those queries from cache and skip the duplicate GET until bootstrap settles; ingest still fills the cache.
Guitaraholic
pushed a commit
that referenced
this pull request
Sep 2, 2026
Guitaraholic
changed the base branch from
fix/layout-thread-title-from-cache
to
main
September 2, 2026 19:15
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.
Human comments
What was wrong
#6 / #10 paint thread chrome from
threadQueryKeywhile bootstrap is in flight.useEnvironmentanduseHostsstill waited forGET /threads/:id?include=environment,hostto settle.Create already returns
environmentId. Opening a second thread in the same workspace often already has that environment (and the hosts list) in React Query from the previous bootstrap ingest. The git-diff tab stayedloadingand the host label stayed empty until this thread’s include GET returned.Related: get-bb/bb#1303.
What changed
resolveEnvironmentQueryMount/resolveHostsQueryMount: enable from cache while bootstrap is pending;refetchOnMount: falseso we do not addGET /environments/:idorGET /hostsnext to the include fetch.environment.isGitRepofrom cache, so the tab can appear before bootstrap settles.Stacked on #10. No protocol bump.
Why this way
Same rule as #6: do not refuse cache we already wrote. Starting
useEnvironmentwheneverenvironmentIdis set would duplicate the include GET. Cache-or-settled is the policy that avoids that.We did not start git work-status or pull-request reads early (they still need a known environment and are the heavier follow-up). We did not merge compose+thread.
Benefit to bb
Web and desktop. Switching threads in the same project, or returning to a thread whose environment is still cached, shows git-diff eligibility and host label without waiting on this open’s include GET. New workspaces with an empty cache behave as today.
Harvest
Submit after #10 (this branch is stacked on the cache-paint stack). Independent of #7/#8. Copy this body.
Decision record: Datahazed/bb#9.
How you verified
resolveEnvironmentQueryMount: cached env + pending bootstrap → enabled, no refetch; empty cache waits; settled enables a cold fetch. CachedisGitRepomakes git-diffeligible.resolveHostsQueryMount: cached host list + pending bootstrap → enabled, no refetch; empty cache waits.environment-queries.test.tsx10 passed,host-queries.test.ts6 passed.