Skip to content

feat: Make all windows float above other apps#15

Merged
GordonBeeming merged 2 commits intomainfrom
float-utility-windows
Apr 3, 2026
Merged

feat: Make all windows float above other apps#15
GordonBeeming merged 2 commits intomainfrom
float-utility-windows

Conversation

@GordonBeeming
Copy link
Copy Markdown
Owner

Summary

  • Add FloatingWindow ViewModifier that sets NSWindow.level = .floating on appear
  • Applied to all 5 utility windows (Settings, About, Duration Picker, Time Picker, Schedules)
  • Windows stay visible when focus moves to another app, which is expected for a menu bar utility

Test plan

  • 133 tests pass
  • Strict concurrency build clean
  • Open Settings/About windows, click another app — Insomnia windows stay on top

🤖 Generated with Claude Code

Add FloatingWindow ViewModifier that sets NSWindow.level to .floating
on appear. Applied to all 5 utility windows (Settings, About, Duration
Picker, Time Picker, Schedules) so they stay visible when focus moves
to another app — important for a menu bar-only utility.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: GitButler <gitbutler@gitbutler.com>
@GordonBeeming GordonBeeming marked this pull request as ready for review April 3, 2026 02:29
Copilot AI review requested due to automatic review settings April 3, 2026 02:29
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds always-on-top behavior to Insomnia’s utility windows to better match expected UX for an LSUIElement menu bar app (windows remain visible when switching to other apps).

Changes:

  • Introduces a FloatingWindow ViewModifier + View.floatingWindow() convenience API.
  • Applies .floatingWindow() to all five auxiliary Window scenes (Settings, About, Duration Picker, Time Picker, Schedules).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
Sources/Insomnia/InsomniaApp.swift Applies the new floating modifier to each auxiliary window’s root view.
Sources/Insomnia/FloatingWindowModifier.swift Implements the floating-window behavior via an onAppear hook and window level change.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Replace window iteration + timing delay with NSViewRepresentable
that reads the specific hosting NSView's .window property.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: GitButler <gitbutler@gitbutler.com>
@GordonBeeming GordonBeeming merged commit f71acba into main Apr 3, 2026
2 checks passed
@GordonBeeming GordonBeeming deleted the float-utility-windows branch April 3, 2026 02:43
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.

2 participants