Skip to content

feat(knowledge): move folders with drag and drop or actions menu - #4461

Closed
Annabelle0726 wants to merge 1 commit into
Tencent:mainfrom
Annabelle0726:codex/folder-reparent
Closed

Annabelle0726 wants to merge 1 commit into
Tencent:mainfrom
Annabelle0726:codex/folder-reparent

Conversation

@Annabelle0726

@Annabelle0726 Annabelle0726 commented Oct 18, 2026 •

Copy link
Copy Markdown

Description

Add two ways to change a knowledge folder's parent: drag it onto another folder (or the knowledge-base root), or use Actions → Move to folder. Both reuse the existing folder move endpoint and preserve the folder name, descendants, selected path and recursive document counts.

  • Exclude self/descendant, unchanged, duplicate and stale destinations; disable mutations for read-only users and while a move is pending.
  • Offer focusable menu buttons, Escape-to-trigger focus restoration and a touch-accessible alternative to dragging.
  • Validate every descendant's resulting path before the repository writes any rows. Previously, normalization could silently truncate an over-deep moved subtree.
  • Add the new labels to the existing six locales.
  • Repair a missing useConnectorLabel mock in the existing assistant-refresh test fixture, which otherwise prevents the current upstream frontend suite from passing.

Type of Change

  • ✨ New feature
  • 🐛 Bug fix
  • 🧪 Test

Testing

  • npm test: 1,800 passed, 0 failed, 1 existing skip.
  • npm run type-check: passed.
  • NODE_OPTIONS=--max-old-space-size=4096 npm run build: passed; existing large-chunk warnings only.
  • Focused folder/component tests: 12 passed.
  • go test ./internal/application/repository: passed, including the regression that fails on unmodified upstream.
  • go vet ./... and go build ./cmd/server: passed on this branch.
  • golangci-lint v2.12.2, filtered with this PR's patch and scoped to ./internal/application/repository: 0 issues, successful exit.

Checks used Linux Go 1.26.9 and Node 24. Upstream GitHub Actions currently require maintainer approval (action_required); remote CI has not run yet.

Browser verification used Chromium and an isolated API fixture: drag/reparent, move to root, subtree preservation after refresh, menu/keyboard operation, Escape focus restoration, rejected cycles, failed requests retaining the original tree, and read-only permissions. The move menu was checked at 1920, 683 and 390 px. The existing workspace minimum-width layout still requires horizontal scrolling at 390 px; this PR does not redesign that layout.

Checklist

  • git diff --check upstream/main...HEAD passes
  • Changed source files are formatted
  • Targeted tests for the changed packages/components pass
  • Diff-scoped Go lint passes
  • Full-repository checks were run; results are recorded above
  • Self-reviewed the code
  • Added regression tests
  • No breaking API or migration changes

Screenshots

Move a folder through the actions menu

@Annabelle0726
Annabelle0726 deleted the codex/folder-reparent branch October 18, 2026 07:49
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