From 737901c962a533c86ac828db0d23a122471d133f Mon Sep 17 00:00:00 2001 From: serversdown Date: Wed, 13 May 2026 16:09:28 +0000 Subject: [PATCH] =?UTF-8?q?refactor(nav):=20rename=20Fleet=E2=86=92Devices?= =?UTF-8?q?,=20add=20Tools=20entry,=20move=20workflows=20to=20Tools?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sidebar evolved from "Fleet defaults to seismograph dashboard" to "Devices defaults to unified roster" + a new "Tools" entry housing the active operator workflows. Sidebar (6 items): Dashboard · Devices · Projects · Tools · Job Planner · Settings Changes: - templates/base.html: renamed Fleet → Devices. Default route changed from /seismographs to /roster — clicking Devices now lands on the unified all-devices view, then operators drill into type-specific layouts via the tab strip. Tools entry added between Projects and Job Planner; highlights when on /tools or any of its linked workflow pages. - templates/partials/fleet_tab_strip.html: reordered tabs so "All Devices" comes first (matches the new default landing). Seismographs → SLMs → Modems follow. - templates/tools.html (new) + /tools route in main.py: card grid hub for active workflows. • Pair Devices — links to /pair-devices • Project Tidy — links to /settings/developer/project-tidy • Backfill from event metadata — /settings/developer/metadata-backfill • Reports — info card pointing to project detail pages where Excel report generation actually lives (per-project context) • Swap Detection — greyed-out placeholder for Phase 5c - templates/settings.html: removed Project Tidy + Metadata Backfill cards from Settings → Developer. They now live in Tools. Settings → Developer retains the truly admin/dev surfaces (Watcher Manager, SFM Admin). The workflow page URLs (/settings/developer/project-tidy, /settings/developer/metadata-backfill) stay where they are — only the nav entry point changes. Bookmarks still work. Co-Authored-By: Claude Opus 4.7 --- backend/main.py | 8 ++ templates/base.html | 33 +++++-- templates/partials/fleet_tab_strip.html | 14 +-- templates/settings.html | 30 +------ templates/tools.html | 110 ++++++++++++++++++++++++ 5 files changed, 153 insertions(+), 42 deletions(-) create mode 100644 templates/tools.html diff --git a/backend/main.py b/backend/main.py index 6c99b7d..3009107 100644 --- a/backend/main.py +++ b/backend/main.py @@ -258,6 +258,14 @@ async def project_tidy_page(request: Request): return templates.TemplateResponse("admin/project_tidy.html", {"request": request}) +@app.get("/tools", response_class=HTMLResponse) +async def tools_page(request: Request): + """Tools / workflow hub. Active operator workflows (device pairing, + project tidy, metadata backfill, future swap detection, report + generators) all live here in card form.""" + return templates.TemplateResponse("tools.html", {"request": request}) + + @app.get("/modems", response_class=HTMLResponse) async def modems_page(request: Request): """Field modems management dashboard""" diff --git a/templates/base.html b/templates/base.html index c869e0f..cfdf4e0 100644 --- a/templates/base.html +++ b/templates/base.html @@ -109,22 +109,22 @@ Dashboard - {# Fleet — single sidebar entry for all device-type pages. - The tab strip on each underlying page (Seismographs / - Sound Level Meters / Modems / All Devices) handles - navigation between the device-type-specific layouts. + {# Devices — single sidebar entry covering all device-type + pages. Lands on /roster (the unified all-devices view); + the tab strip on each underlying page lets the operator + drill into seismograph / SLM / modem specifics. Active when on any /seismographs, /sound-level-meters, /modems, /roster, /pair-devices, /unit/* page. #} - {% set _is_fleet = ( + {% set _is_devices = ( request.url.path in ('/seismographs', '/sound-level-meters', '/modems', '/roster', '/pair-devices') or request.url.path.startswith('/unit/') or request.url.path.startswith('/slm/') ) %} - + - + - Fleet + Devices @@ -134,6 +134,23 @@ Projects + {# Tools — operator workflow hub. Active when on /tools + itself or any of the workflow pages it links into + (project tidy, metadata backfill, pair devices). #} + {% set _is_tools = ( + request.url.path == '/tools' + or request.url.path == '/pair-devices' + or request.url.path == '/settings/developer/project-tidy' + or request.url.path == '/settings/developer/metadata-backfill' + ) %} + + + + + + Tools + + diff --git a/templates/partials/fleet_tab_strip.html b/templates/partials/fleet_tab_strip.html index 5fb879a..21ab219 100644 --- a/templates/partials/fleet_tab_strip.html +++ b/templates/partials/fleet_tab_strip.html @@ -14,6 +14,13 @@ Usage at top of any Fleet-section template:
- -
-
-
Backfill from event metadata
-
- Auto-create projects, locations, and unit assignments from the operator-typed metadata baked into SFM events. Skip the manual entry. -
-
- - Open - -
- - -
-
-
Project Tidy
-
- Find duplicate-looking projects via fuzzy name match (typos, abbreviations, spacing variations) and bulk-merge them. -
-
- - Open - -
+ {# Metadata Backfill + Project Tidy moved to Tools (they're + operator workflows, not admin/dev surfaces). Find them + at /tools. #}
diff --git a/templates/tools.html b/templates/tools.html new file mode 100644 index 0000000..4b20006 --- /dev/null +++ b/templates/tools.html @@ -0,0 +1,110 @@ +{% extends "base.html" %} + +{% block title %}Tools - Seismo Fleet Manager{% endblock %} + +{% block content %} + +
+

Tools

+

+ Active operator workflows. Pair devices, clean up duplicates, generate reports. +

+
+ + + +{% endblock %}