the URL says which page, not which row
`?page=about` instead of `?page=2`. A URL that names the page can be read, sent to somebody, and still means the right thing after a database is restored from a dump with different ids — which happened once in this project already, earlier today. Home needs a word, because its slug is empty by design: that is the check constraint, and it is what makes `/` fall out of joining a slug to the root. An empty string is no use in a query parameter that has to name a page unambiguously, so the admin says `home` — and the site's API now REFUSES that slug, which is what makes the mapping total in both directions rather than merely usual. One reserved address costs nothing. Anybody who wanted /home wanted the front page, which they have. One place maps a page to its URL value and back — pageParam and pageFromParam — so the nav, the detail panel and the builder cannot disagree about what `?page=` means. `record` is deleted on every navigation. It belonged to the per-page record panels, which are unreachable now; nothing reads it, so it was not a bug, but every URL anybody copied carried a parameter naming a row in a section that no longer exists. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
+3
-2
@@ -153,12 +153,13 @@ export const DetailPanel = () => {
|
||||
const [params] = useSearchParams();
|
||||
const raw = params.get('section');
|
||||
/*
|
||||
A page selected inside Pages opens the BUILDER, not the list with a row lit up.
|
||||
A page selected inside Pages opens the BUILDER, not the list with a row lit up. By SLUG, so the URL
|
||||
says which page rather than which row — see pageParam in usePages.
|
||||
|
||||
The nav says the same thing — Pages is a section and the pages are rows under it — so the detail
|
||||
panel follows it. `?page=` is what distinguishes the two, which keeps both addressable.
|
||||
*/
|
||||
const selectedPage = Number(params.get('page')) || null;
|
||||
const selectedPage = params.get('page');
|
||||
const selected: SectionKey = isSectionKey(raw) ? raw : DEFAULT_SECTION;
|
||||
|
||||
const { ready, rootSet, loading } = useReady();
|
||||
|
||||
Reference in New Issue
Block a user