WeKnora/frontend/src/views
linus-liu-web e6dc60be32
fix(knowledge): 文件夹树显示递归文档数,不再把有子目录的文件夹显示成 0 (#4428)
* fix(knowledge): show recursive folder counts in the folder tree

Connector-synced knowledge bases now come with multi-level folders, so a
parent folder often holds no documents of its own while its subtree holds
several. The folder tree, the breadcrumb and the empty state all read
document_count (documents directly in the folder), so those parents rendered
0 and the document list stated "this folder has no documents yet" even though
the documents were one level down. The API was already correct: total_count
carries the recursive number.

- KbFolderTree renders the row's totalCount; the existing tooltip still spells
  out the direct/recursive split.
- KnowledgeBase reports the selected folder's recursive total in the
  breadcrumb. Filtering keeps the flat result count, and a tree that is
  missing or stale falls back to the loaded list total.
- The empty state gains a third branch for folders whose documents all live in
  sub-folders, with a new emptyFolderWithSubfolders message in all six locales.
- folderTree.ts exposes folderDocumentCounts() and shares the node lookup with
  childFolders().

Tests render the tree through Vite SSR (a 0/5 parent and the root row) and
cover the breadcrumb/empty-state computed values plus the template wiring.

* fix(knowledge): count sub-folders beside the breadcrumb document count

The breadcrumb reported the selected folder's recursive document total while
the document list only renders that folder's own documents. A folder holding 2
documents and 1 sub-folder therefore claimed "3 documents" next to a list of 2.
Report the two numbers the page can actually account for, the way the DingTalk
original does: "{documents} documents / {folders} folders".

- The breadcrumb renders a new two-part folderContentsCount message in all six
  locales. Browsing counts the loaded list total (the documents on screen) and
  the folder's direct sub-folders; filtering keeps the flat result count and
  adds no folder number, since it searches documents rather than folders.
- The sub-folder number is childFolders().length: the tree's top-level folders
  at the root, the selected node's children in a folder, and 0 when the tree is
  unavailable or the path is stale.
- The recursive total stays where it is useful: the tree row (totalCount) and
  the empty state, whose folderSubfolderDocumentCount is a different quantity
  (documents below the folder) and is left untouched.

* fix(knowledge): list sub-folders in the document views

Render the current folder's direct sub-folders as rows in the list and as
cards in the grid, ahead of the documents, so browsing matches a file manager
and the DingTalk folder view. Folder entries are navigation only: they carry
no batch checkbox and never enter document selection or sorting.

Filtering still searches the subtree and shows documents only. When the folder
tree is unavailable the views receive an empty list instead of crashing.

Also hide the breadcrumb's folder segment when the folder has no sub-folders
(falling back to the document-only message) and pluralize the folder count in
English and Russian.

* fix(knowledge): use t-icon sizes so the style guard stays at its baseline

The folder row/card icons were sized with literal CSS font-size values,
which the style guard counts against a fixed baseline. Use the t-icon size
attribute instead, as the guard's own guidance asks.

* fix(knowledge): preserve folder list icon size after style guard cleanup

---------

Co-authored-by: linus-liu-web <linus-liu-web@users.noreply.github.com>
Co-authored-by: wizardchen <wizardchen@tencent.com>
2026-10-17 22:37:58 +08:00
..
agent feat(assistant): expand management operations and polish interaction UI (#4427) 2026-10-17 14:35:58 +08:00
artifacts style: polish sidebar, list pages, toolbox and citation UI (#4154) 2026-10-11 15:01:12 +08:00
auth feat(i18n): add Traditional Chinese (zh-TW) locale support (#3916) 2026-10-08 16:18:17 +08:00
chat feat(assistant): let the assistant find skills and MCP services on the web (#4429) 2026-10-17 15:25:08 +08:00
creatChat fix(skill): do not fail installs on non-blocking observations (#4246) 2026-10-13 19:47:14 +08:00
dev refactor(frontend): style consistency pass — shared shells, tokens, unified confirmations (#3376) 2026-09-17 23:11:08 +08:00
embed fix(embed): hide host context in user messages (#4388) 2026-10-16 19:53:10 +08:00
integrations fix: align settings layouts and tolerate existing migration objects (#4164) 2026-10-11 22:48:57 +08:00
knowledge fix(knowledge): 文件夹树显示递归文档数,不再把有子目录的文件夹显示成 0 (#4428) 2026-10-17 22:37:58 +08:00
organization feat(assistant): expand management operations and polish interaction UI (#4427) 2026-10-17 14:35:58 +08:00
platform feat(assistant): trial runs, session grants, page links, and MCP/model/skill management (#4375) 2026-10-16 23:36:01 +08:00
settings feat(assistant): expand management operations and polish interaction UI (#4427) 2026-10-17 14:35:58 +08:00
system feat(assistant): trial runs, session grants, page links, and MCP/model/skill management (#4375) 2026-10-16 23:36:01 +08:00
toolbox style: polish sidebar, list pages, toolbox and citation UI (#4154) 2026-10-11 15:01:12 +08:00