Skip to content

Admin classifier: per-day hover card and estimated cost - #1280

Merged
Zach Dunn (zachdunn) merged 2 commits into
mainfrom
claude/project-thread-vjoamb
Oct 23, 2026
Merged

Zach Dunn (zachdunn) merged 2 commits into
mainfrom
claude/project-thread-vjoamb

Conversation

@zachdunn

@zachdunn Zach Dunn (zachdunn) commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Requested by Zach · project thread

Summary

  • Hover card on the daily activity chart (/admin/classifier). Each day shows the same card the /admin/metrics charts use (.metrics-chart-tooltip): the day, classified / skipped / failed, the total, and the day's model calls, input tokens, and estimated cost when available. Bars are focusable for keyboard. The metrics charts already had hover cards, so this was the only admin chart missing one.
  • Recorded classifier usage. openRouterDecisionsRun writes each ok Decisions response's reported cost and input tokens (Jev bills input only) with the model id to a new Analytics Engine dataset uploads_classifier_calls (CLASSIFIER_CALLS binding, preview dataset too). No D1 writes. An absent binding is a no-op and a write never throws.
  • Est. cost tile. The overview route reads per-day calls, input tokens, and cost back over the AE SQL API (fetchClassifierCostSeries, same token as the other AE panels) and adds costs to the overview payload. Calls without a reported cost are estimated from the reported cost per input token. Unavailable AE shows "-". Data starts when this deploys, so past days read as no calls.

Test plan

  • pnpm test:api, pnpm test:web pass; new tests for the usage parser, the AE write, the cost series query, and the web cost helpers
  • api and web typecheck clean
  • Rendered the component locally against mocked overview data and checked the hover card in dark mode
  • After deploy, confirm points land in uploads_classifier_calls and the tile fills in

🤖 Generated with Claude Code

https://claude.ai/code/session_017RAV94xRKfKGB7yS6GwyNB

The daily activity chart on /admin/classifier gets the same hover/focus
card as the /admin/metrics charts: the day, each series, the total, and
the day's model calls and estimated cost.

Each OpenRouter Decisions call now writes its usage block to a new
Analytics Engine dataset (uploads_classifier_calls). The overview reads
it back per day and the page shows an "Est. cost" tile for the window.
Calls without a reported cost are scaled from the priced ones. Absent
binding or AE token is a no-op and the tile reads unavailable.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RAV94xRKfKGB7yS6GwyNB
@changeset-bot

changeset-bot Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 0cff918

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@zachdunn Zach Dunn (zachdunn) self-assigned this Oct 23, 2026
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one): 2
  • coderabbit:review
  • review
🚫 Excluded labels (none allowed): 1
  • wip

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: eba56477-baf9-4bf4-838d-17df8dcbfd48

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@uploads-sh

uploads-sh Bot commented Oct 23, 2026

Copy link
Copy Markdown

classifier-daily-hover.png
/admin/classifier · after

AI notes · nothing to flag
  • ✅ After screens look ready
  • ➖ Before and after not compared
    • Needs a file marked as before and one marked as after.

View on uploads.sh

1 file · add media: uploads put <file> --pr 1280 · docs

Jev bills input only, so the per-call AE point keeps cost and input
tokens, and the estimate scales reported cost per input token to calls
that carried no cost. The hover card shows the day's input tokens.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RAV94xRKfKGB7yS6GwyNB
@zachdunn
Zach Dunn (zachdunn) merged commit e26eae8 into main Oct 23, 2026
4 checks passed
@zachdunn
Zach Dunn (zachdunn) deleted the claude/project-thread-vjoamb branch October 23, 2026 13:56
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.

2 participants