Sfoglia il codice sorgente

style(ui): match page headers to the topology pattern (#1823)

Nacho 1 mese fa
parent
commit
de70d8a4a7

+ 1 - 0
CHANGELOG.md

@@ -19,6 +19,7 @@ y este proyecto se adhiere a [Versionado Semántico](https://semver.org/lang/es/
 
 
 ### Changed
 ### Changed
 
 
+- 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.
 - The per-unit actions live together now (#1803). **Regenerate token** moved from Settings > Fleet to the Actions column of the agents card, and **Forget host key** moved from the unit detail to the same card, so a unit's configuration is not split across three screens. Both keep their confirmation dialog and only appear where they apply: the token for netpulse agents, the host key for units NetPulse polls over SSH.
 - The per-unit actions live together now (#1803). **Regenerate token** moved from Settings > Fleet to the Actions column of the agents card, and **Forget host key** moved from the unit detail to the same card, so a unit's configuration is not split across three screens. Both keep their confirmation dialog and only appear where they apply: the token for netpulse agents, the host key for units NetPulse polls over SSH.
 - The settings group goes back to its Integrations label and the section that hosts the vendor integrations manager is the one called Complementos (Add-ons in English), which is how the code comment already described it (#1784).
 - The settings group goes back to its Integrations label and the section that hosts the vendor integrations manager is the one called Complementos (Add-ons in English), which is how the code comment already described it (#1784).

+ 3 - 2
app/src/pages/FirmwareUpgrades.tsx

@@ -737,10 +737,11 @@ export default function FirmwareUpgrades() {
         <button
         <button
           onClick={fetchItems}
           onClick={fetchItems}
           disabled={loading}
           disabled={loading}
-          className="inline-flex h-9 items-center gap-2 rounded-lg border border-border bg-surface px-3 text-sm font-medium text-text-primary transition-colors hover:bg-elevated disabled:opacity-50"
+          aria-label={t('common.refresh')}
+          title={t('common.refresh')}
+          className="inline-flex h-9 w-9 items-center justify-center rounded-lg border border-border bg-surface text-text-primary transition-colors hover:bg-elevated disabled:opacity-50"
         >
         >
           <RefreshCw className={cn('h-4 w-4', loading && 'animate-spin')} strokeWidth={1.75} />
           <RefreshCw className={cn('h-4 w-4', loading && 'animate-spin')} strokeWidth={1.75} />
-          {t('common.refresh')}
         </button>
         </button>
       </header>
       </header>
 
 

+ 3 - 2
app/src/pages/ReanchorPanel.tsx

@@ -155,10 +155,11 @@ export default function ReanchorPanel({ refreshTick }: Props) {
           <button
           <button
             onClick={() => void load()}
             onClick={() => void load()}
             disabled={loading}
             disabled={loading}
-            className="inline-flex h-9 items-center gap-2 rounded-lg border border-border bg-elevated px-3 text-sm font-medium text-text-secondary transition-colors hover:border-accent/40 hover:text-accent disabled:opacity-50"
+            aria-label={t('common.refresh')}
+            title={t('common.refresh')}
+            className="inline-flex h-9 w-9 items-center justify-center rounded-lg border border-border bg-elevated text-text-secondary transition-colors hover:border-accent/40 hover:text-accent disabled:opacity-50"
           >
           >
             <RefreshCw className={cn('h-4 w-4', loading && 'animate-spin')} strokeWidth={1.75} />
             <RefreshCw className={cn('h-4 w-4', loading && 'animate-spin')} strokeWidth={1.75} />
-            {t('common.refresh')}
           </button>
           </button>
         </div>
         </div>
 
 

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

@@ -3,7 +3,7 @@ import type { KeyboardEvent as ReactKeyboardEvent } from 'react'
 import { useTranslation } from 'react-i18next'
 import { useTranslation } from 'react-i18next'
 import { Link } from 'react-router'
 import { Link } from 'react-router'
 import { motion, useReducedMotion } from 'framer-motion'
 import { motion, useReducedMotion } from 'framer-motion'
-import { Activity, AlertTriangle, CalendarDays, Clock, Download, RefreshCw, Users } from 'lucide-react'
+import { Activity, AlertTriangle, CalendarDays, ChevronRight, Clock, Download, RefreshCw, Users } from 'lucide-react'
 import { cn, fetchJson } from '@/lib/utils'
 import { cn, fetchJson } from '@/lib/utils'
 import { relTimeFromTs } from '@/i18n'
 import { relTimeFromTs } from '@/i18n'
 import { routerName } from '@/data/mock'
 import { routerName } from '@/data/mock'
@@ -295,10 +295,10 @@ export default function Reports() {
           animate={{ opacity: 1, y: 0 }}
           animate={{ opacity: 1, y: 0 }}
           transition={{ duration: 0.25, ease: 'easeOut' }}
           transition={{ duration: 0.25, ease: 'easeOut' }}
           aria-label={t('common.breadcrumb')}
           aria-label={t('common.breadcrumb')}
-          className="font-mono text-caption text-text-muted"
+          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.reports')}</span>
           <span className="text-text-secondary">{t('nav.reports')}</span>
         </motion.nav>
         </motion.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">
@@ -307,7 +307,7 @@ export default function Reports() {
             animate={{ opacity: 1, y: 0 }}
             animate={{ opacity: 1, y: 0 }}
             transition={{ duration: 0.25, ease: 'easeOut', delay: 0.06 }}
             transition={{ duration: 0.25, ease: 'easeOut', delay: 0.06 }}
           >
           >
-            <p className="text-caption text-text-muted">{t('reports.explain', { window: windowText })}</p>
+            <p className="mt-0.5 text-sm text-text-secondary">{t('reports.explain', { window: windowText })}</p>
           </motion.div>
           </motion.div>
           <motion.div
           <motion.div
             initial={initial}
             initial={initial}

+ 7 - 6
app/src/pages/Roaming.tsx

@@ -3,7 +3,7 @@ import type { KeyboardEvent as ReactKeyboardEvent } from 'react'
 import { useTranslation } from 'react-i18next'
 import { useTranslation } from 'react-i18next'
 import { Link } from 'react-router'
 import { Link } from 'react-router'
 import { motion, useReducedMotion } from 'framer-motion'
 import { motion, useReducedMotion } from 'framer-motion'
-import { AlertTriangle, ArrowDownToLine, ArrowUpFromLine, CheckCircle2, Filter, GitFork, History, RefreshCw, Wifi, X, XCircle } from 'lucide-react'
+import { AlertTriangle, ArrowDownToLine, ArrowUpFromLine, CheckCircle2, ChevronRight, Filter, GitFork, History, RefreshCw, Wifi, X, XCircle } from 'lucide-react'
 import { cn, fetchJson } from '@/lib/utils'
 import { cn, fetchJson } from '@/lib/utils'
 import { useNetPulse, redirectLogin } from '@/data/DataProvider'
 import { useNetPulse, redirectLogin } from '@/data/DataProvider'
 import { useWeakSignalDbm } from '@/hooks/useWeakSignalDbm'
 import { useWeakSignalDbm } from '@/hooks/useWeakSignalDbm'
@@ -441,10 +441,10 @@ export default function Roaming() {
           animate={{ opacity: 1, y: 0 }}
           animate={{ opacity: 1, y: 0 }}
           transition={{ duration: 0.25, ease: 'easeOut' }}
           transition={{ duration: 0.25, ease: 'easeOut' }}
           aria-label={t('common.breadcrumb')}
           aria-label={t('common.breadcrumb')}
-          className="font-mono text-caption text-text-muted"
+          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.roaming')}</span>
           <span className="text-text-secondary">{t('nav.roaming')}</span>
         </motion.nav>
         </motion.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">
@@ -453,7 +453,7 @@ export default function Roaming() {
             animate={{ opacity: 1, y: 0 }}
             animate={{ opacity: 1, y: 0 }}
             transition={{ duration: 0.25, ease: 'easeOut', delay: 0.06 }}
             transition={{ duration: 0.25, ease: 'easeOut', delay: 0.06 }}
           >
           >
-            <p className="text-caption text-text-muted">{t('roaming.subtitle')}</p>
+            <p className="mt-0.5 text-sm text-text-secondary">{t('roaming.subtitle')}</p>
             {(() => {
             {(() => {
               const meta = roamingDaemonMeta(roamingDaemon, t)
               const meta = roamingDaemonMeta(roamingDaemon, t)
               if (!meta) return null
               if (!meta) return null
@@ -487,10 +487,11 @@ export default function Roaming() {
                 setSpin(false)
                 setSpin(false)
               }, 650)
               }, 650)
             }}
             }}
-            className="inline-flex h-9 items-center gap-2 rounded-lg border border-border bg-surface px-3 text-sm font-medium text-text-secondary transition-colors hover:border-accent/40 hover:text-accent"
+            aria-label={t('common.refresh')}
+            title={t('common.refresh')}
+            className="inline-flex h-9 w-9 items-center justify-center rounded-lg border border-border bg-surface text-text-secondary transition-colors hover:border-accent/40 hover:text-accent"
           >
           >
             <RefreshCw className={cn('h-4 w-4 transition-transform duration-500', spin && 'rotate-[360deg]')} strokeWidth={1.75} />
             <RefreshCw className={cn('h-4 w-4 transition-transform duration-500', spin && 'rotate-[360deg]')} strokeWidth={1.75} />
-            {t('common.refresh')}
           </motion.button>
           </motion.button>
         </div>
         </div>
       </header>
       </header>

+ 7 - 6
app/src/pages/Routers.tsx

@@ -1,7 +1,7 @@
 import { useEffect, useState } from 'react'
 import { useEffect, useState } from 'react'
 import { useTranslation } from 'react-i18next'
 import { useTranslation } from 'react-i18next'
 import { Link } from 'react-router'
 import { Link } from 'react-router'
-import { RefreshCw, Rocket } from 'lucide-react'
+import { ChevronRight, RefreshCw, Rocket } from 'lucide-react'
 import { motion, useReducedMotion } from 'framer-motion'
 import { motion, useReducedMotion } from 'framer-motion'
 import { useNetPulse } from '@/data/DataProvider'
 import { useNetPulse } from '@/data/DataProvider'
 import { AgentsSection } from '@/components/routers/AgentsSection'
 import { AgentsSection } from '@/components/routers/AgentsSection'
@@ -156,10 +156,10 @@ export default function Routers() {
           animate={{ opacity: 1, y: 0 }}
           animate={{ opacity: 1, y: 0 }}
           transition={{ duration: 0.25, ease: 'easeOut' }}
           transition={{ duration: 0.25, ease: 'easeOut' }}
           aria-label={t('common.breadcrumb')}
           aria-label={t('common.breadcrumb')}
-          className="font-mono text-caption text-text-muted"
+          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.routers')}</span>
           <span className="text-text-secondary">{t('nav.routers')}</span>
         </motion.nav>
         </motion.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">
@@ -168,7 +168,7 @@ export default function Routers() {
             animate={{ opacity: 1, y: 0 }}
             animate={{ opacity: 1, y: 0 }}
             transition={{ duration: 0.25, ease: 'easeOut', delay: 0.06 }}
             transition={{ duration: 0.25, ease: 'easeOut', delay: 0.06 }}
           >
           >
-            <p className="text-caption text-text-muted">
+            <p className="mt-0.5 text-sm text-text-secondary">
               {t('routers.summary', { total: routers.length, online, warnings: warned })}
               {t('routers.summary', { total: routers.length, online, warnings: warned })}
             </p>
             </p>
           </motion.div>
           </motion.div>
@@ -198,10 +198,11 @@ export default function Routers() {
             </span>
             </span>
             <button
             <button
               onClick={handleRefresh}
               onClick={handleRefresh}
-              className="inline-flex h-9 items-center gap-2 rounded-lg border border-border bg-surface px-3 text-sm font-medium text-text-secondary transition-colors hover:border-accent/40 hover:text-accent"
+              aria-label={t('common.refresh')}
+              title={t('common.refresh')}
+              className="inline-flex h-9 w-9 items-center justify-center rounded-lg border border-border bg-surface text-text-secondary transition-colors hover:border-accent/40 hover:text-accent"
             >
             >
               <RefreshCw className={cn('h-4 w-4 transition-transform duration-500', spinning && 'rotate-[360deg]')} strokeWidth={1.75} />
               <RefreshCw className={cn('h-4 w-4 transition-transform duration-500', spinning && 'rotate-[360deg]')} strokeWidth={1.75} />
-              {t('common.refresh')}
             </button>
             </button>
             {pendingAgents > 0 && (
             {pendingAgents > 0 && (
               <span className="inline-flex items-center gap-2 rounded-full border border-warn/40 bg-warn/10 px-3 py-1.5">
               <span className="inline-flex items-center gap-2 rounded-full border border-warn/40 bg-warn/10 px-3 py-1.5">