pf_app/routes
Paul Trowbridge 91c53ac6d8 Land on the forecast somebody chose, not the newest one
App.jsx fell back to versions[0] when localStorage held no selection, and
the version list is ordered created_at DESC -- so a fresh browser landed on
whatever version was created last. That is a scratch scenario as readily as
the plan, and sales accounts, which never pick a version themselves, had no
way back to the one they were meant to read.

pf.version.is_default names the landing version, at most one per source by
partial unique index, the way pf.layout.is_default already works. Setting it
is admin-only and enforced in the route: it decides where everyone else
lands, so it follows the pf.log rule rather than being the version's own
setting like its name.

A stored selection still wins -- the default is the fallback, not an
override, so nobody building scenarios is thrown back to the plan on every
load.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-22 08:34:46 -04:00
..
auth.js Read territory at login, and survive having none 2026-09-18 11:52:00 -04:00
layouts.js Make a pivot layout a thing people own and publish 2026-09-19 14:20:04 -04:00
log.js Record what a write ran against, and the statement it ran 2026-09-18 12:19:40 -04:00
operations.js Record what a write ran against, and the statement it ran 2026-09-18 12:19:40 -04:00
plans.js Drop Shift years 2026-09-21 12:39:07 -04:00
sources.js Make a pivot layout a thing people own and publish 2026-09-19 14:20:04 -04:00
tables.js Read source columns from pg_catalog, not information_schema 2026-09-18 16:12:05 -04:00
versions.js Land on the forecast somebody chose, not the newest one 2026-09-22 08:34:46 -04:00