WeKnora/frontend/src
wizardchen a4c3c39556 perf(wiki): lazy-load sidebar page list with virtual-scroll tabs
?tab=wiki used to call listWikiPages({page_size: 500}) in a loop up to
50 times, loading ~25k pages into memory before rendering the sidebar
on knowledge bases with tens of thousands of pages. All rows were then
materialized as DOM nodes inside collapsible groups stacked vertically.

This commit reshapes the sidebar around per-type buckets that are
fetched on demand and rendered through a single virtual scroller:

* pagesByType holds one bucket per page_type (summary / entity /
  concept / synthesis / comparison), each with its own items list,
  pagination cursor, KB-wide total, and loading flag. Initial load
  fires one 50-item request per type in parallel.
* Index and Log are fetched directly via getWikiIndex / getWikiLog
  instead of scanning the full page list to find them.
* Groups are surfaced as a horizontal tab bar; switching tabs swaps
  the RecycleScroller's items. Only one bucket is visible at a time,
  so we never stack multiple virtual viewports.
* The scroller runs in page-mode with the outer .wiki-page-list as the
  scrollable ancestor; a 1px sentinel after the list is watched by
  IntersectionObserver to trigger the next page fetch. After each
  batch lands we call scroller.updateVisibleItems(true) on the next
  tick so appended rows render in order without requiring the user
  to jiggle the scroll.
* Switching tabs resets scrollTop so the retained position of the
  previous tab can't re-trigger the sentinel and cascade loads on
  the new (shorter) list.
* Search enters a dedicated flat-result mode (searchResults ref);
  clearing the query flips back to the bucketed view without
  refetching the buckets the user already had open.

Adds vue-virtual-scroller dependency and imports its stylesheet.
2026-05-08 15:07:59 +08:00
..
api perf(wiki): subgraph API and interactive exploration for large graphs 2026-05-08 13:32:54 +08:00
assets fix(frontend): polish model settings UI and fix disabled brand color 2026-05-07 21:51:22 +08:00
components fix(frontend): polish model settings UI and fix disabled brand color 2026-05-07 21:51:22 +08:00
composables fix(frontend): make general-settings font picker actually work 2026-05-07 15:07:24 +08:00
hooks fix(frontend): knowledge document list layout, batch bar, and selection 2026-04-29 15:20:41 +08:00
i18n perf(wiki): lazy-load sidebar page list with virtual-scroll tabs 2026-05-08 15:07:59 +08:00
router feat(frontend): replace standalone search page with global command palette 2026-05-06 16:26:22 +08:00
stores feat(frontend): replace standalone search page with global command palette 2026-05-06 16:26:22 +08:00
types feat(frontend): chunking debug panel with live preview 2026-05-06 17:17:07 +08:00
utils fix(agent): hide trailing thinking event when it duplicates final answer 2026-05-07 17:33:03 +08:00
views perf(wiki): lazy-load sidebar page list with virtual-scroll tabs 2026-05-08 15:07:59 +08:00
wailsjs feat: implement automatic update checking and downloading functionality in the desktop app, enhancing user experience with seamless updates and corresponding UI settings 2026-04-11 18:51:16 +08:00
App.vue fix(frontend): make general-settings font picker actually work 2026-05-07 15:07:24 +08:00
main.ts perf(wiki): lazy-load sidebar page list with virtual-scroll tabs 2026-05-08 15:07:59 +08:00