Menu β–Ύ β–΄

#39 Add Dock reopen regression coverage

closed
nobody
None
2026-07-01
2026-07-01
Anonymous
No

Originally created by: kristofferR

Summary

  • extract the macOS Dock reopen decision into a small helper
  • add regression coverage for hidden/no-window and settings-only reopen cases
  • keep the existing behavior that avoids reloading when a Messenger window is already visible

Validation

  • cd src-tauri && cargo fmt
  • cd src-tauri && cargo clippy --all-targets -- -D warnings
  • cd src-tauri && cargo test --lib
  • node --check inject/messenger.js

Ref [#29]

Summary by CodeRabbit

  • Bug Fixes
  • Improved macOS app reopening behavior so the app now more reliably returns to the main window when it should.
  • Prevents unnecessary reopening when the Messenger window is already visible.

Related

Tickets: #29

Discussion

  • Anonymous

    Anonymous - 2026-07-01

    Originally posted by: kristofferR

    @coderabbitai review

     
  • Anonymous

    Anonymous - 2026-07-01

    Originally posted by: coderabbitai[bot]

    βœ… Action performed Review finished. > Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
     
  • Anonymous

    Anonymous - 2026-07-01

    Originally posted by: coderabbitai[bot]

    Review Change Stack

    No actionable comments were generated in the recent review. πŸŽ‰

    ℹ️ Recent review info
    βš™οΈ Run configuration **Configuration used**: Path: .coderabbit.yaml **Review profile**: ASSERTIVE **Plan**: Pro **Run ID**: `44dea4d9-85f8-4802-b664-0bf541ff7a29`
    πŸ“₯ Commits Reviewing files that changed from the base of the PR and between [d7bd1b] and 0fe372b77897ce2d27229699388ad6a76ede4b9a.
    πŸ“’ Files selected for processing (1) * `src-tauri/src/lib.rs`

    πŸ“ Walkthrough ## Walkthrough Refactors macOS Dock reopen logic by extracting the reopen condition into a new helper function `should_reopen_main`, used by `reopen_main_if_needed`. Adds macOS-only unit tests covering three condition combinations for the extracted helper. ### Changes **Dock Reopen Refactor** |Layer / File(s)|Summary| |---|---| |**Extract reopen condition and add tests**
    `src-tauri/src/lib.rs`|Extracts reopen boolean logic into `should_reopen_main(has_visible_windows, has_visible_messenger_window)`, updates `reopen_main_if_needed` to use it, and adds macOS-only unit tests for the three key visibility combinations.| **Estimated code review effort:** 1 (Trivial) | ~5 minutes **Possibly related PRs** - [[kristofferR/Carrier#36](https://github.com/kristofferR/Carrier/issues/36)](https://github.com/kristofferR/Carrier/pull/36): Adds `RunEvent::Reopen` handling based on visible windows in the same file, related to the reopen condition refactored here.
    πŸš₯ Pre-merge checks | βœ… 5
    βœ… Passed checks (5 passed) | Check name | Status | Explanation | | :------------------------: | :------- | :--------------------------------------------------------------------------------------------------------- | | Description Check | βœ… Passed | Check skipped - CodeRabbit’s high-level summary is enabled. | | Title check | βœ… Passed | The title accurately summarizes the main change: added regression coverage for macOS Dock reopen behavior. | | Docstring Coverage | βœ… Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. | | Linked Issues check | βœ… Passed | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | βœ… Passed | Check skipped because no linked issues were found for this pull request. |
    ✨ Finishing Touches
    πŸ“ Generate docstrings - [ ] Create stacked PR - [ ] Commit on current branch
    πŸ§ͺ Generate unit tests (beta) - [ ] Create PR with unit tests - [ ] Commit unit tests in branch `codex/issue-29-dock-reopen`

    Comment @coderabbitai help to get the list of available commands.

     
  • Anonymous

    Anonymous - 2026-07-01

    Ticket changed by: kristofferR

    • status: open --> closed
     

Log in to post a comment.