mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-27 01:21:24 +00:00
Revert "feat: add task header highlight for visual status indication (#11305)"
This reverts commit 5313cb503a.
98 lines
3.3 KiB
TypeScript
98 lines
3.3 KiB
TypeScript
import { HTMLAttributes, useMemo } from "react"
|
|
import { useAppTranslation } from "@/i18n/TranslationContext"
|
|
import { VSCodeCheckbox } from "@vscode/webview-ui-toolkit/react"
|
|
import { telemetryClient } from "@/utils/TelemetryClient"
|
|
|
|
import { SetCachedStateField } from "./types"
|
|
import { SectionHeader } from "./SectionHeader"
|
|
import { Section } from "./Section"
|
|
import { SearchableSetting } from "./SearchableSetting"
|
|
import { ExtensionStateContextType } from "@/context/ExtensionStateContext"
|
|
|
|
interface UISettingsProps extends HTMLAttributes<HTMLDivElement> {
|
|
reasoningBlockCollapsed: boolean
|
|
enterBehavior: "send" | "newline"
|
|
setCachedStateField: SetCachedStateField<keyof ExtensionStateContextType>
|
|
}
|
|
|
|
export const UISettings = ({
|
|
reasoningBlockCollapsed,
|
|
enterBehavior,
|
|
setCachedStateField,
|
|
...props
|
|
}: UISettingsProps) => {
|
|
const { t } = useAppTranslation()
|
|
|
|
// Detect platform for dynamic modifier key display
|
|
const primaryMod = useMemo(() => {
|
|
const isMac = navigator.platform.toUpperCase().indexOf("MAC") >= 0
|
|
return isMac ? "⌘" : "Ctrl"
|
|
}, [])
|
|
|
|
const handleReasoningBlockCollapsedChange = (value: boolean) => {
|
|
setCachedStateField("reasoningBlockCollapsed", value)
|
|
|
|
// Track telemetry event
|
|
telemetryClient.capture("ui_settings_collapse_thinking_changed", {
|
|
enabled: value,
|
|
})
|
|
}
|
|
|
|
const handleEnterBehaviorChange = (requireCtrlEnter: boolean) => {
|
|
const newBehavior = requireCtrlEnter ? "newline" : "send"
|
|
setCachedStateField("enterBehavior", newBehavior)
|
|
|
|
// Track telemetry event
|
|
telemetryClient.capture("ui_settings_enter_behavior_changed", {
|
|
behavior: newBehavior,
|
|
})
|
|
}
|
|
|
|
return (
|
|
<div {...props}>
|
|
<SectionHeader>{t("settings:sections.ui")}</SectionHeader>
|
|
|
|
<Section>
|
|
<div className="space-y-6">
|
|
{/* Collapse Thinking Messages Setting */}
|
|
<SearchableSetting
|
|
settingId="ui-collapse-thinking"
|
|
section="ui"
|
|
label={t("settings:ui.collapseThinking.label")}>
|
|
<div className="flex flex-col gap-1">
|
|
<VSCodeCheckbox
|
|
checked={reasoningBlockCollapsed}
|
|
onChange={(e: any) => handleReasoningBlockCollapsedChange(e.target.checked)}
|
|
data-testid="collapse-thinking-checkbox">
|
|
<span className="font-medium">{t("settings:ui.collapseThinking.label")}</span>
|
|
</VSCodeCheckbox>
|
|
<div className="text-vscode-descriptionForeground text-sm ml-5 mt-1">
|
|
{t("settings:ui.collapseThinking.description")}
|
|
</div>
|
|
</div>
|
|
</SearchableSetting>
|
|
|
|
{/* Enter Key Behavior Setting */}
|
|
<SearchableSetting
|
|
settingId="ui-enter-behavior"
|
|
section="ui"
|
|
label={t("settings:ui.requireCtrlEnterToSend.label", { primaryMod })}>
|
|
<div className="flex flex-col gap-1">
|
|
<VSCodeCheckbox
|
|
checked={enterBehavior === "newline"}
|
|
onChange={(e: any) => handleEnterBehaviorChange(e.target.checked)}
|
|
data-testid="enter-behavior-checkbox">
|
|
<span className="font-medium">
|
|
{t("settings:ui.requireCtrlEnterToSend.label", { primaryMod })}
|
|
</span>
|
|
</VSCodeCheckbox>
|
|
<div className="text-vscode-descriptionForeground text-sm ml-5 mt-1">
|
|
{t("settings:ui.requireCtrlEnterToSend.description", { primaryMod })}
|
|
</div>
|
|
</div>
|
|
</SearchableSetting>
|
|
</div>
|
|
</Section>
|
|
</div>
|
|
)
|
|
}
|