Keep main window hidden during dictation#668
Conversation
Greptile SummaryThis PR keeps the main FluidVoice window hidden during dictation after Command-H. The main changes are:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 254ab69332
ℹ️ 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".
| func applicationWillHide(_ notification: Notification) { | ||
| // A nonactivating recording panel can make AppKit unhide the process. Remember | ||
| // the visible main window so the panel does not restore it along with itself. | ||
| self.didRevealMainWindowOnLaunch = true |
There was a problem hiding this comment.
Do not mark a hidden login launch as fully bootstrapped
When macOS starts a login item hidden, applicationWillHide can run before the delayed openMainWindowOnLaunch() attempts. Setting didRevealMainWindowOnLaunch here makes every retry return at its guard, so the silent-login path never calls bootMainWindowHiddenIfPresent() to realize ContentView; the menu bar and services that its startup initializes may remain unavailable until the user manually reopens the app. Track completion of the launch boot separately from suppressing a reveal after Command-H.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e6455931db
ℹ️ 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".
| guard self.didRevealMainWindowOnLaunch == false else { return } | ||
|
|
||
| if revealWindow { | ||
| let shouldRevealWindow = revealWindow && !self.shouldSuppressMainWindowLaunchReveal |
There was a problem hiding this comment.
Honor show-at-login after an initially hidden launch
When macOS delivers applicationWillHide before the delayed launch attempts and showMainWindowAtLoginLaunch is enabled, this condition makes shouldRevealWindow false, so the code takes bootMainWindowHiddenIfPresent(), marks launch complete, and never reveals the window requested by the preference. Although the hidden boot now completes, the newly retained shouldSuppressMainWindowLaunchReveal branch is fresh evidence that the enabled-preference path remains bypassed; distinguish an explicit Command-H from the system's initially hidden login launch before suppressing the reveal.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b806f9a3f7
ℹ️ 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".
| // A nonactivating recording panel can make AppKit unhide the process. Remember | ||
| // the visible main window so the panel does not restore it along with itself. | ||
| self.shouldSuppressMainWindowLaunchReveal = true | ||
| self.mainWindowHiddenByAppHide = NSApp.windows.first { |
There was a problem hiding this comment.
Track every visible main window during hide
When multiple FluidVoice windows are visible—supported by the WindowGroup declared in Sources/Fluid/fluidApp.swift:25—this first records only one of them. applicationDidHide therefore orders out only that window, so when the recording panel unhides the process, the other main windows can reappear despite Command-H; retain and order out all matching visible main windows instead.
Useful? React with 👍 / 👎.
FluidVoice PR build readyDownload FluidVoice-PR-668-b806f9a3f77f The artifact contains the ad-hoc-signed app ZIP, Xcode archive, build manifest, and installation instructions. It expires 5 days after the build. Install the app
This build has its own app identity, so its permissions are separate from the release version of FluidVoice. |
Description
Keeps the main FluidVoice window hidden when dictation starts after Command-H, while restoring it on intentional app activation.
Type of Change
Related Issue or Discussion
Closes #631
Testing
swiftlint --strict --config .swiftlint.yml Sourcesswiftformat --config .swiftformat SourcesScreenshots / Video
Notes
Preserves standard minimize, close, and intentional reopen behavior.