From 9ff5f872586ec800324ed5343e2c281c4e05ce55 Mon Sep 17 00:00:00 2001 From: Anto Subash Date: Mon, 25 May 2026 22:33:09 +0200 Subject: [PATCH 1/2] fix(ui): add per-page document titles so browser tabs are distinguishable (#175) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add Inertia `` to all 22 page components and configure the `title` callback in `createInertiaApp` to produce "Page Name — SimpleModule" (or bare "SimpleModule" when no page title is set). --- host/client_app/app.tsx | 1 + host/client_app/pages/Error.tsx | 7 +++++-- host/client_app/pages/Landing.tsx | 2 ++ .../background_tasks/pages/Detail.tsx | 11 +++++++---- .../background_tasks/pages/Index.tsx | 13 ++++++++----- .../background_tasks/pages/Workers.tsx | 7 +++++-- modules/dashboard/dashboard/pages/Doctor.tsx | 5 ++++- modules/dashboard/dashboard/pages/Home.tsx | 19 +++++++++++-------- .../feature_flags/pages/Browse.tsx | 13 ++++++++----- .../file_storage/pages/Browse.tsx | 11 +++++++---- .../permissions/pages/RoleEdit.tsx | 9 ++++++--- .../permissions/pages/UserEdit.tsx | 9 ++++++--- modules/settings/settings/pages/Browse.tsx | 9 ++++++--- modules/settings/settings/pages/Create.tsx | 9 ++++++--- modules/settings/settings/pages/Edit.tsx | 9 ++++++--- .../settings/settings/pages/ModulesEdit.tsx | 6 +++++- modules/users/users/pages/AcceptInvite.tsx | 3 ++- modules/users/users/pages/ForgotPassword.tsx | 2 ++ modules/users/users/pages/Login.tsx | 3 ++- modules/users/users/pages/Profile.tsx | 7 +++++-- modules/users/users/pages/Register.tsx | 2 ++ modules/users/users/pages/ResetPassword.tsx | 3 ++- modules/users/users/pages/VerifyEmail.tsx | 3 ++- 23 files changed, 110 insertions(+), 53 deletions(-) diff --git a/host/client_app/app.tsx b/host/client_app/app.tsx index 58421e29..86a8de39 100644 --- a/host/client_app/app.tsx +++ b/host/client_app/app.tsx @@ -6,6 +6,7 @@ import { bootI18nFromInitialPage, subscribeI18nToNavigation } from './i18n'; import { resolvePage } from './pages'; createInertiaApp({ + title: (title) => (title ? `${title} — SimpleModule` : 'SimpleModule'), resolve: async (name) => { const page = await resolvePage(name); return page; diff --git a/host/client_app/pages/Error.tsx b/host/client_app/pages/Error.tsx index c1531af7..525dc407 100644 --- a/host/client_app/pages/Error.tsx +++ b/host/client_app/pages/Error.tsx @@ -1,4 +1,4 @@ -import { Link } from '@inertiajs/react'; +import { Head, Link } from '@inertiajs/react'; import { keys, useT } from '@simple-module-py/i18n'; import { ErrorScreen } from '@simple-module-py/ui/components/ErrorScreen'; import { Button } from '@simple-module-py/ui/components/ui/button'; @@ -34,7 +34,9 @@ function ErrorPage({ status, message }: Props) { const description = message || descriptions[status] || t(keys.host.error.generic_description); return ( - + <> + + + ); } diff --git a/host/client_app/pages/Landing.tsx b/host/client_app/pages/Landing.tsx index fc5a5938..b37bb36a 100644 --- a/host/client_app/pages/Landing.tsx +++ b/host/client_app/pages/Landing.tsx @@ -1,3 +1,4 @@ +import { Head } from '@inertiajs/react'; import { keys, useT } from '@simple-module-py/i18n'; import { Button } from '@simple-module-py/ui/components/ui/button'; import { Card, CardContent } from '@simple-module-py/ui/components/ui/card'; @@ -66,6 +67,7 @@ function Landing() { return ( <> + {/* Hero with mesh blobs */}
+ +
+ ); } diff --git a/modules/background_tasks/background_tasks/pages/Index.tsx b/modules/background_tasks/background_tasks/pages/Index.tsx index 58bcd171..9073daae 100644 --- a/modules/background_tasks/background_tasks/pages/Index.tsx +++ b/modules/background_tasks/background_tasks/pages/Index.tsx @@ -1,4 +1,4 @@ -import { Link, router, usePage } from '@inertiajs/react'; +import { Head, Link, router, usePage } from '@inertiajs/react'; import { PageShell } from '@simple-module-py/ui/components/PageShell'; import { Button } from '@simple-module-py/ui/components/ui/button'; import { Card } from '@simple-module-py/ui/components/ui/card'; @@ -79,10 +79,12 @@ function Index() { } return ( - + <> + +
@@ -182,6 +184,7 @@ function Index() {
)} + ); } diff --git a/modules/background_tasks/background_tasks/pages/Workers.tsx b/modules/background_tasks/background_tasks/pages/Workers.tsx index 41b82491..e254d154 100644 --- a/modules/background_tasks/background_tasks/pages/Workers.tsx +++ b/modules/background_tasks/background_tasks/pages/Workers.tsx @@ -1,4 +1,4 @@ -import { Link, usePage } from '@inertiajs/react'; +import { Head, Link, usePage } from '@inertiajs/react'; import { PageShell } from '@simple-module-py/ui/components/PageShell'; import { Badge } from '@simple-module-py/ui/components/ui/badge'; import { Button } from '@simple-module-py/ui/components/ui/button'; @@ -91,7 +91,9 @@ function Workers() { } return ( - + <> + +
)}
+ ); } diff --git a/modules/dashboard/dashboard/pages/Doctor.tsx b/modules/dashboard/dashboard/pages/Doctor.tsx index a770a140..4b1d18a7 100644 --- a/modules/dashboard/dashboard/pages/Doctor.tsx +++ b/modules/dashboard/dashboard/pages/Doctor.tsx @@ -1,4 +1,4 @@ -import { usePage } from '@inertiajs/react'; +import { Head, usePage } from '@inertiajs/react'; import { PageShell } from '@simple-module-py/ui/components/PageShell'; import { SectionTitle } from '@simple-module-py/ui/components/SectionTitle'; import { StatCard } from '@simple-module-py/ui/components/StatCard'; @@ -77,6 +77,8 @@ function Doctor() { const unhealthy = system_info.health_checks.filter((c) => c.status !== 'healthy').length; return ( + <> +
+ ); } diff --git a/modules/dashboard/dashboard/pages/Home.tsx b/modules/dashboard/dashboard/pages/Home.tsx index 0732364a..1846b31e 100644 --- a/modules/dashboard/dashboard/pages/Home.tsx +++ b/modules/dashboard/dashboard/pages/Home.tsx @@ -1,4 +1,4 @@ -import { usePage } from '@inertiajs/react'; +import { Head, usePage } from '@inertiajs/react'; import { keys, useT } from '@simple-module-py/i18n'; import { PageShell } from '@simple-module-py/ui/components/PageShell'; import { SectionTitle } from '@simple-module-py/ui/components/SectionTitle'; @@ -38,11 +38,13 @@ function Home() { const unhealthy = props.system_info.health_checks.filter((c) => c.status !== 'healthy').length; return ( - -
+ <> + + +
{import.meta.env.DEV && } -
-
+
+
+ ); } diff --git a/modules/feature_flags/feature_flags/pages/Browse.tsx b/modules/feature_flags/feature_flags/pages/Browse.tsx index 1699bbbb..1a79eb85 100644 --- a/modules/feature_flags/feature_flags/pages/Browse.tsx +++ b/modules/feature_flags/feature_flags/pages/Browse.tsx @@ -1,4 +1,4 @@ -import { router, usePage } from '@inertiajs/react'; +import { Head, router, usePage } from '@inertiajs/react'; import { keys, useT } from '@simple-module-py/i18n'; import { PageShell } from '@simple-module-py/ui/components/PageShell'; import { Badge } from '@simple-module-py/ui/components/ui/badge'; @@ -91,10 +91,12 @@ function Browse() { } return ( - + <> + +
+ ); } diff --git a/modules/file_storage/file_storage/pages/Browse.tsx b/modules/file_storage/file_storage/pages/Browse.tsx index 1f023d5f..7ec398d4 100644 --- a/modules/file_storage/file_storage/pages/Browse.tsx +++ b/modules/file_storage/file_storage/pages/Browse.tsx @@ -1,4 +1,4 @@ -import { router, usePage } from '@inertiajs/react'; +import { Head, router, usePage } from '@inertiajs/react'; import { keys, useT } from '@simple-module-py/i18n'; import { PageShell } from '@simple-module-py/ui/components/PageShell'; import { @@ -81,9 +81,11 @@ function Browse() { } return ( - + + : undefined} > @@ -183,6 +185,7 @@ function Browse() { + ); } diff --git a/modules/permissions/permissions/pages/RoleEdit.tsx b/modules/permissions/permissions/pages/RoleEdit.tsx index 6a04f0cc..84d70556 100644 --- a/modules/permissions/permissions/pages/RoleEdit.tsx +++ b/modules/permissions/permissions/pages/RoleEdit.tsx @@ -1,4 +1,4 @@ -import { Link, useForm } from '@inertiajs/react'; +import { Head, Link, useForm } from '@inertiajs/react'; import { keys, useT } from '@simple-module-py/i18n'; import { PageShell } from '@simple-module-py/ui/components/PageShell'; import { Badge } from '@simple-module-py/ui/components/ui/badge'; @@ -63,8 +63,10 @@ function RoleEdit({ role, assigned, groups }: Props) { const pct = totalRegistered === 0 ? 0 : (data.permissions.length / totalRegistered) * 100; return ( - + + @@ -186,6 +188,7 @@ function RoleEdit({ role, assigned, groups }: Props) { )} + ); } diff --git a/modules/permissions/permissions/pages/UserEdit.tsx b/modules/permissions/permissions/pages/UserEdit.tsx index bdfebb64..682a8f11 100644 --- a/modules/permissions/permissions/pages/UserEdit.tsx +++ b/modules/permissions/permissions/pages/UserEdit.tsx @@ -1,4 +1,4 @@ -import { Link, useForm } from '@inertiajs/react'; +import { Head, Link, useForm } from '@inertiajs/react'; import { keys, useT } from '@simple-module-py/i18n'; import { PageShell } from '@simple-module-py/ui/components/PageShell'; import { StatCard } from '@simple-module-py/ui/components/StatCard'; @@ -64,8 +64,10 @@ function UserEdit({ user, roles, direct, inherited, groups }: Props) { } return ( - + + @@ -215,6 +217,7 @@ function UserEdit({ user, roles, direct, inherited, groups }: Props) { )} + ); } diff --git a/modules/settings/settings/pages/Browse.tsx b/modules/settings/settings/pages/Browse.tsx index e93f0ebf..2cdd96e6 100644 --- a/modules/settings/settings/pages/Browse.tsx +++ b/modules/settings/settings/pages/Browse.tsx @@ -1,4 +1,4 @@ -import { router } from '@inertiajs/react'; +import { Head, router } from '@inertiajs/react'; import { keys, useT } from '@simple-module-py/i18n'; import { PageShell } from '@simple-module-py/ui/components/PageShell'; import { Badge } from '@simple-module-py/ui/components/ui/badge'; @@ -47,8 +47,10 @@ function Browse({ settings }: Props) { } return ( - + + @@ -147,6 +149,7 @@ function Browse({ settings }: Props) {
)}
+ ); } diff --git a/modules/settings/settings/pages/Create.tsx b/modules/settings/settings/pages/Create.tsx index 31df1945..af3caa31 100644 --- a/modules/settings/settings/pages/Create.tsx +++ b/modules/settings/settings/pages/Create.tsx @@ -1,4 +1,4 @@ -import { Link, useForm } from '@inertiajs/react'; +import { Head, Link, useForm } from '@inertiajs/react'; import { keys, useT } from '@simple-module-py/i18n'; import { PageShell } from '@simple-module-py/ui/components/PageShell'; import { Button } from '@simple-module-py/ui/components/ui/button'; @@ -38,8 +38,10 @@ function Create() { } return ( - + + Cancel @@ -152,6 +154,7 @@ function Create() { + ); } diff --git a/modules/settings/settings/pages/Edit.tsx b/modules/settings/settings/pages/Edit.tsx index 63545fa7..e85b89a4 100644 --- a/modules/settings/settings/pages/Edit.tsx +++ b/modules/settings/settings/pages/Edit.tsx @@ -1,4 +1,4 @@ -import { Link, useForm } from '@inertiajs/react'; +import { Head, Link, useForm } from '@inertiajs/react'; import { keys, useT } from '@simple-module-py/i18n'; import { PageShell } from '@simple-module-py/ui/components/PageShell'; import { Button } from '@simple-module-py/ui/components/ui/button'; @@ -39,8 +39,10 @@ function Edit({ setting }: Props) { } return ( - + + @@ -118,6 +120,7 @@ function Edit({ setting }: Props) { + ); } diff --git a/modules/settings/settings/pages/ModulesEdit.tsx b/modules/settings/settings/pages/ModulesEdit.tsx index 2eb95b32..41b34f09 100644 --- a/modules/settings/settings/pages/ModulesEdit.tsx +++ b/modules/settings/settings/pages/ModulesEdit.tsx @@ -1,3 +1,4 @@ +import { Head } from '@inertiajs/react'; import { keys, useT } from '@simple-module-py/i18n'; import { Card } from '@simple-module-py/ui/components/ui/card'; import { Input } from '@simple-module-py/ui/components/ui/input'; @@ -29,7 +30,9 @@ function ModulesEdit({ modules }: Props) { const current = modules.find((m) => m.package === selected); return ( -
+ <> + +