(null)
- const { t } = useTranslation()
-
- return (
-
-
- {!!item?.size && item.size > 0 && (
- <>
-
- {deleteTaskId && (
- !open && setDeleteTaskId(null)}
- open
- />
- )}
- >
- )}
-
- )
-}
-
-interface ContextWindowProgressProps {
- contextWindow: number
- contextTokens: number
- maxTokens?: number
-}
-
-const ContextWindowProgress = ({ contextWindow, contextTokens, maxTokens }: ContextWindowProgressProps) => {
- const { t } = useTranslation()
- // Use the shared utility function to calculate all token distribution values
- const tokenDistribution = useMemo(
- () => calculateTokenDistribution(contextWindow, contextTokens, maxTokens),
- [contextWindow, contextTokens, maxTokens],
- )
-
- // Destructure the values we need
- const { currentPercent, reservedPercent, availableSize, reservedForOutput, availablePercent } = tokenDistribution
-
- // For display purposes
- const safeContextWindow = Math.max(0, contextWindow)
- const safeContextTokens = Math.max(0, contextTokens)
-
- return (
- <>
-
-
{formatLargeNumber(safeContextTokens)}
-
- {/* Invisible overlay for hover area */}
-
-
- {/* Main progress bar container */}
-
- {/* Current tokens container */}
-
- {/* Invisible overlay for current tokens section */}
-
- {/* Current tokens used - darkest */}
-
-
-
- {/* Container for reserved tokens */}
-
- {/* Invisible overlay for reserved section */}
-
- {/* Reserved for output section - medium gray */}
-
-
-
- {/* Empty section (if any) */}
- {availablePercent > 0 && (
-
- {/* Invisible overlay for available space */}
-
-
- )}
-
-
-
{formatLargeNumber(safeContextWindow)}
-
- >
- )
-}
-
export default memo(TaskHeader)
diff --git a/webview-ui/src/components/common/CodeAccordian.tsx b/webview-ui/src/components/common/CodeAccordian.tsx
index 2f0cffd862b..ec39e1704a9 100644
--- a/webview-ui/src/components/common/CodeAccordian.tsx
+++ b/webview-ui/src/components/common/CodeAccordian.tsx
@@ -2,6 +2,7 @@ import { memo, useMemo } from "react"
import { getLanguageFromPath } from "@src/utils/getLanguageFromPath"
import CodeBlock, { CODE_BLOCK_BG_COLOR } from "./CodeBlock"
import { ToolProgressStatus } from "@roo/shared/ExtensionMessage"
+import { VSCodeProgressRing } from "@vscode/webview-ui-toolkit/react"
interface CodeAccordianProps {
code?: string
@@ -69,7 +70,9 @@ const CodeAccordian = ({
MozUserSelect: "none",
msUserSelect: "none",
}}
+ className={`${isLoading ? "animate-pulse" : ""}`}
onClick={isLoading ? undefined : onToggleExpand}>
+ {isLoading && }
{isFeedback || isConsoleLogs ? (
, defaultId: string) => {
let selectedModelId: string
let selectedModelInfo: ModelInfo
@@ -1827,15 +1829,18 @@ export function normalizeApiConfiguration(apiConfiguration?: ApiConfiguration) {
selectedModelInfo: openAiModelInfoSaneDefaults,
}
case "vscode-lm":
+ const modelFamily = apiConfiguration?.vsCodeLmModelSelector?.family ?? vscodeLlmDefaultModelId
+ const modelInfo = {
+ ...openAiModelInfoSaneDefaults,
+ ...vscodeLlmModels[modelFamily as keyof typeof vscodeLlmModels],
+ supportsImages: false, // VSCode LM API currently doesn't support images.
+ }
return {
selectedProvider: provider,
selectedModelId: apiConfiguration?.vsCodeLmModelSelector
? `${apiConfiguration.vsCodeLmModelSelector.vendor}/${apiConfiguration.vsCodeLmModelSelector.family}`
: "",
- selectedModelInfo: {
- ...openAiModelInfoSaneDefaults,
- supportsImages: false, // VSCode LM API currently doesn't support images.
- },
+ selectedModelInfo: modelInfo,
}
default:
return getProviderData(anthropicModels, anthropicDefaultModelId)
diff --git a/webview-ui/src/components/settings/ModelInfoView.tsx b/webview-ui/src/components/settings/ModelInfoView.tsx
index 4f8e6b1d6ff..ad0f5dcde6a 100644
--- a/webview-ui/src/components/settings/ModelInfoView.tsx
+++ b/webview-ui/src/components/settings/ModelInfoView.tsx
@@ -1,15 +1,15 @@
-import { useMemo } from "react"
import { VSCodeLink } from "@vscode/webview-ui-toolkit/react"
import { useAppTranslation } from "@/i18n/TranslationContext"
import { formatPrice } from "@/utils/formatPrice"
import { cn } from "@/lib/utils"
-import { ModelInfo, geminiModels } from "@roo/shared/api"
+import { ModelInfo } from "@roo/shared/api"
import { ModelDescriptionMarkdown } from "./ModelDescriptionMarkdown"
type ModelInfoViewProps = {
+ apiProvider?: string
selectedModelId: string
modelInfo: ModelInfo
isDescriptionExpanded: boolean
@@ -17,13 +17,13 @@ type ModelInfoViewProps = {
}
export const ModelInfoView = ({
+ apiProvider,
selectedModelId,
modelInfo,
isDescriptionExpanded,
setIsDescriptionExpanded,
}: ModelInfoViewProps) => {
const { t } = useAppTranslation()
- const isGemini = useMemo(() => Object.keys(geminiModels).includes(selectedModelId), [selectedModelId])
const infoItems = [
,
- !isGemini && (
-
- ),
+ ,
typeof modelInfo.maxTokens === "number" && modelInfo.maxTokens > 0 && (
<>
{t("settings:modelInfo.maxOutput")}:{" "}
@@ -73,7 +71,7 @@ export const ModelInfoView = ({
{formatPrice(modelInfo.cacheWritesPrice || 0)} / 1M tokens
>
),
- isGemini && (
+ apiProvider === "gemini" && (
{selectedModelId === "gemini-2.5-pro-preview-03-25"
? t("settings:modelInfo.gemini.billingEstimate")
diff --git a/webview-ui/src/components/settings/ModelPicker.tsx b/webview-ui/src/components/settings/ModelPicker.tsx
index 5aa3f1b3140..7995409e098 100644
--- a/webview-ui/src/components/settings/ModelPicker.tsx
+++ b/webview-ui/src/components/settings/ModelPicker.tsx
@@ -186,6 +186,7 @@ export const ModelPicker = ({
{selectedModelId && selectedModelInfo && (