Originally created by: kristofferR
Camera and microphone capture failures currently share misleading, transient guidance and can open macOS Settings automatically.
Replace the warning with a compact recovery card inside the chat. It shows separate camera and microphone rows, distinguishes capture errors from OS permission state, and preserves independent device failures until those devices recover. Active-call tracking remains intact.
On macOS, read permission status without prompting, offer an explicit Allow access action for unrequested permissions, and recheck when Carrier regains focus. Confirmed access changes show a brief reminder to retry the call. Signed native requests limit settings navigation to camera and microphone privacy pages on macOS and Windows. Windows and Linux show unavailable status honestly; Linux includes manual recovery guidance.
Validation: 484 Bun tests and 255 Rust tests pass, plus Biome, TypeScript, cargo fmt, and Clippy. macOS cargo check passed. Browser fixtures cover independent failures, partial recovery, permission changes, dismissal, stale native responses, and synthetic-click rejection. Light and dark card layouts were checked at narrow widths. Live native permission prompts and Settings launches remain unverified. Local preflight was skipped because the shared CodeRabbit quota was blocked.
Ref [#257]
Originally posted by: kristofferR
@coderabbitai review
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: 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: chatgpt-codex-connector[bot]
Codex Review Summary
This comment shows the latest Codex review activity on this pull request.
53b9f1fβΉοΈ 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: coderabbitai[bot]
π Walkthrough
## Walkthrough The change replaces media-permission toasts with a shadow-DOM recovery banner. It classifies capture failures, adds platform-specific guidance and settings actions, exposes a signed native bridge, and tests browser and native behavior. ### Changes **Media permission recovery** |Layer / File(s)|Summary| |---|---| |**Failure classification and messages**`inject/src/messenger/lib/media-permissions.ts`, `inject/src/messenger/lib/media-permissions.test.ts`|The new helpers identify requested devices, classify capture errors, and generate device-specific failure messages and platform guidance.| |**Native privacy settings bridge**
`src-tauri/src/media_permissions.rs`, `src-tauri/src/lib.rs`, `src-tauri/src/window.rs`, `inject/src/types.d.ts`, `src-tauri/capabilities/default.json`|The native layer maps camera and microphone requests to macOS and Windows privacy URLs. The injected bridge sends signed requests and reports results.| |**Capture recovery banner**
`inject/src/messenger/features/media-permissions.ts`, `src-tauri/inject/messenger.js`|Failed captures show a dismissible shadow-DOM banner. Denied permissions include trusted per-device settings actions on supported platforms. Request serials preserve pending failures and dismissal state.| |**Browser behavior validation**
`inject/src/messenger/lib/media-permissions.browser.test.ts`|Headless Chromium tests cover platform labels, failure categories, button behavior, dismissal, concurrent requests, successful capture, and track termination.| **Estimated code review effort:** 4 (Complex) | ~45 minutes **Merge Risk:** _π΅ Low_ Β· up to `e3cf1` On supported older macOS versions, recovery banners appear but their Settings buttons do nothing. The issue is localized and should be corrected before release. ### Sequence Diagram(s) :::mermaid sequenceDiagram participant Messenger participant getUserMediaWrapper participant carrierOpenMediaPrivacy participant NativePrivacyHandler participant OSSettings Messenger->>getUserMediaWrapper: request camera or microphone getUserMediaWrapper-->>Messenger: show recovery banner on failure Messenger->>carrierOpenMediaPrivacy: select device settings carrierOpenMediaPrivacy->>NativePrivacyHandler: send signed request NativePrivacyHandler->>OSSettings: open platform privacy URL NativePrivacyHandler-->>carrierOpenMediaPrivacy: return opened result carrierOpenMediaPrivacy-->>Messenger: resolve settings action
π₯ Pre-merge checks | β 4 | β 1
### β Failed checks (1 warning) | Check name | Status | Explanation | Resolution | | :----------------: | :--------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- | | Docstring Coverage | β οΈ Warning | Docstring coverage is 18.18% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 22 functions across 9 files. (1 skipped: β¦ | Write docstrings for the functions missing them to satisfy the coverage threshold. |β Passed checks (4 passed)
| Check name | Status | Explanation | | :------------------------: | :------- | :------------------------------------------------------------------------------------------------------------- | | 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. | | Description Check | β Passed | Check skipped - CodeRabbitβs high-level summary is enabled. | | Title check | β Passed | The title clearly and concisely describes the main change: improved camera and microphone permission recovery. |Full details: Docstring Coverage
**Explanation** Docstring coverage is 18.18% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 22 functions across 9 files. (1 skipped: 1 unsupported.)β¨ Finishing Touches π‘ 1
π Generate docstrings π‘
- [ ] Create stacked PR - [ ] Commit on current branchπ§ͺ Generate unit tests (beta)
- [ ] Create PR with unit tests - [ ] Commit unit tests in branch `fix/257-media-permissions`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: 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
@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: 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. What shall we delve into next?
Reviewed commit:
53b9f1f115βΉοΈ 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".
Ticket changed by: kristofferR