Skip to content

Home page: last 24 hours and how spots flow - #276

Merged
sonyccd merged 1 commit into
mainfrom
home-page
Oct 27, 2026
Merged

sonyccd merged 1 commit into
mainfrom
home-page

Conversation

@sonyccd

@sonyccd sonyccd commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

A signed-in landing page at /home, built from the "Long Lines home" design canvas. Sign-in, set password and unknown paths now land there instead of Sources, and Home is first in the nav.

What's on the page

  • Stat cards: Delivered and Matched, last 24 hours.
  • How your spots flow (desktop): the system's configuration as Sources -> Connections -> Destinations, whether or not anything flowed. The last 24 hours only label the nodes and set link widths; nothing leaves the diagram for being quiet.
    • Every source each connection takes spots from is linked, including "any source", which is expanded in SQL.
    • Every destination is shown, including ones no connection sends to yet (at the bottom, with no links).
    • Quiet links are drawn at the 2 px floor. Widths grow with the log of the count, and links meeting at one node are stacked side by side.
    • Each link takes its source's catalog markColor from the theme. Each node links to its page.
    • Every connection is shown, with no cap. They are ordered busiest first and grouped under their first source to keep links from crossing.
    • Built with plain MUI plus one SVG per gap between columns. It adds no chart or graph dependency.
  • Phones: a list of every destination with its delivered count, and "View all connections".
  • Empty states:
    • No connections: "Add your first connection", which opens the source picker.
    • Connections but no destinations: "Add your first destination", which opens the type picker.

Data

Migration 20261027001300_home_flow.sql adds home_flow(). It is security definer and executable by authenticated only. It returns what the lists the app already loads can't:

  • matched: distinct spots in the caller's deliveries by created_at, last 24 h, also split by connection and spot source
  • delivered: sent rows by sent_at, last 24 h, split by connection and destination
  • subscription_sources: every connection's sources by the matcher's own rules. source_matches expands an empty list to POTA, SOTAwatch and RBN, and RBN counts only when an AND group names stations, as in spot_matches.

It returns no spot data and is not in api_call (the API stays configuration-only).

Known limits:

  • No match is recorded for a connection the matcher skips (off, or no enabled destination), so the page shows "– matched" for it. Its links are still drawn.
  • deliveries is unique per (destination, spot), so a spot two connections match for a shared destination is credited to one of them.
  • Spots held back by a quiet window aren't counted.

Files

  • supabase/migrations/20261027001300_home_flow.sql and supabase/tests/home_flow.test.sql (13 tests). home_flow is added to the client list in advisor.test.sql.
  • web/src/home/:
    • HomePage.tsx, FlowDiagram.tsx
    • layout.ts: the pure geometry (row positions, widths, stacking, paths)
    • model.ts: which nodes and links, their order, copy helpers
    • colors.ts, types.ts
    • tests for each
  • App.tsx, AppShell.tsx, SignInPage.tsx, SetPasswordPage.tsx and their tests; api.ts gets loadHomeFlow(). database.types.ts is regenerated.
  • CLAUDE.md: a new "Home page rules" section. A new source now goes in home_flow's list too.

Testing

  • npm run build, npm run lint, npm run coverage: pass (1,188 tests, 98.7% lines).
  • pgTAP home_flow, advisor and matcher pass on a fresh local stack. supabase db lint shows only the three warnings already on main. scripts/smoke-test.sql passed on the first commit.
  • Checked by hand on a seeded local stack with quiet connections, an "any source" connection and an unlinked destination: desktop in light and dark, and phone.

After merge

  • supabase db push for 20261027001300_home_flow.sql. No Edge Function deploys are needed.

Not done yet

  • On desktop, "connections but no destinations" uses the phone's empty card until that frame is drawn.

🤖 Generated with Claude Code

A new signed-in landing page at /home, from the "Long Lines home" canvas:
Delivered and Matched stat cards, and a Sources -> Connections -> Destinations
flow diagram drawn with plain MUI and one SVG per column gap. Phones get a
list of destinations instead of the diagram.

Counts come from a new web-only RPC, home_flow(): the caller's last 24 hours
of deliveries (matched = distinct spots by created_at, delivered = sent rows
by sent_at). It stays out of api_call. A connection the matcher skips has no
record, so the page shows an en dash for it.

Sign-in, set password and unknown paths now land on /home, and Home is first
in the nav.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
longlines Ready Ready Preview Oct 27, 2026 3:26pm UTC

@supabase

supabase Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Updates to Preview Branch (home-page) ↗︎

Deployments Status Updated
Database ✅ Tue, 27 Oct 2026 15:26:51 UTC
Services ✅ Tue, 27 Oct 2026 15:26:51 UTC
APIs ✅ Tue, 27 Oct 2026 15:26:51 UTC

Tasks are run on every commit but only new migration files are pushed.
Close and reopen this PR if you want to apply changes from existing seed or migration files.

Tasks Status Updated
Configurations ✅ Tue, 27 Oct 2026 15:26:58 UTC
Migrations ✅ Tue, 27 Oct 2026 15:27:03 UTC
Seeding ✅ Tue, 27 Oct 2026 15:28:35 UTC
Edge Functions ✅ Tue, 27 Oct 2026 15:28:56 UTC

View logs for this Workflow Run ↗︎.
Learn more about Supabase for Git ↗︎.

@sonyccd
sonyccd merged commit ec4a051 into main Oct 27, 2026
10 checks passed
@sonyccd
sonyccd deleted the home-page branch October 27, 2026 15:30

This branch was successfully deployed

1 active deployment
Preview — 78b89d7f Deployed Oct 27, 2026 by vercel[bot]
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