Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions src/core/webview/ClineProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1242,6 +1242,7 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
telemetrySetting,
showRooIgnoredFiles,
language,
showGreeting,
maxReadFileLine,
} = await this.getState()

Expand Down Expand Up @@ -1323,6 +1324,7 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
renderContext: this.renderContext,
maxReadFileLine: maxReadFileLine ?? 500,
settingsImportedAt: this.settingsImportedAt,
showGreeting: showGreeting ?? true, // Ensure showGreeting is included in the returned state
}
}

Expand Down Expand Up @@ -1410,6 +1412,7 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
telemetrySetting: stateValues.telemetrySetting || "unset",
showRooIgnoredFiles: stateValues.showRooIgnoredFiles ?? true,
maxReadFileLine: stateValues.maxReadFileLine ?? 500,
showGreeting: stateValues.showGreeting ?? true, // Ensure showGreeting is returned by getState
}
}

Expand Down
5 changes: 5 additions & 0 deletions src/core/webview/webviewMessageHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,11 @@ export const webviewMessageHandler = async (provider: ClineProvider, message: We
await updateGlobalState("diffEnabled", diffEnabled)
await provider.postStateToWebview()
break
case "showGreeting":
const showGreeting = message.bool ?? true
await updateGlobalState("showGreeting", showGreeting)
await provider.postStateToWebview()
break
case "enableCheckpoints":
const enableCheckpoints = message.bool ?? true
await updateGlobalState("enableCheckpoints", enableCheckpoints)
Expand Down
1 change: 1 addition & 0 deletions src/exports/roo-code.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ type GlobalSettings = {
cachedChromeHostUrl?: string | undefined
enableCheckpoints?: boolean | undefined
checkpointStorage?: ("task" | "workspace") | undefined
showGreeting?: boolean | undefined
ttsEnabled?: boolean | undefined
ttsSpeed?: number | undefined
soundEnabled?: boolean | undefined
Expand Down
1 change: 1 addition & 0 deletions src/exports/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ type GlobalSettings = {
cachedChromeHostUrl?: string | undefined
enableCheckpoints?: boolean | undefined
checkpointStorage?: ("task" | "workspace") | undefined
showGreeting?: boolean | undefined
ttsEnabled?: boolean | undefined
ttsSpeed?: number | undefined
soundEnabled?: boolean | undefined
Expand Down
4 changes: 4 additions & 0 deletions src/schemas/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,8 @@ export const globalSettingsSchema = z.object({
enableCheckpoints: z.boolean().optional(),
checkpointStorage: checkpointStoragesSchema.optional(),

showGreeting: z.boolean().optional(),

ttsEnabled: z.boolean().optional(),
ttsSpeed: z.number().optional(),
soundEnabled: z.boolean().optional(),
Expand Down Expand Up @@ -608,6 +610,8 @@ const globalSettingsRecord: GlobalSettingsRecord = {
enableCheckpoints: undefined,
checkpointStorage: undefined,

showGreeting: undefined,

ttsEnabled: undefined,
ttsSpeed: undefined,
soundEnabled: undefined,
Expand Down
1 change: 1 addition & 0 deletions src/shared/ExtensionMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export type ExtensionState = Pick<
| "remoteBrowserHost"
// | "enableCheckpoints" // Optional in GlobalSettings, required here.
// | "checkpointStorage" // Optional in GlobalSettings, required here.
| "showGreeting"
| "ttsEnabled"
| "ttsSpeed"
| "soundEnabled"
Expand Down
1 change: 1 addition & 0 deletions src/shared/WebviewMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export interface WebviewMessage {
| "maxReadFileLine"
| "searchFiles"
| "toggleApiConfigPin"
| "showGreeting"
text?: string
disabled?: boolean
askResponse?: ClineAskResponse
Expand Down
12 changes: 7 additions & 5 deletions webview-ui/src/components/chat/ChatView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
alwaysAllowSubtasks,
customModes,
telemetrySetting,
showGreeting,
} = useExtensionState()

//const task = messages.length > 0 ? (messages[0].say === "task" ? messages[0] : undefined) : undefined) : undefined
Expand All @@ -95,7 +96,6 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
const [showScrollToBottom, setShowScrollToBottom] = useState(false)
const [isAtBottom, setIsAtBottom] = useState(false)
const lastTtsRef = useRef<string>("")

const [wasStreaming, setWasStreaming] = useState<boolean>(false)
const [showCheckpointWarning, setShowCheckpointWarning] = useState<boolean>(false)

Expand Down Expand Up @@ -1207,10 +1207,12 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
}}>
{telemetrySetting === "unset" && <TelemetryBanner />}
{showAnnouncement && <Announcement version={version} hideAnnouncement={hideAnnouncement} />}
<div style={{ padding: "0 20px", flexShrink: 0 }}>
<h2>{t("chat:greeting")}</h2>
<p>{t("chat:aboutMe")}</p>
</div>
{showGreeting === true && (
<div style={{ padding: "0 20px", flexShrink: 0 }}>
<h2>{t("chat:greeting")}</h2>
<p>{t("chat:aboutMe")}</p>
</div>
)}
{taskHistory.length > 0 && <HistoryPreview showHistoryView={showHistoryView} />}
</div>
)}
Expand Down
40 changes: 40 additions & 0 deletions webview-ui/src/components/settings/InterfaceSettings.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { HTMLAttributes } from "react"
import { useAppTranslation } from "@/i18n/TranslationContext"
import { VSCodeCheckbox } from "@vscode/webview-ui-toolkit/react"
import { Monitor } from "lucide-react"

import { SetCachedStateField } from "./types"
import { SectionHeader } from "./SectionHeader"
import { Section } from "./Section"

type InterfaceSettingsProps = HTMLAttributes<HTMLDivElement> & {
showGreeting?: boolean
setCachedStateField: SetCachedStateField<"showGreeting">
}

export const InterfaceSettings = ({ showGreeting, setCachedStateField, ...props }: InterfaceSettingsProps) => {
const { t } = useAppTranslation()
return (
<div {...props}>
<SectionHeader>
<div className="flex items-center gap-2">
<Monitor className="w-4" />
<div>{t("settings:sections.interface")}</div>
</div>
</SectionHeader>

<Section>
<div>
<VSCodeCheckbox
checked={showGreeting}
onChange={(e: any) => setCachedStateField("showGreeting", e.target.checked)}>
<span className="font-medium">{t("settings:interface.showgreeting.label")}</span>
</VSCodeCheckbox>
<div className="text-vscode-descriptionForeground text-sm mt-1">
{t("settings:interface.showgreeting.description")}
</div>
</div>
</Section>
</div>
)
}
12 changes: 12 additions & 0 deletions webview-ui/src/components/settings/SettingsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
Globe,
Info,
LucideIcon,
Monitor,
} from "lucide-react"
import { CaretSortIcon } from "@radix-ui/react-icons"

Expand Down Expand Up @@ -47,6 +48,7 @@ import ApiOptions from "./ApiOptions"
import { AutoApproveSettings } from "./AutoApproveSettings"
import { BrowserSettings } from "./BrowserSettings"
import { CheckpointSettings } from "./CheckpointSettings"
import { InterfaceSettings } from "./InterfaceSettings"
import { NotificationSettings } from "./NotificationSettings"
import { ContextManagementSettings } from "./ContextManagementSettings"
import { TerminalSettings } from "./TerminalSettings"
Expand All @@ -65,6 +67,7 @@ const sectionNames = [
"autoApprove",
"browser",
"checkpoints",
"interface",
"notifications",
"contextManagement",
"terminal",
Expand Down Expand Up @@ -139,6 +142,7 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone, t
showRooIgnoredFiles,
remoteBrowserEnabled,
maxReadFileLine,
showGreeting,
} = cachedState

// Make sure apiConfiguration is initialized and managed by SettingsView.
Expand Down Expand Up @@ -262,6 +266,7 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone, t
vscode.postMessage({ type: "alwaysAllowSubtasks", bool: alwaysAllowSubtasks })
vscode.postMessage({ type: "upsertApiConfiguration", text: currentApiConfigName, apiConfiguration })
vscode.postMessage({ type: "telemetrySetting", text: telemetrySetting })
vscode.postMessage({ type: "showGreeting", bool: showGreeting })
setChangeDetected(false)
}
}
Expand Down Expand Up @@ -290,6 +295,7 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone, t
const autoApproveRef = useRef<HTMLDivElement>(null)
const browserRef = useRef<HTMLDivElement>(null)
const checkpointsRef = useRef<HTMLDivElement>(null)
const interfaceRef = useRef<HTMLDivElement>(null)
const notificationsRef = useRef<HTMLDivElement>(null)
const contextManagementRef = useRef<HTMLDivElement>(null)
const terminalRef = useRef<HTMLDivElement>(null)
Expand All @@ -304,6 +310,7 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone, t
{ id: "autoApprove", icon: CheckCheck, ref: autoApproveRef },
{ id: "browser", icon: SquareMousePointer, ref: browserRef },
{ id: "checkpoints", icon: GitBranch, ref: checkpointsRef },
{ id: "interface", icon: Monitor, ref: interfaceRef },
{ id: "notifications", icon: Bell, ref: notificationsRef },
{ id: "contextManagement", icon: Database, ref: contextManagementRef },
{ id: "terminal", icon: SquareTerminal, ref: terminalRef },
Expand All @@ -317,6 +324,7 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone, t
autoApproveRef,
browserRef,
checkpointsRef,
interfaceRef,
notificationsRef,
contextManagementRef,
terminalRef,
Expand Down Expand Up @@ -469,6 +477,10 @@ const SettingsView = forwardRef<SettingsViewRef, SettingsViewProps>(({ onDone, t
/>
</div>

<div ref={interfaceRef}>
<InterfaceSettings showGreeting={showGreeting} setCachedStateField={setCachedStateField} />
</div>

<div ref={notificationsRef}>
<NotificationSettings
ttsEnabled={ttsEnabled}
Expand Down
3 changes: 3 additions & 0 deletions webview-ui/src/context/ExtensionStateContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export interface ExtensionStateContextType extends ExtensionState {
pinnedApiConfigs?: Record<string, boolean>
setPinnedApiConfigs: (value: Record<string, boolean>) => void
togglePinnedApiConfig: (configName: string) => void
setShowGreeting: (value: boolean) => void
}

export const ExtensionStateContext = createContext<ExtensionStateContextType | undefined>(undefined)
Expand Down Expand Up @@ -123,6 +124,7 @@ export const ExtensionStateContextProvider: React.FC<{ children: React.ReactNode
clineMessages: [],
taskHistory: [],
shouldShowAnnouncement: false,
showGreeting: true,
allowedCommands: [],
soundEnabled: false,
soundVolume: 0.5,
Expand Down Expand Up @@ -316,6 +318,7 @@ export const ExtensionStateContextProvider: React.FC<{ children: React.ReactNode
setAwsUsePromptCache: (value) => setState((prevState) => ({ ...prevState, awsUsePromptCache: value })),
setMaxReadFileLine: (value) => setState((prevState) => ({ ...prevState, maxReadFileLine: value })),
setPinnedApiConfigs: (value) => setState((prevState) => ({ ...prevState, pinnedApiConfigs: value })),
setShowGreeting: (value) => setState((prevState) => ({ ...prevState, showGreeting: value })),
togglePinnedApiConfig: (configId) =>
setState((prevState) => {
const currentPinned = prevState.pinnedApiConfigs || {}
Expand Down
9 changes: 8 additions & 1 deletion webview-ui/src/i18n/locales/ca/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"advanced": "Avançat",
"experimental": "Funcions experimentals",
"language": "Idioma",
"about": "Sobre Roo Code"
"about": "Sobre Roo Code",
"interface": "Interfície"
},
"autoApprove": {
"description": "Permet que Roo realitzi operacions automàticament sense requerir aprovació. Activeu aquesta configuració només si confieu plenament en la IA i enteneu els riscos de seguretat associats.",
Expand Down Expand Up @@ -470,5 +471,11 @@
"labels": {
"customArn": "ARN personalitzat",
"useCustomArn": "Utilitza ARN personalitzat..."
},
"interface": {
"showgreeting": {
"label": "Mostrar missatge de benvinguda",
"description": "Quan està activat, Roo mostrarà un missatge de benvinguda i introducció."
}
}
}
9 changes: 8 additions & 1 deletion webview-ui/src/i18n/locales/de/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"advanced": "Erweitert",
"experimental": "Experimentelle Funktionen",
"language": "Sprache",
"about": "Über Roo Code"
"about": "Über Roo Code",
"interface": "Oberfläche"
},
"autoApprove": {
"description": "Erlaubt Roo, Operationen automatisch ohne Genehmigung durchzuführen. Aktiviere diese Einstellungen nur, wenn du der KI vollständig vertraust und die damit verbundenen Sicherheitsrisiken verstehst.",
Expand Down Expand Up @@ -470,5 +471,11 @@
"labels": {
"customArn": "Benutzerdefinierte ARN",
"useCustomArn": "Benutzerdefinierte ARN verwenden..."
},
"interface": {
"showgreeting": {
"label": "Begrüßungsnachricht anzeigen",
"description": "Wenn aktiviert, zeigt Roo eine Willkommensnachricht und Einführung an."
}
}
}
9 changes: 8 additions & 1 deletion webview-ui/src/i18n/locales/en/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"advanced": "Advanced",
"experimental": "Experimental Features",
"language": "Language",
"about": "About Roo Code"
"about": "About Roo Code",
"interface": "Interface"
},
"autoApprove": {
"description": "Allow Roo to automatically perform operations without requiring approval. Enable these settings only if you fully trust the AI and understand the associated security risks.",
Expand Down Expand Up @@ -469,5 +470,11 @@
"labels": {
"customArn": "Custom ARN",
"useCustomArn": "Use custom ARN..."
},
"interface": {
"showgreeting": {
"label": "Show greeting message",
"description": "When enabled, Roo will display a welcome message and introduction."
}
}
}
9 changes: 8 additions & 1 deletion webview-ui/src/i18n/locales/es/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"advanced": "Avanzado",
"experimental": "Funciones experimentales",
"language": "Idioma",
"about": "Acerca de Roo Code"
"about": "Acerca de Roo Code",
"interface": "Interfaz"
},
"autoApprove": {
"description": "Permitir que Roo realice operaciones automáticamente sin requerir aprobación. Habilite esta configuración solo si confía plenamente en la IA y comprende los riesgos de seguridad asociados.",
Expand Down Expand Up @@ -470,5 +471,11 @@
"labels": {
"customArn": "ARN personalizado",
"useCustomArn": "Usar ARN personalizado..."
},
"interface": {
"showgreeting": {
"label": "Mostrar mensaje de bienvenida",
"description": "Cuando está habilitado, Roo mostrará un mensaje de bienvenida e introducción."
}
}
}
9 changes: 8 additions & 1 deletion webview-ui/src/i18n/locales/fr/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"advanced": "Avancé",
"experimental": "Fonctionnalités expérimentales",
"language": "Langue",
"about": "À propos de Roo Code"
"about": "À propos de Roo Code",
"interface": "Interface"
},
"autoApprove": {
"description": "Permettre à Roo d'effectuer automatiquement des opérations sans requérir d'approbation. Activez ces paramètres uniquement si vous faites entièrement confiance à l'IA et que vous comprenez les risques de sécurité associés.",
Expand Down Expand Up @@ -470,5 +471,11 @@
"labels": {
"customArn": "ARN personnalisé",
"useCustomArn": "Utiliser un ARN personnalisé..."
},
"interface": {
"showgreeting": {
"label": "Afficher le message de bienvenue",
"description": "Lorsque cette option est activée, Roo affichera un message de bienvenue et une introduction."
}
}
}
9 changes: 8 additions & 1 deletion webview-ui/src/i18n/locales/hi/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"advanced": "उन्नत",
"experimental": "प्रायोगिक सुविधाएँ",
"language": "भाषा",
"about": "Roo Code के बारे में"
"about": "Roo Code के बारे में",
"interface": "इंटरफ़ेस"
},
"autoApprove": {
"description": "Roo को अनुमोदन की आवश्यकता के बिना स्वचालित रूप से ऑपरेशन करने की अनुमति दें। इन सेटिंग्स को केवल तभी सक्षम करें जब आप AI पर पूरी तरह से भरोसा करते हों और संबंधित सुरक्षा जोखिमों को समझते हों।",
Expand Down Expand Up @@ -470,5 +471,11 @@
"labels": {
"customArn": "कस्टम ARN",
"useCustomArn": "कस्टम ARN का उपयोग करें..."
},
"interface": {
"showgreeting": {
"label": "स्वागत संदेश दिखाएँ",
"description": "जब सक्षम किया जाता है, तो Roo एक स्वागत संदेश और परिचय प्रदर्शित करेगा।"
}
}
}
Loading
Loading