Library: load import folder files on demand, memoize search

The library page passed every importable folder's full file list (up to 5,000
entries each, from the worker's scan) into a client component, though it is
only used after clicking Import. With three such folders that was 84% of a
1.3 MB page, re-sent on every refresh after a job finished.

- listLocalFolders() returns path, commit and counts only; the Import button
  fetches one folder's files from GET /api/local-folders?path=…
- addModel() checks that an import folder exists without loading its files.
- LibraryView builds each model's search text once and memoizes the visible
  rows and facet counts; the facet sort uses one Intl.Collator.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EooZ9biu7kFNB4eDJrwQc5
This commit is contained in:
Claude committed 2026-11-01 20:49:18 +00:00
1 parent 76d851896e
commit 7239ba2692
9 files changed
+110 -31

No files matched your search

+6
View File
@@ -14,6 +14,12 @@ step 1 (Hugging Face downloader) is released as a minor version.
everything on the page, paused while the tab is in the background. The server also no longer
grows in memory while a tab stays open, and an idle page no longer redraws every 5 seconds.
### Changed
- **Lighter library page**: folders found in the models folder no longer bring their whole file
list (up to 5,000 entries each) into the page; **Import** loads it when you click it. Search and
filter counts are computed once per change instead of on every progress update.
## [0.16.0] - 2026-10-30
A new look, a search for everything (⌘K / Ctrl+K), removing single files, and an easier deployment