diff --git a/packages/app/src/components/context-window-meter.tsx b/packages/app/src/components/context-window-meter.tsx index d41ca87528..f4c4c1edf4 100644 --- a/packages/app/src/components/context-window-meter.tsx +++ b/packages/app/src/components/context-window-meter.tsx @@ -3,7 +3,6 @@ import Svg, { Circle } from "react-native-svg"; import { StyleSheet, useUnistyles } from "react-native-unistyles"; import { useTranslation } from "react-i18next"; import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"; -import { ContextWindowUsageTooltip } from "@/usage/context-window-section"; import { formatContextPercentage, formatTokenCount } from "./context-window-meter.utils"; interface ContextWindowMeterProps { @@ -11,8 +10,6 @@ interface ContextWindowMeterProps { usedTokens: number | null; totalCostUsd?: number | null; showPercentage?: boolean; - serverId?: string; - agentId?: string; /** Reserve the meter footprint and show a loading ring while usage is pending. */ pending?: boolean; /** Optional glyph envelope for icon-toolbar alignment. */ @@ -98,8 +95,6 @@ export function ContextWindowMeter({ usedTokens, totalCostUsd, showPercentage = false, - serverId, - agentId, pending = false, glyphSize, }: ContextWindowMeterProps) { @@ -207,9 +202,6 @@ export function ContextWindowMeter({ {t("contextWindow.sessionCost", { cost: formattedSessionCost })} ) : null} - {serverId && agentId ? ( - - ) : null} diff --git a/packages/app/src/composer/index.tsx b/packages/app/src/composer/index.tsx index 65ca01b0bb..1286f561d3 100644 --- a/packages/app/src/composer/index.tsx +++ b/packages/app/src/composer/index.tsx @@ -283,8 +283,6 @@ function renderContextWindowMeter( contextWindowUsedTokens: number | null, totalCostUsd: number | null, showPercentage: boolean, - serverId: string, - agentId: string, pending: boolean, glyphSize: number, ): ReactElement | null { @@ -298,8 +296,6 @@ function renderContextWindowMeter( usedTokens={contextWindowUsedTokens} totalCostUsd={totalCostUsd} showPercentage={showPercentage} - serverId={serverId} - agentId={agentId} pending={pending} glyphSize={glyphSize} /> @@ -2094,8 +2090,6 @@ function ComposerContentImpl({ contextWindowUsedTokens, agentState.totalCostUsd, isCompactLayout, - serverId, - agentId, contextWindowPending, contextWindowMeterGlyphSize, ), @@ -2104,28 +2098,13 @@ function ComposerContentImpl({ contextWindowUsedTokens, agentState.totalCostUsd, isCompactLayout, - serverId, - agentId, contextWindowPending, contextWindowMeterGlyphSize, ], ); const { beforeVoiceContent, compactContextWindowContent } = useMemo( - () => { - const placement = resolveContextWindowPlacement(contextWindowMeter, hasAgent, isCompactLayout); - return { - ...placement, - beforeVoiceContent: ( - <> - {placement.beforeVoiceContent} - {hasAgent && !isCompactLayout ? ( - - ) : null} - - ), - }; - }, - [agentId, contextWindowMeter, hasAgent, isCompactLayout, serverId], + () => resolveContextWindowPlacement(contextWindowMeter, hasAgent, isCompactLayout), + [contextWindowMeter, hasAgent, isCompactLayout], ); const hasGithubAttachment = useMemo( diff --git a/packages/app/src/usage/context-window-section.tsx b/packages/app/src/usage/context-window-section.tsx deleted file mode 100644 index 81f1e29746..0000000000 --- a/packages/app/src/usage/context-window-section.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { View } from "react-native"; -import { StyleSheet } from "react-native-unistyles"; -import { UsageCard } from "./card"; -import { useUsagePreferences } from "./display"; -import { useAgentUsage } from "./queries"; - -/** The active agent's usage inside its context-window tooltip. */ -export function ContextWindowUsageTooltip({ - serverId, - agentId, -}: { - serverId: string; - agentId: string; -}) { - const { entry } = useAgentUsage(serverId, agentId); - const { display } = useUsagePreferences(); - if (!entry) return null; - - return ( - <> - - - - ); -} - -const styles = StyleSheet.create((theme) => ({ - divider: { - height: 1, - backgroundColor: theme.colors.borderAccent, - marginVertical: theme.spacing[2], - marginHorizontal: -theme.spacing[2], - }, -})); diff --git a/packages/app/src/usage/format.ts b/packages/app/src/usage/format.ts index 4b0a1c67e9..5cfa0b0f36 100644 --- a/packages/app/src/usage/format.ts +++ b/packages/app/src/usage/format.ts @@ -29,7 +29,11 @@ export function formatPct(value: number, locale?: string): string { } /** A localized percentage that says whether it is used or remaining. */ -export function formatDisplayPct(value: number, displayAs: UsageDisplayAs, locale?: string): string { +export function formatDisplayPct( + value: number, + displayAs: UsageDisplayAs, + locale?: string, +): string { const percentage = formatPct(value, locale); return displayAs === "used" ? i18n.t("providerUsage.values.used", { percentage }) diff --git a/packages/app/src/usage/window-bar.tsx b/packages/app/src/usage/window-bar.tsx index 1f7fc3db28..0ec3976102 100644 --- a/packages/app/src/usage/window-bar.tsx +++ b/packages/app/src/usage/window-bar.tsx @@ -48,8 +48,6 @@ export function UsageWindowBar({ const isAtRisk = window.runsOutAt != null && window.shortfallPct != null; const relativeTime = isAtRisk ? window.runsOutAt : window.resetsAt; useRelativeTimeTick(relativeTime != null); - const relativeTime = isAtRisk ? window.runsOutAt : window.resetsAt; - useRelativeTimeTick(relativeTime != null); const trailing = isAtRisk ? formatRunsOutLabel(window.runsOutAt) : formatResetLabel(window.resetsAt);