* 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>