mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
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
This commit is contained in:
parent
851617c0ff
commit
77bc9e6f92
2 changed files with 18 additions and 26 deletions
|
|
@ -33,7 +33,7 @@ export const CommandPatternSelector: React.FC<CommandPatternSelectorProps> = ({
|
||||||
|
|
||||||
// Create a combined list with full command first, then patterns
|
// Create a combined list with full command first, then patterns
|
||||||
const allPatterns = useMemo(() => {
|
const allPatterns = useMemo(() => {
|
||||||
const fullCommandPattern = { pattern: command, description: "Full command" }
|
const fullCommandPattern: CommandPattern = { pattern: command }
|
||||||
return [fullCommandPattern, ...patterns]
|
return [fullCommandPattern, ...patterns]
|
||||||
}, [command, patterns])
|
}, [command, patterns])
|
||||||
|
|
||||||
|
|
@ -65,37 +65,30 @@ export const CommandPatternSelector: React.FC<CommandPatternSelectorProps> = ({
|
||||||
"-rotate-90": !isExpanded,
|
"-rotate-90": !isExpanded,
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
<span className="text-sm font-medium">{t("chat:commandExecution.commandPermissions")}</span>
|
<span className="text-sm font-medium">{t("chat:commandExecution.manageCommands")}</span>
|
||||||
<StandardTooltip
|
<StandardTooltip
|
||||||
content={
|
content={
|
||||||
<div className="space-y-2 max-w-xs">
|
<div className="max-w-xs">
|
||||||
<p>{t("chat:commandExecution.permissionsTooltip")}</p>
|
<Trans
|
||||||
<p>
|
i18nKey="chat:commandExecution.commandManagementDescription"
|
||||||
<Trans
|
components={{
|
||||||
i18nKey="chat:commandExecution.learnMore"
|
settingsLink: (
|
||||||
components={{
|
<VSCodeLink
|
||||||
link: (
|
href="command:workbench.action.openSettings?%5B%22roo-code%22%5D"
|
||||||
<VSCodeLink
|
className="text-vscode-textLink-foreground hover:text-vscode-textLink-activeForeground"
|
||||||
href="https://docs.roo-code.com/features/command-permissions"
|
/>
|
||||||
className="text-vscode-textLink-foreground hover:text-vscode-textLink-activeForeground"
|
),
|
||||||
/>
|
}}
|
||||||
),
|
/>
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
}>
|
}>
|
||||||
<Info className="size-3.5 text-vscode-descriptionForeground" />
|
<Info className="size-3.5 text-vscode-descriptionForeground" />
|
||||||
</StandardTooltip>
|
</StandardTooltip>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center gap-2 text-xs text-vscode-descriptionForeground">
|
<div className="flex items-center gap-2 text-xs text-vscode-descriptionForeground">
|
||||||
<span>
|
<span>{allowedCommands.length} allowed</span>
|
||||||
{allowedCommands.length} {t("chat:commandExecution.allowed")}
|
|
||||||
</span>
|
|
||||||
<span>•</span>
|
<span>•</span>
|
||||||
<span>
|
<span>{deniedCommands.length} denied</span>
|
||||||
{deniedCommands.length} {t("chat:commandExecution.denied")}
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ describe("CommandPatternSelector", () => {
|
||||||
expect(container).toBeTruthy()
|
expect(container).toBeTruthy()
|
||||||
|
|
||||||
// Check for the command permissions text
|
// Check for the command permissions text
|
||||||
expect(screen.getByText("chat:commandExecution.commandPermissions")).toBeInTheDocument()
|
expect(screen.getByText("chat:commandExecution.manageCommands")).toBeInTheDocument()
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should show full command as first pattern when expanded", () => {
|
it("should show full command as first pattern when expanded", () => {
|
||||||
|
|
@ -62,9 +62,8 @@ describe("CommandPatternSelector", () => {
|
||||||
const expandButton = screen.getByRole("button")
|
const expandButton = screen.getByRole("button")
|
||||||
fireEvent.click(expandButton)
|
fireEvent.click(expandButton)
|
||||||
|
|
||||||
// Check that the full command is shown with description
|
// Check that the full command is shown
|
||||||
expect(screen.getByText("npm install express")).toBeInTheDocument()
|
expect(screen.getByText("npm install express")).toBeInTheDocument()
|
||||||
expect(screen.getByText("- Full command")).toBeInTheDocument()
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should show extracted patterns when expanded", () => {
|
it("should show extracted patterns when expanded", () => {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue