Repository navigation
Clarify macOS access prompt guidance - #11807
Conversation
Greptile SummaryThis PR refines the macOS TCC consent-dialog guidance toast: the title and description now reference the exact system message users see ("Orca would like to access…"), and clicking "Open Settings" now deep-links directly to the Full Disk Access row in the Developer Permissions pane — scrolling it into view and applying a 3-second highlight ring.
Confidence Score: 5/5Safe to merge — changes are purely UI copy and a highlight/scroll deep-link with no data or permission logic touched. The change updates toast copy and adds a transient 3-second highlight ring on the Full Disk Access row when the user arrives via the notice. All paths are well-covered by the new tests: the correct toast title and description are asserted, the navigation target's sectionId is verified, and the highlight data-attribute lifecycle is tested directly. No existing permission-request or state-management logic was modified. Files Needing Attention: No files require special attention.
|
| Filename | Overview |
|---|---|
| src/renderer/src/hooks/useMacosTccPromptNotice.ts | Updates toast title/description to mirror the macOS prompt wording and adds sectionId to the navigation target for direct deep-linking to the Full Disk Access row. |
| src/renderer/src/components/settings/DeveloperPermissionsPane.tsx | Adds highlightedSettingId prop and data-settings-section/data-highlighted attributes to each permission row for scroll targeting and highlight styling; settingId is derived with the same prefix formula as FULL_DISK_ACCESS_SETTINGS_TARGET_ID. |
| src/renderer/src/components/settings/Settings.tsx | Adds highlightedSettingsTargetId state, sets it from sectionId on developer-permissions navigation, auto-clears after 3 s, and passes it down to DeveloperPermissionsPane. |
| src/renderer/src/lib/settings-navigation-types.ts | Exports FULL_DISK_ACCESS_SETTINGS_TARGET_ID as the shared constant for the full-disk-access permission row ID. |
| src/renderer/src/hooks/useMacosTccPromptNotice.test.tsx | Extends tests to assert the new toast copy and that opening Settings sets the navigation target with the correct sectionId. |
| src/renderer/src/components/settings/DeveloperPermissionsPane.test.tsx | New test file verifying that the Full Disk Access row receives data-highlighted="true" when the matching highlightedSettingId prop is passed, and the attribute is absent when the prop is null. |
| src/renderer/src/i18n/locales/en.json | Updates the English catalog strings for the TCC notice to match the new copy in the hook. |
Reviews (2): Last reviewed commit: "Make settings target highlight visible" | Re-trigger Greptile
📝 WalkthroughWalkthroughThe macOS TCC notice now explains the protected-file access prompt and directs navigation to Full Disk Access. Settings tracks the selected developer-permissions target and clears its highlight after three seconds. Developer Permissions assigns stable identifiers to permission rows and applies temporary highlight styling to the selected row. Tests cover notice content, navigation arguments, row highlighting, and highlight removal. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1ada204c-4c35-4e0a-9d94-b2c465281698
📒 Files selected for processing (7)
src/renderer/src/components/settings/DeveloperPermissionsPane.test.tsxsrc/renderer/src/components/settings/DeveloperPermissionsPane.tsxsrc/renderer/src/components/settings/Settings.tsxsrc/renderer/src/hooks/useMacosTccPromptNotice.test.tsxsrc/renderer/src/hooks/useMacosTccPromptNotice.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/lib/settings-navigation-types.ts
| setHighlightedSettingsTargetId( | ||
| settingsNavigationTarget.pane === 'developer-permissions' | ||
| ? (settingsNavigationTarget.sectionId ?? null) | ||
| : null | ||
| ) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Locate Settings.tsx =="
fd -a 'Settings\.tsx$' . || true
echo "== Relevant settings highlight snippets =="
file="$(fd 'Settings\.tsx$' . | head -n 1)"
if [ -n "${file:-}" ]; then
wc -l "$file"
echo "-- lines 420-475 --"
sed -n '420,475p' "$file" | nl -ba -v420
echo "-- lines 650-690 --"
sed -n '650,690p' "$file" | nl -ba -v650
echo "-- DeveloperPermissionsPane highlightedSettingId usages around --"
rg -n "highlightedSettingId|highlightedSettingsTargetId|DEV|SETTINGS_TARGET_HIGHLIGHT_MS|developer-permissions" "$file" -C 2
fiRepository: stablyai/orca
Length of output: 477
🏁 Script executed:
#!/bin/bash
set -euo pipefail
file="src/renderer/src/components/settings/Settings.tsx"
echo "== file size =="
wc -l "$file"
echo "-- lines 420-475 --"
sed -n '420,475p' "$file"
echo "-- lines 650-695 --"
sed -n '650,695p' "$file"
echo "-- focused usages in Settings.tsx --"
rg -n "highlightedSettingId|highlightedSettingsTargetId|SETTINGS_TARGET_HIGHLIGHT_MS|developer-permissions|settingsNavigationTarget|setHighlightedSettingsTarget" "$file" -C 2Repository: stablyai/orca
Length of output: 8193
🌐 Web query:
React documentation updates with the same state value effect not rerun set state
💡 Result:
When you update a React state hook with a value that is identical to the current state, as determined by an Object.is comparison, React will bail out of the update process [1][2]. This is a performance optimization designed to avoid unnecessary work [1][3]. In this scenario: - React will skip re-rendering the component and its children [1][4]. - React will not fire any effects (e.g., those managed by useEffect) [5][2]. It is important to note a technical nuance: while React attempts to skip re-rendering, it may still need to invoke your component function in certain cases (for example, to verify the state or handle concurrency) [1][6]. However, even if the component function is called, React will detect that the state has not changed and will not proceed to update the DOM, recurse to children, or execute side effects [1][5][3]. This behavior is consistent across both modern and legacy React documentation [2][4]. If you are using mutable objects or arrays, ensure you are creating a new reference when updating state; if you provide a new reference that is deeply equal to the previous one, React will still trigger a re-render because Object.is performs a shallow comparison [7][4].
Citations:
- 1: https://react.dev/reference/react/useState
- 2: https://legacy.reactjs.org/docs/hooks-reference.html
- 3: https://stackoverflow.com/questions/76690924/react-component-re-renders-after-setting-state-to-the-same-value
- 4: https://az.react.dev/reference/react/useState
- 5: Hooks bug it re-renders when calling setX for the same value react/react#14810
- 6: Hooks: Calling setState with the SAME value multiple times, evaluates the component function up-to 2 times react/react#17474
- 7: https://stackoverflow.com/questions/59489959/set-state-with-same-value-using-hooks-will-cause-a-rerender
🌐 Web query:
React documentation updates with the same state value effect not rerun set state developer.perms
💡 Result:
When you call a React state setter function with a value identical to the current state (as determined by an Object.is comparison), React will "bail out" of the update [1][2]. This means React will skip re-rendering the component and its children, and will not fire effects [1][2]. However, there is an important nuance regarding component function execution: React may still invoke your component function one additional time to confirm that the state update truly results in no changes before it fully bails out [1][2][3]. This typically happens if the state was previously changed to a new value and then set to that same value again [4]. Once React confirms the values are identical, subsequent calls to the state setter with that same value will not trigger further component function invocations [5][4]. To prevent unnecessary work, if you know the value hasn't changed, you can add a conditional check before calling the setter [6]: if (value!== currentState) { setValue(value); } In summary, while React optimizes performance by skipping the re-render of children and the firing of effects when the state value remains unchanged, you may occasionally observe the component function running again to verify the state before the bail-out occurs [1][5][3].
Citations:
- 1: https://react.dev/reference/react/useState
- 2: https://uk.react.dev/reference/react/useState
- 3: Hooks bug it re-renders when calling setX for the same value react/react#14810
- 4: Hooks: Calling setState with the SAME value multiple times, evaluates the component function up-to 2 times react/react#17474
- 5: https://stackoverflow.com/questions/70210728/react-usestate-reruns-the-component-function-on-no-change
- 6: https://stackoverflow.com/questions/77453742/why-is-the-component-rerendering-after-setting-state
Restart the highlight timer for repeated navigation.
A second navigation to the same developer-permissions sectionId can pass the same value to setHighlightedSettingsTargetId and skip state/effects updates. The original highlight timeout may then clear the row before the full 3 seconds.
Reset the highlight timeout or store a new navigation token when the target repeats.
* Clarify macOS access prompt guidance * Make settings target highlight visible
…yai#11821) This reverts commit 434acaa.
Summary
Follow-up to #11716.
Copy before and after
Validation
Screenshots
Clarified toast message
Full Disk Access target and highlight