* feat(frontend): show overall progress for knowledge file uploads
Batch uploads ran one file at a time with no feedback until the whole
batch finished, and nothing followed the asynchronous parse afterwards.
The knowledge base list still carried a progress panel whose event
emitter was removed with the old menu upload flow, so it never showed.
- Run uploads through a global queue (stores/uploadQueue.ts, wired to
the API in stores/uploadTasks.ts): three concurrent transfers,
per-file cancel that aborts the request, retry for failed or
cancelled files, and polling of the created knowledge rows until
parsing settles. finalizing counts as searchable.
- Add a floating panel (components/upload-tasks/) mounted in the
platform shell: stage headline with a progress ring, bytes and ETA
while uploading, a stacked bar for searchable / in progress / failed /
duplicate, per-file status with hover actions (cancel, retry, open the
document), an issues filter, grouping by batch, collapse, a confirm
before closing mid-upload, and auto-dismiss after a clean finish.
- Warn before unloading the page while transfers are still running.
- Refresh an open knowledge base list as files land (throttled), but
skip mid-batch reloads while the user has scrolled past the first
page; the batch's final refresh always runs.
- Remove the orphaned list-page panel, the unused useKnowledgeBase
requestMethod, the per-batch toasts and the i18n keys they leave
unused.
* fix(frontend): harden the upload queue's wiring into the app
Review of the upload progress panel found the store misbehaving once
connected to real auth and page events:
- The owner watch used one getter returning a fresh array, so every
setUser() fired it, even for the same person (opening the user menu,
hovering the workspace submenu), and dismissed running uploads. Watch
the user id and tenant id as separate sources.
- Starting a new batch after the previous run finished cleared it
whole, including failed files still waiting for Retry. Only batches
whose every file is searchable are dropped now.
- The knowledge base list page reloaded everything on each mid-batch
refresh (about every 2s), closing open card menus. It now waits for
the batch's final event; the detail page's mid-batch refreshes only
reload files and folders, and tags and wiki probes wait for the end.
- A row missing from one successful status poll was marked deleted for
good. It now takes three consecutive misses, reset when it reappears.
- Closing the panel aborted requests whose body was already sent, which
the server still stores. Those are left to finish and trigger a list
refresh when they land.
- Two identical files in one batch could both pass the server's hash
dedup when uploaded in parallel. Same-size files for one knowledge
base now never run at once, so the second sees the first's row.
Also: detect cancellation from the abort signal instead of the item
state, ignore a cancelled attempt that settles after its retry started,
bind the beforeunload guard to the panel's lifetime, and show the
subfolder next to file names from folder uploads.
The store body moves into uploadTasksCore.ts with the API, events and
identity injected, so the owner watch and enqueue policy are tested
alongside the queue.