Skip to content

fix(knowledge): show failure status on folders whose subtree contains failed files (IKC813) - #2402

Open
yaojin3616 wants to merge 1 commit into
mainfrom
fix/ikc813-folder-failed-status
Open

fix(knowledge): show failure status on folders whose subtree contains failed files (IKC813)#2402
yaojin3616 wants to merge 1 commit into
mainfrom
fix/ikc813-folder-failed-status

Conversation

@yaojin3616

Copy link
Copy Markdown
Collaborator

Summary

  • Gitee issue: IKC813(知识空间文件夹:多层级文件里,子文件夹内有失败文件时,父级文件夹未展示异常状态)
  • Root cause: the backend already computes has_failed_files for every folder level (recursive path-prefix rollup in knowledge_space_service._handle_file_folder_extra_info), but the two file-list renderers in the client app never displayed it for folder rows:
    • FileListRow.tsx StatusBadge only keyed off file.status (folders have no status) → returned null.
    • FileCard.tsx renderStatusOverlayTag hard-excluded folders (if (!isAdmin || isFolder) return null).

Changes

  • src/frontend/client/src/pages/knowledge/SpaceDetail/FileListRow.tsx: folder with hasFailedFiles === true now renders the error tone status pill (失败).
  • src/frontend/client/src/pages/knowledge/SpaceDetail/FileCard.tsx: folder branch added to renderStatusOverlayTag — error pill shows on the card overlay and the H5 list row; admin-gated to match the existing file behavior.
  • Regression tests: FileListRow.folderStatus.test.tsx pins the rollup display for both renderers (folder with failures / clean folder / success file).

Verification

  • eslint clean on all touched files.
  • tsc-strict passes for touched files (6 pre-existing errors remain in unrelated Linsight/Execution files, present on main).
  • Jest regression tests added; local run blocked by a missing canvas.node native module in this environment (pre-existing, affects all client jest suites) — tests will be exercised by CI.

… failed files

Gitee IKC813: in a multi-level knowledge file tree, when a subfolder
contained a failed file, every ancestor folder looked clean because both
list renderers ignored the backend-computed `has_failed_files` for
folder rows.

- FileListRow StatusBadge now renders the error pill when a folder has
  hasFailedFiles (covers the desktop list view).
- FileCard renderStatusOverlayTag no longer unconditionally excludes
  folders: a folder with hasFailedFiles shows the same error pill in the
  card view and the H5 list row.
- Regression tests pin the folder rollup behavior for both renderers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant