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

refactor(ui): drop the duplicated page title and unify header actions (#1822)

* refactor(ui): drop the duplicated page title and unify header actions

* style(ui): match header button text size to the rest of the menus
Nacho 1 месяц назад
Родитель
Сommit
51cb3ca00b

+ 1 - 0
CHANGELOG.md

@@ -19,6 +19,7 @@ y este proyecto se adhiere a [Versionado Semántico](https://semver.org/lang/es/
 
 ### Changed
 
+- 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 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 rack picker names its groups the way the rest of the UI does (#1804): **Fleet units** instead of Routers and **Clients** instead of Devices.

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

@@ -846,14 +846,6 @@ export default function Alerts() {
       </nav>
       <div className="flex items-start justify-between gap-3">
         <div>
-          <motion.h1
-            initial={reduce ? false : { opacity: 0, y: 12 }}
-            animate={{ opacity: 1, y: 0 }}
-            transition={{ duration: 0.3, ease: 'easeOut' }}
-            className="font-display text-h1 text-text-primary"
-          >
-            {t('alerts.title')}
-          </motion.h1>
           <motion.p
             initial={reduce ? false : { opacity: 0 }}
             animate={{ opacity: 1 }}
@@ -877,7 +869,7 @@ export default function Alerts() {
             onClick={() => setConfigOpen((v) => !v)}
             aria-expanded={configOpen}
             className={cn(
-              'inline-flex h-9 items-center gap-2 rounded-lg border px-3 text-xs font-medium transition-colors duration-150',
+              'inline-flex h-9 items-center gap-2 rounded-lg border px-3 text-sm font-medium transition-colors duration-150',
               configOpen
                 ? 'border-accent/40 bg-accent-soft text-accent'
                 : 'border-border bg-elevated text-text-secondary hover:border-accent/40 hover:text-accent',
@@ -890,7 +882,7 @@ export default function Alerts() {
             type="button"
             onClick={markAllRead}
             disabled={alertFeed.length === 0}
-            className="inline-flex h-9 items-center gap-2 rounded-lg border border-border bg-elevated px-3 text-xs font-medium text-text-secondary transition-colors duration-150 hover:border-accent/40 hover:text-accent disabled:cursor-not-allowed disabled:opacity-40"
+            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 duration-150 hover:border-accent/40 hover:text-accent disabled:cursor-not-allowed disabled:opacity-40"
           >
             <motion.span key={burst} animate={reduce ? undefined : { scale: [1, 1.2, 1] }} transition={{ duration: 0.35 }}>
               <CheckCheck className="h-4 w-4" strokeWidth={1.75} />
@@ -901,7 +893,7 @@ export default function Alerts() {
             type="button"
             onClick={() => setConfirmClear(true)}
             disabled={alertFeed.length === 0}
-            className="inline-flex h-9 items-center gap-2 rounded-lg border border-danger/30 bg-danger/10 px-3 text-xs font-medium text-danger transition-colors duration-150 hover:bg-danger/15 disabled:cursor-not-allowed disabled:opacity-40"
+            className="inline-flex h-9 items-center gap-2 rounded-lg border border-danger/30 bg-danger/10 px-3 text-sm font-medium text-danger transition-colors duration-150 hover:bg-danger/15 disabled:cursor-not-allowed disabled:opacity-40"
           >
             <Trash2 className="h-4 w-4" strokeWidth={1.75} />
             {t('alerts.clearLog')}
@@ -1133,7 +1125,7 @@ export default function Alerts() {
             return !v
           })}
           className={cn(
-            'inline-flex h-8 items-center gap-2 rounded-full border px-3 text-xs font-medium transition-colors duration-150',
+            'inline-flex h-8 items-center gap-2 rounded-full border px-3 text-sm font-medium transition-colors duration-150',
             onlyUnread
               ? 'border-accent/40 bg-accent-soft text-accent'
               : 'border-border bg-elevated text-text-secondary hover:text-text-primary',

+ 9 - 3
app/src/pages/ChannelPlan.tsx

@@ -610,9 +610,15 @@ export default function ChannelPlan() {
             <Radar className={cn('mr-1.5 h-3.5 w-3.5', scanning && 'animate-pulse')} strokeWidth={1.75} />
             {t('channelPlan.scanNow')}
           </Button>
-          <Button size="sm" variant="outline" disabled={!routerId || loading} onClick={() => loadPlan(routerId)}>
-            <RefreshCw className={cn('mr-1.5 h-3.5 w-3.5', loading && 'animate-spin')} strokeWidth={1.75} />
-            {t('channelPlan.refresh')}
+          <Button
+            size="icon"
+            variant="outline"
+            disabled={!routerId || loading}
+            onClick={() => loadPlan(routerId)}
+            aria-label={t('channelPlan.refresh')}
+            title={t('channelPlan.refresh')}
+          >
+            <RefreshCw className={cn('h-4 w-4', loading && 'animate-spin')} strokeWidth={1.75} />
           </Button>
         </div>
       </div>

+ 0 - 8
app/src/pages/Devices.tsx

@@ -1997,14 +1997,6 @@ export default function Devices() {
         </nav>
         <div className="mt-1.5 flex flex-wrap items-end justify-between gap-x-4 gap-y-3">
           <div>
-            <motion.h1
-              initial={reduce ? false : { opacity: 0, y: 12 }}
-              animate={{ opacity: 1, y: 0 }}
-              transition={{ duration: 0.3, ease: 'easeOut' }}
-              className="font-display text-h1 text-text-primary"
-            >
-              {t('nav.devices')}
-            </motion.h1>
             <p className="mt-0.5 text-caption text-text-muted">
               {t('devices.summary', { total: deviceTotals.total, online: deviceTotals.online })}
             </p>

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

@@ -307,7 +307,6 @@ export default function Reports() {
             animate={{ opacity: 1, y: 0 }}
             transition={{ duration: 0.25, ease: 'easeOut', delay: 0.06 }}
           >
-            <h1 className="font-display text-h1 text-text-primary">{t('nav.reports')}</h1>
             <p className="text-caption text-text-muted">{t('reports.explain', { window: windowText })}</p>
           </motion.div>
           <motion.div
@@ -341,10 +340,11 @@ export default function Reports() {
                   setSpin(false)
                 }, 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"
+              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"
+              aria-label={t('common.refresh')}
+              title={t('common.refresh')}
             >
               <RefreshCw className={cn('h-4 w-4 transition-transform duration-500', spin && 'rotate-[360deg]')} strokeWidth={1.75} />
-              {t('common.refresh')}
             </button>
           </motion.div>
         </div>

+ 0 - 1
app/src/pages/Roaming.tsx

@@ -453,7 +453,6 @@ export default function Roaming() {
             animate={{ opacity: 1, y: 0 }}
             transition={{ duration: 0.25, ease: 'easeOut', delay: 0.06 }}
           >
-            <h1 className="font-display text-h1 text-text-primary">{t('nav.roaming')}</h1>
             <p className="text-caption text-text-muted">{t('roaming.subtitle')}</p>
             {(() => {
               const meta = roamingDaemonMeta(roamingDaemon, t)

+ 0 - 1
app/src/pages/Routers.tsx

@@ -168,7 +168,6 @@ export default function Routers() {
             animate={{ opacity: 1, y: 0 }}
             transition={{ duration: 0.25, ease: 'easeOut', delay: 0.06 }}
           >
-            <h1 className="font-display text-h1 text-text-primary">{t('nav.routers')}</h1>
             <p className="text-caption text-text-muted">
               {t('routers.summary', { total: routers.length, online, warnings: warned })}
             </p>

+ 0 - 8
app/src/pages/Settings.tsx

@@ -5525,14 +5525,6 @@ export default function Settings() {
         <span className="mx-1.5">/</span>
         <span className="text-text-secondary">{t('nav.settings')}</span>
       </nav>
-      <motion.h1
-        initial={reduce ? false : { opacity: 0, y: 12 }}
-        animate={{ opacity: 1, y: 0 }}
-        transition={{ duration: 0.3, ease: 'easeOut' }}
-        className="font-display text-h1 text-text-primary"
-      >
-        {t('nav.settings')}
-      </motion.h1>
       <motion.p
         initial={reduce ? false : { opacity: 0 }}
         animate={{ opacity: 1 }}

+ 0 - 1
app/src/pages/Topology.tsx

@@ -217,7 +217,6 @@ export default function Topology() {
               {t('nav.topology')}
             </span>
           </nav>
-          <h1 className="font-display text-h1 text-text-primary">{t('nav.topology')}</h1>
           <p className="mt-0.5 text-sm text-text-secondary">{t('topology.subtitle')}</p>
         </motion.div>