Skip to content

fix(pwa): keep the image and diagram previews' bar clear of the title bar area (#2026) - #2381

Merged
devswha merged 1 commit into
mainfrom
fix/lightbox-wco-titlebar
Oct 29, 2026
Merged

devswha merged 1 commit into
mainfrom
fix/lightbox-wco-titlebar

Conversation

@devswha

@devswha devswha commented Oct 29, 2026

Copy link
Copy Markdown
Owner

Closes #2026. Thanks @Hyd3-14 for the precise report and root-cause analysis: the fix is the one the issue proposed.

Change

In the installed app with the title bar folded away (Window Controls Overlay), the image preview's and the Mermaid preview's top bar sat at space-3 from the top, inside the 33px title bar band. Two things took the clicks there (reproduced on main in winvm, comment):

  • The browser's own window controls cover the right-hand buttons: an upper-half click on zoom in or fit opened Edge's menus, and on ✕ it closed the whole app window.
  • .app-header's app-region: drag (the WCO block in src/styles.css) stayed active under the full-screen preview, so pressing the bar's zoom readout dragged the window.

Under @media (display-mode: window-controls-overlay), ImageLightbox.css and MermaidLightbox.css now:

  • give the preview's scrim app-region: no-drag, which cancels the header's drag region while a preview is open (Chromium subtracts no-drag rectangles from the drag region);
  • place the bar at top: calc(var(--space-3) + env(titlebar-area-y, 0px) + env(titlebar-area-height, 0px));
  • for the image, reserve the same room in the fitted picture's max-height, so the picture stays centred clear of the bar. The Mermaid canvas keeps its inset: its zoom anchors are stage points, so moving the canvas would make a zoom drift further (review finding, below).

Outside WCO, env(titlebar-area-*) falls back to 0, and the rules apply only in that display mode anyway, so the browser tab, phones and the other installed modes are unchanged.

Design reference: this follows Chromium's Window Controls Overlay guidance (keep interactive content inside env(titlebar-area-*) or below it, and mark it no-drag). The Codex, Claude, Paseo and T3 Code apps have no installed-PWA title bar overlay to copy.

Validation

  • src/styles-wco.test.ts: one new test per preview (the scrim is no-drag, and the bar's top uses env(titlebar-area-y/height)). Both failed on main ("no @media (display-mode: window-controls-overlay) block in ImageLightbox.css / MermaidLightbox.css") and pass now. Moving the offset off top fails the image test again.
  • bun run check fast: workflow syntax, generated files, typecheck, build, unit tests (8679 pass, 0 fail).
  • Real surface, winvm (Windows 11, Edge 156, a fresh profile), Ovis installed as an app from this branch's client build (fixture transport, no herdr session): display-mode: window-controls-overlay matched, title bar area 0,0 772x33. Every click and drag was a real OS mouse event:
    • Image preview: the bar now starts at y=45 (it was y=12). Upper-half clicks (y=55, the same point as in the reproduction) on zoom out, zoom in, fit, copy and ✕ all reached Ovis: zoom 75% to 93% and back, fit, copy, and ✕ closed only the preview while the app window stayed open. A drag from the zoom readout, and one from the old title bar band at (300,15), stayed in the page. The window never moved (rect 10,10 throughout).
    • Mermaid preview: the bar starts at y=45. Upper-half clicks on zoom in (100% to 125%), zoom out, fit and ✕ all reached Ovis, a drag from the readout stayed in the page, and the window never moved.

Reviews

  • omo code reviewer: approve, no HIGH or MEDIUM. Taken from its LOWs: the changelog wording, and a test that pins the offset to top.
  • Codex (gpt-6.1-sol, xhigh): one MEDIUM. The first version also moved the Mermaid canvas down, which widened its existing zoom-anchor drift (zooms use stage coordinates; the canvas transforms about its own corner) from 32px to 65px. Fixed by keeping the canvas as on main. A last Codex round on the new code: no findings, the MEDIUM resolved.

Not in this PR (LOW, not reproduced)

  • Other dialogs (Settings, the file viewer) are centred and normally sit below the title bar band. In an installed window shorter than about 750px, their top could reach the header's drag region, and pressing the upper part of their header buttons would drag the window. Not reproduced. A WCO rule giving every .modal-scrim no-drag would cover it.
  • The Mermaid preview's zoom anchor drifts by the canvas inset (32px at 2x), on main too.

… bar area (#2026)

In the installed app with the title bar folded away (Window Controls Overlay), the image and
Mermaid previews placed their top bar at space-3 from the top, inside the title bar band. The
browser's window controls covered the right-hand buttons (an upper-half click on the close button
closed the whole app), and the header's app-region: drag stayed active under the preview, so a
press on the bar's zoom readout dragged the window.

Under display-mode: window-controls-overlay, both previews now opt out of the drag region on their
scrim, and the bar starts below env(titlebar-area-*); the fitted picture keeps the same room clear
of it.
@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 36 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 8a2dbcc and 07f040a.

Files selected for processing: 4
  • changelog.d/lightbox-wco-titlebar.md
  • src/components/ImageLightbox.css
  • src/components/MermaidLightbox.css
  • src/styles-wco.test.ts
  • 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

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

@devswha

devswha commented Oct 29, 2026

Copy link
Copy Markdown
Owner Author

Agent reviews of this PR (on the diff before the push), with how each finding was resolved:

omo-native-code-reviewer (Claude Opus): approve, no HIGH or MEDIUM.

  • LOW: changelog wording read backwards ("buttons no longer reach the browser's window controls"). Fixed: "no longer sit under".
  • LOW: the test found the env() strings anywhere in the bar rule. Fixed: it now reads the bar's top declaration; moving the offset to margin-top fails it.
  • LOW: other dialogs (Settings, file viewer) could reach the header's drag region in a window shorter than about 750px. Not reproduced and outside Image preview: the top-right buttons sit under the title bar area and only their bottom edge is clickable #2026; listed in the PR body.
  • LOW: branch one commit behind main. Rebased onto c5851e7.

Codex (gpt-6.1-sol, fast, xhigh):

  • MEDIUM: the first version also moved .mermaid-lightbox-canvas down under WCO. Zooms are taken about stage points while the canvas transforms about its own corner, so the anchor drift grew from 32px to 65px. Fixed: the canvas keeps its inset as on main; only the scrim and bar rules remain.
  • Round 2 on the new code: no findings, MEDIUM confirmed resolved.

Checks on the pushed head 07f040a: bun run check fast green (8679 pass, 0 fail), and the winvm installed-app run in the PR body.

@devswha

devswha commented Oct 29, 2026

Copy link
Copy Markdown
Owner Author

Merging 07f040a (closes #2026, thanks @Hyd3-14 for the precise report and root-cause analysis; the fix is the one the issue proposed). In the installed app with the title bar folded away (Window Controls Overlay), the image and Mermaid previews' top bar sat inside the title bar band: the window's own controls took clicks on its right-hand buttons (a click on ✕ could close the app window) and the header's drag region dragged the window from the zoom readout. Under display-mode: window-controls-overlay only, both previews now opt out of dragging and start their bar below the band (the image keeps the same room clear); other display modes are unchanged. Reproduced on main in the Windows VM; reviewed by the merge pass (CSS only, plus src/styles-wco.test.ts).

@devswha
devswha merged commit 4fbc3e4 into main Oct 29, 2026
11 checks passed
@devswha
devswha deleted the fix/lightbox-wco-titlebar branch October 29, 2026 20:34
@devswha devswha mentioned this pull request Oct 30, 2026
devswha added a commit that referenced this pull request Oct 30, 2026
## Release 0.4.21

The release PR, prepared by step 1 of
[docs/development.md#releasing](https://github.com/devswha/ovis/blob/main/docs/development.md#releasing),
now re-folded on main `1ef6ea329108a0985b823e8235b03daddcd0a5f4` after
the owner held 0.4.21 for more work. The merge pass reported the 0.4.21
queue empty.

**Do not merge yet:** the owner judges the final build before release.
No tag and no Release run from this PR's author.

- **Version:** `version` is 0.4.21 in `package.json` and
`herdr-plugin.toml`.
- **Changelog:** `bun scripts/changelog-fold.ts 0.4.21 2026-10-30`
folded 63 fragments into the 2026-10-30 section of `CHANGELOG.md` (71
entries), linked their PRs and deleted the fragments; `changelog.d`
holds only `README.md`.
- `by @login` on every outside contributor's PR link: #2361 @eddieparc,
#2333 @IdrisGit, #2355 @imurfutur3, #2341 @sulthonzh, #2359 @YuuuXie,
#2377 @IdrisGit, #2269 @CharleoYang, #2405 @jpcarranza94, #2414
@homebodify, #2417 @cheol-95, #2418 @eddieparc, #2435 @cheol-95.
- Two outside PRs had no fragment and got an entry by hand: #2341
(OpenCode background commands, Added) and #2359 (installer test timing,
Maintenance).
- Issue reporters are credited in their entries: @blaker3115-Agri
(#1488), @Hyd3-14 (#2026), @osamahbeig (#2343), @Shunamxiao (#2329),
@matiemer (#2362), @kilhyeonjun (#2344), @eddieparc (#2360), @Ploppy3
(#2236), @sulthonzh (#2340), @WOULDU-pres (#2056), @odfalik (#2038),
@aNNdii (#511), @Noobear (#2281, fixed by #2424); #2435 fixes
@cheol-95's own #2434.
- Two fragments ran past the changelog's width (#2418, #2269); their
entries are re-wrapped, words unchanged. #2382's entry reads "OpenCode's
installer puts its folder first" (reviewed earlier on this PR).
- Maintainer PRs without a fragment and without a user-facing change
have no entry: #2353 (check tool), #2371 (guide docs), #2396 and #2397
(tests), #2403 and #2433 (server and client transport seams, no
behaviour change), #2437 (test-only fix for #2435's check). #2438's own
entry (the sidebar selection marked by its fill again) is dropped: the
stroke #2352 added never shipped, so users see no change; #2352's entry
keeps only the Windows high-contrast Highlight bar.
- **Release summaries:** en, ko, ja and zh each have 5 new, 5 improved
and 5 fixed lines. Since the first review: New lists the in-browser
Claude Code / Codex sign-in (#2428) in place of the tab/workspace
shortcut line; Improved lists Settings → Agents (#2427) in place of the
sidebar fold line; Fixed lists the Codex wrong-session fix (#2426,
#2430) in place of the phone screenshot paste line. The Artifacts and
Claude status-line lines keep their reviewed wording (turned on in
Settings). Not in 0.4.21: #2420 (Codex chat behind Kiro), #2065 (Portal
sign-in) and #2436 (relay foundations) stay open for a later release.
- **Remote bundle:** `REMOTE_BUNDLE_VERSION` rises from 39 to 40 because
the bundle inputs (`server/`, `shared/`, `patches/`) changed since
remote-v39. After merge: push `remote-v40` on the merged commit and wait
for the Remote PC bundles workflow before running Release.
- **iOS:** `CURRENT_PROJECT_VERSION` stays 3 (#2370 changed
`Info.plist`; build 3 is not known to be uploaded yet).

## Validation

- `bun scripts/release-guards.ts --base v0.4.20`: "Release 0.4.21:
remote bundle, telemetry Worker and release metadata are in order."
- `dori heavy … bun run check fast` on this branch: workflow syntax,
generated types and themes, typecheck, build, unit tests all ok. Unit:
9166 pass, 0 fail, 36 skip in 591 files.
- Every PR in `v0.4.20..main` was pre-run for the owner's hands-on guide
on isolated copies (own herdr session, fresh state, never the owner's
live session). Items that need a real device (iPhone tap dictation
#2370, dictation keyboards #2386, the installed desktop app's title-bar
overlay #2381) are left for the owner's final check.

This is a release-metadata PR: it changes no code path. Per the release
steps, merge it after CI and the owner's go, then push `remote-v40`,
wait for its bundles, and run Release with `0.4.21`.
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.

Image preview: the top-right buttons sit under the title bar area and only their bottom edge is clickable

1 participant