From 7a7a82d51ae0687e6c0617a290a722129ed39266 Mon Sep 17 00:00:00 2001 From: nicktrn <55853254+nicktrn@users.noreply.github.com> Date: Wed, 13 May 2026 10:00:42 +0100 Subject: [PATCH] feat(webapp): preserve admin tabs search query between Users and Organizations --- .server-changes/admin-tabs-preserve-search.md | 6 ++++++ apps/webapp/app/routes/admin.tsx | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 .server-changes/admin-tabs-preserve-search.md diff --git a/.server-changes/admin-tabs-preserve-search.md b/.server-changes/admin-tabs-preserve-search.md new file mode 100644 index 00000000000..7caaa642626 --- /dev/null +++ b/.server-changes/admin-tabs-preserve-search.md @@ -0,0 +1,6 @@ +--- +area: webapp +type: improvement +--- + +Preserve search string when switching between the Users and Organizations tabs in the admin dashboard. diff --git a/apps/webapp/app/routes/admin.tsx b/apps/webapp/app/routes/admin.tsx index 236c7f0580c..1ac09efc76c 100644 --- a/apps/webapp/app/routes/admin.tsx +++ b/apps/webapp/app/routes/admin.tsx @@ -1,4 +1,4 @@ -import { Outlet } from "@remix-run/react"; +import { Outlet, useSearchParams } from "@remix-run/react"; import { typedjson } from "remix-typedjson"; import { LinkButton } from "~/components/primitives/Buttons"; import { Tabs } from "~/components/primitives/Tabs"; @@ -10,6 +10,10 @@ export const loader = dashboardLoader( ); export default function Page() { + const [searchParams] = useSearchParams(); + const search = searchParams.get("search"); + const searchSuffix = search ? `?search=${encodeURIComponent(search)}` : ""; + return (
@@ -17,11 +21,11 @@ export default function Page() { tabs={[ { label: "Users", - to: "/admin", + to: `/admin${searchSuffix}`, }, { label: "Organizations", - to: "/admin/orgs", + to: `/admin/orgs${searchSuffix}`, }, { label: "Concurrency",