Conversation
The app views and the page slugs share /s/:group. Every app-view path now starts with ~, which normalizeSlug can never produce: it keeps only letters, numbers, combining marks and '-', so no slug from any NIP-54 client can shadow a view or a view a page (CON-50). The corpus test pins the invariant against the colliding titles and the shapes that could try to smuggle the prefix through.
A page titled "Archive", "Search" or "New" normalises to exactly the slugs of the app's own view routes, and React Router matches the static segment first — the page publishes fine and then its own URL opens an app view. The slug arrives from the relay, so refusing the titles in the editor cannot fix it: the fix has to hold without the writer cooperating. Every app-view path now starts with ~, which normalizeSlug can never return (it keeps only letters, numbers, combining marks and '-'). The prefix and the route pattern are owned by space-urls.ts, which builds the routes and every link to the views, so the two cannot drift apart; the router test resolves both the colliding slugs and the prefixed addresses through the real route table, against literal paths. Old view addresses are gone rather than redirected — a redirect route for those words would be a static segment in the page namespace again. Routing table and reasoning updated in docs/06, the archive address in docs/05. Page URLs are untouched. (CON-50)
molgerz
force-pushed
the
con-50-unproducible-app-route-prefix
branch
from
September 19, 2026 04:26
3ea7f95 to
087410f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket
Kaneo CON-50 — "A page whose slug matches an app route becomes unreachable" (#93)
What
A page titled "Archive", "Search" or "New" normalises to exactly the slugs of the app's own view routes (
/s/:group/new,/search,/archive). React Router matches the static segment before:slug, so the page publishes fine, shows up in the tree — and its own URL opens an app view. The slug arrives from the relay (dtag), so refusing those titles in the editor cannot fix it: the fix has to hold without the writer cooperating.The app views now live behind
~, a segmentnormalizeSlugcan never return (it keeps only letters, numbers, combining marks and-). No slug from any NIP-54 client can shadow a view, and every page title is free again.Implementation
src/routes/space-urls.ts(new): ownsAPP_VIEW_PREFIXand the URL buildersspaceNewUrl(with?slug=/?parent=),spaceSearchUrl(with?q=),spaceArchiveUrl.src/routes/router.tsx: the three view routes are built through the builders (/s/:group/~new,~search,~archive), so routes and links cannot drift apart. No redirect routes for the old addresses — a redirect for those words would be a static segment in the page namespace again, the exact thing being removed.Sidebar.tsx(4),Topbar.tsx(1),SpaceOverview.tsx(2),PageView.tsx(2). Query params survive unchanged.~" section indocs/06-ui-information-architecture.md; the archive address indocs/05-versioning-history.md.vite.config.ts: exclude the local git worktree checkouts (.worktrees/,.claude/worktrees/) from the vitest run — their other branches' tests were being picked up from the repo root and failing the gates for every branch on this machine. No effect on CI.Acceptance criteria
/s/:group/~new,/s/:group/~search,/s/:group/~archive.PageViewat/s/:group/<slug>.normalizeSlugcan never return a string starting with~(corpus test over the colliding titles and the shapes that could smuggle the prefix through).?q=,?parent=,?slug=) survive.docs/06;docs/05archive address corrected.npm run typecheck && npm run lint && npm test && npm run build.Test plan
npm run typecheck && npm run lint && npm test && npm run buildgreenspace-urls.test.ts: builders produce/s/:group/~new(?slug=,?parent=),~search(?q=),~archive; the invariant corpus never yields a slug starting with~router.test.ts: pins the view routes as absolute, prefixed literal paths (/s/:group/~newetc.) and resolves both the colliding slugs and the prefixed addresses through the real route table (matchRoutes); page URLs (:slug,:slug/history) are untouched~-prefixed URLs and render the right views?q=/?parent=correctlyTest results
Automated (this session — DeepSeek subagent unavailable, model selection disabled; run on GLM 5.3 Flash):
typecheck✅,lint✅,test✅ (54 files / 595 tests),build✅ — exit 0, re-verified after the branch was rebuilt.space-urls.test.ts+router.test.ts: 45 tests passed (builders, invariant corpus, route-table resolution throughmatchRoutes).Known failure mode found and fixed before review: the first version built the route paths from the bare
:groupparameter, so they came out relative (:group/~new) and matched nothing — every app view fell through toPageView. The route test now pins the absolute literal paths instead of comparing the builders with themselves, andSPACE_ROUTE_PATTERNinspace-urls.tsis the base both the routes and the links are built from.The three remaining items are browser flows against the running dev setup and are deliberately left to manual testing.
Out of scope
dtag such as~newdirectly — no compliant client produces one; documented as residual risk in the refinement.