From 4316a465b8124ee96b5c18e2206243c2c5a67905 Mon Sep 17 00:00:00 2001 From: Zane Staggs Date: Thu, 26 Jun 2025 10:14:21 -0700 Subject: [PATCH 1/2] added flag to enable showing cost tracking --- .../src/components/bottom_menu/BottomMenu.tsx | 19 +++++++---- .../src/components/more_menu/MoreMenu.tsx | 2 +- .../settings/app/AppSettingsSection.tsx | 32 ++++++++++--------- ui/desktop/src/updates.ts | 1 + 4 files changed, 32 insertions(+), 22 deletions(-) diff --git a/ui/desktop/src/components/bottom_menu/BottomMenu.tsx b/ui/desktop/src/components/bottom_menu/BottomMenu.tsx index bd3a2d4aad8b..3e9734717dc3 100644 --- a/ui/desktop/src/components/bottom_menu/BottomMenu.tsx +++ b/ui/desktop/src/components/bottom_menu/BottomMenu.tsx @@ -10,6 +10,7 @@ import { useModelAndProvider } from '../ModelAndProviderContext'; import { Message } from '../../types/message'; import { ManualSummarizeButton } from '../context_management/ManualSummaryButton'; import { CostTracker } from './CostTracker'; +import { COST_TRACKING_ENABLED } from '../../updates'; const TOKEN_LIMIT_DEFAULT = 128000; // fallback for custom models that the backend doesn't know about const TOKEN_WARNING_THRESHOLD = 0.8; // warning shows at 80% of the token limit @@ -223,12 +224,18 @@ export default function BottomMenu({ {/* Cost Tracker - no separator before it */} -
- -
- - {/* Separator between cost and model */} -
+ {COST_TRACKING_ENABLED && ( + <> +
+ +
+
+ + )} {/* Model Selector Dropdown */}
diff --git a/ui/desktop/src/components/more_menu/MoreMenu.tsx b/ui/desktop/src/components/more_menu/MoreMenu.tsx index 75286168b4c3..41635661d943 100644 --- a/ui/desktop/src/components/more_menu/MoreMenu.tsx +++ b/ui/desktop/src/components/more_menu/MoreMenu.tsx @@ -358,7 +358,7 @@ export default function MoreMenu({ subtitle="Browse your saved recipes" icon={} > - Go to Recipe Library + Recipe Library { diff --git a/ui/desktop/src/components/settings/app/AppSettingsSection.tsx b/ui/desktop/src/components/settings/app/AppSettingsSection.tsx index c19558c0b303..ea18cc471dbd 100644 --- a/ui/desktop/src/components/settings/app/AppSettingsSection.tsx +++ b/ui/desktop/src/components/settings/app/AppSettingsSection.tsx @@ -4,7 +4,7 @@ import { Button } from '../../ui/button'; import { Settings, RefreshCw, ExternalLink } from 'lucide-react'; import Modal from '../../Modal'; import UpdateSection from './UpdateSection'; -import { UPDATES_ENABLED } from '../../../updates'; +import { COST_TRACKING_ENABLED, UPDATES_ENABLED } from '../../../updates'; import { getApiUrl, getSecretKey } from '../../../config'; interface AppSettingsSectionProps { @@ -274,21 +274,23 @@ export default function AppSettingsSection({ scrollToSection }: AppSettingsSecti
{/* Cost Tracking */} -
-
-

Cost Tracking

-

- Show model pricing and usage costs -

-
-
- + {COST_TRACKING_ENABLED && ( +
+
+

Cost Tracking

+

+ Show model pricing and usage costs +

+
+
+ +
-
+ )} {/* Pricing Status - only show if cost tracking is enabled */} {showPricing && ( diff --git a/ui/desktop/src/updates.ts b/ui/desktop/src/updates.ts index da6e19cfee1f..3029a850030d 100644 --- a/ui/desktop/src/updates.ts +++ b/ui/desktop/src/updates.ts @@ -1 +1,2 @@ export const UPDATES_ENABLED = true; +export const COST_TRACKING_ENABLED = true; From 94079cb17ebf8484032e4a3c6327189076f05f9e Mon Sep 17 00:00:00 2001 From: Zane Staggs Date: Thu, 26 Jun 2025 10:48:00 -0700 Subject: [PATCH 2/2] base pricing settings visibiliy on COST_TRACKING_ENABLED --- ui/desktop/src/components/settings/app/AppSettingsSection.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/desktop/src/components/settings/app/AppSettingsSection.tsx b/ui/desktop/src/components/settings/app/AppSettingsSection.tsx index ea18cc471dbd..1a96a3d30943 100644 --- a/ui/desktop/src/components/settings/app/AppSettingsSection.tsx +++ b/ui/desktop/src/components/settings/app/AppSettingsSection.tsx @@ -293,7 +293,7 @@ export default function AppSettingsSection({ scrollToSection }: AppSettingsSecti )} {/* Pricing Status - only show if cost tracking is enabled */} - {showPricing && ( + {COST_TRACKING_ENABLED && showPricing && ( <>
Pricing Source: