Skip to content

feat: improve document management usability for issue 781#3

Draft
luoye520ww wants to merge 21 commits into
developfrom
feat/issue-781-doc-management-usability
Draft

feat: improve document management usability for issue 781#3
luoye520ww wants to merge 21 commits into
developfrom
feat/issue-781-doc-management-usability

Conversation

@luoye520ww

@luoye520ww luoye520ww commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up fixes for the issue KunAgent#781 document-management usability implementation.

This draft PR is based on the fork's develop branch, which mirrors KunAgent/Kun:develop, so review diff context matches the upstream target.

Changes

  • Broaden assistant-message file reference detection, including Chinese file names and generated/code-block output.
  • Remove the unsafe cross-workspace auto-preview restore shim. The renderer enhancement no longer reopens stale paths after arbitrary thread/workspace switches.
  • Keep the large reading mode attached to the live preview DOM instead of cloning .ds-code-sidebar, so React-bound interactions are not turned into a dead snapshot.
  • Move file-tree modified sorting into ChatFileTreePanel React state instead of writing style.order on non-flex block rows.
  • Populate WorkspaceEntry.mtimeMs / WorkspaceEntry.size through a metadata-backed workspace directory listing, so modified sorting has real filesystem data.
  • Define Recent files as recently modified workspace files and scan the workspace recursively, instead of only using already-expanded file-tree directories.
  • Add native file-tree/recent-file drag data using the existing composer @path mention token formatting.
  • Scope preview tab pinned/scroll state by page/workspace context instead of only tab label to reduce cross-workspace state collisions.
  • Add focused sorting helper tests for ChatFileTreePanel.

Scope hygiene

The PR diff is intentionally limited to KunAgent#781 document-management files. Skill/runtime/locale behavior changes are not included.

Manual checks

  • Assistant output paths like docs/前处理算法优化计划_v2.0.md and scripts/infer.py are clickable.
  • Code-block output containing file paths can open the right-side preview.
  • Switching to a different workspace no longer restores the old preview path into the new workspace.
  • File tree modified sorting uses mtimeMs from the main process.
  • Recent files are derived from a recursive workspace scan and sorted by modification time.
  • File tree rows and recent-file rows set composer-compatible drag data.
  • Click 阅读; it expands the live preview panel rather than cloning a static copy.

Validation to run locally

npm run lint
npm run typecheck
npm test

I could not run local commands from this environment; this remains draft until those pass locally.

@luoye520ww
luoye520ww changed the base branch from master to develop July 8, 2026 07:26
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.

2 participants