Skip to content

Commit ebc7c9a

Browse files
committed
feat: hide usage tracking UI when API key is configured
Usage tracking via CLI only works for Claude Code subscription users. Hide the Usage button and settings section when an Anthropic API key is set.
1 parent 5bd2b70 commit ebc7c9a

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

apps/ui/src/components/views/board-view/board-header.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { Label } from "@/components/ui/label";
77
import { Plus, Bot } from "lucide-react";
88
import { KeyboardShortcut } from "@/hooks/use-keyboard-shortcuts";
99
import { ClaudeUsagePopover } from "@/components/claude-usage-popover";
10+
import { useAppStore } from "@/store/app-store";
1011

1112
interface BoardHeaderProps {
1213
projectName: string;
@@ -31,15 +32,20 @@ export function BoardHeader({
3132
addFeatureShortcut,
3233
isMounted,
3334
}: BoardHeaderProps) {
35+
const apiKeys = useAppStore((state) => state.apiKeys);
36+
37+
// Hide usage tracking when using API key (only show for Claude Code CLI users)
38+
const showUsageTracking = !apiKeys.anthropic;
39+
3440
return (
3541
<div className="flex items-center justify-between p-4 border-b border-border bg-glass backdrop-blur-md">
3642
<div>
3743
<h1 className="text-xl font-bold">Kanban Board</h1>
3844
<p className="text-sm text-muted-foreground">{projectName}</p>
3945
</div>
4046
<div className="flex gap-2 items-center">
41-
{/* Usage Popover */}
42-
{isMounted && <ClaudeUsagePopover />}
47+
{/* Usage Popover - only show for CLI users (not API key users) */}
48+
{isMounted && showUsageTracking && <ClaudeUsagePopover />}
4349

4450
{/* Concurrency Slider - only show after mount to prevent hydration issues */}
4551
{isMounted && (

apps/ui/src/components/views/settings-view.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,12 @@ export function SettingsView() {
4747
defaultAIProfileId,
4848
setDefaultAIProfileId,
4949
aiProfiles,
50+
apiKeys,
5051
} = useAppStore();
5152

53+
// Hide usage tracking when using API key (only show for Claude Code CLI users)
54+
const showUsageTracking = !apiKeys.anthropic;
55+
5256
// Convert electron Project to settings-view Project type
5357
const convertProject = (
5458
project: ElectronProject | null
@@ -99,7 +103,7 @@ export function SettingsView() {
99103
isChecking={isCheckingClaudeCli}
100104
onRefresh={handleRefreshClaudeCli}
101105
/>
102-
<ClaudeUsageSection />
106+
{showUsageTracking && <ClaudeUsageSection />}
103107
</div>
104108
);
105109
case "ai-enhancement":

0 commit comments

Comments
 (0)