Skip to content

fix(diagnostics): own the Save Diagnostics panel by the requesting window - #1672

Merged
EtienneLescot merged 1 commit into
mainfrom
fix/1667-diagnostics-save-sheet
Dec 1, 2026
Merged

EtienneLescot merged 1 commit into
mainfrom
fix/1667-diagnostics-save-sheet

Conversation

@EtienneLescot

@EtienneLescot EtienneLescot commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Summary

The Save Diagnostics panel was the one save panel opened with no owner window. On macOS an unowned panel floats free, and an app switch leaves it behind the editor, out of reach. It now goes through showSaveDialogOver, like the other save panels:

  • save-diagnostics (editor wordmark menu) and save-diagnostic (renderer crash path): owned by the sender's window.
  • App menu and tray: owned by the focused visible window, the same rule showMessageBox already uses in main.ts.

Related issue

Refs #1667

Type of change

  • Bug fix

Release impact

  • Patch

Desktop impact

  • macOS

Testing

  • npx tsc --noEmit, npx tsc -p tsconfig.test.json --noEmit and npm run lint pass.
  • Not checked on a real Mac yet: the test Mac has no GUI session for the agent account. To check: open Save Diagnostics in the editor, switch to another app, then come back. The panel should be a sheet on the editor.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Diagnostic export save dialogs now appear in the context of the relevant app window, keeping them associated with the app.
    • Message boxes are associated with the visible focused window, or with the main window when no window is focused.
    • These updates apply across diagnostic export actions from the app menu, tray, and in-app controls.

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Diagnostic save dialogs now receive a parent window. IPC handlers pass the sender’s window, while menu and tray actions use the selected visible window when available.

Changes: Diagnostic dialog ownership

Layer / File(s) Summary
Select a dialog parent
electron/main.ts
dialogParent selects the visible focused window, then the visible main window, or null. showMessageBox uses this helper.
Pass ownership through diagnostic save actions
electron/ipc/handlers.ts, electron/main.ts
exportDiagnosticFile uses showSaveDialogOver with a parent window. IPC handlers pass the sender’s window. Menu and tray actions invoke runSaveDiagnostics through zero-argument callbacks.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related issues

Possibly related PRs

Suggested reviewers: my-denia

Merge Risk: Minimal · up to 68325

Save Diagnostics now attaches its save panel to the requesting window instead of opening an unowned panel. No concrete defect was found. The macOS sheet behavior has not been checked on real hardware, so a quick manual check is worthwhile.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the Save Diagnostics panel is now owned by the requesting window (via showSaveDialogOver). It matches the raw summary's changes to handlers.ts and main.ts. The convent…
Description check Passed The description follows the template's main sections: Summary, Related issue (Refs #1667, which is correctly a partial reference), Type of change (Bug fix), Release impact (Patch), Desktop impact (mac…
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.
Full details: Title check

Explanation

The title names the main change: the Save Diagnostics panel is now owned by the requesting window (via showSaveDialogOver). It matches the raw summary's changes to handlers.ts and main.ts. The conventional-commit prefix and length are acceptable, and the title is specific.

Full details: Description check

Explanation

The description follows the template's main sections: Summary, Related issue (Refs #1667, which is correctly a partial reference), Type of change (Bug fix), Release impact (Patch), Desktop impact (macOS), and Testing. It explains the cause and the fix, and it records the checks that ran plus a manual verification step. The template's Screenshots section is omitted. The change is a macOS behavior fix and has no UI-visual change that needs a screenshot, so this omission is acceptable.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fc73839c-b348-49a5-abd5-1dc80f1bfece
Commits

Reviewing files that changed from the base of the PR and between 5349148 and 68325dd.

Files selected for processing: 2

  • electron/ipc/handlers.ts
  • electron/main.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

…ndow

Unowned, the macOS save panel is a free-floating window that an app switch
leaves behind the editor, out of reach. Route it through showSaveDialogOver:
the IPC entry points pass the sender's window, the menu and tray pass the
focused visible window.

Refs #1667
@EtienneLescot
EtienneLescot force-pushed the fix/1667-diagnostics-save-sheet branch from 62b6c0c to 68325dd Compare November 29, 2026 22:07
@EtienneLescot

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor
Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

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.

@EtienneLescot

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor
Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

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.

@EtienneLescot

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor
Action performed

Full review finished.

@EtienneLescot
EtienneLescot merged commit e0a5f4b into main Dec 1, 2026
20 checks passed
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