feat: route create project to edit session#9301
Conversation
8184fa5 to
07cf58a
Compare
ericpgreen2
left a comment
There was a problem hiding this comment.
Product / UX
Project URLs without an explicit branch bounce viewers into the editor. When a project has only an editable dev deployment (no active prod), a URL like /{org}/{proj}/explore/dash1 is redirected into the editor. A read-only viewer who follows a share link lands on the editor instead of the dashboard they were sent to. URLs that include the branch — /{org}/{proj}/@dev/explore/dash1 — already do the right thing. Extend that behavior to URLs without a branch: redirect to the same path on the editable branch (the preview surface), so viewers see the dashboard. Users with edit permission can click the Edit button to switch into editing.
Engineering Implementation
-
Add unit test coverage for the redirect logic.
maybeRedirectToEditableDeploymentis a pure async function — vitest tests covering the active-prod, no-prod, and branch-match cases would lock in the behavior cheaply. The three layout loaders that contain redirect logic can also be tested with mocked load context. The "Covered by tests" checkbox is unchecked. -
Drop the
(misc)addition to the parity script.(misc)is a catch-all containing welcome, deploy, and root-level routes — it has nothing to do with the editor surface. Adding it forces 12 deploy-related allowlist entries (deploy is fundamentally local-only and won't ever exist on cloud), and it nudges welcome toward 1:1 parity with local — which isn't what we want, since the cloud and local welcome flows legitimately differ in telemetry, starter set, and next-step destinations. The parity script earns its keep by unifying the editor surface; welcome and deploy live outside that scope. -
Welcome routing — non-blocking, but worth a ticket. Two issues with how welcome is wired up today:
/-/edit/welcomenests onboarding inside the editing surface. These are different user states, and combining them in the URL hierarchy is conceptually awkward.- Welcome state is tracked in two places: an in-memory
projectWelcomeStatusflag, and whetherrill.yamlexists. When the two disagree, direct navigation to/-/edit/welcomecycles through/-/editand back before settling.
Both feel right to revisit when the welcome flow is reconsidered as part of AI-first.
Developed in collaboration with Claude Code
|
Thanks @ericpgreen2 .
|
fcd2a2d to
95a636f
Compare
95a636f to
7ba5b4e
Compare
rill.yamlthen automatically route to welcome page. This mimics the behaviour on rill-dev./-/edit.Checklist: