Skip to content

Frontend tests: follow the desktop quit hiding the window - #15801

Merged
danielhanchen merged 1 commit into
mainfrom
frontend-tests-follow-quit-hide
Oct 28, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
frontend-tests-follow-quit-hide

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

Frontend unit tests fails on main (seen as the Windows leg on #15795; reproduces locally on 795da3b42a) with three tests that read studio/src-tauri/src/main.rs and still describe the quit as it was before #15723:

not ok - a quit with no window on screen raises no overlay
    (expects fn quit_raises_the_overlay)
not ok - both sides agree on the event names
    (expects const APP_CLOSING_EVENT / APP_CLOSING_CANCELLED_EVENT in main.rs)
not ok - macOS termination checks unsaved transcripts before allowing exit
    (expects begin_or_attach_termination(quit_requires_confirmation(app)))

#15723 changed the quit on purpose: the cover step now hides the main window on every platform instead of emitting the Windows-only app-closing overlay events, a window that was not on screen is left hidden, and the macOS terminate path holds on while a window is on screen (quit_requires_confirmation(app) || main_window_on_screen(app)). Its description notes the frontend overlay (closing-signal.ts, ClosingScreen) is no longer triggered and leaves removing it to a follow-up. The product is right; these three tests were not updated with it.

Change

studio/frontend/tests/desktop-closing-overlay.test.ts: the two tests pinned to the removed Rust emitters are replaced by the contract that replaced them:

  • a quit with no window on screen leaves it hidden: hide_main_window_for_quit hides only when main_window_on_screen(app) says the window is visible, read via window.is_visible();
  • the quit hides the window after the confirmations and before the reap: in quit_sequence, if !confirm() comes before hide(), which comes before reap(); and main.rs does not emit app-closing, so if the overlay is ever wired back the test says to put it back under test (or remove it).

The store-level overlay tests in the same file still pass and still cover closing-signal.ts until the follow-up removes it.

studio/frontend/tests/audio-transcript-lifecycle.test.ts: the macOS check now matches begin_or_attach_termination(quit_requires_confirmation(app)..., so the terminate path may hold on for more reasons but never fewer; the || renderer.unsaved_transcript and confirm_quit_with_unsaved_transcript checks are unchanged.

Testing

  • Whole frontend suite (node --experimental-strip-types --test "tests/**/*.test.ts"): 3 failing on main (the three above), 0 with this change.
  • Sabotage on main.rs, one at a time:
    • reaping before hiding fails "the quit hides the window after the confirmations and before the reap";
    • hiding without asking whether the window is on screen (let hide = true;) fails "a quit with no window on screen leaves it hidden";
    • dropping || renderer.unsaved_transcript from quit_requires_confirmation fails the macOS transcript test.

#15723 made the quit cover the backend reap by hiding the main window on
every platform instead of emitting the Windows-only app-closing overlay
events, and the macOS terminate path now also holds on while a window is
on screen. Three frontend tests still read the old main.rs and fail on main.

The overlay event tests now check the contract that replaced them: the
quit hides the window only when it is on screen, after the confirmations
and before the reap, and Rust does not emit app-closing. The macOS
transcript test accepts the extra reason to hold on.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T15:25:07.940338Z bdd5bed Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: bdd5bed843

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit fb02958 into main Oct 28, 2026
0 of 36 checks passed
@danielhanchen
danielhanchen deleted the frontend-tests-follow-quit-hide branch October 28, 2026 15:26
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.

1 participant