Add undo/redo support and toast notifications for bookmarks - #10
Merged
Conversation
Implement Ctrl+Z/Cmd+Z undo and Ctrl+Shift+Z/Cmd+Shift+Z redo using Yjs UndoManager. Key changes: - Add Y.UndoManager to track local bookmark mutations - Wrap all bookmark CRUD operations in transactions with LOCAL_ORIGIN - Add Toast component for undo feedback after deletions - Show "Undo" action in toast when bookmarks are deleted - Add mod+z and mod+shift+z hotkeys to BookmarkList Users can now recover deleted bookmarks by pressing Ctrl+Z or clicking the Undo button in the toast notification. https://claude.ai/code/session_01U1TSwicVcAS9dakDkpMoH1
✅ Deploy Preview for hypermarkk ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR adds undo/redo functionality and toast notifications to the bookmark management system. Users can now undo/redo bookmark operations (create, update, delete, tag changes) using keyboard shortcuts (Cmd+Z / Cmd+Shift+Z) and receive visual feedback through toast notifications.
Key Changes
Undo/Redo Support: Integrated Yjs UndoManager to track local bookmark operations with a 500ms capture timeout for grouping rapid changes
undo(),redo(),canUndo(),canRedo()functions from useYjs hookLOCAL_ORIGINconstant to track which operations are undoableToast Notification System: Created new Toast component and useToast hook
Toast.jsx: Individual toast component with auto-dismiss, action buttons, and smooth animationsToastContainer: Manages multiple concurrent toastsuseToast(): Hook for managing toast state with add/remove/clear operationsEnhanced User Feedback:
Keyboard Shortcuts:
Cmd+Z/Ctrl+Z: UndoCmd+Shift+Z/Ctrl+Shift+Z: RedoImplementation Details
https://claude.ai/code/session_01U1TSwicVcAS9dakDkpMoH1