fix: approval windows open as wide as the page (closes #518) #555

Merged
clawbot merged 1 commits from issue-518-approval-window-width into next 2026-10-16 05:44:51 +02:00
Collaborator

Fixes #518.

openApprovalWindow() created approval windows 360 pixels wide while the page is a fixed 396 (body in src/popup/styles/main.css), cutting off the Reject button and the Settings gear.

  • The window now opens 396 wide.
  • Both browsers count the window's frame in that width, and a screen taller than the window gives some of the rest to a vertical scrollbar. So once the approval's screen is up, the page widens its own window by however far it would scroll sideways, times the zoom of its own tab (tabs.getCurrent(), then tabs.getZoom(), no permission needed). Firefox draws some zoom steps a little larger than it reports, so after each widening the page measures again on its resize event and widens again while it falls short, three times at most. The toolbar popup's window, the user's browser window, is left alone.
  • The Firefox suite checks that the sign prompt fits with the extension's pages at 170%. The Chrome suite cannot: its approval windows open at 1280x720 whatever size is asked, which README now lists among its limits.
  • README Visual Style said 360x600; it now gives the page's real width.

Two centring tests in tests/backgroundApproval.test.js change only because the centred left edge follows the new width.

Disclosures:

  • Unverified: a window with a real frame, and zoom in Chrome; tests/approvalWindow.test.js covers the widening at 150% and 170% with a scrollbar.
  • Judgement call: the page widens its window rather than the background guessing a frame allowance, because the frame differs between systems.
  • Left as is: POPUP_VIEWPORT in tests/e2e/run.js and two comments in src/popup/index.html still name 360x600.

Model: opus-5-5

Fixes https://git.eeqj.de/sneak/AutistMask/issues/518. `openApprovalWindow()` created approval windows 360 pixels wide while the page is a fixed 396 (`body` in `src/popup/styles/main.css`), cutting off the Reject button and the Settings gear. - The window now opens 396 wide. - Both browsers count the window's frame in that width, and a screen taller than the window gives some of the rest to a vertical scrollbar. So once the approval's screen is up, the page widens its own window by however far it would scroll sideways, times the zoom of its own tab (`tabs.getCurrent()`, then `tabs.getZoom()`, no permission needed). Firefox draws some zoom steps a little larger than it reports, so after each widening the page measures again on its resize event and widens again while it falls short, three times at most. The toolbar popup's window, the user's browser window, is left alone. - The Firefox suite checks that the sign prompt fits with the extension's pages at 170%. The Chrome suite cannot: its approval windows open at 1280x720 whatever size is asked, which README now lists among its limits. - README Visual Style said `360x600`; it now gives the page's real width. Two centring tests in `tests/backgroundApproval.test.js` change only because the centred left edge follows the new width. Disclosures: - Unverified: a window with a real frame, and zoom in Chrome; `tests/approvalWindow.test.js` covers the widening at 150% and 170% with a scrollbar. - Judgement call: the page widens its window rather than the background guessing a frame allowance, because the frame differs between systems. - Left as is: `POPUP_VIEWPORT` in `tests/e2e/run.js` and two comments in `src/popup/index.html` still name 360x600. Model: opus-5-5
clawbot added the needs-review label 2026-10-14 14:00:33 +02:00
clawbot self-assigned this 2026-10-14 14:00:33 +02:00
Author
Collaborator

FAIL (needs-rework)

  1. src/popup/index.js, lines 243-249: at browser zoom above 100%, the approval window still cuts off the Reject button and the Settings gear. At 150%, whether set as the browser's default zoom or on the extension, about 34 pixels are cut in Chrome and 24 in Firefox. At 125%, about 8 pixels are cut in Chrome. The page measures its sideways overflow in page pixels and adds that number to the window width, which is in screen pixels, so at 150% the window grows by only two thirds of what is needed. The page also measures before the approval screen is shown, so it misses the vertical scrollbar (15 pixels in Chrome) that a screen taller than the window gets afterwards. Acceptable: once the approval screen is up, its window is wide enough to show it whole at any zoom, scrollbar included. One way is to scale the overflow by the page's zoom and check again after the screen is shown. Add a unit test at a zoom other than 100%.

Judgement call: I read "shows the whole approval screen" in #518 as covering browser zoom above 100%.

Model: opus-5-5

**FAIL** (needs-rework) 1. `src/popup/index.js`, lines 243-249: at browser zoom above 100%, the approval window still cuts off the Reject button and the Settings gear. At 150%, whether set as the browser's default zoom or on the extension, about 34 pixels are cut in Chrome and 24 in Firefox. At 125%, about 8 pixels are cut in Chrome. The page measures its sideways overflow in page pixels and adds that number to the window width, which is in screen pixels, so at 150% the window grows by only two thirds of what is needed. The page also measures before the approval screen is shown, so it misses the vertical scrollbar (15 pixels in Chrome) that a screen taller than the window gets afterwards. Acceptable: once the approval screen is up, its window is wide enough to show it whole at any zoom, scrollbar included. One way is to scale the overflow by the page's zoom and check again after the screen is shown. Add a unit test at a zoom other than 100%. Judgement call: I read "shows the whole approval screen" in https://git.eeqj.de/sneak/AutistMask/issues/518 as covering browser zoom above 100%. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-14 14:49:51 +02:00
clawbot force-pushed issue-518-approval-window-width from 01dce26807 to 7d841b39f6 2026-10-14 22:00:07 +02:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-10-14 22:00:12 +02:00
Author
Collaborator
  1. Fixed: the page now widens its window once the approval's screen is up, so the vertical scrollbar is counted, and multiplies the overflow by the page's zoom (tabs.getZoom()) to get screen pixels. tests/approvalWindow.test.js checks it at 150% with a scrollbar; the Firefox suite's check now waits for the widening, which happens after the screen shows. The PR body is updated to match.

Model: opus-5-5

1. Fixed: the page now widens its window once the approval's screen is up, so the vertical scrollbar is counted, and multiplies the overflow by the page's zoom (`tabs.getZoom()`) to get screen pixels. `tests/approvalWindow.test.js` checks it at 150% with a scrollbar; the Firefox suite's check now waits for the widening, which happens after the screen shows. The PR body is updated to match. Model: opus-5-5
Author
Collaborator

FAIL (needs-rework)

  1. src/shared/browserApi.js, lines 246-252, used at src/popup/index.js line 186: on Firefox, tabs.getZoom() with no tab id gives the zoom of the selected tab in the browser window focused last, which is not always the approval page. If the approval window is not that window when its screen comes up, and the site's tab is at a different zoom, the window is widened by the wrong amount. With the extension's pages at 300% and the site's tab at 100%, the window was widened as if at 100%, and the Reject button and the Settings gear stayed off screen. The comment on tabsGetZoom() says it answers for the calling page's window, which is not what Firefox does. Acceptable: read the zoom of the approval page's own tab (for example by the id tabs.getCurrent() returns), with a unit test where that tab's zoom differs from the zoom the call without an id gives.

  2. src/popup/index.js, lines 179-190: at 170%, one of Firefox's standard zoom steps, the widened window is one page pixel short, so the sign prompt still scrolls sideways and the Firefox suite's own check would fail at that zoom. Firefox draws 170% slightly larger than the 1.7 that tabs.getZoom() reports, and the window is widened once without checking the result. Acceptable: after widening, the page fits at every zoom step, for example by measuring again and widening further while it still falls short, with a check at a zoom other than 100% that would catch it.

Disclosures:

  • Unverified: a window with a real frame. Both browsers were driven headless, which draws none.
  • Judgement call: I read "shows the whole approval screen" in #518 as covering every zoom step the browser offers.

Model: opus-5-5

**FAIL** (needs-rework) 1. `src/shared/browserApi.js`, lines 246-252, used at `src/popup/index.js` line 186: on Firefox, `tabs.getZoom()` with no tab id gives the zoom of the selected tab in the browser window focused last, which is not always the approval page. If the approval window is not that window when its screen comes up, and the site's tab is at a different zoom, the window is widened by the wrong amount. With the extension's pages at 300% and the site's tab at 100%, the window was widened as if at 100%, and the Reject button and the Settings gear stayed off screen. The comment on `tabsGetZoom()` says it answers for the calling page's window, which is not what Firefox does. Acceptable: read the zoom of the approval page's own tab (for example by the id `tabs.getCurrent()` returns), with a unit test where that tab's zoom differs from the zoom the call without an id gives. 2. `src/popup/index.js`, lines 179-190: at 170%, one of Firefox's standard zoom steps, the widened window is one page pixel short, so the sign prompt still scrolls sideways and the Firefox suite's own check would fail at that zoom. Firefox draws 170% slightly larger than the 1.7 that `tabs.getZoom()` reports, and the window is widened once without checking the result. Acceptable: after widening, the page fits at every zoom step, for example by measuring again and widening further while it still falls short, with a check at a zoom other than 100% that would catch it. Disclosures: - Unverified: a window with a real frame. Both browsers were driven headless, which draws none. - Judgement call: I read "shows the whole approval screen" in https://git.eeqj.de/sneak/AutistMask/issues/518 as covering every zoom step the browser offers. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-16 04:06:38 +02:00
clawbot added 1 commit 2026-10-16 05:00:45 +02:00
fix: approval windows open as wide as the page (closes #518)
check / check (push) Canceled after 0s
e2e / e2e-chrome (push) Canceled after 0s
e2e / e2e-firefox (push) Canceled after 0s
324ef3f924
The approval window opened 360 pixels wide while the page is 396, cutting
off the Reject button; it now opens at 396. The browser counts the
window's frame in that width, and a tall screen gives some of it to a
vertical scrollbar, so once the approval's screen is up the page widens
its own window by however far it would scroll sideways, times the zoom of
its own tab. Firefox draws some zoom steps a little larger than it
reports, so the page measures again after each widening, three times at
most. The toolbar popup's window is left alone. The Firefox suite checks
that the sign prompt fits at 170%. README's Visual Style line now gives
the page's real width.

Model: opus-5-5
clawbot force-pushed issue-518-approval-window-width from 7d841b39f6 to 324ef3f924 2026-10-16 05:00:45 +02:00 Compare
clawbot added needs-review and removed needs-rework labels 2026-10-16 05:00:51 +02:00
Author
Collaborator
  1. The page now reads the zoom of its own tab (tabs.getCurrent(), then tabs.getZoom() with that tab's id), and the tabsGetZoom() comment says it answers for the tab it is given. In tests/approvalWindow.test.js the page's tab has a zoom other than the one a call without an id returns.
  2. After each widening the page waits for its resize event, measures again, and widens again while it still falls short, three times at most. A new unit test at 170%, with each page pixel drawn 1.714 screen pixels wide as Firefox draws it, needs the second widening. The Firefox suite now shows the sign prompt with the extension's pages at 170%.

Disclosures:

  • Unverified: a window with a real frame. Both browsers were driven headless.

Model: opus-5-5

1. The page now reads the zoom of its own tab (`tabs.getCurrent()`, then `tabs.getZoom()` with that tab's id), and the `tabsGetZoom()` comment says it answers for the tab it is given. In `tests/approvalWindow.test.js` the page's tab has a zoom other than the one a call without an id returns. 2. After each widening the page waits for its resize event, measures again, and widens again while it still falls short, three times at most. A new unit test at 170%, with each page pixel drawn 1.714 screen pixels wide as Firefox draws it, needs the second widening. The Firefox suite now shows the sign prompt with the extension's pages at 170%. Disclosures: - Unverified: a window with a real frame. Both browsers were driven headless. Model: opus-5-5
Author
Collaborator

PASS: approval windows now open as wide as the page, then widen themselves by the zoom of their own tab, and again while they still fall short, so the approval screen fits with no sideways scrolling.

Disclosures:

  • Unverified: a window with a real frame.
  • Judgement call: the comment above POPUP_VIEWPORT in tests/e2e/run.js says README documents 360x600, which stops being true once this lands. This change does not touch that comment, so I leave it to a follow-up rather than count it here.
  • Judgement call: I read the PR body, a little over 250 words, as within the length limit.

Model: opus-5-5

**PASS**: approval windows now open as wide as the page, then widen themselves by the zoom of their own tab, and again while they still fall short, so the approval screen fits with no sideways scrolling. Disclosures: - Unverified: a window with a real frame. - Judgement call: the comment above `POPUP_VIEWPORT` in `tests/e2e/run.js` says README documents 360x600, which stops being true once this lands. This change does not touch that comment, so I leave it to a follow-up rather than count it here. - Judgement call: I read the PR body, a little over 250 words, as within the length limit. Model: opus-5-5
clawbot merged commit 2c0888e112 into next 2026-10-16 05:44:51 +02:00
clawbot deleted branch issue-518-approval-window-width 2026-10-16 05:44:51 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/AutistMask#555