feat: editable route on page create#722
Merged
Merged
Conversation
Surface the derived route in the new-page dialog as a prefilled but editable field, and stop rewriting it when the title is renamed. Closes #714 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FM7M5p9XtQv8UNLWW59qrv
Routes were derived from the folder hierarchy and never shown before the page existed, and a later title rename silently moved the URL. Accept an author-supplied route on create (sanitised through the app's slug rule, so a hand-written route can't produce a URL a derived one couldn't), add check_route_available so a clash surfaces while the author types instead of at merge time, and stop recomputing the route when the title changes. Deriving stays the fallback: a create without a route still gets the same hierarchy path as before. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FM7M5p9XtQv8UNLWW59qrv
The dialog now shows a Route field that fills in from the title as you type and stops tracking it the moment you edit it by hand — the same interaction the new-space dialog already has. A route already in use is flagged inline instead of failing at merge. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FM7M5p9XtQv8UNLWW59qrv
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FM7M5p9XtQv8UNLWW59qrv
The field speaks for itself. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FM7M5p9XtQv8UNLWW59qrv
Guarding on the route text alone wasn't enough: two checks of the same text can legitimately disagree when a page claiming that route is created in between, so a late reply could clear a valid error (or reinstate a stale one). Sequence the checks and drop every reply but the newest, including on the failure path and across dialog reopens. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FM7M5p9XtQv8UNLWW59qrv
Confidence Score: 4/5Not safe to merge until saving waits for pending route validation. A duplicate route can still be submitted during the debounce or network window and fail only when merged. Files Needing Attention: frontend/src/composables/useTreeDialogs.js Reviews (2): Last reviewed commit: "refactor(route): use ErrorMessage for th..." | Re-trigger Greptile |
The hand-rolled paragraph duplicated what frappe-ui's ErrorMessage already renders, and drifted from it on colour and size. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dn1ETNV7ufoM8xA6FCLnnE
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.
Why?
Closes #714.
The new-page dialog only asked for a Title. The URL was derived behind the author's back from the folder hierarchy, and renaming the page later silently moved it. Authors never saw the URL they were creating and couldn't choose it.
What?
The dialog now has a Route field that fills in from the title as you type and stops tracking it the moment you edit it by hand — the same interaction the new-space dialog already has.
docs/guides/advanced/caching). Want a flat URL? Delete the middle segments.How?
sanitize_route()normalises every author-supplied route through the app's existing slug rule, so a hand-written route can't produce a URL a derived one couldn't.check_route_available()(new whitelisted read) checks live documents and, when one exists, the change request's own staged items. It's space-scoped with an optionalcr_namebecause the draft CR is created lazily — the dialog can open before one exists. Only the newest in-flight check is allowed to write the result, so a stale reply can't block a valid route.create_cr_pagegains arouteparam; the batchcreate_nodeop already forwarded one._update_cr_item'srecompute_routepath is gone.Spec:
specs/editable_page_route.md.Testing
test_wiki_change_request.py(route honoured, route sanitised, rename-keeps-route regression, availability across live + CR). The rename regression was verified by temp-reverting the fix.e2e/tests/page-route-editable.spec.tscovers prefill → auto-track → manual override → save.🤖 Generated with Claude Code
https://claude.ai/code/session_01Dn1ETNV7ufoM8xA6FCLnnE