Skip to content

feat(agent-manager): reorder projects with drag and drop - #14928

Merged
marius-kilocode merged 1 commit into
mainfrom
reorder-projects-agent-manager
Oct 8, 2026
Merged

marius-kilocode merged 1 commit into
mainfrom
reorder-projects-agent-manager

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

What Problem This Solves

The Agent Manager sidebar lists the current workspace project first, followed by every project the user added. The added projects render in the order they were added, and there was no way to change that order. A user with several repositories could not bring the projects they work in most to the top.

Why This Change Was Made

The project catalog already stores an order field for each entry, but nothing ever rewrote it. This change adds reordering on top of that field, so no new storage key or migration is needed. The project list is a global catalog shared by all windows, so the order is a catalog property rather than webview state.

The drag behavior is deliberately simple. The project header is the drag handle, the dragged project dims, and a thin line marks where it will land. The insertion point depends on which half of a project the pointer is over, so a tall expanded project does not make the target flicker. The order is applied locally right away, then saved, and the extension answers with the stored list so a failed save cannot leave the sidebar in a wrong order.

User Impact

  • Drag a project header to move that project up or down the sidebar.
  • The pinned workspace project cannot be dragged and always stays first.
  • The order survives a restart and applies to all working windows.

Evidence

  • Unit tests (new tests/unit/project-order.test.ts, plus a case in agent-project-messages.test.ts): the drop-point helper, the move helper, the applied order, and saving an order with unknown, duplicate, and unlisted ids.
  • Typecheck, lint, knip, and the focused unit suites pass.
  • Manual test in an isolated VS Code with three added repositories: dragging a project past another showed the drop line and changed the order; the order stayed after a restart; dragging the pinned project did nothing; a long press on a row action button did not start a drag; and releasing the drag outside the sidebar left the order unchanged. Drag interaction was driven with synthetic pointer events, not a real mouse.

Limitations

  • No keyboard reordering. Sections have Move up/Move down menu items; projects do not.
  • No auto-scroll while dragging past the visible part of a long list.

@kilo-code-bot

kilo-code-bot Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

No defects found in the changed lines. The drag helpers (project-order.ts) are pure and covered by unit tests, ProjectRegistry.doReorder re-reads storage before merging so concurrent-window adds are preserved, and the webview drag wiring matches the installed @thisbeyond/solid-dnd@0.7.5 API (createDraggable().ref + dragActivators, event.overlay.transformed.center). All changes are confined to Kilo-owned paths, so no upstream-merge-hygiene concerns. A user-facing changeset and story update are included.

Files Reviewed (13 files)
  • .changeset/agent-manager-project-reorder.md
  • packages/kilo-vscode/src/agent-manager/project/messages.ts
  • packages/kilo-vscode/src/agent-manager/project/registry.ts
  • packages/kilo-vscode/src/agent-manager/types.ts
  • packages/kilo-vscode/tests/unit/agent-project-messages.test.ts
  • packages/kilo-vscode/tests/unit/project-order.test.ts
  • packages/kilo-vscode/webview-ui/agent-manager/ProjectList.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/ProjectsSection.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/SidebarSectionHeader.tsx
  • packages/kilo-vscode/webview-ui/agent-manager/agent-manager.css
  • packages/kilo-vscode/webview-ui/agent-manager/project-order.ts
  • packages/kilo-vscode/webview-ui/src/stories/agent-manager.stories.tsx
  • packages/kilo-vscode/webview-ui/src/types/messages/webview-messages.ts

Reviewed by deepseek-v4.1-flash · Input: 127.6K · Output: 33.4K · Cached: 2.7M

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode merged commit f906f87 into main Oct 8, 2026
26 checks passed
@marius-kilocode
marius-kilocode deleted the reorder-projects-agent-manager branch October 8, 2026 13:55
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