Offer creating the page on the page-not-found screen #115
Labels
No Label
area:auth
area:docs
area:export
area:ops
area:storage
area:supply-chain
auth
backend
blocked
collab
deployment
docs
effort:L
effort:M
effort:S
frontend
plugins
qa
vs-nfd
vs-nfd:blocker
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: stwaidele/dorfteich#115
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Following a wikilink to a page that does not exist yet (a phantom link) dead-ends on
/p/:pondSlug/:pageSlugwith the genericerrors:not_foundbanner. Thepage_trashedbranch (issue #31) shows the pattern for a distinguishable hint with a way out; the proven create mechanic lives in the pond's missing-pages view:POST /ponds/:id/pageswith{title: <slug>}, so the generated slug equals the phantom slug and the links pointing at it resolve (issue #47).Scope
PageEditorPage's error branch: when the pond resolved and the page error is anApiErrorwith codenot_found, render the message plus a "create this page" button. The affordance is deliberately ungated (the sidebar's "New page" button is too; the client cannot distinguish "never existed" from "no read permission" per the #60 convention) — a 403 from the POST surfaces through the regularFormError.{title: pageSlug}; on success invalidate['pages', pondId],['phantom-links', pondId],['pond-links', pondId], and['page', pondId, pageSlug]— the URL already matches, so the refetch mounts the editor in place.PhantomPagesView.createPagemisses the['pond-links']invalidation, so the graph views stay stale after a phantom-create today.editor:wikilink.createHint/links:missing.create).Acceptance criteria
page_trashedbranch is unchanged.Technical notes
apps/web/src/pages/PageEditorPage.tsx(error branch ~line 349),apps/web/src/links/PhantomPagesView.tsx, i18n namespaceseditor/links.Dependencies
None.
Size
~0.5 days.
Implemented in
64e21e9. A plainnot_foundon the page route (the pond resolved) now renders the message plus a create button; the page is created with{title: pageSlug}so the generated slug matches the URL and every wikilink pointing at the address resolves, and the invalidated page query mounts the editor in place. Ungated by design (a reader's POST surfaces as the regular 403 banner); thepage_trashedbranch is untouched. Rode along:PhantomPagesView.createPagenow also invalidates['pond-links']— the graph views kept showing a just-created target as a phantom. Covered bycreate-missing-page.spec.ts(in CI since #119).