Skip to content

feat(macos): show the closed window again when Buzz becomes active - #2658

Merged
dwyatte merged 1 commit into
mainfrom
dwyatte/reshow-on-activate
Nov 5, 2026
Merged

dwyatte merged 1 commit into
mainfrom
dwyatte/reshow-on-activate

Conversation

@dwyatte

@dwyatte dwyatte commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Why

On macOS, closing the main window hides it, and Buzz and its agents keep running (#349). Only a Dock or Finder reopen (RunEvent::Reopen) showed the window again. When you switch to Buzz with ⌘Tab, Spotlight or any other app switch, macOS makes Buzz the active app but shows no window, because AppKit sends applicationShouldHandleReopen only for Dock and Finder reopens. Slack shows its window again when you ⌘Tab back. This matters more once #2443 lets ⌘W close the window.

What

  • When Buzz becomes the active app, it shows the main window again if the person closed it.
  • The launch window stays hidden until the page shows it (visible: false in tauri.macos.conf.json).
  • A minimized window stays in the Dock.
  • ⌘H (Hide) is unchanged.
  • Other platforms are unchanged.

How

  • src-tauri/src/reshow.rs observes NSApplicationDidBecomeActiveNotification. Tao and Tauri expose no app-activation event, and WindowEvent::Focused never fires for a hidden window.
  • The CloseRequested handler records a successful hide in a flag. The observer consumes that flag on each activation. It shows the window, through the existing notifications::focus, only if the window is still hidden and not minimized.
  • Consuming the flag means a window brought back some other way (Dock click or deep link) and minimized later is not shown on the next activation.
  • docs/buzz-help.md describes the close and reshow behavior.

Expected interactions:

  • A Dock click while Buzz is inactive fires both the activation and Reopen. Both run the same focus calls, which have no effect the second time.
  • If the main window is closed during a huddle, activating Buzz through the huddle window also shows the main window again.

Validation

At 35b11e3 (same tree as the b3aa296 checks ran on; only the commit subject changed), on macOS (Apple Silicon):

  • bin/cargo clippy -p Buzz --locked --all-targets -- -D warnings, cargo fmt --check and git diff --check pass.
  • bin/cargo test --manifest-path src-tauri/Cargo.toml --locked: 894 passed and 2 ignored, with one test skipped.
    • The new reshow test covers the launch window, reshowing after a close, the flag being consumed, and minimized windows.
    • The skipped test, window_state::tests::onboarding_snapshot_is_kept_until_next_launch_restore, crashes (SIGSEGV) every time on unmodified origin/main 6d5e054 too. It is not related to this change.
  • An independent agent review found no blocking issues. Its suggestions are applied: a flag-consumption test and clearer help text.

Not yet done

  • Not run in the native app. Tauri's mock runtime does nothing on hide and show, so this needs BUZZ_DEV_VIEWER= just desktop. Steps:
    1. Close the window with the red button, switch to another app, then ⌘Tab back. The window appears.
    2. Close the window, then click the Dock icon. The window appears.
    3. Minimize the window, switch away, then ⌘Tab back. The window stays minimized.
    4. ⌘H, then ⌘Tab back. The window comes back as before.
    5. On a fresh launch, the window appears only when the app is ready.
  • Human testing is still to come.

🤖 Generated with Claude Code

Closing the main window hides it, and only a Dock or Finder reopen showed it
again. Cmd-Tab, Spotlight and other app switches activated Buzz with no
window on screen. Observe NSApplicationDidBecomeActiveNotification and show
the main window when the person closed it. The launch window stays hidden
until the page shows it, and a minimized window stays in the Dock.

Co-authored-by: Claude <f725270ba290dcfb6eb60126196e794d967db9b27cccfcf571bf59a33a271b18@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Dean Wyatte <[email protected]>
@dwyatte
dwyatte force-pushed the dwyatte/reshow-on-activate branch from b3aa296 to 35b11e3 Compare November 5, 2026 19:50
@dwyatte dwyatte changed the title fix(macos): show the closed window again when Buzz becomes active feat(macos): show the closed window again when Buzz becomes active Nov 5, 2026
@dwyatte
dwyatte marked this pull request as ready for review November 5, 2026 19:52
@dwyatte
dwyatte requested a review from a team as a code owner November 5, 2026 19:52

@kazemek21 kazemek21 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Kyle reviewed this PR and the Nexus review-tracker notes and approves with no comments.

Posted by Codex (gpt-6.1-sol) on behalf of kylez

@dr0uleau dr0uleau left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤖 approved at 35b11e3877ac997ba5bd3ba27585919b12bfc093 after the four review checks and successful CI

@dwyatte
dwyatte merged commit fe3dd19 into main Nov 5, 2026
42 checks passed
@dwyatte
dwyatte deleted the dwyatte/reshow-on-activate branch November 5, 2026 23:09
wpfleger96 added a commit that referenced this pull request Nov 5, 2026
…-service

* origin/main: (29 commits)
  fix(agents): treat what an agent reads as information, and give answering rules only to mentions (#2456)
  feat: add up arrow message editing preference (#2659)
  fix(channels): move focus to channel settings opened from the header menu (#2526)
  fix(window): restore position before size and never fall back to a sub-minimum window (#2405)
  fix(messages): pick the latest message with the shared ordering (#2403)
  fix(channels): let shift+escape through the channel settings panel (#2402)
  fix(builderlab): clarify signed-out agent settings (#2602)
  feat(builderlab): preselect the catalog's recommended model (#2552)
  feat(host-process): set BUZZ_VERSION for every spawned process (#2674)
  fix(agents): finish Delete for a synced agent with no config (#2692)
  ci(flake-check): select related tests within a 9-minute lane budget (#2607)
  feat(macos): show the closed window again when Buzz becomes active (#2658)
  fix(channels): show channel actions as soon as the menu opens (#2657)
  fix(huddles): confirm before starting a huddle from the header (#2687)
  perf(composer): reuse per-keystroke projections, snapshots and reference scans (#2590)
  perf(agents): skip the activity snapshot compare for unrelated channel traffic (#2586)
  test(solo): wait for the live header before opening a joined viewer's access (#2599)
  fix(messages): show who reacted in channels where you can't react (#2601)
  feat(agents): clarify remote execution across desktop (#2600)
  perf(relay): size paged history with the cached per-event sizes (#2597)
  ...

# Conflicts:
#	src-tauri/src/host_process/tests.rs
baxen added a commit that referenced this pull request Nov 6, 2026
* origin/main: (36 commits)
  perf(mentions): rank only the shown rows and skip empty-query Space work (#2298)
  fix(messages): stop bare links at fullwidth and CJK punctuation (#2404)
  fix(agents): treat what an agent reads as information, and give answering rules only to mentions (#2456)
  feat: add up arrow message editing preference (#2659)
  fix(channels): move focus to channel settings opened from the header menu (#2526)
  fix(window): restore position before size and never fall back to a sub-minimum window (#2405)
  fix(messages): pick the latest message with the shared ordering (#2403)
  fix(channels): let shift+escape through the channel settings panel (#2402)
  fix(builderlab): clarify signed-out agent settings (#2602)
  feat(builderlab): preselect the catalog's recommended model (#2552)
  feat(host-process): set BUZZ_VERSION for every spawned process (#2674)
  fix(agents): finish Delete for a synced agent with no config (#2692)
  ci(flake-check): select related tests within a 9-minute lane budget (#2607)
  feat(macos): show the closed window again when Buzz becomes active (#2658)
  fix(channels): show channel actions as soon as the menu opens (#2657)
  fix(huddles): confirm before starting a huddle from the header (#2687)
  perf(composer): reuse per-keystroke projections, snapshots and reference scans (#2590)
  perf(agents): skip the activity snapshot compare for unrelated channel traffic (#2586)
  test(solo): wait for the live header before opening a joined viewer's access (#2599)
  fix(messages): show who reacted in channels where you can't react (#2601)
  ...

# Conflicts:
#	docs/buzz-help.md
nathan-thillairajah added a commit that referenced this pull request Nov 6, 2026
…page

* origin/main: (49 commits)
  fix(browser): recheck the FI session when the app viewer exchange returns 401 (#2678)
  fix(members): find verified people who have no profile (#2554)
  fix(dev): clear React's dev render measures so long sessions do not grow (#2495)
  Move app navigation to a dock and unify conversation headers (#2626)
  perf(mentions): rank only the shown rows and skip empty-query Space work (#2298)
  fix(messages): stop bare links at fullwidth and CJK punctuation (#2404)
  fix(agents): treat what an agent reads as information, and give answering rules only to mentions (#2456)
  feat: add up arrow message editing preference (#2659)
  fix(channels): move focus to channel settings opened from the header menu (#2526)
  fix(window): restore position before size and never fall back to a sub-minimum window (#2405)
  fix(messages): pick the latest message with the shared ordering (#2403)
  fix(channels): let shift+escape through the channel settings panel (#2402)
  fix(builderlab): clarify signed-out agent settings (#2602)
  feat(builderlab): preselect the catalog's recommended model (#2552)
  feat(host-process): set BUZZ_VERSION for every spawned process (#2674)
  fix(agents): finish Delete for a synced agent with no config (#2692)
  ci(flake-check): select related tests within a 9-minute lane budget (#2607)
  feat(macos): show the closed window again when Buzz becomes active (#2658)
  fix(channels): show channel actions as soon as the menu opens (#2657)
  fix(huddles): confirm before starting a huddle from the header (#2687)
  ...

Signed-off-by: Nathan Thillairajah <[email protected]>

# Conflicts:
#	docs/browser.md
#	src-tauri/src/browser/builderlab.rs
nathan-thillairajah added a commit that referenced this pull request Nov 6, 2026
…dylan/browser-unavailable-page

* origin/dylan/browser-denied-page: (49 commits)
  fix(browser): recheck the FI session when the app viewer exchange returns 401 (#2678)
  fix(members): find verified people who have no profile (#2554)
  fix(dev): clear React's dev render measures so long sessions do not grow (#2495)
  Move app navigation to a dock and unify conversation headers (#2626)
  perf(mentions): rank only the shown rows and skip empty-query Space work (#2298)
  fix(messages): stop bare links at fullwidth and CJK punctuation (#2404)
  fix(agents): treat what an agent reads as information, and give answering rules only to mentions (#2456)
  feat: add up arrow message editing preference (#2659)
  fix(channels): move focus to channel settings opened from the header menu (#2526)
  fix(window): restore position before size and never fall back to a sub-minimum window (#2405)
  fix(messages): pick the latest message with the shared ordering (#2403)
  fix(channels): let shift+escape through the channel settings panel (#2402)
  fix(builderlab): clarify signed-out agent settings (#2602)
  feat(builderlab): preselect the catalog's recommended model (#2552)
  feat(host-process): set BUZZ_VERSION for every spawned process (#2674)
  fix(agents): finish Delete for a synced agent with no config (#2692)
  ci(flake-check): select related tests within a 9-minute lane budget (#2607)
  feat(macos): show the closed window again when Buzz becomes active (#2658)
  fix(channels): show channel actions as soon as the menu opens (#2657)
  fix(huddles): confirm before starting a huddle from the header (#2687)
  ...

Signed-off-by: Nathan Thillairajah <[email protected]>

# Conflicts:
#	src-tauri/src/browser/builderlab.rs
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.

3 participants