refactor: remove unused useUndoRedo hook#602
Open
Shubh-Raj wants to merge 7 commits intoaccordproject:mainfrom
Open
refactor: remove unused useUndoRedo hook#602Shubh-Raj wants to merge 7 commits intoaccordproject:mainfrom
Shubh-Raj wants to merge 7 commits intoaccordproject:mainfrom
Conversation
The useUndoRedo hook was originally added with undo/redo UI buttons but the buttons were accidentally removed during a UI refactor in commit 61f3865. Since Monaco Editor handles native Ctrl+Z/Ctrl+Y, this hook became redundant dead code. Changes: - Delete src/components/useUndoRedo.ts - Simplify editor components to use store state directly Signed-off-by: Shubh-Raj <shubhraj625@gmail.com>
✅ Deploy Preview for ap-template-playground ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
Author
|
If the undo/redo buttons are needed in the editors, I'd be happy to implement them instead. Just let me know! |
…ndoredo' into shubhraj/cleanup/remove-unused-undoredo
Contributor
Author
|
Resolved the merge conflicts. |
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the now-dead useUndoRedo hook and updates the editor container components to read/write editor state directly from the Zustand store, relying on Monaco’s native undo/redo behavior.
Changes:
- Deleted
src/components/useUndoRedo.ts(no remaining references found). - Refactored
TemplateModel,TemplateMarkdown, andAgreementDatato pass store-backed editor values directly to their editors. - Simplified change handlers to update
editor*state and trigger rebuild via the corresponding async store setters.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/components/useUndoRedo.ts | Removed unused undo/redo hook implementation. |
| src/editors/editorsContainer/TemplateModel.tsx | Removed hook usage; use editorModelCto + store setters directly. |
| src/editors/editorsContainer/TemplateMarkdown.tsx | Removed hook usage; use editorValue + store setters directly. |
| src/editors/editorsContainer/AgreementData.tsx | Removed hook usage; use editorAgreementData + store setters directly. |
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.
Closes #601
Removes the unused
useUndoRedohook that became dead code after commit61f3865removed the undo/redo UI buttons during a UI refactor. Monaco Editor handles native Ctrl+Z/Ctrl+Y, making this hook redundant.Changes
Flags
Screenshots or Video
N/A - No visual changes
Related Issues
622297c(Mar 2025)61f3865(Aug 2025)Author Checklist
--signoffoption of git commit.mainfromfork:branchname