Explorar o código

style(ui): align every page header with the topology layout (#1826)

Nacho hai 1 mes
pai
achega
7cce4aa34f
Modificáronse 4 ficheiros con 13 adicións e 77 borrados
  1. 1 0
      CHANGELOG.md
  2. 4 4
      app/src/pages/Alerts.tsx
  3. 4 24
      app/src/pages/Devices.tsx
  4. 4 49
      app/src/pages/Settings.tsx

+ 1 - 0
CHANGELOG.md

@@ -19,6 +19,7 @@ y este proyecto se adhiere a [Versionado Semántico](https://semver.org/lang/es/
 
 
 ### Changed
 ### Changed
 
 
+- Every page header now uses the same layout as the topology one (#1823). Alerts, Devices and Settings still placed the breadcrumb and the explanation differently, with a slash separator and a caption-sized line, so the text landed in a different spot on each page. They now share the chevron separator, the caption breadcrumb and the body-sized explanation, aligned the same way.
 - Firmware upgrades no longer repeats its own name (#1823). The page was the only one still printing the section title under the top bar, and the line below it opened with the same words. The title is gone and the line now says what the page does: track each unit, start the flash and keep a copy of the configuration first.
 - Firmware upgrades no longer repeats its own name (#1823). The page was the only one still printing the section title under the top bar, and the line below it opened with the same words. The title is gone and the line now says what the page does: track each unit, start the flash and keep a copy of the configuration first.
 - Page headers follow the topology one (#1822): the breadcrumb keeps its small caption size with the same chevron separator, and the line under it grows to the body size in the secondary colour, so the explanation reads before the controls. Every refresh control is icon-only now, square and with the accessible name kept, which also matches the height of the rest of the header actions.
 - Page headers follow the topology one (#1822): the breadcrumb keeps its small caption size with the same chevron separator, and the line under it grows to the body size in the secondary colour, so the explanation reads before the controls. Every refresh control is icon-only now, square and with the accessible name kept, which also matches the height of the rest of the header actions.
 - The page title is no longer printed twice (#1815). The top bar already shows it, so the copy under the breadcrumb is gone and what stays is the breadcrumb plus a one-line explanation of what the page is for. Refresh actions in the page header are icon-only now, with the accessible name kept, and every header button shares the same height.
 - The page title is no longer printed twice (#1815). The top bar already shows it, so the copy under the breadcrumb is gone and what stays is the breadcrumb plus a one-line explanation of what the page is for. Refresh actions in the page header are icon-only now, with the accessible name kept, and every header button shares the same height.

+ 4 - 4
app/src/pages/Alerts.tsx

@@ -839,18 +839,18 @@ export default function Alerts() {
   return (
   return (
     <div className="mx-auto w-full max-w-[1100px]">
     <div className="mx-auto w-full max-w-[1100px]">
       {/* ① Page header */}
       {/* ① Page header */}
-      <nav aria-label={t('common.breadcrumb')} className="mb-1 text-caption text-text-muted">
+      <nav aria-label={t('common.breadcrumb')} className="mb-1 flex items-center gap-1 text-caption text-text-muted">
         <Link to="/" className="transition-colors hover:text-accent">{t('common.home')}</Link>
         <Link to="/" className="transition-colors hover:text-accent">{t('common.home')}</Link>
-        <span className="mx-1.5">/</span>
+        <ChevronRight className="h-3 w-3" strokeWidth={1.75} aria-hidden />
         <span className="text-text-secondary">{t('nav.alerts')}</span>
         <span className="text-text-secondary">{t('nav.alerts')}</span>
       </nav>
       </nav>
-      <div className="flex items-start justify-between gap-3">
+      <div className="flex flex-wrap items-end justify-between gap-x-4 gap-y-3">
         <div>
         <div>
           <motion.p
           <motion.p
             initial={reduce ? false : { opacity: 0 }}
             initial={reduce ? false : { opacity: 0 }}
             animate={{ opacity: 1 }}
             animate={{ opacity: 1 }}
             transition={{ duration: 0.3, delay: reduce ? 0 : 0.15 }}
             transition={{ duration: 0.3, delay: reduce ? 0 : 0.15 }}
-            className="mt-0.5 text-caption text-text-muted"
+            className="mt-0.5 text-sm text-text-secondary"
           >
           >
             {unread > 0 ? (
             {unread > 0 ? (
               <>
               <>

+ 4 - 24
app/src/pages/Devices.tsx

@@ -2,27 +2,7 @@ import { forwardRef, useCallback, useEffect, useMemo, useState } from 'react'
 import { useTranslation } from 'react-i18next'
 import { useTranslation } from 'react-i18next'
 import { Link, useNavigate, useSearchParams } from 'react-router'
 import { Link, useNavigate, useSearchParams } from 'react-router'
 import { AnimatePresence, motion, useReducedMotion } from 'framer-motion'
 import { AnimatePresence, motion, useReducedMotion } from 'framer-motion'
-import {
-  ArrowDown,
-  ArrowLeftRight,
-  ArrowUp,
-  ArrowUpDown,
-  Check,
-  ChevronDown,
-  Columns3,
-  Download,
-  Filter,
-  LayoutGrid,
-  List,
-  Pencil,
-  Pin,
-  Search,
-  ShieldCheck,
-  SignalLow,
-  Sparkles,
-  Wifi,
-  X,
-} from 'lucide-react'
+import { ArrowDown, ArrowLeftRight, ArrowUp, ArrowUpDown, Check, ChevronDown, ChevronRight, Columns3, Download, Filter, LayoutGrid, List, Pencil, Pin, Search, ShieldCheck, SignalLow, Sparkles, Wifi, X } from 'lucide-react'
 import type { LucideIcon } from 'lucide-react'
 import type { LucideIcon } from 'lucide-react'
 import { DeviceRow, deviceIcon, SignalIcon } from '@/components/DeviceRow'
 import { DeviceRow, deviceIcon, SignalIcon } from '@/components/DeviceRow'
 import { CountUp } from '@/components/CountUp'
 import { CountUp } from '@/components/CountUp'
@@ -1988,16 +1968,16 @@ export default function Devices() {
     <div className="space-y-4 md:space-y-5">
     <div className="space-y-4 md:space-y-5">
       {/* ① Page header */}
       {/* ① Page header */}
       <header>
       <header>
-        <nav aria-label={t('common.breadcrumb')} className="text-caption text-text-muted">
+        <nav aria-label={t('common.breadcrumb')} className="mb-1 flex items-center gap-1 text-caption text-text-muted">
           <Link to="/" className="transition-colors hover:text-accent">
           <Link to="/" className="transition-colors hover:text-accent">
             {t('common.home')}
             {t('common.home')}
           </Link>
           </Link>
-          <span className="mx-1.5">/</span>
+          <ChevronRight className="h-3 w-3" strokeWidth={1.75} aria-hidden />
           <span className="text-text-secondary">{t('nav.devices')}</span>
           <span className="text-text-secondary">{t('nav.devices')}</span>
         </nav>
         </nav>
         <div className="mt-1.5 flex flex-wrap items-end justify-between gap-x-4 gap-y-3">
         <div className="mt-1.5 flex flex-wrap items-end justify-between gap-x-4 gap-y-3">
           <div>
           <div>
-            <p className="mt-0.5 text-caption text-text-muted">
+            <p className="mt-0.5 text-sm text-text-secondary">
               {t('devices.summary', { total: deviceTotals.total, online: deviceTotals.online })}
               {t('devices.summary', { total: deviceTotals.total, online: deviceTotals.online })}
             </p>
             </p>
           </div>
           </div>

+ 4 - 49
app/src/pages/Settings.tsx

@@ -2,52 +2,7 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
 import { useTranslation } from 'react-i18next'
 import { useTranslation } from 'react-i18next'
 import { Link } from 'react-router'
 import { Link } from 'react-router'
 import { AnimatePresence, motion, useReducedMotion } from 'framer-motion'
 import { AnimatePresence, motion, useReducedMotion } from 'framer-motion'
-import {
-  BadgeCheck,
-  Check,
-  ChevronDown,
-  CircleAlert,
-  Copy,
-  Database,
-  Download,
-  ExternalLink,
-  Eye,
-  EyeOff,
-  FileText,
-  FlaskConical,
-  Gauge,
-  HardDrive,
-  History,
-  KeyRound,
-  Loader2,
-  LogOut,
-  MonitorSmartphone,
-  Moon,
-  Pencil,
-  Plus,
-  Power,
-  Lock,
-   Radar,
-   RefreshCw,
-   RotateCcw,
-   RotateCw,
-  Router as RouterIcon,
-   Server,
-   Settings2,
-    Shield,
-    ShieldCheck,
-   Star,
-   Sun,
-   Trash2,
-   TriangleAlert,
-   UserCog,
-   Users,
-   Volume2,
-   Wifi,
-   X,
-   ChevronUp,
-  CalendarClock,
-} from 'lucide-react'
+import { BadgeCheck, CalendarClock, Check, ChevronDown, ChevronRight, ChevronUp, CircleAlert, Copy, Database, Download, ExternalLink, Eye, EyeOff, FileText, FlaskConical, Gauge, HardDrive, History, KeyRound, Loader2, Lock, LogOut, MonitorSmartphone, Moon, Pencil, Plus, Power, Radar, RefreshCw, RotateCcw, RotateCw, Router as RouterIcon, Server, Settings2, Shield, ShieldCheck, Star, Sun, Trash2, TriangleAlert, UserCog, Users, Volume2, Wifi, X } from 'lucide-react'
 import type { LucideIcon } from 'lucide-react'
 import type { LucideIcon } from 'lucide-react'
 import Integrations from './Integrations'
 import Integrations from './Integrations'
 import { HealthRing } from '@/components/HealthRing'
 import { HealthRing } from '@/components/HealthRing'
@@ -218,7 +173,7 @@ function Card({ title, caption, index, reduce, children, headerSlot, className }
       <div className="mb-4 flex items-start justify-between gap-3">
       <div className="mb-4 flex items-start justify-between gap-3">
         <div>
         <div>
           <h2 className="font-display text-h2 text-text-primary">{title}</h2>
           <h2 className="font-display text-h2 text-text-primary">{title}</h2>
-          {caption && <p className="mt-0.5 text-caption text-text-muted">{caption}</p>}
+          {caption && <p className="mt-0.5 text-sm text-text-secondary">{caption}</p>}
         </div>
         </div>
         {headerSlot}
         {headerSlot}
       </div>
       </div>
@@ -5520,9 +5475,9 @@ export default function Settings() {
   return (
   return (
     <div className="mx-auto w-full max-w-[1180px]">
     <div className="mx-auto w-full max-w-[1180px]">
       {/* ① Page header */}
       {/* ① Page header */}
-      <nav aria-label={t('common.breadcrumb')} className="mb-1 text-caption text-text-muted">
+      <nav aria-label={t('common.breadcrumb')} className="mb-1 flex items-center gap-1 text-caption text-text-muted">
         <Link to="/" className="transition-colors hover:text-accent">{t('common.home')}</Link>
         <Link to="/" className="transition-colors hover:text-accent">{t('common.home')}</Link>
-        <span className="mx-1.5">/</span>
+        <ChevronRight className="h-3 w-3" strokeWidth={1.75} aria-hidden />
         <span className="text-text-secondary">{t('nav.settings')}</span>
         <span className="text-text-secondary">{t('nav.settings')}</span>
       </nav>
       </nav>
       <motion.p
       <motion.p