From 5ea40093a6806bea01a1e9a73d1c8b4dfb09e085 Mon Sep 17 00:00:00 2001 From: Cameron Pak Date: Tue, 17 Mar 2026 16:20:45 -0500 Subject: [PATCH] fix: include admin_basepath in absolute navigation paths Fixes navigate(..., { absolute: true }) only prepending basepath but missing admin_basepath, causing links like /data instead of /admin/data. Adds admin_basepath to BkndAdminConfig type. Amp-Thread-ID: https://ampcode.com/threads/T-019cfd9f-89ca-703c-a86c-99eef60e3fe8 Co-authored-by: Amp --- app/src/ui/Admin.tsx | 5 +++++ app/src/ui/lib/routes.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/ui/Admin.tsx b/app/src/ui/Admin.tsx index 766b56a8..82293c55 100644 --- a/app/src/ui/Admin.tsx +++ b/app/src/ui/Admin.tsx @@ -16,6 +16,11 @@ export type BkndAdminConfig = { * @default `/` */ basepath?: string; + /** + * Sub-path for the Admin UI within the base path + * @default `` + */ + admin_basepath?: string; /** * Path to return to when clicking the logo * @default `/` diff --git a/app/src/ui/lib/routes.ts b/app/src/ui/lib/routes.ts index 46ed4fbe..a2b5bcc6 100644 --- a/app/src/ui/lib/routes.ts +++ b/app/src/ui/lib/routes.ts @@ -101,7 +101,7 @@ export function useNavigate() { } } - const _url = options?.absolute ? `~/${basepath}${url}`.replace(/\/+/g, "/") : url; + const _url = options?.absolute ? `~/${app.options.basepath}/${app.options.admin_basepath}${url}`.replace(/\/+/g, "/") : url; const state = { ...options?.state, referrer: location,