Repository navigation
fix(notifications): phrase permission labels without losing acronyms - #466
Merged
Merged
Conversation
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.
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two wording bugs in permission prompts:
*scope interpolated the raw action id: "This will always allow shell for this project.", while the question above it says "Allow run command?".Change
shared/src/notifications/format.ts: newgetPermissionPhrase(action)lowercases each word ofgetPermissionLabel(action)unless the word is all caps ("Run Command" → "run command", "Fetch URL" → "fetch URL").getPermissionAlwaysScopeuses it for the wildcard summary ("This will always allow run command for this project.").frontend/src/components/session/PermissionRequestDialog.tsx: the question usesgetPermissionPhraseinstead oftypeLabel.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:getPermissionPhrasecases (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: cleanpnpm --filter backend exec vitest run test/services/notification-format.test.ts: 41 passedpnpm --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 passedpnpm --filter frontend typecheck: cleanFollow-up
The mobile app (ocmgr-mobile) carries a local copy of this phrasing helper until its
@opencode-manager/shareddependency is updated past this change; it will then switch togetPermissionPhraseand pick up the corrected scope summary.Summary by CodeRabbit