fix(desktop): restore dragging workspaces out of sections#2564
fix(desktop): restore dragging workspaces out of sections#2564Kitenite wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds target-index-aware drop handling across the workspace sidebar (client DnD hooks and components), a new TRPC procedure to move a workspace to a section at a specific index, and a small router-side reordering/normalization helper surface. Also exports and uses a new react-query hook to call the procedure. Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceSidebar/ProjectSection/ProjectSection.tsx`:
- Around line 326-327: The drag-over classes on the ungrouped drop zone set
border style and color but omit border width, so the visual cue can be
invisible; update the conditional class string where
ungroupedDropZone.isDragOver is used in ProjectSection (the JSX that builds the
drop-zone classes) to include the "border" utility (e.g., add "border" alongside
"border-solid border-primary/30") so the border appears when isDragOver is true.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 8e733c9f-e3f8-4f70-8f4e-758ed44ec68a
📒 Files selected for processing (1)
apps/desktop/src/renderer/screens/main/components/WorkspaceSidebar/ProjectSection/ProjectSection.tsx
| ungroupedDropZone.isDragOver && | ||
| "bg-primary/5 border-solid border-primary/30", |
There was a problem hiding this comment.
Add explicit border width in drag-over state
At Line 326-327, the drag-over classes set border style/color but not width, so the border cue may not render. Add border to make the drop feedback consistently visible.
Suggested patch
ungroupedDropZone.isDragOver &&
- "bg-primary/5 border-solid border-primary/30",
+ "bg-primary/5 border border-solid border-primary/30",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| ungroupedDropZone.isDragOver && | |
| "bg-primary/5 border-solid border-primary/30", | |
| ungroupedDropZone.isDragOver && | |
| "bg-primary/5 border border-solid border-primary/30", |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In
`@apps/desktop/src/renderer/screens/main/components/WorkspaceSidebar/ProjectSection/ProjectSection.tsx`
around lines 326 - 327, The drag-over classes on the ungrouped drop zone set
border style and color but omit border width, so the visual cue can be
invisible; update the conditional class string where
ungroupedDropZone.isDragOver is used in ProjectSection (the JSX that builds the
drop-zone classes) to include the "border" utility (e.g., add "border" alongside
"border-solid border-primary/30") so the border appears when isDragOver is true.
There was a problem hiding this comment.
1 issue found across 8 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/desktop/src/lib/trpc/routers/workspaces/procedures/sections.ts">
<violation number="1" location="apps/desktop/src/lib/trpc/routers/workspaces/procedures/sections.ts:27">
P2: Filter out soft-deleting workspaces when reordering section items; otherwise `targetIndex` can map to the wrong visible position.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| const sectionWorkspaces = localDb | ||
| .select() | ||
| .from(workspaces) | ||
| .where(eq(workspaces.sectionId, sectionId)) |
There was a problem hiding this comment.
P2: Filter out soft-deleting workspaces when reordering section items; otherwise targetIndex can map to the wrong visible position.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/desktop/src/lib/trpc/routers/workspaces/procedures/sections.ts, line 27:
<comment>Filter out soft-deleting workspaces when reordering section items; otherwise `targetIndex` can map to the wrong visible position.</comment>
<file context>
@@ -19,6 +20,150 @@ function randomSectionColor(): string {
+ const sectionWorkspaces = localDb
+ .select()
+ .from(workspaces)
+ .where(eq(workspaces.sectionId, sectionId))
+ .all()
+ .sort((a, b) => a.tabOrder - b.tabOrder);
</file context>
| .where(eq(workspaces.sectionId, sectionId)) | |
| .where( | |
| and(eq(workspaces.sectionId, sectionId), isNull(workspaces.deletingAt)), | |
| ) |
Summary
Testing
Summary by CodeRabbit
New Features
Improvements