File Browser Intent Prefetch
Goal
Make web document navigation from the site file browser feel instant when a user has hovered or keyboard-focused the destination before activating it.
Context
The captured production trace shows that the click handler is fast, but an uncached navigation waits on a serial Remix manifest request and route-data request before rendering the next document. The route response is also large. This change targets the serial post-click wait for anticipated navigation; cold navigation and route-payload reduction are separate follow-ups.
Design
Keep the shared SiteFileBrowser independent of Remix by adding an optional onPrefetch(id) callback beside its existing onNavigate(id) callback. A document row calls onPrefetch on pointer entry and focus. Activation continues to call onNavigate immediately and never waits for prefetching.
The web integration converts the document ID to the same URL used for navigation and asks Remix to prefetch that destination with PrefetchPageLinks. It remembers requested destinations for the lifetime of the mounted page so repeated pointer movement or focus does not restart the same prefetch.
No hover delay is introduced. Starting immediately provides the largest window for the data to arrive, while Remix and browser caching deduplicate useful route assets and data. Prefetch failure is non-blocking: a later click follows the existing navigation behavior and can fetch normally.
Interaction and Accessibility
Mouse and pen intent is detected with pointer entry on the document control.
Keyboard intent is detected when the document control receives focus.
Existing click, keyboard activation, active-state, and tree semantics remain unchanged.
Prefetching adds no loading state and does not move focus or alter visible content.
Scope
Included:
Intent prefetching for document rows in the web site file browser.
Deduplication of repeated intent for the same destination.
Tests for pointer intent, keyboard focus, deduplication, and unchanged navigation.
Excluded:
Cold navigation optimization.
Route-loader response-size reduction.
Progressive document rendering.
Prefetching in other document lists or in the desktop app.
Verification
Automated tests will confirm that pointer entry and focus request prefetch, repeated intent is deduplicated, and activation still navigates normally. A production-like performance recording should then confirm that a sufficiently hovered or focused destination no longer starts the manifest and route-data waterfall after the click.
Do you like what you are reading? Subscribe to receive updates.
Unsubscribe anytime