Skip to content

Commit 77bc9e6

Browse files
committed
fix: remove 'Full command' description and use correct translation keys
- Removed the 'Full command' description from the first pattern - Updated translation keys to use existing ones from chat.json - Fixed tooltip to use Trans component with settings link - Updated tests to match the changes
1 parent 851617c commit 77bc9e6

File tree

2 files changed

+18
-26
lines changed

2 files changed

+18
-26
lines changed

webview-ui/src/components/chat/CommandPatternSelector.tsx

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const CommandPatternSelector: React.FC<CommandPatternSelectorProps> = ({
3333

3434
// Create a combined list with full command first, then patterns
3535
const allPatterns = useMemo(() => {
36-
const fullCommandPattern = { pattern: command, description: "Full command" }
36+
const fullCommandPattern: CommandPattern = { pattern: command }
3737
return [fullCommandPattern, ...patterns]
3838
}, [command, patterns])
3939

@@ -65,37 +65,30 @@ export const CommandPatternSelector: React.FC<CommandPatternSelectorProps> = ({
6565
"-rotate-90": !isExpanded,
6666
})}
6767
/>
68-
<span className="text-sm font-medium">{t("chat:commandExecution.commandPermissions")}</span>
68+
<span className="text-sm font-medium">{t("chat:commandExecution.manageCommands")}</span>
6969
<StandardTooltip
7070
content={
71-
<div className="space-y-2 max-w-xs">
72-
<p>{t("chat:commandExecution.permissionsTooltip")}</p>
73-
<p>
74-
<Trans
75-
i18nKey="chat:commandExecution.learnMore"
76-
components={{
77-
link: (
78-
<VSCodeLink
79-
href="https://docs.roo-code.com/features/command-permissions"
80-
className="text-vscode-textLink-foreground hover:text-vscode-textLink-activeForeground"
81-
/>
82-
),
83-
}}
84-
/>
85-
</p>
71+
<div className="max-w-xs">
72+
<Trans
73+
i18nKey="chat:commandExecution.commandManagementDescription"
74+
components={{
75+
settingsLink: (
76+
<VSCodeLink
77+
href="command:workbench.action.openSettings?%5B%22roo-code%22%5D"
78+
className="text-vscode-textLink-foreground hover:text-vscode-textLink-activeForeground"
79+
/>
80+
),
81+
}}
82+
/>
8683
</div>
8784
}>
8885
<Info className="size-3.5 text-vscode-descriptionForeground" />
8986
</StandardTooltip>
9087
</div>
9188
<div className="flex items-center gap-2 text-xs text-vscode-descriptionForeground">
92-
<span>
93-
{allowedCommands.length} {t("chat:commandExecution.allowed")}
94-
</span>
89+
<span>{allowedCommands.length} allowed</span>
9590
<span></span>
96-
<span>
97-
{deniedCommands.length} {t("chat:commandExecution.denied")}
98-
</span>
91+
<span>{deniedCommands.length} denied</span>
9992
</div>
10093
</button>
10194

webview-ui/src/components/chat/__tests__/CommandPatternSelector.spec.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ describe("CommandPatternSelector", () => {
4848
expect(container).toBeTruthy()
4949

5050
// Check for the command permissions text
51-
expect(screen.getByText("chat:commandExecution.commandPermissions")).toBeInTheDocument()
51+
expect(screen.getByText("chat:commandExecution.manageCommands")).toBeInTheDocument()
5252
})
5353

5454
it("should show full command as first pattern when expanded", () => {
@@ -62,9 +62,8 @@ describe("CommandPatternSelector", () => {
6262
const expandButton = screen.getByRole("button")
6363
fireEvent.click(expandButton)
6464

65-
// Check that the full command is shown with description
65+
// Check that the full command is shown
6666
expect(screen.getByText("npm install express")).toBeInTheDocument()
67-
expect(screen.getByText("- Full command")).toBeInTheDocument()
6867
})
6968

7069
it("should show extracted patterns when expanded", () => {

0 commit comments

Comments
 (0)