WeKnora/frontend/src/views/knowledge
Martín Alcalá Rubí bbf7ac29bf fix(frontend): dedupe KB list to stop empty render with ≥2 knowledge bases
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>
2026-06-08 12:10:30 +08:00
..
components refactor(knowledge-processing): streamline cancel parse functionality and enhance user confirmation dialogs 2026-06-04 15:48:04 +08:00
settings fix: skip credential validation when editing data source 2026-06-04 15:29:22 +08:00
wiki feat(wiki): add "View in Graph" entry on wiki page 2026-05-22 21:02:01 +08:00
KnowledgeBase.vue fix(knowledge): update doc-scroll-container class binding to account for loading state 2026-06-08 12:03:41 +08:00
KnowledgeBaseEditorModal.vue feat(contextualGuides): add multiple contextual guide components for agent and knowledge base creation 2026-06-03 14:42:46 +08:00
KnowledgeBaseList.vue fix(frontend): dedupe KB list to stop empty render with ≥2 knowledge bases 2026-06-08 12:10:30 +08:00
kbListMerge.test.ts fix(frontend): dedupe KB list to stop empty render with ≥2 knowledge bases 2026-06-08 12:10:30 +08:00
kbListMerge.ts fix(frontend): dedupe KB list to stop empty render with ≥2 knowledge bases 2026-06-08 12:10:30 +08:00