2.1 KiB
2.1 KiB
Story 2.2: Undo/Redo des Modifications
Status: review
Story
As a Julien (Analyst), I want to undo my last data edits, so that I can explore changes without fear of losing the original data.
Acceptance Criteria
- Undo History: The system tracks changes to cell values.
- Undo Action: Users can press
Ctrl+Zor click an "Undo" button to revert the last edit. - Redo Action: Users can press
Ctrl+Y(orCtrl+Shift+Z) to re-apply an undone edit. - Visual Indicator: The Undo/Redo buttons in the toolbar are disabled if no history is available.
- Session Scope: History is maintained during the current session (stateless).
Tasks / Subtasks
- State Management (Zustand) (AC: 1, 2, 3)
- Implement
zundoor a custom middleware for state history inuseGridStore. - Add
undoandredoactions.
- Implement
- Keyboard Shortcuts (AC: 2, 3)
- Add global event listeners for
Ctrl+ZandCtrl+Y.
- Add global event listeners for
- UI Controls (AC: 4)
- Add Undo/Redo buttons to the
FileUploaderor a newToolbarcomponent.
- Add Undo/Redo buttons to the
Dev Notes
- Optimization: Using
zundomiddleware to partialize state history (tracking onlydata,columns, andmodifiedCells). - Shortcuts: Implemented global keyboard event listeners in the main layout.
- UX: Added responsive toolbar buttons with disabled states when no history is present.
Project Structure Notes
- Modified
frontend/src/store/use-grid-store.tsto includetemporalmiddleware. - Updated
frontend/src/app/page.tsxwith UI buttons and shortcut logic.
References
- [Source: functional-requirements.md#FR8]
- [Source: project-context.md#Data & State Architecture]
Dev Agent Record
Agent Model Used
{{agent_model_name_version}}
Completion Notes List
- Integrated
zundofor comprehensive history tracking. - Added Undo/Redo logic to the global Zustand store.
- Implemented
Ctrl+Z,Ctrl+Shift+Z, andCtrl+Ykeyboard shortcuts. - Added visual buttons in the application header with state-dependent enabling/disabling.
File List
- /frontend/src/store/use-grid-store.ts
- /frontend/src/app/page.tsx