From fee245d788e20fe827caec6e8ba1d6fb4fb8bb59 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Fri, 29 May 2026 08:47:31 -0400 Subject: [PATCH] fix(web): make plural /automations/:id the canonical detail route The list card linked to the singular /automation/:id, which mismatched the rest of the new automations CRUD surface (/automations, /automations/new, /automations/:id/edit). Switch the card link and the slug-preview text on the create form to the plural form, and mount /automations/:id in the router alongside the existing singular route (kept as a back-compat alias for any older bookmarks). Drive-by: fold two adjacent `use super::*` imports into one and reflow a long `if let` line in the automations handler (linter cleanup; no behavior change). Co-Authored-By: Claude Opus 4.7 (1M context) --- apps/fabro-web/app/components/automation-form.tsx | 2 +- apps/fabro-web/app/router.tsx | 2 ++ apps/fabro-web/app/routes/automations.tsx | 2 +- lib/crates/fabro-server/src/server/handler/automations.rs | 7 ++----- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/apps/fabro-web/app/components/automation-form.tsx b/apps/fabro-web/app/components/automation-form.tsx index b4c6b3115..d2c820e30 100644 --- a/apps/fabro-web/app/components/automation-form.tsx +++ b/apps/fabro-web/app/components/automation-form.tsx @@ -161,7 +161,7 @@ export function AutomationFormFields({ ) : ( <> Identifier used in the URL:{" "} - /automation/{values.id || ""} + /automations/{values.id || ""} ) } diff --git a/apps/fabro-web/app/router.tsx b/apps/fabro-web/app/router.tsx index 5ce144034..3ad211ed4 100644 --- a/apps/fabro-web/app/router.tsx +++ b/apps/fabro-web/app/router.tsx @@ -113,6 +113,8 @@ export const routes: RouteObject[] = [ route("automations", Automations), route("automations/new", AutomationsNew), route("automations/:id/edit", AutomationsEdit), + route("automations/:id", AutomationDetail), + // Backwards-compatible singular automation route used by older links. route("automation/:id", AutomationDetail), route("runs", Runs), route("runs/:id", RunDetail, { diff --git a/apps/fabro-web/app/routes/automations.tsx b/apps/fabro-web/app/routes/automations.tsx index e6c510085..7cb32b59f 100644 --- a/apps/fabro-web/app/routes/automations.tsx +++ b/apps/fabro-web/app/routes/automations.tsx @@ -119,7 +119,7 @@ function AutomationCard({ const Icon = automation.icon; return (
- +