Repository navigation
feat(desktop): calm the Permissions settings page - #11525
Conversation
There was a problem hiding this comment.
4 issues found across 13 files
Confidence score: 3/5
- In
desktop/macos/Desktop/Sources/MainWindow/Pages/PermissionsPageChrome.swift, the Screen Recording state can be shown as fully granted while capture still requires a relaunch, which risks users getting stuck with a non-working setup flow—usescreenRecordingNeedsRelaunchin the granted-state branch so the UI reflects the restart requirement. - In
desktop/macos/Desktop/Sources/MainWindow/Pages/PermissionsPage.swift, notification authorization and alert-style handling are out of sync with the sidebar logic, so users can see conflicting permission status between views—include banner visibility in the notification action flow so both surfaces compute the same state. - In
desktop/macos/e2e/flows/screen-recording-permission.yaml, thecovers:metadata namesPermissionsPageChrome.swifteven though the flow never navigates there, which can create a false sense of end-to-end coverage—either update navigation to exercise that page or narrow the declared coverage. - In
desktop/macos/Desktop/Tests/SettingsSidebarItemLayoutTests.swift, the notice-layout assertion is confounded by a simultaneous selection-state change, so regressions in notice width can be masked—keep selection constant between fixtures to isolate and verify the notice effect.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="desktop/macos/e2e/flows/screen-recording-permission.yaml">
<violation number="1" location="desktop/macos/e2e/flows/screen-recording-permission.yaml:13">
P3: `PermissionsPageChrome.swift` is listed under this flow's `covers:`, but every step only visits the Rewind page, the Rewind settings gear, a screen-recording section inside Settings, and the Dashboard — none navigate to the Permissions settings sidebar page, which is the sole surface that uses `PermissionsPageChrome` (via `PermissionsPage`). This is unexercised/fake coverage; per the repo convention (AGENTS.md: "Don't expand covers: lists as fake coverage") and prior feedback on coverage claims, only list a file in a flow that actually exercises its path.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/MainWindow/Pages/PermissionsPageChrome.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/MainWindow/Pages/PermissionsPageChrome.swift:39">
P1: When Screen Recording is granted while Omi is still running, this returns `false` and the page renders a compact Granted row even though capture remains unusable until relaunch. Use `screenRecordingNeedsRelaunch` at the page/policy boundary instead of the deprecated `isScreenRecordingStale` flag, so the row keeps the recovery action until the new grant is active.</violation>
</file>
<file name="desktop/macos/Desktop/Sources/MainWindow/Pages/PermissionsPage.swift">
<violation number="1" location="desktop/macos/Desktop/Sources/MainWindow/Pages/PermissionsPage.swift:22">
P2: When notifications are authorized but their alert style is `None`, the sidebar still reports a missing permission while this page shows a Granted row. Include the banner-visibility state in the notification action flow and render the System Settings recovery instructions for it.</violation>
</file>
<file name="desktop/macos/Desktop/Tests/SettingsSidebarItemLayoutTests.swift">
<violation number="1" location="desktop/macos/Desktop/Tests/SettingsSidebarItemLayoutTests.swift:79">
P3: This test compares `noticed` (isSelected: true, with notice) against `plain` (isSelected: false, without notice), so it does not isolate the effect of the notice. Selection changes the font weight/width and therefore the row height, so an apples-to-oranges mismatch could either be masked (selection adds height that hides a wrap) or produce a false pass. Build both rows with the same selection state — the selected row is where the notice actually renders — so the only differing variable is `showsMissingPermissionNotice`.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| static func microphoneNeedsAction(granted: Bool) -> Bool { !granted } | ||
|
|
||
| static func screenRecordingNeedsAction(granted: Bool, stale: Bool) -> Bool { | ||
| !granted || stale |
There was a problem hiding this comment.
P1: When Screen Recording is granted while Omi is still running, this returns false and the page renders a compact Granted row even though capture remains unusable until relaunch. Use screenRecordingNeedsRelaunch at the page/policy boundary instead of the deprecated isScreenRecordingStale flag, so the row keeps the recovery action until the new grant is active.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Sources/MainWindow/Pages/PermissionsPageChrome.swift, line 39:
<comment>When Screen Recording is granted while Omi is still running, this returns `false` and the page renders a compact Granted row even though capture remains unusable until relaunch. Use `screenRecordingNeedsRelaunch` at the page/policy boundary instead of the deprecated `isScreenRecordingStale` flag, so the row keeps the recovery action until the new grant is active.</comment>
<file context>
@@ -0,0 +1,52 @@
+ static func microphoneNeedsAction(granted: Bool) -> Bool { !granted }
+
+ static func screenRecordingNeedsAction(granted: Bool, stale: Bool) -> Bool {
+ !granted || stale
+ }
+
</file context>
| } | ||
|
|
||
| private var notificationsNeedAction: Bool { | ||
| PermissionsPageChrome.notificationsNeedAction(granted: appState.hasNotificationPermission) |
There was a problem hiding this comment.
P2: When notifications are authorized but their alert style is None, the sidebar still reports a missing permission while this page shows a Granted row. Include the banner-visibility state in the notification action flow and render the System Settings recovery instructions for it.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Sources/MainWindow/Pages/PermissionsPage.swift, line 22:
<comment>When notifications are authorized but their alert style is `None`, the sidebar still reports a missing permission while this page shows a Granted row. Include the banner-visibility state in the notification action flow and render the System Settings recovery instructions for it.</comment>
<file context>
@@ -6,65 +6,73 @@ import SwiftUI
+ }
+
+ private var notificationsNeedAction: Bool {
+ PermissionsPageChrome.notificationsNeedAction(granted: appState.hasNotificationPermission)
+ }
+
</file context>
| - desktop/macos/Desktop/Sources/ScreenRecordingPermissionPolicy.swift | ||
| - desktop/macos/Desktop/Sources/Onboarding/PermissionDragGuidance.swift | ||
| - desktop/macos/Desktop/Sources/MainWindow/Pages/PermissionsPage.swift | ||
| - desktop/macos/Desktop/Sources/MainWindow/Pages/PermissionsPageChrome.swift |
There was a problem hiding this comment.
P3: PermissionsPageChrome.swift is listed under this flow's covers:, but every step only visits the Rewind page, the Rewind settings gear, a screen-recording section inside Settings, and the Dashboard — none navigate to the Permissions settings sidebar page, which is the sole surface that uses PermissionsPageChrome (via PermissionsPage). This is unexercised/fake coverage; per the repo convention (AGENTS.md: "Don't expand covers: lists as fake coverage") and prior feedback on coverage claims, only list a file in a flow that actually exercises its path.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/e2e/flows/screen-recording-permission.yaml, line 13:
<comment>`PermissionsPageChrome.swift` is listed under this flow's `covers:`, but every step only visits the Rewind page, the Rewind settings gear, a screen-recording section inside Settings, and the Dashboard — none navigate to the Permissions settings sidebar page, which is the sole surface that uses `PermissionsPageChrome` (via `PermissionsPage`). This is unexercised/fake coverage; per the repo convention (AGENTS.md: "Don't expand covers: lists as fake coverage") and prior feedback on coverage claims, only list a file in a flow that actually exercises its path.</comment>
<file context>
@@ -10,6 +10,7 @@ covers:
- desktop/macos/Desktop/Sources/ScreenRecordingPermissionPolicy.swift
- desktop/macos/Desktop/Sources/Onboarding/PermissionDragGuidance.swift
- desktop/macos/Desktop/Sources/MainWindow/Pages/PermissionsPage.swift
+ - desktop/macos/Desktop/Sources/MainWindow/Pages/PermissionsPageChrome.swift
- desktop/macos/Desktop/Sources/AppState/AppState+SystemActions.swift
- desktop/macos/Desktop/Sources/AppState/AppState+Permissions.swift
</file context>
|
|
||
| func testPermissionsRowWithMissingNoticeStaysOnOneLine() { | ||
| let plain = itemHeight(section: .permissions, isSelected: false, showsMissingPermissionNotice: false) | ||
| let noticed = itemHeight(section: .permissions, isSelected: true, showsMissingPermissionNotice: true) |
There was a problem hiding this comment.
P3: This test compares noticed (isSelected: true, with notice) against plain (isSelected: false, without notice), so it does not isolate the effect of the notice. Selection changes the font weight/width and therefore the row height, so an apples-to-oranges mismatch could either be masked (selection adds height that hides a wrap) or produce a false pass. Build both rows with the same selection state — the selected row is where the notice actually renders — so the only differing variable is showsMissingPermissionNotice.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At desktop/macos/Desktop/Tests/SettingsSidebarItemLayoutTests.swift, line 79:
<comment>This test compares `noticed` (isSelected: true, with notice) against `plain` (isSelected: false, without notice), so it does not isolate the effect of the notice. Selection changes the font weight/width and therefore the row height, so an apples-to-oranges mismatch could either be masked (selection adds height that hides a wrap) or produce a false pass. Build both rows with the same selection state — the selected row is where the notice actually renders — so the only differing variable is `showsMissingPermissionNotice`.</comment>
<file context>
@@ -74,12 +74,30 @@ final class SettingsSidebarItemLayoutTests: XCTestCase {
+ func testPermissionsRowWithMissingNoticeStaysOnOneLine() {
+ let plain = itemHeight(section: .permissions, isSelected: false, showsMissingPermissionNotice: false)
+ let noticed = itemHeight(section: .permissions, isSelected: true, showsMissingPermissionNotice: true)
+ XCTAssertEqual(
+ noticed, plain, accuracy: 0.5,
</file context>
The page always looked like an incident. Granted access is now a compact list, the nav uses a lock with a mark only while something is missing, and Permissions sits with the other access settings. Co-authored-by: Cursor <[email protected]>
Thread appState into the settings sidebar without adding a line the oversized-file freeze would reject. Co-authored-by: Cursor <[email protected]>
The settings-sidebar appState thread landed without growing the file, so the oversized-file freeze has to follow it down. Co-authored-by: Cursor <[email protected]>
…flow The presentation policy lives in its own file now, and the e2e coverage check requires a flow to name it. Co-authored-by: Cursor <[email protected]>
A clone-local user.email minted PR commits as Ratchet Test, so GitHub could not attribute them. Fail those identities at commit and preflight time. Co-authored-by: Cursor <[email protected]>
4316db1 to
e729e44
Compare
* fix(repo): reject Git identities that can never be attributed PR #12239 was authored entirely by `r <r@r>` from a stale clone-local `user.email`. This guard ran on every one of those commits — 66 over five days — and printed "OK: Git author identity is not a test fixture" each time. It was enumerating the previous incident rather than the invariant. After #11525 minted `Ratchet Test <[email protected]>`, the check learned that exact display name, that exact local-part, and three reserved TLDs. `r@r` is none of those, so it passed: `email_tld("r@r")` returns `"r"`, because the domain has no dot to split on. The rule is now the property that makes an identity wrong. An address whose domain cannot resolve can never be delivered or attributed to anyone, whatever it is called. That single predicate covers both incidents and the family they belong to, and it needs no allowlist to maintain. `failures_for` already applied its predicate to clone-local config as well as to the commit range, so one change covers every lane at once: - pre-commit (`--pending`) rejects the override before a commit is minted - the local lane of `git-author-identity` rejects it again before push - the CI lane never sees a developer's `.git/config`, so the commit range is the only unbypassable place this can be caught — and it now is Real addresses, including `users.noreply.github.com`, are untouched; a name-only identity carries an empty email and is not judged on it. The report wording said "test fixture", which is exactly what let a non-fixture bad identity read as a pass. It now says unattributable. Co-Authored-By: Claude Opus 5 <[email protected]> * feat(failure-classes): add FC-guard-encodes-incident-literals The class this PR's fix belongs to, and the reason it took a second incident to notice: a guard written after an incident encoded that incident's literal values instead of the property that made it wrong, so the next instance passed while the check reported success. evidence_prs is empty because this PR is the first instance; the adding commit is the evidence. Co-Authored-By: Claude Opus 5 <[email protected]> --------- Co-authored-by: Claude Opus 5 <[email protected]>
Summary
Test plan
Verification
PermissionsPagePresentationTests,SettingsSidebarItemLayoutTests,FailLoudConfigTests/testPermissionsPageSurfacesSystemAudioRow, and the settings reachability checks inTopNavigationBarLayoutTests./Applications/omi-permissions-ux.app(com.omi.omi-permissions-ux) withOMI_AUTOMATION_PORT=47852 ./scripts/omi-ctl navigate settings permissions.make preflightpassed (20 local checks).Made with Cursor