The "All" scope of the knowledge-base list renders every card with `:key="kb.id"`. The same knowledge base can appear more than once in the source data — owned *and* shared back to the caller, or shared into their view through two different organizations (distinct share_id, identical knowledge_base.id). Duplicate `v-for` keys corrupt Vue's virtual-DOM patch and the list renders empty/partial. A single KB never collides, so the page works with one KB and blanks once there are two or more — the exact behavior reported in #795. Extract the merge into a pure, unit-tested helper (mergeAllScopeKnowledgeBases) that de-duplicates by knowledge-base id — owned rows win over shared duplicates, and repeated shares of one KB keep the most-privileged permission — while preserving the existing pinned → mine → teammate → shared(editable-first) ordering. Tests use the repo's existing node:test convention; a `test` script is added so `npm test` discovers them (it also wires up the two previously orphaned *.test.ts files). Fixes #795 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| packages | ||
| public | ||
| src | ||
| .dockerignore | ||
| .gitignore | ||
| Dockerfile | ||
| docker-entrypoint.sh | ||
| env.d.ts | ||
| index.html | ||
| nginx.conf | ||
| package-lock.json | ||
| package.json | ||
| package.json.md5 | ||
| pnpm-workspace.yaml | ||
| tsconfig.app.json | ||
| tsconfig.json | ||
| tsconfig.node.json | ||
| vite.config.ts | ||