-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Improve editor placement and selection workflows #543
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7f917ad
feat: expose accepted canvas node selections
Aymericr fb06b5c
feat(editor): replace bulk delete alert with dialog
Aymericr ed82dcd
fix(editor): allow immediate selection after opening placement
Aymericr a7150e3
feat(spawn): preview model during placement
Aymericr 0fa7d83
feat(editor): add cross-project selection clipboard
Aymericr 3c1eeca
Merge remote-tracking branch 'origin/main' into feat/contextual-selec…
Aymericr d31de46
fix(editor): harden placement and clipboard previews
Aymericr 9f220c8
fix(editor): preserve carried clipboard state
Aymericr e501ddb
fix(editor): replace active paste drafts safely
Aymericr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
packages/editor/src/components/editor/delete-confirmation-dialog.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| 'use client' | ||
|
|
||
| import { useEffect } from 'react' | ||
| import useDeleteConfirmation from '../../store/use-delete-confirmation' | ||
| import { | ||
| Dialog, | ||
| DialogContent, | ||
| DialogDescription, | ||
| DialogFooter, | ||
| DialogHeader, | ||
| DialogTitle, | ||
| } from '../ui/primitives/dialog' | ||
|
|
||
| export function DeleteConfirmationDialog() { | ||
| const request = useDeleteConfirmation((state) => state.request) | ||
| const cancel = useDeleteConfirmation((state) => state.cancel) | ||
| const confirm = useDeleteConfirmation((state) => state.confirm) | ||
|
|
||
| useEffect(() => cancel, [cancel]) | ||
|
|
||
| return ( | ||
| <Dialog onOpenChange={(open) => !open && cancel()} open={request !== null}> | ||
| <DialogContent | ||
| className="border-border/70 bg-background/95 shadow-2xl backdrop-blur-xl sm:max-w-md" | ||
| data-delete-confirmation-dialog | ||
| showCloseButton={false} | ||
| > | ||
| <DialogHeader> | ||
| <DialogTitle>Delete {request?.count ?? 0} elements?</DialogTitle> | ||
| <DialogDescription> | ||
| This removes every selected element. You can undo the deletion while it remains in the | ||
| editor history. | ||
| </DialogDescription> | ||
| </DialogHeader> | ||
| <DialogFooter> | ||
| <button | ||
| className="rounded-full border border-border px-4 py-2 text-sm transition-colors hover:bg-accent" | ||
| onClick={cancel} | ||
| type="button" | ||
| > | ||
| Cancel | ||
| </button> | ||
| <button | ||
| className="rounded-full bg-red-600 px-4 py-2 text-sm text-white transition-colors hover:bg-red-700" | ||
| onClick={confirm} | ||
| type="button" | ||
| > | ||
| Delete | ||
| </button> | ||
| </DialogFooter> | ||
| </DialogContent> | ||
| </Dialog> | ||
| ) | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.