Originally created by: kristofferR
Compact Messenger dialogs can trigger media-viewer chrome, restoring the Facebook header and shifting controls when a picker opens.
Classify viewport-sized media overlays structurally and share the resulting marker between CSS and control positioning. Exclude compact/nested pickers, Messenger's main surface, and Carrier overlays; clear stale markers and offsets when viewers hide, change, or disappear.
Validation: rebased onto current main; formatting, Clippy, 246 Rust tests, lint, typechecking, 465 Bun tests, and regenerated inject bundles pass. Chromium fixtures cover three window widths, light/dark themes, both zoom paths from 30β200%, and viewer lifecycle changes. Live Messenger and cross-platform WebView checks remain pending. Local CodeRabbit preflight was skipped by crq due to the shared quota block.
Ref [#254].
Excluded nested dialogs, navigation areas, composers, and other non-viewer surfaces from viewer controls.
Bug Fixes
Improved behavior across zoom levels, themes, hidden elements, and varying screen sizes.
Tests
Originally posted by: kristofferR
@codex review for consequential defects introduced by this PR; do not expand its original scope with unrelated refactors, features, or speculative hardening
Originally posted by: chatgpt-codex-connector[bot]
Codex Review Summary
This comment shows the latest Codex review activity on this pull request.
37eeaf6βΉοΈ About Codex in GitHub
[Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). 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.
Originally posted by: kristofferR
@coderabbitai review
Originally posted by: coderabbitai[bot]
β οΈ Action not completed
Review rate limited. > 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.Originally posted by: coderabbitai[bot]
π Walkthrough
## Walkthrough The change adds media viewer classification, supports multiple active dialogs, synchronizes control offsets and attributes, updates CSS selectors, and adds unit and Chromium-based fixture tests across viewport sizes and viewer states. ### Changes **Media viewer controls** |Layer / File(s)|Summary| |---|---| |**Media viewer classification**`inject/src/messenger/lib/media-viewer.ts`, `inject/src/messenger/lib/media-viewer.test.ts`|Adds media viewer shape validation and dialog classification based on visibility, viewport coverage, overlay positioning, media content, controls, and excluded regions.| |**Viewer control synchronization and styling**
`inject/src/messenger/features/viewer-controls.ts`, `src-tauri/inject/messenger.js`, `src-tauri/inject/messenger.css`, `inject/src/messenger/lib/media-viewer.browser.test.ts`|Tracks multiple dialogs, updates viewer markers and control offsets, observes relevant layout and media changes, applies marker-based CSS rules, and validates DOM/CSS behavior in Chromium fixtures.| **Estimated code review effort:** 4 (Complex) | ~45 minutes **Merge Risk:** _π‘ Moderate_ Β· up to `e8a12` The Messenger fix appears well tested, but the new Chromium fixture can time out and fail CI. Set the test timeout to 60 seconds before merging. ### Sequence Diagram(s) :::mermaid sequenceDiagram participant Dialogs participant MediaViewerDetector participant ViewerControls participant MessengerCSS Dialogs->>MediaViewerDetector: inspect role-based dialogs MediaViewerDetector->>ViewerControls: return media viewer classification ViewerControls->>Dialogs: set or remove data-carrier-media-viewer ViewerControls->>MessengerCSS: apply viewer banner and control rules Dialogs->>ViewerControls: report resize, mutation, load, or metadata changes
π₯ Pre-merge checks | β 4 | β 1
### β Failed checks (1 warning) | Check name | Status | Explanation | Resolution | | :----------------: | :--------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- | | Docstring Coverage | β οΈ Warning | Docstring coverage is 15.38% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 5 files. (1 skipped: β¦ | Write docstrings for the functions missing them to satisfy the coverage threshold. |β Passed checks (4 passed)
| Check name | Status | Explanation | | :------------------------: | :------- | :--------------------------------------------------------------------------------------------------------------------------------------- | | Description Check | β Passed | Check skipped - CodeRabbitβs high-level summary is enabled. | | Title check | β Passed | The title clearly and concisely describes the main change: preventing compact Messenger popovers from being classified as media viewers. | | 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: Docstring Coverage
**Explanation** Docstring coverage is 15.38% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 5 files. (1 skipped: 1 unsupported.)β¨ Finishing Touches π‘ 2
π Generate docstrings π‘
- [ ] Create stacked PR - [ ] Commit on current branchπ οΈ Fix failing CI checks π‘
- [ ] Create stacked PR - [ ] Commit on current branchπ§ͺ Generate unit tests (beta)
- [ ] Create PR with unit tests - [ ] Commit unit tests in branch `fix/254-media-viewer-classification`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
- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)Comment
@coderabbitai helpto get the list of available commands.Originally posted by: chatgpt-codex-connector[bot]
Codex Review: Didn't find any major issues. Breezy!
Reviewed commit:
e8a1214fbbβΉοΈ About Codex in GitHub
[Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). 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".
Originally posted by: kristofferR
@coderabbitai review
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.Originally posted by: kristofferR
@codex review for consequential defects introduced by this PR; do not expand its original scope with unrelated refactors, features, or speculative hardening
Originally posted by: kristofferR
@codex review for consequential defects introduced by this PR; do not expand its original scope with unrelated refactors, features, or speculative hardening
Originally posted by: chatgpt-codex-connector[bot]
Codex Review: Didn't find any major issues. Keep it up!
Reviewed commit:
74464a4d1eβΉοΈ About Codex in GitHub
[Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). 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".
Originally posted by: kristofferR
@codex review for consequential defects introduced by this PR; do not expand its original scope with unrelated refactors, features, or speculative hardening
Ticket changed by: kristofferR
Originally posted by: chatgpt-codex-connector[bot]
Codex Review: Didn't find any major issues. π
Reviewed commit:
37eeaf6a67βΉοΈ About Codex in GitHub
[Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). 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".