Skip to content

DEV-423: Cloud usage chart and session history from the new endpoints - #4

Merged
xkickflip merged 4 commits into
mainfrom
chris-dev-423-review-temp-tokens-ledger-tracking-cloud-usage-reporting
Nov 8, 2026
Merged

xkickflip merged 4 commits into
mainfrom
chris-dev-423-review-temp-tokens-ledger-tracking-cloud-usage-reporting

Conversation

@xkickflip

@xkickflip xkickflip commented Nov 8, 2026 •

Copy link
Copy Markdown
Member
  • Session history pages from GET /chat/sessions, with a "Show empty" switch and server CSV export
  • Usage chart reads GET /chat/usage (7/30/90 days, credits/sessions)
  • Credits rows drop request and token counts; usage page renders in one step, no lock icons
  • make run-local points at the local Supabase API

Deploy after smartloop-ai/slp-api#167.

The ledger endpoint is gone; history now reads cloud sessions, a page at
a time, instead of loading the whole range.

- Columns: started, status, credits (held while open), upstream USD for
  superusers; a row opens to every field the API sent
- "Show 50 more" fetches the next page; the footer comes from the first
  page's summary
- Sessions that charged nothing are hidden, with a toggle when there are
  any
- Export downloads the server's CSV for the range and filter
- Days are the browser's time zone's days
The usage chart read /chat/ledger, which is gone, and the credits rows
read quota fields the API no longer sends (requests and token counts),
so the billing credits section would throw.

- Usage chart: GET /chat/usage fetched once for 90 days in the browser's
  time zone; 7/30/90 and Credits/Sessions (plus upstream USD for
  superusers) re-slice it without another request
- ActivityChart also takes server-binned days and a value format, and
  labels its axis for any number of days; the access-log chart is
  unchanged apart from label spacing
- Credits rows (usage page and billing settings): no requests or token
  counts; show credits or percent left and open sessions instead
- Usage page renders its rows together once status, usage and models
  are in, instead of filling in row by row
- In-page links to Session History and billing use next/link, so they
  no longer reload the whole app
- Drop the model list's lock icons: every row showed the same state
- Remove fetchLedger and LedgerEntry
run-local still pointed at the Python API on localhost:8888, which
doesn't have the new endpoints.

- run-local uses http://127.0.0.1:55321/functions/v1/api, what slp-api's
  make supabase-dev serves
- README: how to start the local API and its seeded accounts
- Show empty sessions with a "Show empty" switch instead of a checkbox
- Only show the spinner and dim the table when a load takes over 300ms
- Keep Export CSV enabled while a new range loads
- Fix the column widths so they don't shift between ranges
@xkickflip
xkickflip merged commit 850bbb0 into main Nov 8, 2026
1 check passed
@xkickflip
xkickflip deleted the chris-dev-423-review-temp-tokens-ledger-tracking-cloud-usage-reporting branch November 8, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant