Repository navigation
LOCAL: add a gamified TeamClaude leaderboard section to the sidebar - #67
Conversation
…nt seam Shared surface for the sidebar leaderboard: the snapshot the runtime host serves from the coordinator's existing /teamclaude/status, and the renderer client the sidebar calls. The client returns null until the service lands. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Polls getTeamClaudeLeaderboard from the focused workspace's account owner (as the status bar does) while the window is visible, refreshing on visibility and focus. A null or not-configured result hides the section. The compact row shows rank, fresh tokens and the gap to the neighbour, with medal tints for ranks 1-3 and a brief rank-move indicator; it expands upward into the full board, whose state persists in localStorage. A request sequence drops replies from a previous target or an unmounted section, and a failed read marks the last board stale instead of clearing it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Resolve the en.json conflict by keeping both the leaderboard keys and the keys from sync #64. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
💡 Codex ReviewWhen the board is rendered, this tooltip contains a client list and additional usage statistics rather than a control label. AGENTS.md reference: AGENTS.md:L10-L10 For an AGENTS.md reference: AGENTS.md:L10-L10 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…le reason inline The style guide reserves Tooltip for naming controls and keeps errors users must read inline (Codex review on #67). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Both Codex findings on cf6f09a are addressed in b54be75:
Re-captured both states with @codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
HoverCardContent owns its spacing and typography; the changed-code quality gate refused the p-3 and text-xs overrides. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
ELI5
The bottom of the left sidebar gets a small trophy row that shows where you stand in the team's TeamClaude token use today: "#3 of 6 today · 42.3M tokens · 6.6M behind #2". Clicking it opens the full board. It updates about once a minute, and it appears only on machines that run TeamClaude.
What Changed
The section sits directly above the settings/help toolbar. It lives in
src/renderer/src/components/sidebar/teamclaude-leaderboard/, andsidebar/index.tsxgets a 2-line insertion.Data
getTeamClaudeLeaderboard(target)everyTEAMCLAUDE_LEADERBOARD_REFRESH_MS(60s) through the existinginstallWindowVisibilityTimeoutPoller.useActiveAccountOwner, the same owner the status bar uses.States
null(an older or upstream runtime) ornot-configuredhides the section, with no console noise.unavailableis a muted one-line row with the reason in a tooltip.Compact row
status-warning, silvermuted-foreground, bronzeworkspace-status-done.motion-reduce:animate-none.Board
fetchedAt.Other
en.jsonkeys, required by the localization gates.This PR also carries the shared commit
20990ec7a6: the snapshot types (src/shared/teamclaude-leaderboard-types.ts) and the renderer client seam, which returnsnulluntil the data-service PR implements it. Until that PR lands, the section stays hidden.Why
The operator asked for a gamified "you are #2" leaderboard of one-day TeamClaude token use, in the sidebar just above settings/help. It updates live-ish, a person's several minidevs count as one score, it reads only existing endpoints, and it is fork-only.
Fresh tokens (input + output + cache writes) are the ranking metric because cache reads make up about 98% of the raw total. Raw totals would mostly rank context length rather than work.
Linked Issue
N/A: operator request in session. Follow-ups:
mobile/src/home/MobileHomeAccountUsageCards.tsx.Visual Proof
The component fixture was captured with
pnpm fixtures:shot 'sidebar/teamclaude-leaderboard/*' --theme both --scale 2at 280px and 220px sidebar widths. It covers 10 states in light and dark themes: leader, leaderExpanded, midPack, midPackMinWidth, midPackRowTooltip, rankUp, rankDown, stale, notRanked and unavailable. The images are on minidev-alex1 and not attached here, because no image-upload tool is available on the VM. I can add them on request. A capture in the integrated app will follow once the data service lands.At 220px only the compact row's gap text truncates ("6.6M behi…").
Testing
pnpm check:changed --maxWorkers=2 --base=refs/remotes/swaplabs/swaplabs/mainpassed 24/24 checks on 12 files, in the worker's run.The guard test passes 2/2: an out-of-order target switch, and staleness on a read failure. With the sequence check removed, the out-of-order test fails as intended.
Coordinator re-run after opening: pending, posted as a comment when done.
I manually tested these changes locally (component fixtures; integrated-app check pending the service)
Automated tests added/updated, or explained why not below
AI Disclosure
Prepared by Claude Code (Claude Opus 5.5) at the operator's request.
Review
Opened at the operator's request to "open PRs asap and run tests after". The local review and a coordinator test run come after opening.
Agent skill upstream boundary
Notes
null, which hides the section.Checklist
N/Awith reason: fixture captures are listed above; image files available on requestpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred): the worker'scheck:changedpassed; the coordinator re-run and the full build follow🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.