This repository was archived by the owner on Sep 2, 2026. It is now read-only.
Repository navigation
[Spec] Sidebar usage gauge - #58
Merged
Merged
Conversation
Rolls store feature interactions up to category totals for ticket #36; pure seam so ranking/cap/share logic is unit-testable without React.
SidebarUsageGauge reads featureInteractions from the app store and renders top categories as monochrome thin bars; renders nothing when the store is empty (ticket #36). Adds en catalog keys for the new copy.
Rows stay translation-free in the memo; labels re-translate on useTranslation-driven rerenders instead of freezing at first compute.
…ible Collapse the 15-case label switch into a Record of lazy translate() thunks so keys stay literal for i18n extraction (#36). Clamp nonzero bar widths up to the smallest visible percent so heavy outliers don't round small categories to invisible 0% bars.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Spec & Tickets
Criteria
getSidebarUsageGaugeRowsrollsstate.featureInteractionsinto category totals; testssums feature interactions into category totals…,renders real category counts and monochrome bars from the store[]for{}/null/undefined; component returnsnull; testsstays empty when the telemetry store has no records,renders nothing when the telemetry store has no recordsworktree-sidebar-foregroundopacity tiers +muted-foreground; no new tokensSIDEBAR_USAGE_GAUGE_MAX_ROWS = 4), monochrome grays, below the scrollableWorktreeListChanges
View-model seam (
sidebar-usage-gauge-model.ts)FeatureInteractionState, heaviest-first with catalog-order tie-break, capped at 4 rows,shareOfMaxbar math with a 3% minimum visible width for nonzero shares (getSidebarUsageGaugeBarWidthPercent).SIDEBAR_USAGE_GAUGE_ROW_LABELS) resolved at render time so language switches apply.Component (
SidebarUsageGauge.tsx)useAppStore((s) => s.featureInteractions); caption + up to 4 label/count/bar rows; renders nothing on empty state.Wiring & i18n
index.tsx); 16 auto i18n keys inen.json.Tests
Decisions recorded
interactionCountfeeds the gauge (usage-bucket primitives are analytics emission ranges) → satisfies "real counts" + "no new collection".translate()calls.SidebarToolbarpattern).QA plan