Add manual Agent project ordering#637
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughAgent Mode now maintains manually ordered project roots separately from session recency. The backend validates and persists explicit orders, while the frontend provides optimistic reducer state, serialized mutations, and drag-and-drop ordering with insertion feedback. ChangesAgent project ordering
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant AgentSidebarContent
participant AgentMode
participant AgentRuntimeService
participant TauriBackend
AgentSidebarContent->>AgentMode: report reordered project roots
AgentMode->>AgentRuntimeService: saveProjectRootOrder(userId, paths)
AgentRuntimeService->>TauriBackend: invoke agent_save_project_root_order
TauriBackend-->>AgentRuntimeService: return persisted roots
AgentRuntimeService-->>AgentMode: confirm or reject order
AgentMode-->>AgentSidebarContent: render confirmed visible order
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Deploying maple with
|
| Latest commit: |
b22853e
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://4dea08b6.maple-ca8.pages.dev |
| Branch Preview URL: | https://codex-agent-project-ordering.maple-ca8.pages.dev |
Future Projects UX opportunitiesThese are follow-up opportunities rather than blockers for this Agent Mode change. 1. Drag-ordering performanceThe current implementation is deliberately correctness-first and should be fast for ordinary project lists. During a drag, however, each native pointer update measures every project header and updates React state, which rerenders the project/session subtree. If profiling shows jank as lists grow, the highest-value improvements would be:
The persistence algorithm itself is already appropriate: validating and writing one complete ordered list is linear, simple, and reliable for this data size. 2. Extending this UX to Chat ProjectsThe pure ordering pieces are a good foundation, but the current implementation is not a drop-in Chat Mode feature. Before adding a second consumer:
This keeps the current PR focused while giving Chat Mode a shared interaction primitive and the persistence model appropriate for cloud-backed projects. |
|
This is probably fine for now, I will need to consider where settings / preferences like this live long term. I'm also not sure how this would behave on mobile but we don't expose agent mode on mobile yet so it's also fine for now probably. |
AnthonyRonning
left a comment
There was a problem hiding this comment.
I'll likely change the entire "backend" architecture here around projects but this doesn't introduce too much that didn't already exist, and the frontend looks good, so merge whenever it's ready.
project-drag-and-drop.mov
Closes #633
What
Why
Project order was previously changed in two places: native recent-root persistence promoted projects during runtime and session activity, while the sidebar sorted projects by
lastUsedMs. Selecting a project or session could therefore move its project unexpectedly.Impact
Checks
just formatjust lint— 0 errors; 12 pre-existing warningsjust buildcd frontend && bun test— 119 passed, 0 failedjust rust-lint— passed with existing Tao dependency warningscd frontend/src-tauri && cargo test --all-targets --locked— 123 passed, 0 failedgit diff --checkSummary by CodeRabbit