Skip to content

fix(ui): the API spend line says "Since 4 Nov" instead of a range ending today - #6726

Open
jenna-winkler wants to merge 1 commit into
mainfrom
claude/intelligent-cray-lbeg4x
Open

jenna-winkler wants to merge 1 commit into
mainfrom
claude/intelligent-cray-lbeg4x

Conversation

@jenna-winkler

@jenna-winkler jenna-winkler commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

What and why

The API spend card showed a running range such as "4–19 Nov 2026, so far". Spend uses UTC days, so in the evening west of UTC the end date is tomorrow's date. The line also had a dotted underline and a tooltip that repeated the start date. Now a running range shows only its start: "Since 4 Nov", or "Today so far" for the Today tab. The line has no underline and no tooltip.

Reviewer guide

  • What changes in substance
    • A running range shows only where it starts. A finished range (Last week, Last month) keeps its full dates.
    • The year shows only when the range started in an earlier year than today, for example "Since 28 Dec 2026" in January.
    • The Today tab shows "Today so far", not a date. (open) The UTC day boundary is unchanged; the help text still explains it.
  • Where to look closely
    • A finished range that starts before metering began keeps its tooltip, "Measuring started on …". Only a running range lost the tooltip. (open)

Scope

  • spend/lib/range-label.ts: a new formatSoFar formatter.
  • spend/lib/copy.ts: rangeLine uses formatSoFar for a running range.
  • spend/components/spend-total-lines.tsx: a running range renders as plain text, with no tooltip.
  • A new unit test, spend-range-line.test.ts.

Issue

Closes #6714

Testing

  • vitest: the new test and the spend tests pass.
  • Full UI unit suite: 2250 passed, 20 failed. The same 20 fail on main without this change (cron-conversion, just-ask, schedule-form-rule). They depend on the sandbox time zone.
  • tsc --noEmit, eslint and prettier --check pass on the changed files.

…ing today

A running range named today's UTC day as its end, which reads as
tomorrow in the evening west of UTC, and the line carried an underline
and a tooltip that repeated the start date. A running range now names
only its start ("Since 4 Nov", or "Today so far"), with no tooltip.
A finished range keeps its full dates.

Fixes #6714

Assisted-By: Claude
Signed-off-by: Jenna Winkler <135358348+jenna-winkler@users.noreply.github.com>

@dam-code-protector dam-code-protector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ Code Guardian 🛡️ — ✅ Code Review @ a2ca736

PR #6726: fix(ui): the API spend line says "Since 4 Nov" instead of a range ending today

Author: jenna-winkler | Branch: claude/intelligent-cray-lbeg4x → main | Changes: +55 −3 (4 files)

Summary

This PR changes the line under a spend total for a running range. The line names only the start ("Since 4 Nov" or "Today so far"). It has no underline and no tooltip, and a finished range keeps its full dates and tooltip.

Findings

  • ✅ Looks good: I ran shownRange and formatSoFar on eight range shapes. A running month cut at the start reads "Since 4 Nov". A week across New Year reads "Since 28 Dec 2026". The first day of a month or a week reads "Today so far". A cut finished month keeps its full dates and its tooltip. All added comments pass check:comment-types.

Documentation Check (doc-drift)

  • 🟢 Suggestion: The Home screen text says that a running range "ends at today and says "so far"". This PR makes that sentence false, so change it to the new lines (docs/architecture/spend-limits.md:447).

Issue Fit

✅ No findings.

TypeScript Engineering Review

✅ No findings.

React UI Engineering Review

  • 🟢 Suggestion: The tooltip rule is now the JSX condition shown.soFar || !shown.cutAtStart, and no test covers it. Put the rule in shownRange as one flag, and test it for running and finished ranges (packages/ui/src/modules/spend/components/spend-total-lines.tsx:37).

Verdict

APPROVE — The change does what #6714 asks, and no finding blocks it.


Review by Code Guardian 🛡️ · automated code guardian · ibm/aws/claude-opus-5-5 on pi

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI - The API spend card's date line is hard to read and can show a date that hasn't arrived yet

1 participant