Repository navigation
Closed
Labels
enhancementNew feature or request
Description
Why
The Swift shell shows each provider's weekly usage in the sidebar footer: a chip per provider between the device picker and Settings, and a Weekly Usage popover above them.
The web shell shows nothing, although the core already computes the numbers.
Usage display is on the umbrella PRD's deferred list (agents/prd/web-shell-pivot/prd.md D-04).
What exists
herdr-core/src/usage.rsfillsnavigator.provider_usage: one row per provider (clauderead throughclaude -p /usage,codexthrough its usage endpoint with a session-JSONL fallback), each withstate,used_percent,resets_at_unix_seconds,message, andbuckets(per-model rows such as Fable under Claude Code).- The refresh timer reads two hints that ride
ui_state_update:usage_window_visible(a 5-minute refresh while the window is visible) andusage_popover_open(opening the popover refreshes a row older than 60 s). - Swift draws it in
macos/Sources/HerdrMacOS/HideSidebar.swift(HideUsagePopover).
Gap
contracts/hided-ws.schema.jsondeclares neithernavigator.provider_usagenor the two hint fields, soweb/src/generated/hided-ws.tshas no type for them.- The web never sends the hints, so a web-only session gets the first read and never refreshes.
web/src/sidebar.tsxhas no chip or popover.
Scope
- Contract: declare
provider_usage(withbuckets) on the navigator andusage_window_visible/usage_popover_openonui_state_update, then regenerate the web types. - Footer chips: provider mark and percent, colored by the same thresholds as Swift, muted when
stateis notavailable,staleorfallback. - Popover:
Weekly Usagewith7 days, one row per provider (label, reset countdown such asin 5d 4h, percent, bar) and indented bucket rows under it. - Hints:
usage_window_visiblefollows document visibility,usage_popover_openfollows the popover. - States: loading and unavailable read as a muted chip with the row's
messageinside the popover, never a banner (design principle Move live and remote Herdr parsing to the typed boundary #13). - Pen: draw the chip and popover as a Component sheet and update the sidebar screen sheet in the same PR (
docs/DESIGN_WORKFLOW.md).
Done when
- For one core, the web chips and popover show the same percents and resets as the Swift shell.
- Opening the popover after 60 s triggers a read, and a hidden tab stops the 5-minute refresh.
- Web e2e covers an available, a loading and an unavailable row from the fixture.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
web: group the ⌘K palette in the Swift search form and add the sideba…
Move Settings into the sidebar footer and give the usage popover its …
fix: remove the causes of the connected-node runtime test flakes (#1824)