Skip to content

feat(app): make file editor window placement optional - #256

Closed
loooinfo wants to merge 2 commits into
TooonyChen:mainfrom
loooinfo:feature/file-editor-window-placement
Closed

loooinfo wants to merge 2 commits into
TooonyChen:mainfrom
loooinfo:feature/file-editor-window-placement

Conversation

@loooinfo

Copy link
Copy Markdown
Contributor

Summary

  • Add a checked-by-default Keep the file editor in front of the main window option under Options → General → Tabs and window. The label describes the relation to the main window.
  • With the option off, the next editor window opens independently. The main window can come to the front and the editor can be minimized and restored. Opening a file again focuses the existing window and restores it if minimized.
  • Save the preference on this device. Changes apply after reopening the editor and leave open tabs and unsaved changes in place. App shutdown still closes the editor through the existing cleanup path.

Closes #255

Testing

  • Settings UI and persistence in English and Simplified Chinese, editor window reuse, unsaved changes, tray behavior, quit cleanup, and sync isolation. Checked screenshots in both languages.
  • Confirmed the editor placement test fails when the preference is bypassed. An audit run also found the new row could move the existing SSH agent input below the viewport. Its test now scrolls to that input in the normal window size.
  • go vet ./..., go tool mygo vet, Windows amd64 and macOS arm64 cross-builds passed.
  • A Win32 window smoke test under Wine checked native ownership, z-order, the minimize button style, minimize/restore, and the editor close callbacks. Windows 11 and macOS desktop testing remain pending.
  • go test -race -timeout 20m ./... reproduced the same three failures on both this branch and unmodified upstream 78c2f91: TestBackgroundImage, TestBackgroundReadsOffUIThread and TestCommandBarPage. The feature tests passed and no race was reported.

Copy link
Copy Markdown
Owner

Thanks for this. The problem in #255 is real, and looking at why it happens changed what I would like the fix to be: the file editor is owned by the main window, and cannot be minimized, only because it opens through the same code as the dialogs. That is right for a dialog and wrong for a window people work in for a long time. So it does not need an option; it should simply be an ordinary window.

Could you rework the PR to that?

  • No setting. Remove the "Keep the file editor in front of the main window" checkbox, the independentFileEditor key, its strings in both locales, and the docs for it. The General page then does not grow, and the scrolling added to agent_test.go can go too.
  • The editor window is always independent: no owner, not modal, minimize enabled. Whichever window you click comes to the front. Dialogs, Options and the other secondary windows stay owned as they are.
  • Keep what the independent path already needs: opening a file again focuses the existing editor and restores it if minimized, and quitting (or hiding to the tray) still closes it through CloseAll, with the unsaved-changes question when the user closes it themselves.
  • Dialogs the editor opens (unsaved changes, save errors) should be owned by the editor window, so they do not open behind it.

Since the behavior can only be judged on a real desktop, please say in the PR what you tried on Windows and macOS: clicking between the two windows, minimizing and restoring the editor, the taskbar or Dock entry, and quitting with unsaved changes. Wine alone is not enough for this one.

Please update #255's title and text to match.


Generated by Claude Code

Copy link
Copy Markdown
Owner

Update: to get this in sooner I am doing the rework on this side, so there is no need to push the changes from my earlier comment. A branch here starts from your commits, removes the setting and makes the editor an ordinary window, and goes up as a new PR that closes #255. Your commits stay in it and you are credited as co-author on the squash commit. I will link it here and close this PR when it is up.

One thing you could still help with, if you have the time: trying that PR's build on Windows (clicking between the two windows, minimize and restore, quitting with unsaved changes), since that is where #255 came from.


Generated by Claude Code

Copy link
Copy Markdown
Owner

Continued in #273, which starts from your commits, drops the setting and opens the editor as an ordinary top-level window (through WindowSpec.TopLevel, which #266 had added on main for the panel windows), keeping your secondaryWindowOptions helper. Closing this one in its favor; you are credited as co-author on the squash commit.

#273 has not been tried on a real desktop yet. If you can run its build on Windows, the click-through list in its description is what needs checking, and a note there on what you see would help a lot.


Generated by Claude Code

@TooonyChen TooonyChen closed this Nov 29, 2026
TooonyChen added a commit that referenced this pull request Nov 29, 2026
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. It is now a top-level window: whichever window is clicked comes to the front, and it can be minimized. Dialogs and Options stay owned. The Dock icon shows the main window hidden in the tray also while the editor is open. Not tried on a real desktop. Continues #256.

Closes #255

Co-authored-by: loooinfo <22438720+loooinfo@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015nMqJEvqPnRmPgi6dnraZM
@loooinfo
loooinfo deleted the feature/file-editor-window-placement branch November 29, 2026 10:22
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.

feat(app): make file editor window placement optional

2 participants