Prefetch thread bootstrap when a sidebar row receives keyboard focus - #14
Merged
Conversation
Pointerdown already starts the include GET. Enter on a focused row still waited until after mount. onFocus uses the same prefetch helper.
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
Pointerdown already starts
GET /threads/:id?include=environment,host(Datahazed/bb#8). Keyboard users who Tab to a sidebar row and press Enter still started that GET afterThreadDetailViewmounted. Same first-paint stall, different input.Related: get-bb/bb#1303.
What changed
onFocuson the thread row link callsprefetchThreadDetailBootstrap, the same helper pointerdown and create use.No router change. No daemon bump.
Why this way
Focus is the keyboard analogue of pointerdown: we know the thread id before activation. Hover prefetch is still out — it would fire while scrolling a long list. We did not keep both compose and thread views mounted.
Benefit to bb
Keyboard thread-open matches click: the include GET is already in flight when the detail view mounts. Completes the sidebar-open half of the first-paint rule without a new API.
Harvest
Submit after #8 / get-bb get-bb#2935 so
prefetchThreadDetailBootstrapexists. Copy this body onto a get-bb PR that targets a branch containing those, or stack.How you verified
ThreadRow.test.tsx:bootstrap-prefetchbeforefocus-completebeforeactivate-complete. 79 passed (run from bb-me after copying the worktree files; QueryClient already in the row harness from Prefetch thread bootstrap on sidebar row pointerdown #8).