Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
0430998
feat: move slash commands to settings tab with gear icon for discover…
roomote Sep 15, 2025
46ae66c
feat: simplify slash commands popover and add settings navigation
roomote Sep 15, 2025
bd9a499
ux: Makes text area buttons appear only when there's text (#7987)
brunobergher Sep 15, 2025
a1f8b7d
Removes SlashCommand icon from textarea
brunobergher Sep 15, 2025
f4ab67a
Reorders settings for slash commands
brunobergher Sep 15, 2025
620cf3d
Ensures the gear icon in slash commands goes to the right place in se…
brunobergher Sep 15, 2025
d0ce642
Visual tweaks to make the settings cog work in the slashcommands popo…
brunobergher Sep 15, 2025
690f680
Makes the intro copy for slash commands only appear when there's no s…
brunobergher Sep 15, 2025
6173797
test: add comprehensive test coverage for SlashCommandItemSimple and …
roomote Sep 15, 2025
8801439
fix: corrected C# tree-sitter query (#7813)
mubeen-zulfiqar Sep 15, 2025
05540da
Removes unused components
brunobergher Sep 15, 2025
8041639
Adds translations (including old stuff which had never been localized)
brunobergher Sep 15, 2025
c5df5e4
Merge remote-tracking branch 'origin/main' into feat/slash-commands-s…
mrubens Sep 15, 2025
a09893c
Update webview-ui/src/i18n/locales/ca/chat.json
mrubens Sep 15, 2025
9e86f9a
Update webview-ui/src/i18n/locales/fr/settings.json
mrubens Sep 15, 2025
3eac654
Update webview-ui/src/i18n/locales/ja/chat.json
mrubens Sep 15, 2025
4752dfd
Update webview-ui/src/i18n/locales/nl/chat.json
mrubens Sep 15, 2025
365c817
Update webview-ui/src/i18n/locales/zh-TW/chat.json
mrubens Sep 15, 2025
bb43eb2
Delete webview-ui/src/__tests__/SettingsTabNavigation.spec.tsx
mrubens Sep 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/core/webview/webviewMessageHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2776,7 +2776,12 @@ export const webviewMessageHandler = async (
TelemetryService.instance.captureTabShown(message.tab)
}

await provider.postMessageToWebview({ type: "action", action: "switchTab", tab: message.tab })
await provider.postMessageToWebview({
type: "action",
action: "switchTab",
tab: message.tab,
values: message.values,
})
}
break
}
Expand Down
4 changes: 4 additions & 0 deletions src/i18n/locales/ca/common.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/de/common.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -215,5 +215,9 @@
"preventCompletionWithOpenTodos": {
"description": "Prevent task completion when there are incomplete todos in the todo list"
}
},
"docsLink": {
"label": "Docs",
"url": "https://docs.roocode.com"
}
}
4 changes: 4 additions & 0 deletions src/i18n/locales/es/common.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/fr/common.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/hi/common.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/id/common.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/it/common.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/ja/common.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/ko/common.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/nl/common.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/pl/common.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/pt-BR/common.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/ru/common.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/tr/common.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/vi/common.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/zh-CN/common.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/i18n/locales/zh-TW/common.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion webview-ui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ const App = () => {
if (message.action === "switchTab" && message.tab) {
const targetTab = message.tab as Tab
switchTab(targetTab)
setCurrentSection(undefined)
// Extract targetSection from values if provided
const targetSection = message.values?.section as string | undefined
setCurrentSection(targetSection)
setCurrentMarketplaceTab(undefined)
} else {
// Handle other actions using the mapping
Expand Down
2 changes: 0 additions & 2 deletions webview-ui/src/components/chat/ChatTextArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import { AutoApproveDropdown } from "./AutoApproveDropdown"
import { MAX_IMAGES_PER_MESSAGE } from "./ChatView"
import ContextMenu from "./ContextMenu"
import { IndexingStatusBadge } from "./IndexingStatusBadge"
import { SlashCommandsPopover } from "./SlashCommandsPopover"
import { usePromptHistory } from "./hooks/usePromptHistory"

interface ChatTextAreaProps {
Expand Down Expand Up @@ -1232,7 +1231,6 @@ export const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
</button>
</StandardTooltip>
)}
{!isEditMode ? <SlashCommandsPopover /> : null}
{!isEditMode ? <IndexingStatusBadge /> : null}
<StandardTooltip content={t("chat:addImages")}>
<button
Expand Down
79 changes: 71 additions & 8 deletions webview-ui/src/components/chat/ContextMenu.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useEffect, useMemo, useRef, useState } from "react"
import { getIconForFilePath, getIconUrlByName, getIconForDirectoryPath } from "vscode-material-icons"
import { Settings } from "lucide-react"

import type { ModeConfig } from "@roo-code/types"
import type { Command } from "@roo/ExtensionMessage"
Expand All @@ -11,6 +12,10 @@ import {
SearchResult,
} from "@src/utils/context-mentions"
import { removeLeadingNonAlphanumeric } from "@src/utils/removeLeadingNonAlphanumeric"
import { vscode } from "@src/utils/vscode"
import { buildDocLink } from "@/utils/docLinks"
import { Trans } from "react-i18next"
import { t } from "i18next"

interface ContextMenuProps {
onSelect: (type: ContextMenuOptionType, value?: string) => void
Expand Down Expand Up @@ -77,8 +82,6 @@ const ContextMenu: React.FC<ContextMenuProps> = ({
fontWeight: "bold",
fontSize: "0.85em",
opacity: 0.8,
textTransform: "uppercase",
letterSpacing: "0.5px",
}}>
{option.label}
</span>
Expand Down Expand Up @@ -136,13 +139,13 @@ const ContextMenu: React.FC<ContextMenuProps> = ({
</div>
)
case ContextMenuOptionType.Problems:
return <span>Problems</span>
return <span>{t("chat:contextMenu.problems")}</span>
case ContextMenuOptionType.Terminal:
return <span>Terminal</span>
return <span>{t("chat:contextMenu.terminal")}</span>
case ContextMenuOptionType.URL:
return <span>Paste URL to fetch contents</span>
return <span>{t("chat:contextMenu.url")}</span>
case ContextMenuOptionType.NoResults:
return <span>No results found</span>
return <span>{t("chat:contextMenu.noResults")}</span>
case ContextMenuOptionType.Git:
if (option.value) {
return (
Expand Down Expand Up @@ -251,6 +254,17 @@ const ContextMenu: React.FC<ContextMenuProps> = ({
)
}

const handleSettingsClick = (e: React.MouseEvent) => {
// Prevent any default behavior
e.preventDefault()
// Switch to settings tab and navigate to slash commands section
vscode.postMessage({
type: "switchTab",
tab: "settings",
values: { section: "slashCommands" },
})
}

return (
<div
style={{
Expand All @@ -275,14 +289,63 @@ const ContextMenu: React.FC<ContextMenuProps> = ({
overflowY: "auto",
overflowX: "hidden",
}}>
{/* Settings button for slash commands */}
{searchQuery === "/" && (
<div className="p-2 flex items-start gap-4 justify-between">
{searchQuery.length === 1 && (
<div className="text-sm">
<p className="font-bold text-base text-vscode-foreground mt-1 mb-0.5">Slash Commands</p>
<p className="text-xs mt-0.5 -mb-1">
<Trans
i18nKey="settings:slashCommands.description"
components={{
DocsLink: (
<a
href={buildDocLink(
"features/slash-commands",
"slash_commands_settings",
)}
target="_blank"
rel="noopener noreferrer"
className="text-vscode-textLink-foreground hover:underline">
{t("common:docsLink.label")}
</a>
),
}}
/>
</p>
</div>
)}
<button
className="mt-1 cursor-pointer"
onClick={handleSettingsClick}
onMouseDown={(e) => {
e.stopPropagation()
e.preventDefault()
}}
onMouseEnter={(e) => {
e.currentTarget.style.opacity = "1"
e.currentTarget.style.backgroundColor = "var(--vscode-list-hoverBackground)"
}}
onMouseLeave={(e) => {
e.currentTarget.style.opacity = "0.7"
e.currentTarget.style.backgroundColor = "transparent"
}}
title={t("chat:slashCommands.manageCommands")}>
<Settings size={16} />
</button>
</div>
)}
{filteredOptions && filteredOptions.length > 0 ? (
filteredOptions.map((option, index) => (
<div
key={`${option.type}-${option.value || index}`}
onClick={() => isOptionSelectable(option) && onSelect(option.type, option.value)}
style={{
padding:
option.type === ContextMenuOptionType.SectionHeader ? "8px 6px 4px 6px" : "4px 6px",
option.type === ContextMenuOptionType.SectionHeader
? "16px 8px 4px 8px"
: "4px 8px",
cursor: isOptionSelectable(option) ? "pointer" : "default",
color: "var(--vscode-dropdown-foreground)",
display: "flex",
Expand Down Expand Up @@ -367,7 +430,7 @@ const ContextMenu: React.FC<ContextMenuProps> = ({
color: "var(--vscode-foreground)",
opacity: 0.7,
}}>
<span>No results found</span>
<span>{t("chat:contextMenu.noResults")}</span>
</div>
)}
</div>
Expand Down
28 changes: 28 additions & 0 deletions webview-ui/src/components/chat/SlashCommandItemSimple.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from "react"

import type { Command } from "@roo/ExtensionMessage"

interface SlashCommandItemSimpleProps {
command: Command
onClick?: (command: Command) => void
}

export const SlashCommandItemSimple: React.FC<SlashCommandItemSimpleProps> = ({ command, onClick }) => {
return (
<div
className="px-4 py-2 text-sm flex items-center hover:bg-vscode-list-hoverBackground cursor-pointer"
onClick={() => onClick?.(command)}>
{/* Command name */}
<div className="flex-1 min-w-0">
<div>
<span className="truncate text-vscode-foreground">/{command.name}</span>
{command.description && (
<div className="text-xs text-vscode-descriptionForeground truncate mt-0.5">
{command.description}
</div>
)}
</div>
</div>
</div>
)
}
Loading
Loading