Repository navigation
fix(app): open the file editor as an ordinary window - #273
Conversation
…dinary-window Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015nMqJEvqPnRmPgi6dnraZM
The editor was owned by the main window and could not be minimized only because it opened through the same code as the dialogs. Drop the setting that made this optional: the editor is always a top-level window, using the TopLevel window kind the panel windows already have. Dialogs and Options stay owned. Remove the checkbox, the independentFileEditor key, its strings and its docs, and restore the agent test that had to scroll the longer page. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015nMqJEvqPnRmPgi6dnraZM
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 91ab6ab3a0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Kind: WindowFileEditor, Title: a.fileEditorTitle, | ||
| Width: 1000, Height: 700, MinWidth: 560, MinHeight: 360, | ||
| OwnKeys: true, CloseRequested: a.closeFileEditorRequested, Closed: a.fileEditorClosed, | ||
| OwnKeys: true, TopLevel: true, |
There was a problem hiding this comment.
Restore the tray-hidden main window when the editor is visible
On macOS, hiding the main window to the tray while the editor has unsaved changes now leaves a visible top-level editor window. The Dock activation handler in main.go only calls plat.showMain() when hasVisibleWindows is false, so clicking the Dock icon in this state no longer brings back the terminal window. Update that handler to also restore the main window when it is hidden in the tray, regardless of whether the editor is visible.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed and fixed in 2aceca5: OnActivate now calls plat.showMain() whatever windows are visible. showMain returns at once when the main window is not in the tray, so nothing changes outside that case. Not tried on a real Mac; it is step 8 of the click-through in the description.
Generated by Claude Code
With the main window hidden in the tray, an editor with unsaved changes stays open, and as an ordinary window it is no longer hidden along. The Dock icon then found a visible window and did not bring the main window back. It now shows the main window whenever it is in the tray. Refs #255 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015nMqJEvqPnRmPgi6dnraZM
|
CI on 2aceca5 failed in Generated by Claude Code |
Summary
The file editor window was owned by the main window and could not be minimized, only because it opened through the same code as the dialogs. On Windows that kept it above the terminal whichever window had the focus. It is now an ordinary window beside the main one: no owner, not modal, minimize enabled, and whichever window is clicked comes to the front. There is no setting for it.
This continues #256 by @loooinfo, whose commits are kept, reworked as decided in the review there:
independentFileEditorkey (and its place inlocalSettingsand the sync tests), its strings in both locales and its docs are removed. Options › General is unchanged from main, so the scrolling feat(app): make file editor window placement optional #256 added toagent_test.gois gone too.WindowSpec.TopLevelwith feat(app): maximize the bottom panel in place and open it in a window #266 (the panels' windows) while feat(app): make file editor window placement optional #256 addedIndependentfor the same thing.Independentis removed and the editor setsTopLevel. feat(app): make file editor window placement optional #256'ssecondaryWindowOptionshelper stays, as it makes the options testable: a top-level window gets noParent, noModaland noDisableMinimize; every other secondary window is as before. The panels' windows are top-level as they are on main.FocusWindowrestores a minimized window before focusing it (now a smallbringToFrontwith a test), and the comment thatCloseAllis what closes windows the main window does not own.ui.AlertDialogs drawn in the editor's own view, and save errors show in its status bar, so nothing of the editor's can open behind it. The editor opens no native file chooser and never callsConfirm. No change was needed there.features.md(the editor's Window section) anddevelopment.md(Child windows) in both languages.Closes #255
Testing
go build ./...,go vet ./...,GOOS=windows go vet .,GOOS=darwin go vet .,go tool mygo vet,go tool mygo generate(catalog equal to main's).GOOS=windows GOARCH=amd64 go build .andGOOS=darwin GOARCH=arm64 go build .both build.go test -race -count=1 -timeout 30m ./...: every packageok.TestFileEditorOrdinaryWindow(internal/app, replaces feat(app): make file editor window placement optional #256'sTestFileEditorWindowPlacement): the editor's spec is top-level and not modal while Options is owned; opening the file again keeps the window and tab and callsFocusWindowfor the editor; the close button asks, with the question in the editor's view and not the main window's, and Cancel keeps the changes; hiding to the tray closes Options, keeps an editor with changes and closes one without;CloseAllcloses it without asking. It fails withoutTopLevelon the editor's spec.TestSecondaryWindowOptions(root package, from feat(app): make file editor window placement optional #256, now onTopLevel): owned, top-level and modal options, same position.TestBringToFront(root package): a minimized window is restored, then focused.Not tested: anything on a real desktop. The z-order, minimizing, and the taskbar and Dock behavior cannot be rendered headless, and nothing here ran on Windows or macOS. What is expected comes from reading MyGo v0.10.0's backends: on Windows a window without
Parenthas no owner (so it is not kept above the main window, has its own taskbar button, and does not minimize with it); on macOS it is anNSWindowthat MyGo neither orders above the main window nor hides with it;Focusrestores a minimized window on Windows, andRestoreis called first on every platform.Please click through this on Windows and on macOS before merging:
Generated by Claude Code