Skip to content

feat(desktop): user-configurable close-to-tray with first-close prompt - #3

Merged
vastsa merged 6 commits into
vastsa:mainfrom
Tioit-Wang:feat/close-to-tray-prompt-once
Aug 15, 2026
Merged

vastsa merged 6 commits into
vastsa:mainfrom
Tioit-Wang:feat/close-to-tray-prompt-once

Conversation

@Tioit-Wang

@Tioit-Wang Tioit-Wang commented Aug 14, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Makes the Windows/Linux close behavior user-configurable with close-to-tray support (ADR 0071, D210):

  • Minimize is always a native minimize — the taskbar entry stays, and the bounds watchdog no longer force-restores minimized or tray-hidden windows.
  • First close prompts once: with an unset preference, a native modal asks Cancel / Close to tray / Quit. Picking one persists it permanently; Cancel keeps the window open.
  • Close to tray: the window hides, the app keeps running under a system-tray icon (click restores; menu offers Open / Quit).
  • Quit app: legacy behavior — closing exits the app.
  • Settings → General (Windows/Linux only) exposes a two-option segment — Close to tray / Quit app — so the remembered choice can be changed, but never reverted to prompting (closeBehavior/set rejects ask).
  • macOS keeps the native Dock lifecycle untouched.

Implementation

  • Tray created lazily and reconciled with the preference; close is intercepted only for ask/tray while quitting and macOS closes always fall through.
  • Preference persisted by Electron main in <data>/close-behavior.json (no host-core/Rust changes).
  • Additive IPC: pi-desktop/window/closeBehavior/get and /set; localized via @pi-desktop/i18n (en + zh-CN).

Validation

  • @pi-desktop/desktop typecheck passes
  • Desktop unit tests: 572 passed, 0 failed
  • Dev app launched and verified on Windows (host-core handshake, agent sidecar ready)

Docs

  • ADR 0071, decisions-log D210, E2E-120, IPC protocol and interaction-patterns specs updated

@vercel

vercel Bot commented Aug 14, 2026

Copy link
Copy Markdown

@Tioit-Wang is attempting to deploy a commit to the vastsa's projects Team on Vercel.

A member of the Team first needs to authorize it.

Tioit-Wang and others added 6 commits August 15, 2026 14:48
Avoids collision with the released corner-hierarchy ADR 0071. Updates the
title and all references (D210, interaction patterns, E2E plan).
Remove the duplicate @pi-desktop/i18n import and the duplicated tray
teardown inside the before-quit shutdown IIFE, drop stray blank lines in
tray menu builders, restore the ExtensionMarketSection SettingsCard tail,
and re-add the closing brace after the prompt keys in both i18n locales.

This branch was successfully deployed

1 active deployment
Preview — 0a1a1774 Deployed Aug 15, 2026 by vercel[bot]
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