From e9e0315667ceae461bb760c5691265b5cf3aaa55 Mon Sep 17 00:00:00 2001 From: Viktor Bystrov <18964918+ViktorBystrov72@users.noreply.github.com> Date: Fri, 20 Nov 2026 19:57:48 +0500 Subject: [PATCH 1/3] feat(desktop): configure Codex quota display --- .../components/PresetsBar/PresetsBar.tsx | 11 ++ .../PresetBarItem/PresetBarItem.tsx | 77 ++++++++++++- .../getCodexPresetQuota.test.ts | 82 ++++++++++++++ .../getCodexPresetQuota.ts | 32 ++++++ .../utils/getCodexPresetQuota/index.ts | 1 + .../UsageWarningDot/UsageWarningDot.tsx | 25 ++++- .../getAccountUsageState.test.ts | 29 +++++ .../getAccountUsageState.ts | 17 ++- .../workspace/$workspaceId/page.tsx | 1 + .../renderer/routes/_authenticated/layout.tsx | 3 + .../CodexUsageSettings/CodexUsageSettings.tsx | 102 ++++++++++++++++++ .../components/CodexUsageSettings/index.ts | 1 + .../usage/components/UsageView/UsageView.tsx | 2 + apps/desktop/src/renderer/stores/settings.ts | 9 ++ packages/i18n/locales/cs/messages.po | 15 +++ packages/i18n/locales/de/messages.po | 15 +++ packages/i18n/locales/en/messages.po | 15 +++ packages/i18n/locales/es/messages.po | 15 +++ packages/i18n/locales/fr/messages.po | 15 +++ packages/i18n/locales/id/messages.po | 15 +++ packages/i18n/locales/it/messages.po | 15 +++ packages/i18n/locales/ja/messages.po | 15 +++ packages/i18n/locales/ko/messages.po | 15 +++ packages/i18n/locales/nl/messages.po | 15 +++ packages/i18n/locales/pl/messages.po | 15 +++ packages/i18n/locales/pt-BR/messages.po | 15 +++ packages/i18n/locales/ru/messages.po | 15 +++ packages/i18n/locales/tr/messages.po | 15 +++ packages/i18n/locales/uk/messages.po | 15 +++ packages/i18n/locales/vi/messages.po | 15 +++ packages/i18n/locales/zh-CN/messages.po | 15 +++ packages/i18n/locales/zh-TW/messages.po | 15 +++ 32 files changed, 654 insertions(+), 8 deletions(-) create mode 100644 apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/components/PresetsBar/components/PresetBarItem/utils/getCodexPresetQuota/getCodexPresetQuota.test.ts create mode 100644 apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/components/PresetsBar/components/PresetBarItem/utils/getCodexPresetQuota/getCodexPresetQuota.ts create mode 100644 apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/components/PresetsBar/components/PresetBarItem/utils/getCodexPresetQuota/index.ts create mode 100644 apps/desktop/src/renderer/routes/_authenticated/settings/usage/components/CodexUsageSettings/CodexUsageSettings.tsx create mode 100644 apps/desktop/src/renderer/routes/_authenticated/settings/usage/components/CodexUsageSettings/index.ts diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/components/PresetsBar/PresetsBar.tsx b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/components/PresetsBar/PresetsBar.tsx index 9027b606478..d15bd74dbad 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/components/PresetsBar/PresetsBar.tsx +++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/components/PresetsBar/PresetsBar.tsx @@ -19,6 +19,7 @@ import { useIsDarkTheme, } from "renderer/assets/app-icons/preset-icons"; import { HotkeyMenuShortcut } from "renderer/components/HotkeyMenuShortcut"; +import { useWorkspaceHostUrl } from "renderer/hooks/host-service/useWorkspaceHostUrl"; import { useAgentConfigs } from "renderer/hooks/useAgentConfigs"; import { useBuiltinPresets } from "renderer/hooks/useBuiltinPresets"; import { useParadevShell } from "renderer/hooks/useParadevShell"; @@ -33,6 +34,7 @@ import { BuiltinPresetBarItem } from "./components/BuiltinPresetBarItem"; import { PresetBarItem } from "./components/PresetBarItem"; interface PresetsBarProps { + workspaceId: string; matchedPresets: TerminalPresetRow[]; executePreset: (preset: TerminalPresetRow) => void | Promise; showPresetsBar: boolean; @@ -74,6 +76,7 @@ function getVisiblePresetOrder( } export function PresetsBar({ + workspaceId, matchedPresets, executePreset, showPresetsBar, @@ -83,6 +86,7 @@ export function PresetsBar({ const isDark = useIsDarkTheme(); const isParadevShell = useParadevShell(); const collections = useCollections(); + const hostUrl = useWorkspaceHostUrl(workspaceId); const { activeHostUrl } = useLocalHostService(); const { data: agents } = useAgentConfigs(activeHostUrl); const builtinPresets = useBuiltinPresets(); @@ -354,12 +358,19 @@ export function PresetsBar({ handleEditPreset(presetToEdit.id)} + onViewUsage={(accountKey) => + navigate({ + to: "/settings/usage", + search: { workspaceId, agent: "codex", accountKey }, + }) + } onLocalReorder={handleLocalVisibleReorder} onPersistReorder={handlePersistVisibleReorder} /> diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/components/PresetsBar/components/PresetBarItem/PresetBarItem.tsx b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/components/PresetsBar/components/PresetBarItem/PresetBarItem.tsx index 4145a8b1502..42c6cbb5e61 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/components/PresetsBar/components/PresetBarItem/PresetBarItem.tsx +++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/components/PresetsBar/components/PresetBarItem/PresetBarItem.tsx @@ -1,48 +1,77 @@ import { Trans } from "@lingui/react/macro"; import type { HostAgentConfig } from "@superset/host-service/settings"; +import { formatPercent } from "@superset/i18n/format"; import { Button } from "@superset/ui/button"; import { ContextMenu, ContextMenuContent, ContextMenuItem, + ContextMenuLabel, ContextMenuSeparator, ContextMenuTrigger, } from "@superset/ui/context-menu"; +import { cn } from "@superset/ui/utils"; import { useEffect, useRef } from "react"; import { useDrag, useDrop } from "react-dnd"; import { HiMiniCommandLine } from "react-icons/hi2"; +import { QuotaWindowRow } from "renderer/components/QuotaWindowRow"; +import { useHostUsageQuota } from "renderer/hooks/host-service/useHostUsageQuota"; +import { useNow } from "renderer/hooks/useNow"; import type { HotkeyId } from "renderer/hotkeys"; import { HotkeyTooltip } from "renderer/hotkeys"; +import { findLinkedAgent } from "renderer/lib/agent-launch-command"; import { resolvePresetIcon } from "renderer/lib/preset-icon"; +import { resolvePresetIconKey } from "renderer/lib/preset-icon-key"; import type { TerminalPresetRow } from "renderer/routes/_authenticated/providers/CollectionsProvider/dashboardSidebarLocal"; +import { useSettings } from "renderer/stores/settings"; +import { getCodexPresetQuota } from "./utils/getCodexPresetQuota"; const V2_PRESET_BAR_ITEM_TYPE = "V2_PRESET_BAR_ITEM"; interface PresetBarItemProps { preset: TerminalPresetRow; + hostUrl: string | null; visibleIndex: number; hotkeyId?: HotkeyId; isDark: boolean; agents: HostAgentConfig[] | undefined; onExecutePreset: (preset: TerminalPresetRow) => void; onEdit: (preset: TerminalPresetRow) => void; + onViewUsage: (accountKey?: string) => void; onLocalReorder: (fromIndex: number, toIndex: number) => void; onPersistReorder: (presetId: string, targetVisibleIndex: number) => void; } export function PresetBarItem({ preset, + hostUrl, visibleIndex, hotkeyId, isDark, agents, onExecutePreset, onEdit, + onViewUsage, onLocalReorder, onPersistReorder, }: PresetBarItemProps) { const containerRef = useRef(null); const icon = resolvePresetIcon(preset, agents, isDark); + const location = useSettings((settings) => settings.codexUsageLocation); + const linked = findLinkedAgent(agents, preset.agentId); + const isCodex = + (linked?.presetId ?? resolvePresetIconKey(preset, undefined)) === "codex"; + const showUsage = isCodex && location === "preset"; + const quota = useHostUsageQuota(showUsage ? hostUrl : null); + const now = useNow(60_000, showUsage && !!hostUrl); + const { account, windows, summary } = getCodexPresetQuota( + quota.data ?? [], + now.getTime(), + quota.isError, + ); + const used = summary + ? formatPercent(summary.usedPercent / 100, { maximumFractionDigits: 0 }) + : undefined; const [{ isDragging }, drag] = useDrag( () => ({ @@ -90,7 +119,10 @@ export function PresetBarItem({ - + + {showUsage && ( + <> + + Usage · Default + + {windows.length > 0 ? ( + windows.map((window) => ( + + )) + ) : ( + + {account?.credentialKind === "api_key" ? ( + API billing + ) : quota.isLoading ? ( + Reading usage… + ) : ( + Usage unavailable. + )} + + )} + onViewUsage(account?.accountKey)}> + View usage + + + + )} onExecutePreset(preset)}> Run script diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/components/PresetsBar/components/PresetBarItem/utils/getCodexPresetQuota/getCodexPresetQuota.test.ts b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/components/PresetsBar/components/PresetBarItem/utils/getCodexPresetQuota/getCodexPresetQuota.test.ts new file mode 100644 index 00000000000..dcb33a2ec6a --- /dev/null +++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/components/PresetsBar/components/PresetBarItem/utils/getCodexPresetQuota/getCodexPresetQuota.test.ts @@ -0,0 +1,82 @@ +import { expect, test } from "bun:test"; +import type { + UsageAccount, + UsageQuotaWindow, +} from "renderer/hooks/host-service/useHostUsageQuota"; +import { getCodexPresetQuota } from "./getCodexPresetQuota"; + +const now = Date.UTC(2026, 10, 20); +const session: UsageQuotaWindow = { + id: "primary", + label: "Session (5h)", + usedPercent: 80, + resetsAt: new Date(now + 3600_000), +}; +const weekly: UsageQuotaWindow = { + id: "secondary", + label: "Weekly", + usedPercent: 50, + resetsAt: new Date(now + 2 * 3600_000), +}; +const account: UsageAccount = { + agent: "codex", + credentialKind: "subscription", + selection: null, + accountKey: "default", + email: null, + plan: "plus", + status: "ok", + statusDetail: null, + sourceLabel: "default", + windows: [session, weekly], + isDefault: true, + creditsBalance: null, + extraUsage: null, + fetchedAt: new Date(now), +}; + +test("summarizes the default Codex subscription's weekly window", () => { + const result = getCodexPresetQuota( + [ + { ...account, agent: "claude" }, + { ...account, isDefault: false, accountKey: "other" }, + account, + ], + now, + false, + ); + expect(result.account).toBe(account); + expect(result.summary).toBe(weekly); + expect(result.windows).toEqual([session, weekly]); +}); + +test("keeps a current window when another window has reset", () => { + const expired = { ...weekly, resetsAt: new Date(now) }; + const result = getCodexPresetQuota( + [{ ...account, windows: [session, expired] }], + now, + false, + ); + expect(result.summary).toBe(session); + expect(result.windows).toEqual([session]); +}); + +test("does not substitute another subscription for the default API account", () => { + const result = getCodexPresetQuota( + [ + { ...account, isDefault: false }, + { ...account, credentialKind: "api_key" }, + ], + now, + false, + ); + expect(result.account?.credentialKind).toBe("api_key"); + expect(result.summary).toBeUndefined(); +}); + +test("hides cached quota after it expires or the query fails", () => { + expect(getCodexPresetQuota([account], now + 600_000, false).windows).toEqual( + [], + ); + expect(getCodexPresetQuota([account], now, true).windows).toEqual([]); +}); diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/components/PresetsBar/components/PresetBarItem/utils/getCodexPresetQuota/getCodexPresetQuota.ts b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/components/PresetsBar/components/PresetBarItem/utils/getCodexPresetQuota/getCodexPresetQuota.ts new file mode 100644 index 00000000000..d588758cee7 --- /dev/null +++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/components/PresetsBar/components/PresetBarItem/utils/getCodexPresetQuota/getCodexPresetQuota.ts @@ -0,0 +1,32 @@ +import type { UsageAccount } from "renderer/hooks/host-service/useHostUsageQuota"; + +const MAX_QUOTA_AGE_MS = 10 * 60_000; + +export function getCodexPresetQuota( + accounts: readonly UsageAccount[], + now: number, + failed: boolean, +) { + const account = accounts.find( + (candidate) => candidate.agent === "codex" && candidate.isDefault, + ); + const windows = + !failed && + account?.credentialKind === "subscription" && + account.status === "ok" && + now - new Date(account.fetchedAt).getTime() < MAX_QUOTA_AGE_MS + ? account.windows.filter( + (window) => + Number.isFinite(window.usedPercent) && + window.usedPercent >= 0 && + (!window.resetsAt || new Date(window.resetsAt).getTime() > now), + ) + : []; + const summary = + windows.find( + (window) => window.id === "seven_day" || window.label === "Weekly", + ) ?? + windows.find((window) => window.id === "secondary") ?? + windows[0]; + return { account, windows, summary }; +} diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/components/PresetsBar/components/PresetBarItem/utils/getCodexPresetQuota/index.ts b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/components/PresetsBar/components/PresetBarItem/utils/getCodexPresetQuota/index.ts new file mode 100644 index 00000000000..24e4c7a4c7c --- /dev/null +++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/components/PresetsBar/components/PresetBarItem/utils/getCodexPresetQuota/index.ts @@ -0,0 +1 @@ +export { getCodexPresetQuota } from "./getCodexPresetQuota"; diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/components/UsageWarningDot/UsageWarningDot.tsx b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/components/UsageWarningDot/UsageWarningDot.tsx index bef00231880..ecc90fd381c 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/components/UsageWarningDot/UsageWarningDot.tsx +++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/components/UsageWarningDot/UsageWarningDot.tsx @@ -1,6 +1,10 @@ import { useLingui } from "@lingui/react/macro"; import { formatPercent } from "@superset/i18n/format"; import { cn } from "@superset/ui/utils"; +import { + DEFAULT_USAGE_WARNING_THRESHOLD, + useSettings, +} from "renderer/stores/settings"; import { useAccountUsage } from "../../hooks/useAccountUsage"; export function UsageWarningDot({ @@ -11,10 +15,27 @@ export function UsageWarningDot({ terminalId: string; }) { const { t } = useLingui(); - const { state, tightest } = useAccountUsage(workspaceId, terminalId); - if (state !== "ready" || !tightest || tightest.usedPercent < 70) return null; + const { binding, state, tightest } = useAccountUsage(workspaceId, terminalId); + const location = useSettings((settings) => settings.codexUsageLocation); + const codexThreshold = useSettings((settings) => + settings.codexUsageThresholdEnabled ? settings.codexUsageThreshold : 0, + ); + if (state !== "ready" || !tightest) return null; + const isCodex = binding?.agentId === "codex"; + if (isCodex && location !== "session") return null; + const threshold = isCodex ? codexThreshold : DEFAULT_USAGE_WARNING_THRESHOLD; + if (tightest.usedPercent < threshold) return null; + const percent = formatPercent(tightest.usedPercent / 100); const label = t({ message: `Account usage: ${percent} used` }); + if (isCodex) { + return ( + + {percent} + + ); + } + return ( { expect(result.state).toBe("api"); expect(result.account).toBeUndefined(); }); + test("keeps the current Codex window when another window has reset", () => { + const weekly = { + id: "secondary", + label: "Weekly", + usedPercent: 50, + resetsAt: new Date(now + 3600_000), + }; + const result = getAccountUsageState({ + ...input, + identity: { ...input.identity, agent: "codex" }, + accounts: [ + { + ...account, + agent: "codex", + windows: [ + { + id: "primary", + label: "Session", + usedPercent: 99, + resetsAt: new Date(now), + }, + weekly, + ], + }, + ], + }); + expect(result.state).toBe("ready"); + expect(result.tightest).toBe(weekly); + }); test("unsupported agents and missing quota are not zero usage", () => { expect(getAccountUsageState({ ...input, supported: false }).state).toBe( "unavailable", diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/hooks/useAccountUsage/utils/getAccountUsageState/getAccountUsageState.ts b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/hooks/useAccountUsage/utils/getAccountUsageState/getAccountUsageState.ts index cd7b6f9dbb7..32091f00d7c 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/hooks/useAccountUsage/utils/getAccountUsageState/getAccountUsageState.ts +++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/hooks/usePaneRegistry/hooks/useAccountUsage/utils/getAccountUsageState/getAccountUsageState.ts @@ -1,4 +1,7 @@ -import type { UsageAccount } from "renderer/hooks/host-service/useHostUsageQuota"; +import type { + UsageAccount, + UsageQuotaWindow, +} from "renderer/hooks/host-service/useHostUsageQuota"; interface Identity { source?: "environment" | "profile"; @@ -40,7 +43,13 @@ export function getAccountUsageState({ const generalWindows = windows.filter((w) => ["five_hour", "seven_day", "primary", "secondary"].includes(w.id), ); - const tightest = generalWindows.reduce<(typeof windows)[number] | undefined>( + const hasReset = (window: UsageQuotaWindow) => + window.resetsAt !== null && new Date(window.resetsAt).getTime() <= now; + const isCodex = identity?.agent === "codex"; + const usableWindows = isCodex + ? generalWindows.filter((window) => !hasReset(window)) + : generalWindows; + const tightest = usableWindows.reduce( (a, b) => (!a || b.usedPercent > a.usedPercent ? b : a), undefined, ); @@ -48,7 +57,7 @@ export function getAccountUsageState({ account && (failed || now - new Date(account.fetchedAt).getTime() >= 10 * 60_000 || - windows.some((w) => w.resetsAt && new Date(w.resetsAt).getTime() <= now)); + (isCodex ? !tightest : windows.some(hasReset))); const state = !supported ? "unavailable" : loading @@ -57,7 +66,7 @@ export function getAccountUsageState({ ? "unverified" : identity.credentialKind === "api_key" ? "api" - : !account || account.status !== "ok" || !tightest + : !account || account.status !== "ok" || generalWindows.length === 0 ? "unavailable" : stale ? "stale" diff --git a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/page.tsx b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/page.tsx index 9eb27b874ff..0d87d8002da 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/page.tsx +++ b/apps/desktop/src/renderer/routes/_authenticated/_dashboard/workspace/$workspaceId/page.tsx @@ -781,6 +781,7 @@ function WorkspaceContent() { renderBelowTabBar={() => showPresetsBar ? ( syncPersistedStoreAcrossWindows(useSettings), []); // Seed the parked-terminal eviction cap from settings (SUPER-1545). const { data: parkedRuntimeCap } = diff --git a/apps/desktop/src/renderer/routes/_authenticated/settings/usage/components/CodexUsageSettings/CodexUsageSettings.tsx b/apps/desktop/src/renderer/routes/_authenticated/settings/usage/components/CodexUsageSettings/CodexUsageSettings.tsx new file mode 100644 index 00000000000..3b9fe189437 --- /dev/null +++ b/apps/desktop/src/renderer/routes/_authenticated/settings/usage/components/CodexUsageSettings/CodexUsageSettings.tsx @@ -0,0 +1,102 @@ +import { Trans } from "@lingui/react/macro"; +import { Input } from "@superset/ui/input"; +import { Label } from "@superset/ui/label"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@superset/ui/select"; +import { Switch } from "@superset/ui/switch"; +import { useState } from "react"; +import { useUserPreferences } from "renderer/hooks/useUserPreferences"; +import { useSettings } from "renderer/stores/settings"; + +export function CodexUsageSettings() { + const location = useSettings((settings) => settings.codexUsageLocation); + const thresholdEnabled = useSettings( + (settings) => settings.codexUsageThresholdEnabled, + ); + const threshold = useSettings((settings) => settings.codexUsageThreshold); + const update = useSettings((settings) => settings.update); + const { setShowPresetsBar } = useUserPreferences(); + const [draft, setDraft] = useState(null); + + return ( +
+
+ + +
+ {location === "session" && ( +
+
+ + update("codexUsageThresholdEnabled", enabled) + } + /> + +
+ {thresholdEnabled && ( +
+ + setDraft(event.currentTarget.value)} + onBlur={(event) => { + const value = event.currentTarget.valueAsNumber; + if (Number.isInteger(value) && value >= 1 && value <= 100) { + update("codexUsageThreshold", value); + } + setDraft(null); + }} + onKeyDown={(event) => { + if (event.key === "Enter") event.currentTarget.blur(); + }} + /> +
+ )} +
+ )} +
+ ); +} diff --git a/apps/desktop/src/renderer/routes/_authenticated/settings/usage/components/CodexUsageSettings/index.ts b/apps/desktop/src/renderer/routes/_authenticated/settings/usage/components/CodexUsageSettings/index.ts new file mode 100644 index 00000000000..72dc8aeae72 --- /dev/null +++ b/apps/desktop/src/renderer/routes/_authenticated/settings/usage/components/CodexUsageSettings/index.ts @@ -0,0 +1 @@ +export { CodexUsageSettings } from "./CodexUsageSettings"; diff --git a/apps/desktop/src/renderer/routes/_authenticated/settings/usage/components/UsageView/UsageView.tsx b/apps/desktop/src/renderer/routes/_authenticated/settings/usage/components/UsageView/UsageView.tsx index a10f8fade04..6a1dff83b49 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/settings/usage/components/UsageView/UsageView.tsx +++ b/apps/desktop/src/renderer/routes/_authenticated/settings/usage/components/UsageView/UsageView.tsx @@ -36,6 +36,7 @@ import { QUOTA_AGENT_LABELS } from "renderer/utils/usage/quotaAgentLabels"; import { useRemoveUsageAccount } from "../../hooks/useRemoveUsageAccount"; import { useRestartAgentSessions } from "../../hooks/useRestartAgentSessions"; import { useSetDefaultUsageAccount } from "../../hooks/useSetDefaultUsageAccount"; +import { CodexUsageSettings } from "../CodexUsageSettings"; import { LeaderboardCard } from "../LeaderboardCard"; import { UsageHistorySection } from "../UsageHistorySection"; import type { SwitchSignInTarget } from "./components/AddAccountDialog"; @@ -477,6 +478,7 @@ export function UsageView({ return (
+
diff --git a/apps/desktop/src/renderer/stores/settings.ts b/apps/desktop/src/renderer/stores/settings.ts index f6369f177a5..b88902ba02b 100644 --- a/apps/desktop/src/renderer/stores/settings.ts +++ b/apps/desktop/src/renderer/stores/settings.ts @@ -2,6 +2,9 @@ import { create } from "zustand"; import { persist } from "zustand/middleware"; export type ChangesOpenTarget = "pane" | "tab"; +export type CodexUsageLocation = "session" | "preset"; + +export const DEFAULT_USAGE_WARNING_THRESHOLD = 70; interface Settings { diffStyle: "split" | "unified"; @@ -13,6 +16,9 @@ interface Settings { dictationEnabled: boolean; showParadevAnywhereButton: boolean; showRailUsage: boolean; + codexUsageLocation: CodexUsageLocation; + codexUsageThresholdEnabled: boolean; + codexUsageThreshold: number; } interface SettingsStore extends Settings { @@ -29,6 +35,9 @@ export const useSettings = create()( dictationEnabled: true, showParadevAnywhereButton: true, showRailUsage: true, + codexUsageLocation: "session", + codexUsageThresholdEnabled: true, + codexUsageThreshold: DEFAULT_USAGE_WARNING_THRESHOLD, update: (key, value) => set({ [key]: value }), }), { name: "settings" }, diff --git a/packages/i18n/locales/cs/messages.po b/packages/i18n/locales/cs/messages.po index cc94c0695dd..8e9fda88a0d 100644 --- a/packages/i18n/locales/cs/messages.po +++ b/packages/i18n/locales/cs/messages.po @@ -5007,6 +5007,12 @@ msgstr "Blok kódu" msgid "Code Block" msgstr "Blok kódu" +msgid "Codex button" +msgstr "Tlačítko Codex" + +msgid "Codex usage indicator" +msgstr "Ukazatel využití Codexu" + #. Homepage headline, line 2 of 2, after “Run an Army of”. msgid "Coding Agents" msgstr "Kódovacích agentů" @@ -13968,6 +13974,9 @@ msgstr "Jen pozvaní lidé" msgid "Only people who opted in appear here." msgstr "Objevují se tu jen lidé, kteří se sami přihlásili." +msgid "Only show at or above a threshold" +msgstr "Zobrazit až od prahové hodnoty" + msgid "Only the author can change a comment" msgstr "Komentář může upravit jen jeho autor" @@ -18303,6 +18312,9 @@ msgstr "Relace skončila" msgid "Session ended. Press Enter to start a new shell." msgstr "Relace skončila. Stiskněte Enter a spustí se nový shell." +msgid "Session header" +msgstr "Záhlaví relace" + msgid "Session name" msgstr "Název relace" @@ -21235,6 +21247,9 @@ msgstr "Tři kroky · dotýká se packages/ui a apps/desktop" msgid "Threshold" msgstr "Práh" +msgid "Threshold (%)" +msgstr "Prahová hodnota (%)" + msgid "Ticket to production under one day, median" msgstr "Od ticketu do produkce pod jeden den, medián" diff --git a/packages/i18n/locales/de/messages.po b/packages/i18n/locales/de/messages.po index de3ed1cc8dd..95d6e7961a0 100644 --- a/packages/i18n/locales/de/messages.po +++ b/packages/i18n/locales/de/messages.po @@ -5007,6 +5007,12 @@ msgstr "Codeblock" msgid "Code Block" msgstr "Code-Block" +msgid "Codex button" +msgstr "Codex-Schaltfläche" + +msgid "Codex usage indicator" +msgstr "Codex-Nutzungsanzeige" + #. Homepage headline, line 2 of 2, after “Run an Army of”. msgid "Coding Agents" msgstr "Coding-Agenten" @@ -13968,6 +13974,9 @@ msgstr "Nur eingeladene Personen" msgid "Only people who opted in appear here." msgstr "Hier erscheinen nur Personen, die sich dafür entschieden haben." +msgid "Only show at or above a threshold" +msgstr "Erst ab einem Schwellenwert anzeigen" + msgid "Only the author can change a comment" msgstr "Nur die verfassende Person kann einen Kommentar ändern" @@ -18303,6 +18312,9 @@ msgstr "Sitzung beendet" msgid "Session ended. Press Enter to start a new shell." msgstr "Sitzung beendet. Drücke die Eingabetaste, um eine neue Shell zu starten." +msgid "Session header" +msgstr "Sitzungskopfzeile" + msgid "Session name" msgstr "Sitzungsname" @@ -21235,6 +21247,9 @@ msgstr "Drei Schritte · betrifft packages/ui und apps/desktop" msgid "Threshold" msgstr "Schwellenwert" +msgid "Threshold (%)" +msgstr "Schwellenwert (%)" + msgid "Ticket to production under one day, median" msgstr "Ticket bis Produktion unter einem Tag, Median" diff --git a/packages/i18n/locales/en/messages.po b/packages/i18n/locales/en/messages.po index 46c8a8c48d6..c4664e895a1 100644 --- a/packages/i18n/locales/en/messages.po +++ b/packages/i18n/locales/en/messages.po @@ -5007,6 +5007,12 @@ msgstr "Code block" msgid "Code Block" msgstr "Code Block" +msgid "Codex button" +msgstr "Codex button" + +msgid "Codex usage indicator" +msgstr "Codex usage indicator" + #. Homepage headline, line 2 of 2, after “Run an Army of”. msgid "Coding Agents" msgstr "Coding Agents" @@ -13968,6 +13974,9 @@ msgstr "Only people invited" msgid "Only people who opted in appear here." msgstr "Only people who opted in appear here." +msgid "Only show at or above a threshold" +msgstr "Only show at or above a threshold" + msgid "Only the author can change a comment" msgstr "Only the author can change a comment" @@ -18303,6 +18312,9 @@ msgstr "Session ended" msgid "Session ended. Press Enter to start a new shell." msgstr "Session ended. Press Enter to start a new shell." +msgid "Session header" +msgstr "Session header" + msgid "Session name" msgstr "Session name" @@ -21235,6 +21247,9 @@ msgstr "Three steps · touches packages/ui and apps/desktop" msgid "Threshold" msgstr "Threshold" +msgid "Threshold (%)" +msgstr "Threshold (%)" + msgid "Ticket to production under one day, median" msgstr "Ticket to production under one day, median" diff --git a/packages/i18n/locales/es/messages.po b/packages/i18n/locales/es/messages.po index 1cbc09c42c9..bab9a930726 100644 --- a/packages/i18n/locales/es/messages.po +++ b/packages/i18n/locales/es/messages.po @@ -5007,6 +5007,12 @@ msgstr "Bloque de código" msgid "Code Block" msgstr "Bloque de código" +msgid "Codex button" +msgstr "Botón de Codex" + +msgid "Codex usage indicator" +msgstr "Indicador de uso de Codex" + #. Homepage headline, line 2 of 2, after “Run an Army of”. msgid "Coding Agents" msgstr "Agentes de código" @@ -13968,6 +13974,9 @@ msgstr "Solo personas invitadas" msgid "Only people who opted in appear here." msgstr "Aquí solo aparecen las personas que han decidido participar." +msgid "Only show at or above a threshold" +msgstr "Mostrar solo a partir de un umbral" + msgid "Only the author can change a comment" msgstr "Solo el autor puede cambiar un comentario" @@ -18303,6 +18312,9 @@ msgstr "Sesión finalizada" msgid "Session ended. Press Enter to start a new shell." msgstr "La sesión ha terminado. Pulsa Intro para abrir una nueva shell." +msgid "Session header" +msgstr "Encabezado de la sesión" + msgid "Session name" msgstr "Nombre de la sesión" @@ -21235,6 +21247,9 @@ msgstr "Tres pasos · toca packages/ui y apps/desktop" msgid "Threshold" msgstr "Umbral" +msgid "Threshold (%)" +msgstr "Umbral (%)" + msgid "Ticket to production under one day, median" msgstr "Del ticket a producción en menos de un día, en la mediana" diff --git a/packages/i18n/locales/fr/messages.po b/packages/i18n/locales/fr/messages.po index ffeb474171f..981aeb8d36c 100644 --- a/packages/i18n/locales/fr/messages.po +++ b/packages/i18n/locales/fr/messages.po @@ -5007,6 +5007,12 @@ msgstr "Bloc de code" msgid "Code Block" msgstr "Bloc de code" +msgid "Codex button" +msgstr "Bouton Codex" + +msgid "Codex usage indicator" +msgstr "Indicateur d’utilisation de Codex" + #. Homepage headline, line 2 of 2, after “Run an Army of”. msgid "Coding Agents" msgstr "d'agents de code" @@ -13968,6 +13974,9 @@ msgstr "Personnes invitées uniquement" msgid "Only people who opted in appear here." msgstr "Seules les personnes qui ont choisi de participer apparaissent ici." +msgid "Only show at or above a threshold" +msgstr "Afficher uniquement à partir d’un seuil" + msgid "Only the author can change a comment" msgstr "Seul l’auteur peut modifier un commentaire" @@ -18303,6 +18312,9 @@ msgstr "Session terminée" msgid "Session ended. Press Enter to start a new shell." msgstr "Session terminée. Appuyez sur Entrée pour démarrer un nouveau shell." +msgid "Session header" +msgstr "En-tête de la session" + msgid "Session name" msgstr "Nom de la session" @@ -21235,6 +21247,9 @@ msgstr "Trois étapes · touche packages/ui et apps/desktop" msgid "Threshold" msgstr "Seuil" +msgid "Threshold (%)" +msgstr "Seuil (%)" + msgid "Ticket to production under one day, median" msgstr "Du ticket à la production en moins d'un jour, en médiane" diff --git a/packages/i18n/locales/id/messages.po b/packages/i18n/locales/id/messages.po index d3b33ed50b7..db21d1a1479 100644 --- a/packages/i18n/locales/id/messages.po +++ b/packages/i18n/locales/id/messages.po @@ -5007,6 +5007,12 @@ msgstr "Blok kode" msgid "Code Block" msgstr "Blok Kode" +msgid "Codex button" +msgstr "Tombol Codex" + +msgid "Codex usage indicator" +msgstr "Indikator penggunaan Codex" + #. Homepage headline, line 2 of 2, after “Run an Army of”. msgid "Coding Agents" msgstr "Agen Coding" @@ -13968,6 +13974,9 @@ msgstr "Hanya orang yang diundang" msgid "Only people who opted in appear here." msgstr "Hanya orang yang memilih ikut serta yang muncul di sini." +msgid "Only show at or above a threshold" +msgstr "Tampilkan hanya saat mencapai ambang batas" + msgid "Only the author can change a comment" msgstr "Hanya penulis yang bisa mengubah komentar" @@ -18303,6 +18312,9 @@ msgstr "Sesi berakhir" msgid "Session ended. Press Enter to start a new shell." msgstr "Sesi berakhir. Tekan Enter untuk memulai shell baru." +msgid "Session header" +msgstr "Header sesi" + msgid "Session name" msgstr "Nama sesi" @@ -21235,6 +21247,9 @@ msgstr "Tiga langkah · menyentuh packages/ui dan apps/desktop" msgid "Threshold" msgstr "Ambang batas" +msgid "Threshold (%)" +msgstr "Ambang batas (%)" + msgid "Ticket to production under one day, median" msgstr "Tiket ke produksi di bawah satu hari, median" diff --git a/packages/i18n/locales/it/messages.po b/packages/i18n/locales/it/messages.po index a8ee190a2a8..5fbcbfe0e82 100644 --- a/packages/i18n/locales/it/messages.po +++ b/packages/i18n/locales/it/messages.po @@ -5007,6 +5007,12 @@ msgstr "Blocco di codice" msgid "Code Block" msgstr "Code Block" +msgid "Codex button" +msgstr "Pulsante Codex" + +msgid "Codex usage indicator" +msgstr "Indicatore di utilizzo di Codex" + #. Homepage headline, line 2 of 2, after “Run an Army of”. msgid "Coding Agents" msgstr "Agenti di coding" @@ -13968,6 +13974,9 @@ msgstr "Solo le persone invitate" msgid "Only people who opted in appear here." msgstr "Qui compaiono solo le persone che hanno scelto di partecipare." +msgid "Only show at or above a threshold" +msgstr "Mostra solo al raggiungimento della soglia" + msgid "Only the author can change a comment" msgstr "Solo l’autore può modificare un commento" @@ -18303,6 +18312,9 @@ msgstr "Sessione terminata" msgid "Session ended. Press Enter to start a new shell." msgstr "Sessione terminata. Premi Invio per avviare una nuova shell." +msgid "Session header" +msgstr "Intestazione della sessione" + msgid "Session name" msgstr "Nome della sessione" @@ -21235,6 +21247,9 @@ msgstr "Tre passaggi · tocca packages/ui e apps/desktop" msgid "Threshold" msgstr "Soglia" +msgid "Threshold (%)" +msgstr "Soglia (%)" + msgid "Ticket to production under one day, median" msgstr "Dal ticket alla produzione in meno di un giorno, mediana" diff --git a/packages/i18n/locales/ja/messages.po b/packages/i18n/locales/ja/messages.po index 504a580e9cb..ddfcf6d60fe 100644 --- a/packages/i18n/locales/ja/messages.po +++ b/packages/i18n/locales/ja/messages.po @@ -5007,6 +5007,12 @@ msgstr "コードブロック" msgid "Code Block" msgstr "Code Block" +msgid "Codex button" +msgstr "Codex ボタン" + +msgid "Codex usage indicator" +msgstr "Codex の使用量インジケーター" + #. Homepage headline, line 2 of 2, after “Run an Army of”. msgid "Coding Agents" msgstr "コードを書こう" @@ -13968,6 +13974,9 @@ msgstr "招待したユーザーのみ" msgid "Only people who opted in appear here." msgstr "参加を選んだ人だけがここに表示されます。" +msgid "Only show at or above a threshold" +msgstr "しきい値以上の場合のみ表示" + msgid "Only the author can change a comment" msgstr "コメントを変更できるのは作成者だけです" @@ -18303,6 +18312,9 @@ msgstr "セッション終了" msgid "Session ended. Press Enter to start a new shell." msgstr "セッションが終了しました。Enter キーを押すと新しいシェルを起動します。" +msgid "Session header" +msgstr "セッションヘッダー" + msgid "Session name" msgstr "セッション名" @@ -21235,6 +21247,9 @@ msgstr "3ステップ · packages/uiとapps/desktopに変更" msgid "Threshold" msgstr "しきい値" +msgid "Threshold (%)" +msgstr "しきい値(%)" + msgid "Ticket to production under one day, median" msgstr "チケットから本番まで中央値1日未満" diff --git a/packages/i18n/locales/ko/messages.po b/packages/i18n/locales/ko/messages.po index 5c7a1235bae..8f2aef1f05e 100644 --- a/packages/i18n/locales/ko/messages.po +++ b/packages/i18n/locales/ko/messages.po @@ -5007,6 +5007,12 @@ msgstr "코드 블록" msgid "Code Block" msgstr "코드 블록" +msgid "Codex button" +msgstr "Codex 버튼" + +msgid "Codex usage indicator" +msgstr "Codex 사용량 표시기" + #. Homepage headline, line 2 of 2, after “Run an Army of”. msgid "Coding Agents" msgstr "실행하세요" @@ -13968,6 +13974,9 @@ msgstr "초대된 사람만" msgid "Only people who opted in appear here." msgstr "참여를 선택한 사람만 여기에 표시됩니다." +msgid "Only show at or above a threshold" +msgstr "임계값 이상일 때만 표시" + msgid "Only the author can change a comment" msgstr "작성자만 댓글을 변경할 수 있습니다" @@ -18303,6 +18312,9 @@ msgstr "세션 종료" msgid "Session ended. Press Enter to start a new shell." msgstr "세션이 종료되었습니다. Enter 키를 눌러 새 셸을 시작하세요." +msgid "Session header" +msgstr "세션 헤더" + msgid "Session name" msgstr "세션 이름" @@ -21235,6 +21247,9 @@ msgstr "3단계 · packages/ui와 apps/desktop을 수정" msgid "Threshold" msgstr "기준값" +msgid "Threshold (%)" +msgstr "임계값(%)" + msgid "Ticket to production under one day, median" msgstr "티켓부터 프로덕션까지 중앙값 하루 미만" diff --git a/packages/i18n/locales/nl/messages.po b/packages/i18n/locales/nl/messages.po index ee12a8bb548..5d7631bb1f7 100644 --- a/packages/i18n/locales/nl/messages.po +++ b/packages/i18n/locales/nl/messages.po @@ -5007,6 +5007,12 @@ msgstr "Codeblok" msgid "Code Block" msgstr "Codeblok" +msgid "Codex button" +msgstr "Codex-knop" + +msgid "Codex usage indicator" +msgstr "Indicator voor Codex-gebruik" + #. Homepage headline, line 2 of 2, after “Run an Army of”. msgid "Coding Agents" msgstr "Coding agents" @@ -13968,6 +13974,9 @@ msgstr "Alleen uitgenodigde personen" msgid "Only people who opted in appear here." msgstr "Alleen mensen die zich hebben aangemeld verschijnen hier." +msgid "Only show at or above a threshold" +msgstr "Pas vanaf een drempelwaarde tonen" + msgid "Only the author can change a comment" msgstr "Alleen de auteur kan een reactie wijzigen" @@ -18303,6 +18312,9 @@ msgstr "Sessie beëindigd" msgid "Session ended. Press Enter to start a new shell." msgstr "Sessie beëindigd. Druk op Enter om een nieuwe shell te starten." +msgid "Session header" +msgstr "Sessiekop" + msgid "Session name" msgstr "Sessienaam" @@ -21235,6 +21247,9 @@ msgstr "Drie stappen · raakt packages/ui en apps/desktop" msgid "Threshold" msgstr "Drempel" +msgid "Threshold (%)" +msgstr "Drempelwaarde (%)" + msgid "Ticket to production under one day, median" msgstr "Ticket tot productie onder één dag, mediaan" diff --git a/packages/i18n/locales/pl/messages.po b/packages/i18n/locales/pl/messages.po index 2fabe3f2531..2c24e563076 100644 --- a/packages/i18n/locales/pl/messages.po +++ b/packages/i18n/locales/pl/messages.po @@ -5007,6 +5007,12 @@ msgstr "Blok kodu" msgid "Code Block" msgstr "Blok kodu" +msgid "Codex button" +msgstr "Przycisk Codex" + +msgid "Codex usage indicator" +msgstr "Wskaźnik użycia Codex" + #. Homepage headline, line 2 of 2, after “Run an Army of”. msgid "Coding Agents" msgstr "Agentów kodujących" @@ -13968,6 +13974,9 @@ msgstr "Tylko zaproszone osoby" msgid "Only people who opted in appear here." msgstr "Pojawiają się tu tylko osoby, które zgłosiły się same." +msgid "Only show at or above a threshold" +msgstr "Pokazuj dopiero od wartości progowej" + msgid "Only the author can change a comment" msgstr "Tylko autor może zmienić komentarz" @@ -18303,6 +18312,9 @@ msgstr "Sesja zakończona" msgid "Session ended. Press Enter to start a new shell." msgstr "Sesja zakończona. Naciśnij Enter, aby uruchomić nową powłokę." +msgid "Session header" +msgstr "Nagłówek sesji" + msgid "Session name" msgstr "Nazwa sesji" @@ -21235,6 +21247,9 @@ msgstr "Trzy kroki · dotyka packages/ui i apps/desktop" msgid "Threshold" msgstr "Próg" +msgid "Threshold (%)" +msgstr "Próg (%)" + msgid "Ticket to production under one day, median" msgstr "Od zgłoszenia do produkcji poniżej jednego dnia, mediana" diff --git a/packages/i18n/locales/pt-BR/messages.po b/packages/i18n/locales/pt-BR/messages.po index d0e8ddb849d..58ec65ac2bf 100644 --- a/packages/i18n/locales/pt-BR/messages.po +++ b/packages/i18n/locales/pt-BR/messages.po @@ -5007,6 +5007,12 @@ msgstr "Bloco de código" msgid "Code Block" msgstr "Bloco de código" +msgid "Codex button" +msgstr "Botão do Codex" + +msgid "Codex usage indicator" +msgstr "Indicador de uso do Codex" + #. Homepage headline, line 2 of 2, after “Run an Army of”. msgid "Coding Agents" msgstr "Agentes de código" @@ -13968,6 +13974,9 @@ msgstr "Somente pessoas convidadas" msgid "Only people who opted in appear here." msgstr "Só aparecem aqui as pessoas que optaram por participar." +msgid "Only show at or above a threshold" +msgstr "Mostrar somente a partir de um limite" + msgid "Only the author can change a comment" msgstr "Somente o autor pode alterar um comentário" @@ -18303,6 +18312,9 @@ msgstr "Sessão encerrada" msgid "Session ended. Press Enter to start a new shell." msgstr "Sessão encerrada. Pressione Enter para iniciar um novo shell." +msgid "Session header" +msgstr "Cabeçalho da sessão" + msgid "Session name" msgstr "Nome da sessão" @@ -21235,6 +21247,9 @@ msgstr "Três passos · mexe em packages/ui e apps/desktop" msgid "Threshold" msgstr "Limite" +msgid "Threshold (%)" +msgstr "Limite (%)" + msgid "Ticket to production under one day, median" msgstr "Do ticket à produção em menos de um dia, na mediana" diff --git a/packages/i18n/locales/ru/messages.po b/packages/i18n/locales/ru/messages.po index d5381912aea..6949f09b12b 100644 --- a/packages/i18n/locales/ru/messages.po +++ b/packages/i18n/locales/ru/messages.po @@ -5007,6 +5007,12 @@ msgstr "Блок кода" msgid "Code Block" msgstr "Блок кода" +msgid "Codex button" +msgstr "Кнопка Codex" + +msgid "Codex usage indicator" +msgstr "Индикатор использования Codex" + #. Homepage headline, line 2 of 2, after “Run an Army of”. msgid "Coding Agents" msgstr "Агентов-программистов" @@ -13968,6 +13974,9 @@ msgstr "Только приглашённые" msgid "Only people who opted in appear here." msgstr "Здесь показаны только те, кто согласился участвовать." +msgid "Only show at or above a threshold" +msgstr "Показывать только при достижении порога" + msgid "Only the author can change a comment" msgstr "Изменить комментарий может только автор" @@ -18303,6 +18312,9 @@ msgstr "Сеанс завершён" msgid "Session ended. Press Enter to start a new shell." msgstr "Сеанс завершён. Нажмите Enter, чтобы запустить новую оболочку." +msgid "Session header" +msgstr "Заголовок сессии" + msgid "Session name" msgstr "Имя сессии" @@ -21235,6 +21247,9 @@ msgstr "Три шага · затрагивает packages/ui и apps/desktop" msgid "Threshold" msgstr "Порог" +msgid "Threshold (%)" +msgstr "Порог (%)" + msgid "Ticket to production under one day, median" msgstr "От тикета до продакшена меньше суток, медиана" diff --git a/packages/i18n/locales/tr/messages.po b/packages/i18n/locales/tr/messages.po index 6a52c2bd66c..b8437cc768b 100644 --- a/packages/i18n/locales/tr/messages.po +++ b/packages/i18n/locales/tr/messages.po @@ -5007,6 +5007,12 @@ msgstr "Kod bloğu" msgid "Code Block" msgstr "Kod bloğu" +msgid "Codex button" +msgstr "Codex düğmesi" + +msgid "Codex usage indicator" +msgstr "Codex kullanım göstergesi" + #. Homepage headline, line 2 of 2, after “Run an Army of”. msgid "Coding Agents" msgstr "bir ordu çalıştırın" @@ -13968,6 +13974,9 @@ msgstr "Yalnızca davet edilen kişiler" msgid "Only people who opted in appear here." msgstr "Burada yalnızca katılmayı seçenler görünür." +msgid "Only show at or above a threshold" +msgstr "Yalnızca eşik değerine ulaşıldığında göster" + msgid "Only the author can change a comment" msgstr "Yorumu yalnızca yazarı değiştirebilir" @@ -18303,6 +18312,9 @@ msgstr "Oturum sona erdi" msgid "Session ended. Press Enter to start a new shell." msgstr "Oturum sona erdi. Yeni bir kabuk başlatmak için Enter tuşuna basın." +msgid "Session header" +msgstr "Oturum başlığı" + msgid "Session name" msgstr "Oturum adı" @@ -21235,6 +21247,9 @@ msgstr "Üç adım · packages/ui ve apps/desktop dizinlerine dokunur" msgid "Threshold" msgstr "Eşik" +msgid "Threshold (%)" +msgstr "Eşik (%)" + msgid "Ticket to production under one day, median" msgstr "Biletten üretime bir günün altında, medyan" diff --git a/packages/i18n/locales/uk/messages.po b/packages/i18n/locales/uk/messages.po index d08831f687d..9cd06ee621b 100644 --- a/packages/i18n/locales/uk/messages.po +++ b/packages/i18n/locales/uk/messages.po @@ -5001,6 +5001,12 @@ msgstr "Блок коду" msgid "Code Block" msgstr "Блок коду" +msgid "Codex button" +msgstr "Кнопка Codex" + +msgid "Codex usage indicator" +msgstr "Індикатор використання Codex" + #. Homepage headline, line 2 of 2, after “Run an Army of”. msgid "Coding Agents" msgstr "кодинг-агентів" @@ -13962,6 +13968,9 @@ msgstr "Лише запрошені люди" msgid "Only people who opted in appear here." msgstr "Тут показано лише тих, хто погодився на участь." +msgid "Only show at or above a threshold" +msgstr "Показувати лише після досягнення порога" + msgid "Only the author can change a comment" msgstr "Лише автор може змінити коментар" @@ -18297,6 +18306,9 @@ msgstr "Сеанс завершено" msgid "Session ended. Press Enter to start a new shell." msgstr "Сеанс завершено. Натисніть Enter, щоб запустити нову оболонку." +msgid "Session header" +msgstr "Заголовок сеансу" + msgid "Session name" msgstr "Назва сеансу" @@ -21229,6 +21241,9 @@ msgstr "Три кроки · зачіпає packages/ui і apps/desktop" msgid "Threshold" msgstr "Поріг" +msgid "Threshold (%)" +msgstr "Поріг (%)" + msgid "Ticket to production under one day, median" msgstr "Від тікета до продакшену менше ніж за день (медіана)" diff --git a/packages/i18n/locales/vi/messages.po b/packages/i18n/locales/vi/messages.po index 495f4fa2dde..449d9e526b9 100644 --- a/packages/i18n/locales/vi/messages.po +++ b/packages/i18n/locales/vi/messages.po @@ -5007,6 +5007,12 @@ msgstr "Khối mã" msgid "Code Block" msgstr "Code Block" +msgid "Codex button" +msgstr "Nút Codex" + +msgid "Codex usage indicator" +msgstr "Chỉ báo mức sử dụng Codex" + #. Homepage headline, line 2 of 2, after “Run an Army of”. msgid "Coding Agents" msgstr "Agent lập trình" @@ -13968,6 +13974,9 @@ msgstr "Chỉ những người được mời" msgid "Only people who opted in appear here." msgstr "Chỉ những người đã chọn tham gia mới xuất hiện ở đây." +msgid "Only show at or above a threshold" +msgstr "Chỉ hiển thị khi đạt ngưỡng trở lên" + msgid "Only the author can change a comment" msgstr "Chỉ tác giả mới có thể sửa bình luận" @@ -18303,6 +18312,9 @@ msgstr "Phiên đã kết thúc" msgid "Session ended. Press Enter to start a new shell." msgstr "Phiên đã kết thúc. Nhấn Enter để mở shell mới." +msgid "Session header" +msgstr "Tiêu đề phiên" + msgid "Session name" msgstr "Tên phiên" @@ -21235,6 +21247,9 @@ msgstr "Ba bước · động tới packages/ui và apps/desktop" msgid "Threshold" msgstr "Ngưỡng" +msgid "Threshold (%)" +msgstr "Ngưỡng (%)" + msgid "Ticket to production under one day, median" msgstr "Từ ticket đến production dưới một ngày, tính trung vị" diff --git a/packages/i18n/locales/zh-CN/messages.po b/packages/i18n/locales/zh-CN/messages.po index f3861db700b..4b05e6d0442 100644 --- a/packages/i18n/locales/zh-CN/messages.po +++ b/packages/i18n/locales/zh-CN/messages.po @@ -5007,6 +5007,12 @@ msgstr "代码块" msgid "Code Block" msgstr "代码块" +msgid "Codex button" +msgstr "Codex 按钮" + +msgid "Codex usage indicator" +msgstr "Codex 用量指示器" + #. Homepage headline, line 2 of 2, after “Run an Army of”. msgid "Coding Agents" msgstr "编程智能体大军" @@ -13968,6 +13974,9 @@ msgstr "仅受邀者" msgid "Only people who opted in appear here." msgstr "只有选择加入的人才会出现在这里。" +msgid "Only show at or above a threshold" +msgstr "仅在达到或超过阈值时显示" + msgid "Only the author can change a comment" msgstr "只有作者可以修改评论" @@ -18303,6 +18312,9 @@ msgstr "会话已结束" msgid "Session ended. Press Enter to start a new shell." msgstr "会话已结束。按 Enter 启动新的 Shell。" +msgid "Session header" +msgstr "会话标题栏" + msgid "Session name" msgstr "会话名称" @@ -21235,6 +21247,9 @@ msgstr "三个步骤 · 涉及packages/ui和apps/desktop" msgid "Threshold" msgstr "阈值" +msgid "Threshold (%)" +msgstr "阈值 (%)" + msgid "Ticket to production under one day, median" msgstr "从工单到上线中位不足一天" diff --git a/packages/i18n/locales/zh-TW/messages.po b/packages/i18n/locales/zh-TW/messages.po index fe521176171..45186c6d158 100644 --- a/packages/i18n/locales/zh-TW/messages.po +++ b/packages/i18n/locales/zh-TW/messages.po @@ -5007,6 +5007,12 @@ msgstr "程式碼塊" msgid "Code Block" msgstr "程式碼塊" +msgid "Codex button" +msgstr "Codex 按鈕" + +msgid "Codex usage indicator" +msgstr "Codex 用量指示器" + #. Homepage headline, line 2 of 2, after “Run an Army of”. msgid "Coding Agents" msgstr "程式代理程式大軍" @@ -13968,6 +13974,9 @@ msgstr "僅受邀者" msgid "Only people who opted in appear here." msgstr "只有選擇加入的人才會出現在這裡。" +msgid "Only show at or above a threshold" +msgstr "僅在達到或超過門檻時顯示" + msgid "Only the author can change a comment" msgstr "只有作者可以修改留言" @@ -18303,6 +18312,9 @@ msgstr "工作階段已結束" msgid "Session ended. Press Enter to start a new shell." msgstr "工作階段已結束。按 Enter 啟動新的 Shell。" +msgid "Session header" +msgstr "工作階段標題列" + msgid "Session name" msgstr "會話名稱" @@ -21235,6 +21247,9 @@ msgstr "三個步驟 · 涉及packages/ui和apps/desktop" msgid "Threshold" msgstr "門檻" +msgid "Threshold (%)" +msgstr "門檻 (%)" + msgid "Ticket to production under one day, median" msgstr "從工單到上線中位不足一天" From bf8ef1eed84fd39bca56b48458b1fd94900ee71d Mon Sep 17 00:00:00 2001 From: Viktor Bystrov <18964918+ViktorBystrov72@users.noreply.github.com> Date: Tue, 24 Nov 2026 15:19:39 +0500 Subject: [PATCH 2/3] fix(desktop): rehydrate settings when window sync starts --- apps/desktop/src/renderer/routes/_authenticated/layout.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/desktop/src/renderer/routes/_authenticated/layout.tsx b/apps/desktop/src/renderer/routes/_authenticated/layout.tsx index 655985b8411..407720daf66 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/layout.tsx +++ b/apps/desktop/src/renderer/routes/_authenticated/layout.tsx @@ -140,7 +140,11 @@ function AuthenticatedLayout() { const [isSigningOut, setIsSigningOut] = useState(false); useSettingsExternalChangeListener(); - useEffect(() => syncPersistedStoreAcrossWindows(useSettings), []); + useEffect(() => { + const unsubscribe = syncPersistedStoreAcrossWindows(useSettings); + void useSettings.persist.rehydrate(); + return unsubscribe; + }, []); // Seed the parked-terminal eviction cap from settings (SUPER-1545). const { data: parkedRuntimeCap } = From a91286ccb0f966329983556d1c16927d8ed76046 Mon Sep 17 00:00:00 2001 From: Viktor Bystrov <18964918+ViktorBystrov72@users.noreply.github.com> Date: Tue, 24 Nov 2026 15:31:38 +0500 Subject: [PATCH 3/3] fix(desktop): handle settings without local storage --- apps/desktop/src/renderer/routes/_authenticated/layout.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/desktop/src/renderer/routes/_authenticated/layout.tsx b/apps/desktop/src/renderer/routes/_authenticated/layout.tsx index 407720daf66..fc6cc2394fe 100644 --- a/apps/desktop/src/renderer/routes/_authenticated/layout.tsx +++ b/apps/desktop/src/renderer/routes/_authenticated/layout.tsx @@ -141,8 +141,10 @@ function AuthenticatedLayout() { useSettingsExternalChangeListener(); useEffect(() => { + const persist = useSettings.persist; + if (!persist) return; const unsubscribe = syncPersistedStoreAcrossWindows(useSettings); - void useSettings.persist.rehydrate(); + void persist.rehydrate(); return unsubscribe; }, []);