feat(gastown): redesign town list overview with rich cards, sparklines, and aggregate stats#1949
feat(gastown): redesign town list overview with rich cards, sparklines, and aggregate stats#1949
Conversation
…s, and aggregate stats Replace the basic town list pages (/gastown and /organizations/:id/gastown) with an information-dense overview featuring per-town cards with bead counts, 24h activity sparklines, active agent indicators, and a sidebar with aggregate stats including real cost/token data from microdollar_usage via Hyperdrive.
| let totalActiveAgents = 0; | ||
|
|
||
| for (const result of statsResults) { | ||
| if (result.status === 'rejected') continue; |
There was a problem hiding this comment.
WARNING: Silently dropping failed town stats can misclassify non-empty accounts as empty
listTowns() has already confirmed the town exists, but this continue removes it from cards whenever a TownDO RPC fails. In the personal overview that can produce cards.length === 0, which triggers the onboarding redirect even for users who already have towns. Consider returning a fallback card or surfacing an error instead of skipping the town entirely. The same pattern appears again in getOrgTownOverview below.
|
|
||
| function DocLinks() { | ||
| const links = [ | ||
| { label: 'Getting Started', href: '#' }, |
There was a problem hiding this comment.
WARNING: These documentation links ship as broken navigation
All three entries in this list point to #, so clicking them just jumps to the top of the current page instead of opening documentation. If the real docs URLs are not ready yet, hiding this section until valid destinations exist avoids shipping misleading links.
Code Review SummaryStatus: 2 Issues Found | Recommendation: Address before merge Overview
Fix these issues in Kilo Cloud Issue Details (click to expand)WARNING
Other Observations (not in diff)N/A Files Reviewed (14 files)
Reviewed by gpt-5.4-20260305 · 779,129 tokens |
Summary
/gastownand/organizations/:id/gastown) with an information-dense overview featuring per-town cards with bead count pills, 24h activity sparklines, active agent indicators, and a sidebar with aggregate statsgetTownOverviewandgetOrgTownOverviewtRPC procedures that fan out to each TownDO for bead counts, agent stats, and sparkline data, plus querymicrodollar_usagevia Hyperdrive for real 7-day cost/token totalsPageTitleContextwith anactionsslot so pages can place buttons at the far right of theAppTopbar(used here for the "+ Town" button)GastownOverviewClient,TownCard, andSparklinecomponents used by both personal and org-scoped pagesVerification
pnpm typecheck— pass (Next.js app + trpc package)pnpm --filter cloudflare-gastown typecheck— passpnpm lint— pass (0 errors insrc/)pnpm format:check— passVisual Changes
Initial designs. I will refine because this looks like garbo
The town list pages are fully redesigned. No before/after screenshots available from CLI, but the key changes are:
Reviewer Notes
microdollar_usagehas notown_idcolumn. This is the correct granularity for the overview sidebar.queryUsageLast7dhelper gracefully returns zeros ifHYPERDRIVEbinding is unavailable (e.g. local dev).julianday()arithmetic in SQLite to bucket bead events into 48 half-hour windows — avoids pulling raw events to the worker.kilo-app/src/lib/appsflyer.tsrequired--no-verifyon push; unrelated to this PR.Closes #1421