Skip to content

feat(admin): sortable workspace list with creation dates, upload drill-down by workspace, BYO counts - #1090

Merged
Zach Dunn (zachdunn) merged 2 commits into
mainfrom
claude/admin-observability-improvements-c366a9
Oct 6, 2026
Merged

Zach Dunn (zachdunn) merged 2 commits into
mainfrom
claude/admin-observability-improvements-c366a9

Conversation

@zachdunn

Copy link
Copy Markdown
Member

Summary

Operator observability improvements for /admin and /admin/metrics.

Workspaces list

  • Created column. Uses the backing org's created_at (now returned by the auth worker's /internal/orgs/summaries). Workspaces without an org fall back to the record's self-serve createdAt, then to the record's earliest token timestamp.
  • Sortable columns. Every header is a sort toggle with aria-sort. The default sort is newest first. Ties fall back to name A→Z. The sort logic is in lib/admin-workspace-sort.ts, so it is unit-tested without rendering the island. No table library added.
  • Organization folded into the Workspace column. The org name shows as a byline only when it differs from the slug, or as "no organization yet". Otherwise the byline would repeat the slug on almost every row.

Metrics drill-down

  • The overview returns series.uploadsByWorkspace: sparse (day, workspace, count, bytes) rows from daily_metrics, served by the existing covering daily_metrics_window_idx.
  • The uploads chart tooltip lists the day's top three workspaces with their share of uploads.
  • Clicking a bar (or pressing Enter/Space on it) opens a per-day table below the chart: uploads, share, bytes, and setup badges. On load, the table shows the window's peak day.
  • A Workspace filter, or clicking any workspace name in the day or activity tables, charts that one workspace's daily uploads.
  • Per-user attribution is out of scope: daily_metrics records the workspace for each upload, not the user.

BYO bucket visibility

  • New BYO bucket workspaces tile, plus a BYO badge beside GH App in a shared "Setup" column. Counted from KV records via isByoRecord. The read is best-effort, and a KV failure reports zero instead of failing the page. The overview stays cached for 10 minutes (cache key bumped to v4).
  • listWorkspaceNames(env) added to workspace.ts and used by both the admin workspace list and the overview.

Screenshots (local fixtures)

Workspaces Metrics drill-down
Workspaces table sorted by Created, org names as bylines Uploads chart with a selected day and its per-workspace breakdown

Test plan

  • pnpm test (all packages) passes; new tests cover the auth summaries createdAt, admin list date fallbacks, overview drill-down rows + BYO count, sort, and drill-down helpers
  • Verified locally on stack-raw with seeded fixtures: sorting, bar selection, tooltip, workspace filter, BYO tile/badges, no console errors
  • Deploy note: until the auth worker deploys, the Created column falls back to record/token dates

…ce upload drill-down, BYO bucket counts

Workspaces: merge the organization into the workspace column as a byline (shown only when it differs from the slug), add a Created column (org created_at, falling back to the record's self-serve stamp, then its earliest token), and make every column header sortable.

Metrics: the overview now returns sparse per-workspace daily upload rows. The uploads chart tooltip lists a day's top workspaces, clicking a bar opens a per-day breakdown (uploads, share, bytes), and a workspace filter charts one workspace alone. Adds a BYO bucket workspaces tile and a BYO badge beside the GitHub App badge.
@changeset-bot

changeset-bot Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 23ce9c9

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

@uploads-sh

uploads-sh Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

2 files · View all on uploads.sh →

127.0.0.1-admin-after.webp
/admin · after

127.0.0.1-admin-metrics-after.webp
/admin/metrics · after

Maintained by uploads.sh · add media: uploads put <file> --pr 1090 · docs

@coderabbitai

coderabbitai Bot commented Oct 6, 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
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b43af334-4b1e-40e9-8fcb-1c67a4a8d839

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
  • Autopilot · 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.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
uploads-auth 5c7f0ca Oct 06 2026, 09:05 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
uploads-web 23ce9c9 Commit Preview URL

Branch Preview URL
Oct 06 2026, 10:23 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
uploads-api 23ce9c9 Commit Preview URL

Branch Preview URL
Oct 06 2026, 10:23 PM

- Build the drill-down once per overview (single-pass buildUploadDrilldown) instead of regrouping rows on every bar click; its row type now derives from MetricsOverview.
- Selecting a day toggles the highlight in place rather than redrawing the chart, which drops the focus-restore workaround.
- Share bar-selection attrs and click/keyboard wiring between the plain and stacked charts; tooltip extra is a template string like the rest of the page.
- Workspaces table: header columns from one array, org byline helper, shared formatAdminDate (also used by the users page).
- /admin/orgs/backfill uses listWorkspaceNames; earliestTokenAt is a single-pass min.
@zachdunn
Zach Dunn (zachdunn) merged commit 16a27f3 into main Oct 6, 2026
5 checks passed
@zachdunn
Zach Dunn (zachdunn) deleted the claude/admin-observability-improvements-c366a9 branch October 6, 2026 22:26
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