fix(chatelet): root-relative routes so room deep links and refreshes work #159

Merged
padreug merged 1 commit from fix/chatelet-standalone-routing-base into dev 2026-09-21 17:58:09 +00:00
Owner

The chatelet module hardcoded /chatelet in its route paths while the
standalone also mounts under a Vite base path (/chatelet/), which the
router applies too. The two stacked, so in-app URLs came out
double-prefixed (/chatelet/chatelet/<id>) and the clean single-prefix
URL (/chatelet/<id> — what a person would type or share) stripped the
base to /<id>, matched nothing, and fell back to the room list.

Click-through and refresh already worked on the double-prefixed URL,
thanks to the standalone SPA fallback that keeps deep links under the
alias location (server-deploy d5f5a19). This change is about the URLs
themselves: make the routes root-relative (/ list, /:id detail,
/my-bookings) so the base path supplies the single prefix. In-app
navigation now produces clean /chatelet/<id> URLs, and that typeable,
shareable form resolves to the room instead of the list.

Drops the now-redundant / → /chatelet redirect, points the
list/detail/browse links and the Rooms tab at the new paths, and keys the
tab's active state off the route name (a / prefix test would match
everything).

Verified on a production build served under /chatelet/ like nginx: the
list, a deep link to a room, a refresh on it, and in-app room clicks all
resolve to the detail page with a single-prefixed URL. vue-tsc build passes.

Note: the events standalone has the same double-prefix pattern. It is
functional today (click-through and refresh work), so cleaning up its URLs
the same way is low-priority polish, not a fix — left out of this PR.

The chatelet module hardcoded `/chatelet` in its route paths while the standalone also mounts under a Vite base path (`/chatelet/`), which the router applies too. The two stacked, so in-app URLs came out double-prefixed (`/chatelet/chatelet/<id>`) and the clean single-prefix URL (`/chatelet/<id>` — what a person would type or share) stripped the base to `/<id>`, matched nothing, and fell back to the room list. Click-through and refresh already worked on the double-prefixed URL, thanks to the standalone SPA fallback that keeps deep links under the alias location (server-deploy `d5f5a19`). This change is about the URLs themselves: make the routes root-relative (`/` list, `/:id` detail, `/my-bookings`) so the base path supplies the single prefix. In-app navigation now produces clean `/chatelet/<id>` URLs, and that typeable, shareable form resolves to the room instead of the list. Drops the now-redundant `/` → `/chatelet` redirect, points the list/detail/browse links and the Rooms tab at the new paths, and keys the tab's active state off the route name (a `/` prefix test would match everything). Verified on a production build served under `/chatelet/` like nginx: the list, a deep link to a room, a refresh on it, and in-app room clicks all resolve to the detail page with a single-prefixed URL. vue-tsc build passes. Note: the events standalone has the same double-prefix pattern. It is functional today (click-through and refresh work), so cleaning up its URLs the same way is low-priority polish, not a fix — left out of this PR.
The chatelet module hardcoded '/chatelet' in its route paths while the
standalone also mounts under a Vite base path ('/chatelet/'), which the
router applies too. The two stacked: in-app URLs came out double-prefixed
('/chatelet/chatelet/<id>'), and a direct load or refresh of a room URL
stripped the base to '/<id>', matched nothing, and fell back to the room
list — so room deep links and page refreshes were broken.

Make the routes root-relative ('/' list, '/:id' detail, '/my-bookings')
and let the base path supply the prefix. Drop the now-redundant '/' ->
'/chatelet' redirect, point the list/detail/browse links and the Rooms tab
at the new paths, and key the tab's active state off the route name (a '/'
prefix test would match everything).

Verified on a production build served under '/chatelet/' like nginx: deep
link to a room, refresh on it, list, and in-app room clicks all resolve to
the detail page with a single-prefixed URL. vue-tsc build passes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
padreug force-pushed fix/chatelet-standalone-routing-base from 18aaff12e2 to 53327b3ef2 2026-09-21 17:51:25 +00:00 Compare
padreug deleted branch fix/chatelet-standalone-routing-base 2026-09-21 17:58:10 +00:00
Sign in to join this conversation.
No description provided.