* feat(admin): add a Billing tab for subscriptions and sales
The admin can now follow subscriptions and sales without opening Stripe:
- Summary tiles: active subscriptions (monthly/annual), MRR with annual
plans counted as 1/12, sales and revenue for 7d/30d/90d/12m/all time,
all-time sales, subscriptions cancelling at period end, and refunds
and disputes.
- A stacked chart of sales per day, week or month by plan family.
- A by-plan table: active grants, period and all-time sales and revenue.
- A paginated list of grants with plan, Stripe status, active/expired/
revoked and user filters, linked to the admin user, repository or
conference.
- One row of webhook health: pending, failed, oldest pending event, last
error and unreviewed payment reversals.
A sale is one checkout or subscription, so a paper pack's three grants
count once. Revenue is each sale's Stripe list price, resolved once per
price and cached in memory. Currencies are never added together. Without
Stripe the page shows counts and marks revenue as unavailable.
GET /api/admin/billing/summary and /grants sit behind the admin check.
Grants get a { purchasedAt, _id } index for the list.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix: preserve payment history in admin billing totals
* fix: scope billing history and preserve original sale prices
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
- Admin errors: filters stack on phones (tabs, search, Sort and Group,
refresh) instead of squeezing into one row
- Admin overview: Summary / Performance / Cache views, kept in the URL
hash; charts take the full width on phones
- Phone menu: aligned rows with icons, neutral fill for the current page,
account links inline, no duplicate Sign in
- My work: removed and expired projects get a labelled badge, a muted
"Link offline" in place of the copy link, and an inline Enable/Extend
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Phone viewer: Contents menu for README headings, theme toggle in the header,
GitHub icon on sign-in, 12px Ace font
- File ⋯ menu: file details line, Find for HTML, View raw, Download ZIP,
Copy file path
- Redaction slots inside highlighted code blocks; fix regex lastIndex reuse
in the redaction walker
- Landing and FAQ copy: plainer headings, trust items, closing CTA band
- Explorer ZIP button label, snapshot text cleanup
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One-row phone toolbar, errors page opens on server errors, one-row submit
bar, publish warning after a source loads, three-column FAQ with a help
card, queue range control in the Throughput card, shared admin table cards,
dark-mode contrast and a stronger phone code scroll cue.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Viewer: full-height app bar with a Help menu, search + ZIP sidebar, one
toolbar for README and code, reading mode with a scroll-tracking outline,
docked find for Markdown and code, and redaction slots (a blank stone slot
holding the term number) in prose, headings, code, the tree and the path.
Landing and FAQ: live redaction demo, serif display headings, teal accent.
Author screens: My work table with copy/open/edit actions, a usage meter,
a single-container New anonymization flow with a sticky submit bar, themed
form controls, and consistent GitHub connection cards.
Admin: underline tabs, severity-first errors chart and list, error tiles
that filter (older pages load until matches appear), queue and overview
health states, and shared toolbar heights and borders.
Fixes: guarded localStorage access, failed README images render a
placeholder, phone hover states no longer stick, and UI tests updated for
the new copy and markup.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>