From 992f2617ec39a8d77e3cafbf72eda79bd6ea5ce5 Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Fri, 31 Jul 2026 15:40:55 +0200 Subject: [PATCH] Space Manager: navigate to space list after hitting Save --- client/spaces_ui/components/SpaceEditor.tsx | 4 +++- client/spaces_ui/components/SpaceForm.tsx | 10 ++++------ e2e/admin-spaces.test.ts | 4 +++- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/client/spaces_ui/components/SpaceEditor.tsx b/client/spaces_ui/components/SpaceEditor.tsx index 6fa3b75a..d85650db 100644 --- a/client/spaces_ui/components/SpaceEditor.tsx +++ b/client/spaces_ui/components/SpaceEditor.tsx @@ -57,7 +57,9 @@ export function SpaceEditor({ // screen, so its remaining settings are one step away rather than // behind another round trip through the list. onSaved={(savedId) => - navigate(id ? spacesUrl("/") : spacesUrl(`/${encodeURIComponent(savedId)}`)) + navigate( + id ? spacesUrl("/") : spacesUrl(`/${encodeURIComponent(savedId)}`), + ) } onDeleted={() => navigate(spacesUrl("/"))} onUnauthorized={onUnauthorized} diff --git a/client/spaces_ui/components/SpaceForm.tsx b/client/spaces_ui/components/SpaceForm.tsx index a0e0b36b..eafa8a40 100644 --- a/client/spaces_ui/components/SpaceForm.tsx +++ b/client/spaces_ui/components/SpaceForm.tsx @@ -75,9 +75,8 @@ export function SpaceForm({ ); // Matches the server's own `runtimeApi` default for a fresh space. const [runtimeApi, setRuntimeApi] = useState(initial?.runtimeApi ?? true); - const [runtimeAvailability, setRuntimeAvailability] = useState< - RuntimeAvailability | null - >(null); + const [runtimeAvailability, setRuntimeAvailability] = + useState(null); const [indexPage, setIndexPage] = useState(initial?.indexPage ?? "index"); const [errors, setErrors] = useState([]); // Only ever "saving": a successful save navigates away — to the space list @@ -149,9 +148,8 @@ export function SpaceForm({ .then((info) => setRuntimeAvailability(info.runtimeApi)) .catch(() => {}); }, []); - const runtimeApiUnavailable = runtimeApiUnavailableReason( - runtimeAvailability, - ); + const runtimeApiUnavailable = + runtimeApiUnavailableReason(runtimeAvailability); return (