feat(editor): dirty-aware tabs, cleaner unsaved dialog, preserve undo history after save - #38
Merged
Merged
Conversation
… history after save - Add reactive useFileDirty hook backed by a subscription store so tab labels re-render when a file's dirty state changes. - Append '*' to modified file tab names (VS Code parity) and drop the yellow 'font-mono * unsaved' text from the editor action header. - Unsaved Changes dialog: remove redundant Cancel button (the X close button already covers it), drop font-mono on the file name, and remove the 'Do you want to save before closing?' prompt text. - Keep the Monaco model alive across saves (no dispose/setValue) and push a fresh undo stop on save so Ctrl+Z history is preserved until the file is closed, matching VS Code behavior.
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
*indicator; removed the yellowfont-mono * unsavedtext from the editor action header. Added a subscription-baseduseFileDirtyhook so tabs re-render reactively on dirty state changes.pushStackElement()creates a checkpoint so Ctrl+Z history persists until the file is closed.Related Issue
N/A
Type of Change
Testing
make buildpassesmake lintpassesmake testpassesNotes for Reviewer
src/frontend/src/features/editor/hooks/useFileDirty.ts,src/frontend/src/features/workspaces/components/TabButton.tsx(extracted per-file-component lint rule).editorDirtyStorenow has asubscribeDirtyChangesAPI to allow reactive consumption of dirty state changes.TabButtonusesuseFileDirtyto re-render individually per tab without re-rendering the entire tab bar.