chore(dashboard): redirect 5 orphaned legacy routes to their tabbed homes

/gauge-sites, /town-anchors, /mesh, /meshtastic/sources, and
/meshcore/companion each duplicate content now tabbed inside Places,
MeshtasticNodes, and MeshCoreContactsCompanion, and have no in-app
<Link> pointing at them (verified with rg). Convert them to
<Navigate replace> redirects, matching the existing /notifications
and /data-sources precedent.

/town-anchors, /meshtastic/sources, and /meshcore/companion land on
their host's first tab rather than deep-linking to the second tab
(no ?tab= support exists) — same accepted trade-off as the existing
/notifications and /data-sources redirects.

Drop the now-dead extraTitleItems entries and the redundant
'/meshcore/companion' pathTitles entry, plus the Radio, Droplets,
Layers, and Bot icon imports that were only used by those entries
(MapPin is kept — still used by the /places nav item). These 5
routes were never nav entries (extraTitleItems only), so the sidebar
stays at 17 items with 5 Meshtastic / 5 MeshCore — MT/MC symmetry
unchanged.
This commit is contained in:
Matt Johnson 2026-07-16 17:50:56 +00:00
commit 4c97a7d3f1
2 changed files with 11 additions and 23 deletions

View file

@ -1,19 +1,14 @@
import { Routes, Route, Navigate } from 'react-router-dom'
import Layout from './components/Layout'
import Dashboard from './pages/Dashboard'
import Mesh from './pages/Mesh'
import Environment from './pages/Environment'
import Config from './pages/Config'
import ActivityLog from './pages/ActivityLog'
import Notifications from './pages/Notifications'
import Reference from './pages/Reference'
import GaugeSites from './pages/GaugeSites'
import TownAnchors from './pages/TownAnchors'
import MeshCoreRouting from './pages/MeshCoreRouting'
import MeshCoreConnection from './pages/MeshCoreConnection'
import MeshCoreCompanion from './pages/MeshCoreCompanion'
import MeshtasticConnection from './pages/MeshtasticConnection'
import MeshtasticSources from './pages/MeshtasticSources'
import Places from './pages/Places'
import MeshtasticNodes from './pages/MeshtasticNodes'
import MeshCoreContactsCompanion from './pages/MeshCoreContactsCompanion'
@ -47,14 +42,17 @@ function App() {
{/* Custom sources folded into Data Feeds; keep old bookmark working */}
<Route path="/data-sources" element={<Navigate to="/environment" replace />} />
{/* De-navved routes still work */}
<Route path="/gauge-sites" element={<GaugeSites />} />
<Route path="/town-anchors" element={<TownAnchors />} />
<Route path="/mesh" element={<Mesh />} />
{/* Legacy /gauge-sites -> Places (Gauge Sites tab) */}
<Route path="/gauge-sites" element={<Navigate to="/places" replace />} />
{/* Legacy /town-anchors -> Places (lands on first tab, no ?tab= deep-link) */}
<Route path="/town-anchors" element={<Navigate to="/places" replace />} />
{/* Legacy /mesh -> Meshtastic Nodes & Health (Nodes tab) */}
<Route path="/mesh" element={<Navigate to="/meshtastic/nodes" replace />} />
{/* Meshtastic routes */}
<Route path="/meshtastic/connection" element={<MeshtasticConnection />} />
<Route path="/meshtastic/sources" element={<MeshtasticSources />} />
{/* Legacy /meshtastic/sources -> Nodes & Health (lands on first tab, no ?tab= deep-link) */}
<Route path="/meshtastic/sources" element={<Navigate to="/meshtastic/nodes" replace />} />
<Route path="/meshtastic/scheduled" element={<ScheduledBroadcasts family="meshtastic" />} />
<Route path="/meshtastic/nodes" element={<MeshtasticNodes />} />
<Route path="/meshtastic/danger-zones" element={<MeshtasticDangerZones />} />
@ -64,7 +62,8 @@ function App() {
<Route path="/meshcore/routing" element={<MeshCoreRouting />} />
<Route path="/meshcore/scheduled" element={<ScheduledBroadcasts family="meshcore" />} />
<Route path="/meshcore/contacts" element={<MeshCoreContactsCompanion />} />
<Route path="/meshcore/companion" element={<MeshCoreCompanion />} />
{/* Legacy /meshcore/companion -> Contacts & Companion (lands on first tab, no ?tab= deep-link) */}
<Route path="/meshcore/companion" element={<Navigate to="/meshcore/contacts" replace />} />
<Route path="/meshcore/danger-zones" element={<MeshCoreDangerZones />} />
</Routes>
</Layout>

View file

@ -3,18 +3,14 @@ import { Link, useLocation, useNavigate } from 'react-router-dom'
import { useDirty } from '@/context/DirtyContext'
import {
LayoutDashboard,
Radio,
Cloud,
BellRing,
BookOpen,
Droplets,
MapPin,
Map,
Wifi,
Layers,
Network,
Users,
Bot,
Settings,
Calendar,
Activity,
@ -84,13 +80,7 @@ const navGroups: NavGroup[] = [
// Flattened view of every nav item for title lookup.
// Also include de-navved routes so they still resolve a title.
const extraTitleItems: NavItem[] = [
{ path: '/gauge-sites', label: 'Gauge Sites', icon: Droplets },
{ path: '/town-anchors', label: 'Town Anchors', icon: MapPin },
{ path: '/mesh', label: 'Mesh', icon: Radio },
{ path: '/meshtastic/sources', label: 'Sources', icon: Layers },
{ path: '/meshcore/companion', label: 'Companion', icon: Bot },
]
const extraTitleItems: NavItem[] = []
const allNavItems: NavItem[] = [
...navGroups.flatMap((g) => g.items),
@ -106,7 +96,6 @@ const pathTitles: Record<string, string> = {
'/meshtastic/danger-zones': 'Danger Zones',
'/meshcore/danger-zones': 'Danger Zones',
'/meshcore/contacts': 'Contacts & Companion',
'/meshcore/companion': 'Contacts & Companion',
}
function formatUptime(seconds: number): string {