Skip to content

feat(settings): nudge when runtime permissions aren't all granted#120

Merged
StuBehan merged 1 commit into
mainfrom
feat/settings-permissions-nudge
Jul 3, 2026
Merged

feat(settings): nudge when runtime permissions aren't all granted#120
StuBehan merged 1 commit into
mainfrom
feat/settings-permissions-nudge

Conversation

@StuBehan

@StuBehan StuBehan commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Problem

When a runtime grant (Accessibility, Automation → System Events, or Notifications) isn't set, StackNudge silently loses core behaviour — no banner, no window focus, no Enter-to-approve keystroke — with nothing in the panel to say why. The only way to notice was to open Settings → Check permissions… and look.

Changes

Surfaces missing permissions the same way updates already are — an at-a-glance dot plus a pinned banner:

  • Orange dot on the Settings tab. tab() now takes dotColor: Color? instead of dot: Bool; the Settings tab shows orange when a grant is missing, the existing accent dot when only an update is pending (permissions win the colour — they're more urgent).
  • permissionsRow() banner pinned above the Settings sections when any grant is missing. Lists which ones (e.g. "Accessibility, Automation") and, like the update row, is keyboard-navigable — selecting + Enter (or a click) opens the Permissions window.
  • State + refresh on PanelNav: missingPermissions: [SettingsPane] and refreshPermissions() (Accessibility/Automation probed sync, Notifications async). Both denied and not-yet-determined count as missing. Refreshed on launch and on every Settings open, so the dot + banner clear once the user grants and comes back.
  • Fix: updateRow hardcoded .id(0) / selectedSettingIndex = 0, assuming it was always the first row. Now uses nav.index(of: .update) so it survives the permissions row sitting above it.

Testing

  • swiftc -typecheck panel/*.swift shared/*.swift — clean.
  • Added test_permissionsRow_prependedWhenMissing and test_permissionsRow_sitsAboveUpdate_whenBothPresent to SettingsRowTests.
  • Verified live: revoking a grant shows the orange dot + banner; granting and returning to Settings clears both.

Follow-ups (not in this PR)

  • The banner is a static list; it doesn't yet distinguish denied from not-yet-determined in the copy (both read the same).

🤖 Generated with Claude Code

Surface missing Accessibility / Automation / Notifications grants the
same way updates are surfaced: an orange dot on the Settings tab and a
keyboard-navigable banner pinned above the Settings sections that opens
the Permissions window. Both denied and not-yet-determined count as
missing. Refreshed on launch and every Settings open so the nudge clears
once the user grants and returns.

Also fixes updateRow's hardcoded index-0 assumption so it survives the
permissions row sitting above it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@StuBehan StuBehan merged commit 3233f6f into main Jul 3, 2026
6 checks passed
@StuBehan StuBehan deleted the feat/settings-permissions-nudge branch July 3, 2026 12:36
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.

2 participants