Skip to content

feat(editor): dirty-aware tabs, cleaner unsaved dialog, preserve undo history after save - #38

Merged
04mg merged 1 commit into
developfrom
feat/editor-keep-state-and-close-confirm
Jul 21, 2026
Merged

feat(editor): dirty-aware tabs, cleaner unsaved dialog, preserve undo history after save#38
04mg merged 1 commit into
developfrom
feat/editor-keep-state-and-close-confirm

Conversation

@04mg

@04mg 04mg commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • Unsaved Changes dialog: removed redundant Cancel button, dropped font-mono from the file name, removed the "Do you want to save before closing?" prompt text.
  • Modified file tabs now show a trailing * indicator; removed the yellow font-mono * unsaved text from the editor action header. Added a subscription-based useFileDirty hook so tabs re-render reactively on dirty state changes.
  • Undo/redo history is now preserved across saves (matches VS Code behavior). The Monaco model is no longer reset on save; instead pushStackElement() creates a checkpoint so Ctrl+Z history persists until the file is closed.

Related Issue

N/A

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Refactor
  • Other

Testing

  • make build passes
  • make lint passes
  • make test passes
  • Manually tested in browser

Notes for Reviewer

  • New files: src/frontend/src/features/editor/hooks/useFileDirty.ts, src/frontend/src/features/workspaces/components/TabButton.tsx (extracted per-file-component lint rule).
  • The editorDirtyStore now has a subscribeDirtyChanges API to allow reactive consumption of dirty state changes.
  • TabButton uses useFileDirty to re-render individually per tab without re-rendering the entire tab bar.

… 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.
@04mg
04mg merged commit 2c00ab4 into develop Jul 21, 2026
@04mg
04mg deleted the feat/editor-keep-state-and-close-confirm branch July 21, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant