Skip to content

[FR] Preload file names #2464

@suse-coder

Description

@suse-coder

Is your feature request related to a problem? Please describe.

Currently, every time I navigate into a folder, there is a noticeable delay (~300ms+) before the file list renders. This is because each folder click triggers a network request to fetch the metadata before anything can be displayed. In a deeply nested folder structure or on slower connections, this adds up quickly and makes browsing feel sluggish compared to native file managers or apps like Linear/Figma that use local-first sync engines.

Modern sync solutions like Zero demonstrate that metadata can be pre-synced to the client so that every interaction reads from a local database and renders instantly, with changes syncing in the background.

Describe the solution you'd like

Pre-sync file and folder metadata to the browser so that folder navigation is instant (reads from local cache, no network round-trip required per click).

The ideal flow would be:

  1. App startup → sync metadata (file name, size, etag, parent folder, mime type, modified date) into a local browser store (IndexedDB)
  2. User clicks a folder → query local store → render instantly (~1ms)
  3. Background → delta sync keeps local store up to date via polling or SSE/WebSocket events
  4. Another user makes a change → background sync picks it up → UI updates reactively

Result: Every folder click feels instant. No loading spinners for metadata. The UI always has something to show immediately, and background sync keeps it fresh.

Describe alternatives you've considered

1. TanStack Query (Vue Query) — most practical starting point

TanStack Query could be integrated alongside Pinia to manage server state separately from UI state. It provides:

  • staleWhileRevalidate — show cached data instantly, refetch in the background
  • Optimistic updates — UI reflects changes before the server confirms
  • Background refetching — on window focus, on interval, or via manual invalidation (e.g. triggered by SSE events)
  • Query caching — previously visited folders load instantly on revisit

This would be the lowest-effort, highest-impact change. It doesn't require any backend modifications and works with the existing WebDAV/Graph APIs. It wouldn't give truly instant first visits to a folder (still needs one network request), but every subsequent visit and back-navigation would be instant.

Vue Components
   ↓
Pinia (UI state)  +  TanStack Query (server/cache state)
   ↓
WebDAV / Graph API

2. Zero / ElectricSQL — not viable currently

Solutions like Zero and ElectricSQL provide excellent instant sync experiences, but they require Postgres as the backend data source (they read the Postgres WAL for change detection). Since OpenCloud does not use Postgres as its primary store and serves file metadata via WebDAV/Graph, these tools would not be compatible without adding a significant translation layer, which defeats the purpose.

Additional context

Scale consideration: Even for large accounts, syncing metadata is lightweight. 100,000 files × ~500 bytes per entry ≈ 50MB in IndexedDB, well within browser storage limits. Initial sync would take a few seconds; subsequent delta syncs would be near-instant.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions