Skip to content

fix(notifications): phrase permission labels without losing acronyms - #466

Merged
chriswritescode-dev merged 1 commit into
mainfrom
fix/permission-phrase-wording
Oct 25, 2026
Merged

chriswritescode-dev merged 1 commit into
mainfrom
fix/permission-phrase-wording

Conversation

@chriswritescode-dev

@chriswritescode-dev chriswritescode-dev commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

What

Two wording bugs in permission prompts:

  • The always-allow summary for a * scope interpolated the raw action id: "This will always allow shell for this project.", while the question above it says "Allow run command?".
  • The PWA permission dialog lowercased the whole label, so acronyms broke: "Allow fetch url?".

Change

  • shared/src/notifications/format.ts: new getPermissionPhrase(action) lowercases each word of getPermissionLabel(action) unless the word is all caps ("Run Command" → "run command", "Fetch URL" → "fetch URL"). getPermissionAlwaysScope uses it for the wildcard summary ("This will always allow run command for this project.").
  • frontend/src/components/session/PermissionRequestDialog.tsx: the question uses getPermissionPhrase instead of typeLabel.toLowerCase(). This was the only whole-label lowercasing call site; the heading badge still shows the capitalized label.

Tests

  • backend/test/services/notification-format.test.ts: getPermissionPhrase cases (multi-word, acronym, empty action, unknown action) and updated wildcard-scope expectations. The shared package has no test runner, and this file already covers the notification formatters.
  • frontend/src/components/session/PermissionRequestDialog.test.tsx: updated wildcard summary and a phrasing test for "Allow run command?" / "Allow fetch URL?".

Validation

  • pnpm --filter @opencode-manager/shared typecheck: clean
  • pnpm --filter backend exec vitest run test/services/notification-format.test.ts: 41 passed
  • pnpm --filter frontend exec vitest run src/components/session src/components/navigation src/App.permission-dialog.test.tsx src/contexts/EventContext.test.tsx: 30 files, 618 tests passed
  • pnpm --filter frontend typecheck: clean
  • eslint on the changed files: clean

Follow-up

The mobile app (ocmgr-mobile) carries a local copy of this phrasing helper until its @opencode-manager/shared dependency is updated past this change; it will then switch to getPermissionPhrase and pick up the corrected scope summary.

Summary by CodeRabbit

  • Bug Fixes
    • Permission prompts now use clearer, lowercase action wording while preserving capitalization for acronyms such as “URL.”
    • Wildcard permission summaries now display readable action phrases, such as “run command” and “fetch URL,” instead of raw action names.

The always-allow summary interpolated the raw action id ("always allow
shell") while every other surface shows the label ("Run Command"), and
the permission dialog lowercased the whole label, turning "Fetch URL"
into "fetch url". getPermissionPhrase lowercases each word of the label
unless it is all caps, and both the scope summary and the dialog
question use it.
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 804916e8-a219-4b18-b854-848f716cc203
Commits

Reviewing files that changed from the base of the PR and between 11a2661 and 8747cfe.

Files selected for processing: 4
  • backend/test/services/notification-format.test.ts
  • frontend/src/components/session/PermissionRequestDialog.test.tsx
  • frontend/src/components/session/PermissionRequestDialog.tsx
  • shared/src/notifications/format.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.

Walkthrough

The shared notification formatter now provides human-readable permission phrases. Wildcard summaries and permission request questions use these phrases, with fully uppercase words preserved.

Changes: Permission phrase formatting

Layer / File(s) Summary
Format phrases and wildcard summaries
shared/src/notifications/format.ts, backend/test/services/notification-format.test.ts
The shared formatter lowercases non-uppercase words while preserving fully uppercase words. Wildcard summaries use the formatted phrase. Backend tests cover known labels, empty actions, unknown actions, and wildcard summary text.
Use formatted phrases in permission prompts
frontend/src/components/session/PermissionRequestDialog.tsx, frontend/src/components/session/PermissionRequestDialog.test.tsx
The dialog question uses the shared formatter. Frontend tests check shell and webfetch wording and the wildcard scope text.

Priority: Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Merge Risk: Minimal · up to 8747c

The permission wording changes are mergeable with normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title names the main change: permission labels are phrased without losing acronyms, which matches the new getPermissionPhrase helper and the dialog/summary wording changes. It is specific, uses th…
Description check Passed The description covers the problem (raw action id in the wildcard always-allow summary and whole-label lowercasing in the PWA dialog), the change, tests, and validation results. It does not select a '…
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: Title check

Explanation

The title names the main change: permission labels are phrased without losing acronyms, which matches the new getPermissionPhrase helper and the dialog/summary wording changes. It is specific, uses the conventional commit prefix, and is 68 characters long.

Full details: Description check

Explanation

The description covers the problem (raw action id in the wildcard always-allow summary and whole-label lowercasing in the PWA dialog), the change, tests, and validation results. It does not select a 'Type of Change' box and does not tick the template checklist items, and it has no 'Summary' heading content beyond '## What'. The 'Code follows project style' and lint/typecheck items are partly reported in Validation, but the template checkboxes are unchecked. The core information is present, so the description is mostly complete.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@chriswritescode-dev
chriswritescode-dev merged commit 7ec2bde into main Oct 25, 2026
2 checks passed
@chriswritescode-dev
chriswritescode-dev deleted the fix/permission-phrase-wording branch October 25, 2026 20:44
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.

1 participant