Skip to content

Index page in Payload; Page Settings for the precipitation table - #1316

Open
rchlfryn wants to merge 1 commit into
feat/station-pagesfrom
feat/station-page-settings
Open

rchlfryn wants to merge 1 commit into
feat/station-pagesfrom
feat/station-page-settings

Conversation

@rchlfryn

@rchlfryn rchlfryn commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Description

Stacked on #1315. Two things on top of it:

The /weather/stations index becomes a Payload page. The native index was a hardcoded list of links with an intro nobody could edit. It's now a normal page under the Weather dropdown, so the URL is unchanged and an editor owns the content. The detail, precipitation and map routes stay native. NWAC's page already exists in production; the nav still needs pointing at it and the "Weather Data" built-in row deleted.

Page Settings for the Accumulated Precipitation table. The table used to be a side effect of the pages: every station on a live page, in a north-to-south sort nobody could change. It's now its own per-center document (unique-tenant collection, ADR 016), titled with the center's name, with one tab: which columns the table shows, and an ordered list of the stations it shows, built with the same stations field the pages use. The list's picker only offers stations reporting precipitation and marks a listed station that has stopped; the public table drops a station with no precipitation series and keeps the settings order. Station note icons are gone from that table.

No migration in this PR. The weather_station_settings table (and its precip_columns select table) is handled by hand; pnpm seed creates it locally through Payload's schema push. The seed fills NWAC's document with the 19 loggers that have a gauge, in page order, and all columns.

Related Issues

Stacked on #1315. Follow-ups: #1303, #1304.

Key Changes

  • collections/WeatherStationSettings ("Page Settings" in the admin): one document per center; precipColumns (select, empty means all) above precipStations (stationsField with requiredVariable: precip_accum_one_hour). services/stations/precipColumns and getWeatherStationSettings (cached under the station-pages tag).
  • PrecipAccumulationTable: columns prop; rows in the settings order; no note flag or legend. tableHelpers.buildPrecipAccumulationTable: keeps the requested order and drops a station whose response has no precipitation series.
  • weather/stations/page.tsx deleted; the seed gives NWAC a stations page under the Weather nav instead of the built-in row.
  • Seed: NWAC_PRECIP_STATIONS, the settings document, the second collection in the Admin role grant.
  • .husky/check-migrations: the keyword scan skips src/migrations/data/, which it could not read anyway.
  • custom.scss: no stray gap above a tabs field that follows only a hidden input.

How to test

  1. pnpm seed, then pnpm dev.
  2. nwac.localhost:3000/weather/stations: the "Weather Data" Payload page, reached from the Weather dropdown.
  3. Admin → Weather → Page Settings: one document titled "Northwest Avalanche Center". Columns first, then 19 stations with status dots. Remove one and reload /weather/stations/accumulated-precipitation; its row is gone. Drag one to the top; it leads the table. Pick 24H, 72H and Elevation only; the table has four columns.
  4. The Add station search on that tab offers only stations reporting precipitation (Camp Muir, a wind station, is not there); on a station page it offers everything the center tracks plus its untracked loggers.

Screenshots / Demo video

TODO: Page Settings with the columns select and stations table.

Migration Explanation

None here, by design; the settings table is created by hand. #1315 carries the station_pages migration.

Future enhancements / Questions

🤖 Generated with Claude Code

Stacked on the station pages change.

The /weather/stations index becomes an ordinary Payload page under the
Weather nav, so the URL is unchanged and an editor owns the content; the
native index and its built-in row go.

The Accumulated Precipitation table gets a per-center Page Settings document
(unique-tenant collection, titled with the center's name): which columns to
show, then the ordered list of stations, built with the same stations field
the pages use. That list's picker offers only stations reporting
precipitation and marks a listed one that has stopped; the public table
keeps the settings order, drops a station with no precipitation series and
shows "missing" for a gauge that reported none. Station note icons come off
the table.

No migration here: the settings table is created by hand. The seed fills
NWAC's document with the 19 loggers that have a gauge, in page order. The
pre-commit migration scan now skips src/migrations/data, which it could not
read.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Preview deployment: https://featxstation-page-settings.preview.avy-fx.org

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