Skip to content

fix(tray): re-apply panel bounds after show to stop half-size popups on Windows - #3209

Open
netcatty-bot wants to merge 1 commit into
mainfrom
ai/issue-3181-33245774792
Open

fix(tray): re-apply panel bounds after show to stop half-size popups on Windows#3209
netcatty-bot wants to merge 1 commit into
mainfrom
ai/issue-3181-33245774792

Conversation

@netcatty-bot

Copy link
Copy Markdown
Collaborator

Summary

  • After the tray panel window is shown, the main process now checks the live content bounds against the intended 360x520 rect and re-applies it when they drifted (verify-and-repair pass after every show, both the ready path and the deferred first-load path).
  • Added a boundsMatch helper (1px tolerance) plus a BOUNDS_MATCH_TOLERANCE_PX constant to the pure bounds module so the comparison stays testable and out of the bridge.
  • Stored the last intended panel bounds so the deferred did-finish-load show can verify even though showTrayPanel has already returned; the state is reset on cleanup.

Why

On Windows the transparent, non-resizable tray popup can ignore the setBounds pushed while it is hidden: at show time the shell keeps (or re-applies) a stale rect, so the panel pops up at roughly half its designed size with fully readable but scaled-down content — exactly the symptom reported in #3064 and still reproducible in 1.1.82 (#3181), on both 200% and 100% display scale. The previous fix (#3068) computed the correct rect but only applied it before the window was shown; a wrong show-time result was never detected or corrected.

Changes

  • electron/bridges/globalShortcutBridge.cjs: new ensureTrayPanelBounds (compare live bounds, re-apply once if mismatched), called right after win.show() in both show paths; remembered intended bounds in trayPanelPendingBounds.
  • electron/bridges/trayPanelBounds.cjs: pure boundsMatch comparison helper (no Electron dependency).
  • Tests: trayPanelBounds.test.cjs covers boundsMatch; globalShortcutBridge.test.cjs adds a fake-window regression test where the pre-show setBounds is undone (Windows glitch model) and asserts the panel is corrected to the designed 360x520 rect after show, plus a guard test that no redundant resize happens when the original setBounds already stuck.

Testing

  • node --test electron/bridges/trayPanelBounds.test.cjs electron/bridges/globalShortcutBridge.test.cjs — 50/50 pass.
  • node --test electron/bridges/*.test.cjs — 2036 pass, 0 fail.
  • npx eslint on the four changed files — clean.
  • Manual check on Windows at 100%/200% scale (not verified in this environment): right-click tray icon → panel should appear at full size beside the icon; resize should not flicker because the verify only re-applies when bounds drifted.

Fixes #3181

Automation

  • Automated implement pass
  • Review gate: @codex review (own/bot PRs only)
  • Draft until Codex reports clean findings

@netcatty-bot netcatty-bot added automation:bot-pr PR created or owned by Cursor automation automation:codex-loop Own/bot PR waiting on Codex review↔fix loop triage Touched by Cursor automation labels Aug 29, 2026
@binaricat

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 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-08-29T09:56:03.620165Z 943dab0 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. More of your lovely PRs please.

Reviewed commit: 943dab0946

ℹ️ 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".

@netcatty-bot
netcatty-bot marked this pull request as ready for review August 29, 2026 09:56
@netcatty-bot netcatty-bot added automation:codex-clean Last Codex review reported clean and removed automation:codex-loop Own/bot PR waiting on Codex review↔fix loop labels Aug 29, 2026
@netcatty-bot

Copy link
Copy Markdown
Collaborator Author

Codex reported no major issues. This PR is marked ready for human review/merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation:bot-pr PR created or owned by Cursor automation automation:codex-clean Last Codex review reported clean triage Touched by Cursor automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 在最新版本下托盘托盘的小窗口尺寸依然存在问题

2 participants