feat(app): open the session window at launch and on reopen; local install script

--window opens the Redline window at launch, so a script or a demo lands on the new UI instead of an idle menu-bar icon. Clicking the running app in Finder, or open -a Redline, now shows the window instead of doing nothing. scripts/install-local.sh installs the locally built app into /Applications, keeps the previous copy at .build/Redline-<version>.app for rollback, and launches it with the window open.
This commit is contained in:
Claude Fable 5
2026-11-01 08:41:03 +04:00
parent 3061e45bcb
commit 1ae8351b04
2 changed files with 74 additions and 0 deletions
+19
View File
@@ -81,6 +81,25 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
func applicationDidFinishLaunching(_ notification: Notification) {
Task { await model.bootstrap() }
// `--window` opens the session window at launch (scripts and demos); a normal
// launch stays quiet in the menu bar.
if CommandLine.arguments.contains("--window") {
presentSessionsWindow()
}
}
/// Clicking the app in Finder, or `open -a Redline`, while it runs shows the
/// window instead of doing nothing — standard macOS behaviour for a menu-bar app
/// with a main window.
func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows: Bool) -> Bool {
if !hasVisibleWindows {
presentSessionsWindow()
}
return true
}
private func presentSessionsWindow() {
(model as SessionsWindowPresenting).presentSessionsWindow(focusLane: false)
}
/// Builds the model exactly the way the real app launches: paths come from