Просмотр исходного кода

style(ui): unify page width and header spacing (#1829)

Nacho 1 месяц назад
Родитель
Сommit
8002c1562c

+ 1 - 0
CHANGELOG.md

@@ -19,6 +19,7 @@ y este proyecto se adhiere a [Versionado Semántico](https://semver.org/lang/es/
 
 ### Changed
 
+- Every page now shares the same width and the same header gap (#1823). Alerts and Settings capped their content at their own width while the rest used the shell, so Alerts looked narrower than the menu it sits in. The breadcrumb also sat outside the block that holds the explanation, which is why the gap under it differed from page to page. Both now come from the same shell width and the same header block.
 - The in-app help covers integrations and certificates (#1823). Two flows are new: one walks through the add-ons group in Settings, the vendor catalog and what a pusher is, including the units that already push without a record; the other covers the HTTPS card, from the certificate or private CA source to the agent pin and the extra options for connection strings and plain HTTP. Both cite the real UI labels as chips, like the rest of the page.
 - The Channels page no longer repeats its name (#1823). The top bar said Canales and the page said Analisis de canales right below it, because it was the one page that kept its own title and had no breadcrumb. It now follows the same header as the rest. The extra margin that pushed the explanation away from the breadcrumb on Routers, Devices, Reports and Roaming is gone too, so the gap is the same everywhere.
 - 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.

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

@@ -837,15 +837,15 @@ export default function Alerts() {
   const filterKey = `${sev}|${[...cats].sort().join(',')}|${onlyUnread}`
 
   return (
-    <div className="mx-auto w-full max-w-[1100px]">
+    <div className="w-full">
       {/* ① Page header */}
-      <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>
-        <ChevronRight className="h-3 w-3" strokeWidth={1.75} aria-hidden />
-        <span className="text-text-secondary">{t('nav.alerts')}</span>
-      </nav>
       <div className="flex flex-wrap items-end justify-between gap-x-4 gap-y-3">
         <div>
+        <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>
+          <ChevronRight className="h-3 w-3" strokeWidth={1.75} aria-hidden />
+          <span className="text-text-secondary">{t('nav.alerts')}</span>
+        </nav>
           <motion.p
             initial={reduce ? false : { opacity: 0 }}
             animate={{ opacity: 1 }}

+ 7 - 7
app/src/pages/Devices.tsx

@@ -1968,15 +1968,15 @@ export default function Devices() {
     <div className="space-y-4 md:space-y-5">
       {/* ① Page header */}
       <header>
-        <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>
-          <ChevronRight className="h-3 w-3" strokeWidth={1.75} aria-hidden />
-          <span className="text-text-secondary">{t('nav.devices')}</span>
-        </nav>
         <div className="flex flex-wrap items-end justify-between gap-x-4 gap-y-3">
           <div>
+  <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>
+            <ChevronRight className="h-3 w-3" strokeWidth={1.75} aria-hidden />
+            <span className="text-text-secondary">{t('nav.devices')}</span>
+          </nav>
             <p className="mt-0.5 text-sm text-text-secondary">
               {t('devices.summary', { total: deviceTotals.total, online: deviceTotals.online })}
             </p>

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

@@ -290,23 +290,23 @@ export default function Reports() {
     <div className="space-y-4 md:space-y-5">
       {/* ① Page header */}
       <header>
-        <motion.nav
-          initial={initial}
-          animate={{ opacity: 1, y: 0 }}
-          transition={{ duration: 0.25, ease: 'easeOut' }}
-          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>
-          <ChevronRight className="h-3 w-3" strokeWidth={1.75} aria-hidden />
-          <span className="text-text-secondary">{t('nav.reports')}</span>
-        </motion.nav>
         <div className="flex flex-wrap items-end justify-between gap-x-4 gap-y-3">
           <motion.div
             initial={initial}
             animate={{ opacity: 1, y: 0 }}
             transition={{ duration: 0.25, ease: 'easeOut', delay: 0.06 }}
           >
+  <motion.nav
+            initial={initial}
+            animate={{ opacity: 1, y: 0 }}
+            transition={{ duration: 0.25, ease: 'easeOut' }}
+            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>
+            <ChevronRight className="h-3 w-3" strokeWidth={1.75} aria-hidden />
+            <span className="text-text-secondary">{t('nav.reports')}</span>
+          </motion.nav>
             <p className="mt-0.5 text-sm text-text-secondary">{t('reports.explain', { window: windowText })}</p>
           </motion.div>
           <motion.div

+ 11 - 11
app/src/pages/Roaming.tsx

@@ -436,23 +436,23 @@ export default function Roaming() {
     <div className="space-y-4 md:space-y-5">
       {/* ① Page header */}
       <header>
-        <motion.nav
-          initial={initial}
-          animate={{ opacity: 1, y: 0 }}
-          transition={{ duration: 0.25, ease: 'easeOut' }}
-          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>
-          <ChevronRight className="h-3 w-3" strokeWidth={1.75} aria-hidden />
-          <span className="text-text-secondary">{t('nav.roaming')}</span>
-        </motion.nav>
         <div className="flex flex-wrap items-end justify-between gap-x-4 gap-y-3">
           <motion.div
             initial={initial}
             animate={{ opacity: 1, y: 0 }}
             transition={{ duration: 0.25, ease: 'easeOut', delay: 0.06 }}
           >
+  <motion.nav
+            initial={initial}
+            animate={{ opacity: 1, y: 0 }}
+            transition={{ duration: 0.25, ease: 'easeOut' }}
+            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>
+            <ChevronRight className="h-3 w-3" strokeWidth={1.75} aria-hidden />
+            <span className="text-text-secondary">{t('nav.roaming')}</span>
+          </motion.nav>
             <p className="mt-0.5 text-sm text-text-secondary">{t('roaming.subtitle')}</p>
             {(() => {
               const meta = roamingDaemonMeta(roamingDaemon, t)

+ 11 - 11
app/src/pages/Routers.tsx

@@ -151,23 +151,23 @@ export default function Routers() {
     <div className="space-y-4 md:space-y-5">
       {/* ① Page header */}
       <header>
-        <motion.nav
-          initial={reduce ? false : { opacity: 0, y: 12 }}
-          animate={{ opacity: 1, y: 0 }}
-          transition={{ duration: 0.25, ease: 'easeOut' }}
-          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>
-          <ChevronRight className="h-3 w-3" strokeWidth={1.75} aria-hidden />
-          <span className="text-text-secondary">{t('nav.routers')}</span>
-        </motion.nav>
         <div className="flex flex-wrap items-end justify-between gap-x-4 gap-y-3">
           <motion.div
             initial={reduce ? false : { opacity: 0, y: 12 }}
             animate={{ opacity: 1, y: 0 }}
             transition={{ duration: 0.25, ease: 'easeOut', delay: 0.06 }}
           >
+  <motion.nav
+            initial={reduce ? false : { opacity: 0, y: 12 }}
+            animate={{ opacity: 1, y: 0 }}
+            transition={{ duration: 0.25, ease: 'easeOut' }}
+            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>
+            <ChevronRight className="h-3 w-3" strokeWidth={1.75} aria-hidden />
+            <span className="text-text-secondary">{t('nav.routers')}</span>
+          </motion.nav>
             <p className="mt-0.5 text-sm text-text-secondary">
               {t('routers.summary', { total: routers.length, online, warnings: warned })}
             </p>

+ 1 - 1
app/src/pages/Settings.tsx

@@ -5473,7 +5473,7 @@ export default function Settings() {
   )
 
   return (
-    <div className="mx-auto w-full max-w-[1180px]">
+    <div className="w-full">
       {/* ① Page header */}
       <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>