From b8b7df0966132fa6563177ce947aaa3f85ccfa52 Mon Sep 17 00:00:00 2001 From: Louis King Date: Thu, 16 Jul 2026 22:56:48 +0100 Subject: [PATCH] ui(routes): split from/to header into aligned icon grid The route card header wrapped onto two lines when from/to labels were long. Replace the inline "from -> to" title with a two-row CSS grid (auto | 1fr) so labels align vertically, each preceded by a dedicated SVG icon (iconRouteFrom/iconRouteTo: arrow departing/arriving at a dot). Long labels now ellipsize with a title tooltip. Move the reversibility indicator (reversible <-> vs one-way ->) out of the title into a ghost badge beside the quality badge, where it no longer fights the grid layout. Also nudge spacing between "Recent Packets" and its path rows (mt-1 -> mt-2) for a little breathing room. --- src/meshcore_hub/web/static/js/spa/icons.js | 8 ++++++++ .../web/static/js/spa/pages/routes.js | 16 ++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/meshcore_hub/web/static/js/spa/icons.js b/src/meshcore_hub/web/static/js/spa/icons.js index a1f4451..e7350c0 100644 --- a/src/meshcore_hub/web/static/js/spa/icons.js +++ b/src/meshcore_hub/web/static/js/spa/icons.js @@ -181,3 +181,11 @@ export function iconClock(cls = 'h-5 w-5') { export function iconFilter(cls = 'h-5 w-5') { return html``; } + +export function iconRouteFrom(cls = 'h-5 w-5') { + return html``; +} + +export function iconRouteTo(cls = 'h-5 w-5') { + return html``; +} diff --git a/src/meshcore_hub/web/static/js/spa/pages/routes.js b/src/meshcore_hub/web/static/js/spa/pages/routes.js index 80b2bde..3028db4 100644 --- a/src/meshcore_hub/web/static/js/spa/pages/routes.js +++ b/src/meshcore_hub/web/static/js/spa/pages/routes.js @@ -1,6 +1,6 @@ import { apiGet, apiPost, apiPut, apiDelete, isAbortError } from '../api.js'; import { html, litRender, nothing, t, errorAlert, getConfig, hasRole } from '../components.js'; -import { iconPath, iconPlus, iconEdit, iconTrash, iconPackets, iconClock, iconRuler, iconNodes, iconSatelliteDish } from '../icons.js'; +import { iconPath, iconPlus, iconEdit, iconTrash, iconPackets, iconClock, iconRuler, iconNodes, iconSatelliteDish, iconRouteFrom, iconRouteTo } from '../icons.js'; const VISIBILITY_ORDER = ['community', 'member', 'operator', 'admin']; @@ -147,14 +147,18 @@ function renderRouteCard(route, { isAdmin, onDelete, onEdit, detail, navigate, p
-

- ${route.from_label} - ${arrow} - ${route.to_label} +

+
+ ${iconRouteFrom('h-5 w-5')} + ${route.from_label} + ${iconRouteTo('h-5 w-5')} + ${route.to_label} +

${route.description ? html`

${route.description}

` : nothing}
+ ${arrow} ${badge}
@@ -186,7 +190,7 @@ function renderDetailContent(route, detail, { navigate, packetsEnabled, history ${historySection} ${matches.length > 0 ? html`
${t('routes.recent_packets')} -
+
${matches.map(m => { const prefixLen = 2 * (route.match_width || 1); const pathLookup = new Map(