Skip to content

Demo: the four Proto-OKN close-out questions, prewarmed (do not merge until after the demo) - #59

Open
prayaslashkari wants to merge 5 commits into
developmentfrom
demo
Open

prayaslashkari wants to merge 5 commits into
developmentfrom
demo

Conversation

@prayaslashkari

Copy link
Copy Markdown
Collaborator

Cuts the Proto-OKN close-out demo onto its own branch, off current development.

Do not merge until after the demo. The pinned block at the top of PREBUILT_QUERIES is demo-only ordering, and the comment in that file says to remove it afterwards. This PR is here for review and visibility, not to be merged on green.

What is here

Four commits reused from the earlier feat/demo-questions-prewarmed lineage, rebased onto development at 01a6899, plus one cleanup:

  • feat(dashboard): pin the four demo questions and prewarm their popups
  • fix(api): raise the result-cache ceiling to 32MB
  • fix(map): sample popup laid out for the placeholder on first open
  • fix(dashboard): leave facilities unconstrained in the PFOS upstream question
  • fix(scripts): drop the duplicate check-query-snapshots entry

The four questions, in landing-page order

  1. samples-near-airports-indiana
  2. waterbodies-near-airports-indiana
  3. facilities-upstream-pfos-york-cumberland
  4. samples-downstream-airports-indiana

All four have thumbnails in public/thumbs/.

Two decisions worth a reviewer's eye

Block A on the PFOS question is unconstrained (blockA: { type: 'facilities' }, no region). The counties scope the samples on block C alone, because an upstream source can sit outside the county its sample is in. That makes the result large, roughly 8670 points and 3925 lines, and the thumbnail was rebuilt from a live run at that shape.

warm-sample-details.mts lists three ids, not four. The waterbodies question is deliberately absent: its popup branch in MapPopup.tsx renders from feature props with no fetch, so it has nothing to warm.

Still to do before the demo

The branch carries the warming code, not a warmed cache. Both of these need a run against the target API:

CACHE_WRITE_TOKEN=... API_BASE=... npx tsx scripts/warm-cache.mts
CACHE_WRITE_TOKEN=... API_BASE=... npx tsx scripts/warm-sample-details.mts

Dropping the region from block A moved that question's cache key to q:61245341..., so any earlier warm of it is unreachable and it has to be re-warmed.

Verification

tsc --noEmit -p tsconfig.app.json exits 0 against the newer engine from #55 and #58.

Supersedes #54, which is being closed in favour of this one.

Puts the Proto-OKN close-out demo set at the top of PREBUILT_QUERIES so they
are the four landing-page cards, with thumbnails built from live runs.

Sample popups previously hit the SPARQL endpoints on every click. Adds an
`s:` key namespace in the existing result cache, a read-through in
useSampleDetails (any miss or error falls back to the live query, as before),
and scripts/warm-sample-details.mts to fill it for the demo questions.
The Indiana water-bodies-near-airports demo question serialises to 26.6MB of
polygon geometry and was rejected by the route body limit (a bare 413 from
express, before our own size check).
Leaflet measures a popup when it opens; react-leaflet calls update() on
popupopen and never again. The observation rows arrive after that, so the
first open kept the placeholder's size and anchor and the content spilled out
of the box. The second open looked right only because React Query already had
the rows.
…uestion

The demo question asked for facilities in York and Cumberland that are
upstream of PFOS samples in those same counties. An upstream source can
sit outside the county its sample is in, so the county scope belongs to
the samples alone.

Both this and samples-downstream-airports-indiana now lead with the
target under development's narrowness ranking; check-query-joins expects
that. Thumbnail rebuilt from a live run (8670 points, 3925 lines).
Rebasing the demo work onto development left two identical copies of the
same script entry, since development already defines it. Nothing behaved
differently, both values match and the last key wins, but a duplicate JSON
key is a lint and review hazard.
@railway-app

railway-app Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the explorer-app-pr-59 environment in sawgraph-explorer

Service Status Web Updated
sawgraph-api ✅ Success (View Logs) Web Sep 20, 2026 at 4:13 pm UTC
sawgraph-web ✅ Success (View Logs) Web Sep 20, 2026 at 4:13 pm UTC

This branch was successfully deployed

1 active deployment
sawgraph-explorer / explorer-app-pr-59 — 720b9685 Deployed Sep 20, 2026 by railway-app[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