Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions ui/desktop/src/components/bottom_menu/BottomMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -223,12 +224,18 @@ export default function BottomMenu({
</div>

{/* Cost Tracker - no separator before it */}
<div className="flex items-center h-full ml-1">
<CostTracker inputTokens={inputTokens} outputTokens={outputTokens} sessionCosts={sessionCosts} />
</div>

{/* Separator between cost and model */}
<div className="w-[1px] h-4 bg-borderSubtle mx-1.5" />
{COST_TRACKING_ENABLED && (
<>
<div className="flex items-center h-full ml-1">
<CostTracker
inputTokens={inputTokens}
outputTokens={outputTokens}
sessionCosts={sessionCosts}
/>
</div>
<div className="w-[1px] h-4 bg-borderSubtle mx-1.5" />
</>
)}

{/* Model Selector Dropdown */}
<div className="flex items-center h-full">
Expand Down
2 changes: 1 addition & 1 deletion ui/desktop/src/components/more_menu/MoreMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ export default function MoreMenu({
subtitle="Browse your saved recipes"
icon={<FileText className="w-4 h-4" />}
>
Go to Recipe Library
Recipe Library
</MenuButton>
<MenuButton
onClick={() => {
Expand Down
34 changes: 18 additions & 16 deletions ui/desktop/src/components/settings/app/AppSettingsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -274,24 +274,26 @@ export default function AppSettingsSection({ scrollToSection }: AppSettingsSecti
</div>

{/* Cost Tracking */}
<div className="flex items-center justify-between mb-4">
<div>
<h3 className="text-textStandard">Cost Tracking</h3>
<p className="text-xs text-textSubtle max-w-md mt-[2px]">
Show model pricing and usage costs
</p>
</div>
<div className="flex items-center">
<Switch
checked={showPricing}
onCheckedChange={handleShowPricingToggle}
variant="mono"
/>
{COST_TRACKING_ENABLED && (
<div className="flex items-center justify-between mb-4">
<div>
<h3 className="text-textStandard">Cost Tracking</h3>
<p className="text-xs text-textSubtle max-w-md mt-[2px]">
Show model pricing and usage costs
</p>
</div>
<div className="flex items-center">
<Switch
checked={showPricing}
onCheckedChange={handleShowPricingToggle}
variant="mono"
/>
</div>
</div>
</div>
)}

{/* Pricing Status - only show if cost tracking is enabled */}
{showPricing && (
{COST_TRACKING_ENABLED && showPricing && (
<>
<div className="flex items-center justify-between text-xs mb-2 px-4">
<span className="text-textSubtle">Pricing Source:</span>
Expand Down
1 change: 1 addition & 0 deletions ui/desktop/src/updates.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export const UPDATES_ENABLED = true;
export const COST_TRACKING_ENABLED = true;
Loading