Skip to content

Prefetch file contents on hover and focus - #8

Merged
anishshobithps merged 1 commit into
mainfrom
feat/hover-prefetch
Nov 10, 2026
Merged

anishshobithps merged 1 commit into
mainfrom
feat/hover-prefetch

Conversation

@anishshobithps

Copy link
Copy Markdown
Contributor

Summary

  • Hovering or focusing a file row for 80 ms prefetches its contents at low priority, so opening it is usually served from the blob cache.
  • A small createPrefetcher in the viewer core owns the dwell timer and a queue with at most 4 prefetches running. A failed prefetch frees its slot and surfaces nothing.
  • Prefetch is skipped for binary files, files over 256 KB, content already cached and when the browser reports data saver. Requests already in flight are shared with an explicit open through the blob store.
  • The tree listens with delegated pointer and focus handlers on the tree element, one set for all rows.

Not included

Aborting a started prefetch when the pointer leaves. Started requests are shared through the blob store, so aborting could cancel a file the reader has since opened. Leaving before the dwell ends cancels the prefetch before it starts.

Test plan

  • turbo run check-types lint
  • 244 tests (7 new for dwell, cancel, row change, concurrency and failure)
  • Browser check on the fixture big session: hovering a file row fetched its content without opening it
  • CI

@vercel

vercel Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
website-vw4l Ready Ready Preview Nov 10, 2026 3:37pm UTC

@anishshobithps
anishshobithps merged commit 0c5bfbc into main Nov 10, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
Preview – website-vw4l — 6b8131d8 Deployed Nov 10, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant