Skip to content

✨ dashboard: running-cost tile rotates hour / today / week / month - #15620

Merged
clubanderson merged 3 commits into
v5from
cost-rotate
Oct 30, 2026
Merged

clubanderson merged 3 commits into
v5from
cost-rotate

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #15614

The Overview RUNNING tile (3 · $53.91 this hour) now rotates its cost window continuously — this hour → today → this week → this month — with ~4 s dwell per phrase.

Frontend

  • Quiet vertical crossfade/slide of only the amount + window phrase; the 3 · agent count stays fixed.
  • No layout shift: the rotor is an inline-grid with all four phrases stacked in one grid area, so width is reserved for the widest phrase; the tile value is nowrap with ellipsis fallback (fixes the "this hour" wrapping to a second line).
  • Amber/text tokens only (var(--amber) / var(--text)); no raw hex/rgba (style ratchet clean).
  • prefers-reduced-motion: reduce → instant swap, no transition.
  • Pauses while hovered or while document.hidden; resumes in step (the tick skips rather than advancing).
  • Tooltip lists all four values and explains the window semantics.
  • Status repaints keep the current phrase (rotation state is module-level).

Server

/api/status.fleetRun gains dayUSD, weekUSD, monthUSD, windowsPriced, aggregated from the existing cost ledger in UpdateStatusIfFresh:

  • hour — unchanged, the run meter's rise since the top of the clock hour.
  • today / this week / this month — per-UTC-day ledger (stored CostDailyRollup for complete days, folded 5-min snapshots for today) summed from 00:00 UTC today / Monday 00:00 UTC (ISO week) / the 1st 00:00 UTC, plus the live tail since the last snapshot, floored at hourUSD.
  • windowsPriced=false when there is no ledger yet (UI then shows only the hour phrase).

Tests

  • fleet_cost_windows_test.go — window starts (ISO week / zone), ledger + tail sum, hour floor / unpriced path.
  • fleet_cost_rotor.test.js (Node, fake timers) — rotation order and 4 s timing, repaint keeps index, hover/hidden pause + resume in step, reduced-motion path sets no is-out, markup/tooltip, nowrap/ellipsis/token-only CSS.
  • webstatic/fleet_run_stat_test.go updated for the new markup.

Docs

src/docs/dashboard-sections.md, src/docs/api-reference/health-status-events.md, changelog.d/added-15614-running-cost-rotor.md.

Screenshots (one per window)

RUNNING tile showing this hour
RUNNING tile showing today
RUNNING tile showing this week
RUNNING tile showing this month

The Overview RUNNING tile now rotates its cost window every ~4s
(this hour → today → this week → this month) with a quiet vertical
crossfade of only the amount+window phrase. Agent count stays fixed,
width is reserved for the widest phrase (nowrap + ellipsis fallback),
prefers-reduced-motion swaps instantly, rotation pauses on hover or
while the tab is hidden and resumes in step, and the tooltip lists all
four values.

Server side, /api/status.fleetRun gains dayUSD / weekUSD / monthUSD /
windowsPriced, aggregated from the existing cost ledger (UTC day, ISO
week, calendar month) plus the live tail since the last snapshot.

Fixes #15614

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 30, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign nicholasjackson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Oct 30, 2026
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#15526 🌱 dashboard: split stage_tracker.go into 4 files same files src/docs/dashboard-sections.md
src/pkg/dashboard/server.go
#15530 🐛 fix(dashboard): issue-row linked PR passes null when the lineage chip is empty same files src/pkg/dashboard/static/index.html
#15616 🐛 tracker: PRs under repair leave the merge train same files src/docs/dashboard-sections.md
src/pkg/dashboard/static/index.html
#15566 🌱 refactor: split stage tracker UI tests same files src/pkg/dashboard/static-src/js/agent-now.js
src/pkg/dashboard/static/index.html
#15574 🌱 dashboard: split stage_tracker.go into 4 files same files src/docs/dashboard-sections.md
src/pkg/dashboard/server.go

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Failing checks:

  • test (dashboard 2/4)
  • test (dashboard 3/4)
  • test (dashboard shuffle 1/3)
  • test (dashboard shuffle 3/3)

Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

stage 080-awaiting-merge-admission → 071-needs-author: optional-check-failing:test (dashboard 2/4)

TestNavbarUpgradeBeeDoesNotAddBareSetInterval caps bare setInterval(
calls in static/index.html; use dashboardSetInterval (paused while the
tab is hidden) and hold its visibilitychange re-fire so the rotation
resumes in step.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@clubanderson
clubanderson merged commit 3dc7198 into v5 Oct 30, 2026
77 of 78 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the cost-rotate branch October 30, 2026 02:43
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dashboard: running-cost tile should rotate hour / today / week / month and stop wrapping

1 participant