You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Editor: unsaved work can be lost — no Save As menu item, no dirty tracking, stale window title #116
Four related file-handling gaps, all of which can cost the user work (Phase 2, item 2 of docs/ROADMAP.md).
1. "Save As" is not in the File menu
The File menu offers New / Open / Save (SchemaEditor.cs:236-248). SaveAs() exists (:323) but is only reachable indirectly: Save() falls through to it when the path is empty (:308), and the "Save Now" button in the unsaved-schema banner calls it (:454). Once a schema has a path there is no way to save a copy elsewhere.
2. No dirty tracking or unsaved-changes prompt
New() (:284) and Open() (:292) both call Reset() and replace CurrentSchema immediately. Unsaved edits are gone with no prompt. Closing the window has the same problem.
UndoRedo.MarkAsSaved() is already called on a successful save (:317), so the undo service knows whether the document is dirty — nothing reads it.
3. The window title is computed once and never updated
privatestaticvoidMain(string[]_){stringtitle=nameof(SchemaEditor);if(Instance.CurrentSchemais not null&&!string.IsNullOrEmpty(Instance.CurrentSchemaPath)){title+=$" - {Path.GetFileName(Instance.CurrentSchemaPath)}";}ImGuiApp.Start(new(){Title=title,...});// SchemaEditor.cs:52-66}
The title reflects whichever schema was restored at startup, forever. Open a different file and the title still names the old one.
4. No recent-files menu
AppData.CurrentSchemaPath persists exactly one path. Reopening a recent schema means navigating the file browser every time.
Acceptance criteria
"Save As…" is a File menu item, always enabled when a schema is open.
A dirty indicator appears in the window title (e.g. a trailing *), driven off the undo service's saved state.
New / Open / window-close prompt to save when the schema is dirty, with Save / Discard / Cancel.
The window title updates whenever the open schema or its path changes.
A recent-files list (bounded, persisted in AppData) appears in the File menu, skipping entries that no longer exist.
It adds ImGuiApp.SetWindowTitle(string) (the config's Title is init-only and read once at window creation) and ImGuiAppConfig.OnClosing, a Func<bool> that cancels the close by returning false.
The close hook cancels by clearing IWindow.IsClosing, which the windowing backend re-reads each iteration of the run loop — so it works on every platform, rather than being Windows-only like the existing HideOnClose, which subclasses the native window to intercept WM_CLOSE.
Once that lands and a release carries it, the rest of this issue is small here:
Live window title — call SetWindowTitle from the render loop with the document name and a trailing * when UndoRedo.HasUnsavedChanges. The dirty state is already tracked and already read for the menu-bar indicator; this just sends it somewhere else too.
Window-close prompt — set OnClosing to return false while unsaved changes exist, raising the same Save / Discard / Cancel prompt that New and Open already use, and call ImGuiApp.Stop() when the user confirms. A modal can't be drawn from the callback itself (it returns before the next frame), so it sets the flag the existing prompt already keys off.
Nothing else in this issue is outstanding — Save As with Ctrl+Shift+S, dirty tracking read off the undo service, New/Open prompting, the bounded recent-files list, and a guarded Exit all shipped in #125.
Activity
matt-edmondson commentedon Aug 28, 2026
The two remaining bullets are unblocked upstream: ktsu-dev/ImGuiApp#341.
It adds
ImGuiApp.SetWindowTitle(string)(the config'sTitleisinit-only and read once at window creation) andImGuiAppConfig.OnClosing, aFunc<bool>that cancels the close by returningfalse.The close hook cancels by clearing
IWindow.IsClosing, which the windowing backend re-reads each iteration of the run loop — so it works on every platform, rather than being Windows-only like the existingHideOnClose, which subclasses the native window to interceptWM_CLOSE.Once that lands and a release carries it, the rest of this issue is small here:
SetWindowTitlefrom the render loop with the document name and a trailing*whenUndoRedo.HasUnsavedChanges. The dirty state is already tracked and already read for the menu-bar indicator; this just sends it somewhere else too.OnClosingto returnfalsewhile unsaved changes exist, raising the same Save / Discard / Cancel prompt that New and Open already use, and callImGuiApp.Stop()when the user confirms. A modal can't be drawn from the callback itself (it returns before the next frame), so it sets the flag the existing prompt already keys off.Nothing else in this issue is outstanding — Save As with
Ctrl+Shift+S, dirty tracking read off the undo service, New/Open prompting, the bounded recent-files list, and a guarded Exit all shipped in #125.Generated by Claude Code
Merge pull request #132 from ktsu-dev/claude/schema-issues-kwr4lk