-
Notifications
You must be signed in to change notification settings - Fork 896
fix(desktop): restore dragging workspaces out of sections #2564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| import { toast } from "@superset/ui/sonner"; | ||
| import { electronTrpc } from "renderer/lib/electron-trpc"; | ||
| import { invalidateWorkspaceQueries } from "./invalidateWorkspaceQueries"; | ||
|
|
||
| export function useMoveWorkspaceToSectionAtIndex() { | ||
| const utils = electronTrpc.useUtils(); | ||
|
|
||
| return electronTrpc.workspaces.moveWorkspaceToSectionAtIndex.useMutation({ | ||
| onSuccess: () => invalidateWorkspaceQueries(utils), | ||
| onError: (error) => | ||
| toast.error(`Failed to move workspace: ${error.message}`), | ||
| }); | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -129,6 +129,7 @@ export function ProjectSection({ | |||||||||
| canAccept: (item) => | ||||||||||
| item.sectionId !== null && item.projectId === projectId, | ||||||||||
| targetSectionId: null, | ||||||||||
| getTargetIndex: () => topLevelChildren.length, | ||||||||||
| }); | ||||||||||
|
|
||||||||||
| const handleNewWorkspace = () => { | ||||||||||
|
|
@@ -312,19 +313,21 @@ export function ProjectSection({ | |||||||||
| className="overflow-hidden" | ||||||||||
| > | ||||||||||
| <div className="pb-1"> | ||||||||||
| {topLevelChildren.length === 0 && ( | ||||||||||
| <div | ||||||||||
| {...ungroupedDropZone.handlers} | ||||||||||
| className={cn( | ||||||||||
| "transition-colors rounded-sm min-h-8", | ||||||||||
| ungroupedDropZone.isDropTarget && | ||||||||||
| !ungroupedDropZone.isDragOver && | ||||||||||
| "border border-dashed border-primary/20", | ||||||||||
| ungroupedDropZone.isDragOver && | ||||||||||
| "bg-primary/5 border-solid border-primary/30", | ||||||||||
| )} | ||||||||||
| /> | ||||||||||
| )} | ||||||||||
| <div | ||||||||||
| {...ungroupedDropZone.handlers} | ||||||||||
| className={cn( | ||||||||||
| "transition-colors rounded-sm", | ||||||||||
| (topLevelChildren.length === 0 || | ||||||||||
| ungroupedDropZone.isDropTarget || | ||||||||||
| ungroupedDropZone.isDragOver) && | ||||||||||
| "min-h-8", | ||||||||||
| ungroupedDropZone.isDropTarget && | ||||||||||
| !ungroupedDropZone.isDragOver && | ||||||||||
| "border border-dashed border-primary/20", | ||||||||||
| ungroupedDropZone.isDragOver && | ||||||||||
| "bg-primary/5 border-solid border-primary/30", | ||||||||||
|
Comment on lines
+327
to
+328
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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 Suggested patch ungroupedDropZone.isDragOver &&
- "bg-primary/5 border-solid border-primary/30",
+ "bg-primary/5 border border-solid border-primary/30",📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
| )} | ||||||||||
| /> | ||||||||||
| {topLevelChildren.map((item) => | ||||||||||
| item.kind === "workspace" ? ( | ||||||||||
| <WorkspaceListItem | ||||||||||
|
|
||||||||||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Filter out soft-deleting workspaces when reordering section items; otherwise
targetIndexcan map to the wrong visible position.Prompt for AI agents