Skip to content

Add startup window state preference (#1367)#1538

Open
SukuWc wants to merge 1 commit into
stablefrom
feat/startup-window-state-1367
Open

Add startup window state preference (#1367)#1538
SukuWc wants to merge 1 commit into
stablefrom
feat/startup-window-state-1367

Conversation

@SukuWc

@SukuWc SukuWc commented Jun 23, 2026

Copy link
Copy Markdown
Member

Closes #1367.

What

Adds a Startup window state radio in Preferences → General that controls how the window appears when Grid Editor launches:

Option Behavior
Open in a normal window Show normally (default)
Open minimized to the taskbar minimize() — sits in the taskbar/dock
Open hidden in the tray Stays hidden; tray icon on Windows/Linux, dock icon on macOS

This addresses the request to start the editor minimized/unobtrusively (useful when it auto-starts with the system). The "if already running, open the window" half was already handled by the single-instance lock and is hardened here.

How

  • New persistent setting startupWindowState ("normal" | "taskbar" | "tray", default "normal") in app-helper.store.ts, persisted via the existing app-settings machinery.
  • Preferences.svelte: a MeltRadio matching the adjacent "Run application in background" control.
  • main.ts:
    • Window is created with show: false and shown on ready-to-show (also removes the white flash on normal launch); the chosen startup state is applied there.
    • second-instance handler now restores + shows + focuses the window on all platforms (previously show() was skipped on macOS, and only minimized windows were restored), so a minimized/tray start is always recoverable by relaunching. The deeplink parse is guarded so a plain relaunch no longer throws on new URL().

Testing

  • npm run web-build passes.
  • Verified on Linux: normal launch shows the window; relaunching a running instance triggers the single-instance handler without errors and re-focuses the existing window.
  • ⚠️ Needs cross-platform confirmation: the taskbar (minimize) and tray (hide) paths could not be visually verified on the dev machine's tiling window manager (no tray/taskbar/minimize support there). Please confirm on Windows and macOS that those two options land the window minimized/hidden as intended and that it restores correctly.

🤖 Generated with Claude Code

Add a "Startup window state" radio in Preferences > General with three
options controlling how the window appears when Grid Editor launches:

- normal:  open in a normal window (default)
- taskbar: open minimized to the taskbar/dock
- tray:    open hidden in the tray (Windows/Linux) / dock (macOS)

The window is now created with `show: false` and shown on `ready-to-show`,
which also avoids a white flash on normal launch. The single-instance
`second-instance` handler now restores + shows + focuses the window on all
platforms (previously `show()` was skipped on macOS and only minimized
windows were restored), so a minimized/tray start is always recoverable by
relaunching. It also guards the deeplink parse so a plain relaunch no longer
throws on `new URL()`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@SukuWc SukuWc moved this from Todo to Ready for QA in Editor Roadmap Jun 23, 2026
@github-actions

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit b03a119):

https://grid-editor-web--pr1538-feat-startup-window-ywzpla1n.web.app

(expires Thu, 23 Jul 2026 13:16:24 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 2b65ba6ef19c55d367eaffd04e46bcde25305d6f

@github-actions

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit b03a119):

https://grid-playwright-result--pr1538-feat-startup-window-rvejvegs.web.app

(expires Fri, 26 Jun 2026 13:24:56 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 0f764ceb264072188bf1a5dee10613d8f10b4ca2

@Greg-Orca Greg-Orca moved this from Ready for QA to QA in progress in Editor Roadmap Jun 24, 2026
@Greg-Orca

Copy link
Copy Markdown
Contributor

Mac OS ok

@narayb

narayb commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Tested on Windows 11:

  • Minimized to taskbar works as expected.
  • Minimized to tray doesn't work, the application doesn't appear on the tray at all, nor does it start normally. It potentially requires the keep app minimized after closeing the window setting on ON?

Tested on Fedora Workstation 44 (GNOME, Wayland):

  • Minimized to taskbar doesn't work, because there is no taskbar, AFAIK no Wayland window is created. Because the app is running, but no window was created, there's no way to change the option back in the GUI, so the user has to fix this in the config.json.
  • Minimized to tray also doesn't work for the same reasons, no tray exists on GNOME DE. Because of this no Wayland window is created and the GUI app stays inaccessible. Once again, has to be fixed in the config.json.

@Greg-Orca Greg-Orca moved this from QA in progress to In Progress in Editor Roadmap Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Start editor Minimized

3 participants