Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

fix(ui): stop detail-page tabs jumping, unify them as segmented bars

Juan Denisbc3711f32db1
diff --git a/frontend/src/components/ds/PageTopbar.jsx b/frontend/src/components/ds/PageTopbar.jsx
index 8ad8f455..70a66f19 100644
--- a/frontend/src/components/ds/PageTopbar.jsx
+++ b/frontend/src/components/ds/PageTopbar.jsx
@@ -61,59 +61,64 @@ function TopbarTabs({ tabs, label }) {
});
return (
+ // The nav is the flex-fill measurement region (kept right-aligned so a
+ // changing page title never shoves the tabs sideways); the inner bar is
+ // the visible segmented control that actually holds the tabs.
<nav ref={containerRef} className="sk-topbar__tabs" aria-label={`${label} sections`}>
- {tabs.map((t, i) => {
- const isHidden = hiddenSet.has(i);
- return (
- <NavLink
- key={t.to}
- to={t.to}
- end={t.end}
- ref={(el) => { itemRefs.current[i] = el; }}
- className={({ isActive }) => cn('sk-topbar__tab', isActive && 'is-active')}
- style={{ display: isHidden ? 'none' : undefined }}
- data-overflow={isHidden ? 'hidden' : undefined}
- >
- {t.icon}
- {t.label}
- </NavLink>
- );
- })}
- {hiddenIndices.length > 0 && (
- <Popover open={popoverOpen} onOpenChange={setPopoverOpen}>
- <PopoverTrigger asChild>
- <button
- ref={moreBtnRef}
- type="button"
- className="sk-topbar__tab sk-topbar__more"
- aria-label="More sections"
+ <div className="sk-topbar__tabs-inner">
+ {tabs.map((t, i) => {
+ const isHidden = hiddenSet.has(i);
+ return (
+ <NavLink
+ key={t.to}
+ to={t.to}
+ end={t.end}
+ ref={(el) => { itemRefs.current[i] = el; }}
+ className={({ isActive }) => cn('sk-topbar__tab', isActive && 'is-active')}
+ style={{ display: isHidden ? 'none' : undefined }}
+ data-overflow={isHidden ? 'hidden' : undefined}
>
- <MoreHorizontal size={16} />
- More
- </button>
- </PopoverTrigger>
- <PopoverContent align="end" sideOffset={6} className="ui-popover-content">
- <div className="tabs-overflow-list">
- {hiddenIndices.map((idx) => {
- const t = tabs[idx];
- return (
- <NavLink
- key={t.to}
- to={t.to}
- end={t.end}
- className="tabs-overflow-item"
- data-state={idx === activeIndex ? 'active' : 'inactive'}
- onClick={() => setPopoverOpen(false)}
- >
- {t.icon}
- {t.label}
- </NavLink>
- );
- })}
- </div>
- </PopoverContent>
- </Popover>
- )}
+ {t.icon}
+ {t.label}
+ </NavLink>
+ );
+ })}
+ {hiddenIndices.length > 0 && (
+ <Popover open={popoverOpen} onOpenChange={setPopoverOpen}>
+ <PopoverTrigger asChild>
+ <button
+ ref={moreBtnRef}
+ type="button"
+ className="sk-topbar__tab sk-topbar__more"
+ aria-label="More sections"
+ >
+ <MoreHorizontal size={16} />
+ More
+ </button>
+ </PopoverTrigger>
+ <PopoverContent align="end" sideOffset={6} className="ui-popover-content">
+ <div className="tabs-overflow-list">
+ {hiddenIndices.map((idx) => {
+ const t = tabs[idx];
+ return (
+ <NavLink
+ key={t.to}
+ to={t.to}
+ end={t.end}
+ className="tabs-overflow-item"
+ data-state={idx === activeIndex ? 'active' : 'inactive'}
+ onClick={() => setPopoverOpen(false)}
+ >
+ {t.icon}
+ {t.label}
+ </NavLink>
+ );
+ })}
+ </div>
+ </PopoverContent>
+ </Popover>
+ )}
+ </div>
</nav>
);
}
diff --git a/frontend/src/styles/components/_design-system.scss b/frontend/src/styles/components/_design-system.scss
index e43d0a0c..7a891cc5 100644
--- a/frontend/src/styles/components/_design-system.scss
+++ b/frontend/src/styles/components/_design-system.scss
@@ -387,26 +387,43 @@ $sk-tones: ('accent', 'green', 'cyan', 'amber', 'red', 'violet');
&__spacer { flex: 1; }
&__actions { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
- // Routed sub-nav (the ex-sidebar sub-items). Grows to fill the bar so the
- // overflow measurement in PageTopbar has a bounded width to fit against;
- // overflow:hidden suppresses any flash before the first measurement.
+ // Routed sub-nav (the ex-sidebar sub-items). The nav is the flex-fill
+ // measurement region for PageTopbar's overflow logic; it is right-aligned so
+ // the changing page title on the left can grow/shrink WITHOUT shoving the
+ // tabs sideways (the old jump). overflow:hidden suppresses any pre-measure
+ // flash.
&__tabs {
display: flex;
align-items: center;
- gap: 2px;
+ justify-content: flex-end;
margin-left: 6px;
flex: 1 1 auto;
min-width: 0;
overflow: hidden;
}
+ // The visible segmented bar that actually holds the tabs — gives the sub-nav
+ // real presence against the page background, matching the detail-page tab
+ // bar instead of floating as bare text.
+ &__tabs-inner {
+ display: inline-flex;
+ align-items: center;
+ gap: 2px;
+ max-width: 100%;
+ padding: 3px;
+ background: var(--surface);
+ border: 1px solid var(--border);
+ border-radius: 10px;
+ }
&__tab {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 6px 11px;
- border-radius: 8px;
+ border-radius: 7px;
font-size: 13px;
- font-weight: 450;
+ // Uniform weight across states so activating a tab never re-flows its
+ // neighbours; the active tab is set apart by fill + colour, not weight.
+ font-weight: 500;
color: var(--text-dim);
text-decoration: none;
white-space: nowrap;
@@ -414,13 +431,12 @@ $sk-tones: ('accent', 'green', 'cyan', 'amber', 'red', 'violet');
svg { width: 15px; height: 15px; }
&:hover { background: var(--surface-hover); color: var(--text); }
- &.is-active { background: var(--accent-bg); color: var(--accent-bright); font-weight: 500; }
+ &.is-active { background: var(--accent-bg); color: var(--accent-bright); }
}
// Overflow ("More") trigger — a tab-styled button that never collapses.
&__more {
flex-shrink: 0;
border: none;
- background: transparent;
font: inherit;
cursor: pointer;
&[data-state="open"] { background: var(--surface-hover); color: var(--text); }
@@ -428,7 +444,7 @@ $sk-tones: ('accent', 'green', 'cyan', 'amber', 'red', 'violet');
@media (max-width: 768px) {
flex-wrap: wrap;
- &__tabs { order: 3; width: 100%; margin-left: 0; }
+ &__tabs { order: 3; width: 100%; margin-left: 0; justify-content: flex-start; }
}
}
diff --git a/frontend/src/styles/pages/_applications.scss b/frontend/src/styles/pages/_applications.scss
index 7f77be20..5f53e18b 100644
--- a/frontend/src/styles/pages/_applications.scss
+++ b/frontend/src/styles/pages/_applications.scss
@@ -544,14 +544,16 @@
// Tabs navigation (WordPress pages render these classes; ApplicationDetail
// uses shadcn Tabs — see the scoped `.tabs` block below)
+// A real containing bar so the tab nav has presence, instead of a transparent
+// underline strip that blends into the page background. Tabs are pills inside
+// it; the active pill is filled so the current section is unmistakable.
.app-detail-tabs {
display: flex;
- gap: 2px;
- background: transparent;
- border: none;
- border-bottom: 1px solid var(--border-soft);
- border-radius: 0;
- padding: 0;
+ gap: 3px;
+ background: var(--surface);
+ border: 1px solid var(--border);
+ border-radius: var(--radius);
+ padding: 4px;
overflow-x: auto;
&::-webkit-scrollbar {
@@ -563,38 +565,36 @@
display: flex;
align-items: center;
gap: 7px;
- padding: 11px 14px;
+ padding: 8px 13px;
background: transparent;
border: none;
- border-radius: 0;
- border-bottom: 2px solid transparent;
- color: var(--text-faint);
+ border-radius: 7px;
+ color: var(--text-dim);
font-size: 13px;
- font-weight: $font-weight-normal;
+ font-weight: $font-weight-medium;
cursor: pointer;
white-space: nowrap;
- transition: color 0.14s;
+ transition: color 0.14s, background 0.14s;
svg {
- color: var(--text-ghost);
+ color: var(--text-faint);
transition: color 0.14s;
flex-shrink: 0;
}
&:hover {
- background: none;
- color: var(--text-dim);
+ background: var(--surface-2);
+ color: var(--text);
svg {
- color: var(--text-faint);
+ color: var(--text-dim);
}
}
&.active {
- background: none;
- color: var(--text);
- border-bottom-color: var(--accent);
- font-weight: $font-weight-medium;
+ background: var(--accent-bg);
+ color: var(--accent-bright);
+ font-weight: $font-weight-semibold;
svg {
color: var(--accent-bright);
diff --git a/frontend/src/styles/pages/_service-detail.scss b/frontend/src/styles/pages/_service-detail.scss
index 5ce4c5cd..c3453c6c 100644
--- a/frontend/src/styles/pages/_service-detail.scss
+++ b/frontend/src/styles/pages/_service-detail.scss
@@ -1085,12 +1085,25 @@ h3.svc-eyebrow {
// OVERVIEW TAB
// ============================================
.overview-tab {
- // KPI strip (ds MetricCard)
+ // Stack the KPI band, the info/metrics grid and the full-width panels with
+ // one consistent rhythm, so the KPI strip is never glued to the section
+ // directly below it (the old "no padding under the KPIs" gap).
+ display: flex;
+ flex-direction: column;
+ gap: $space-5;
+
+ // Lift the KPI tiles so they read as deliberate stat cards rather than flat
+ // boxes that dissolve into the page (dark --surface ≈ --bg-body).
+ .sk-kpi {
+ border-color: var(--border);
+ box-shadow: var(--shadow-sm);
+ }
+
+ // KPI strip (ds MetricCard) — legacy grid, kept for any non-KpiBand use
&__kpis {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: $space-4;
- margin-bottom: $space-4;
@media (max-width: $breakpoint-lg) { grid-template-columns: repeat(2, 1fr); }
@media (max-width: $breakpoint-sm) { grid-template-columns: 1fr; }
@@ -1101,7 +1114,6 @@ h3.svc-eyebrow {
display: grid;
grid-template-columns: 1fr 1fr;
gap: $space-4;
- margin-bottom: $space-4;
@media (max-width: $breakpoint-md) {
grid-template-columns: 1fr;
@@ -1110,8 +1122,9 @@ h3.svc-eyebrow {
&__card {
background: var(--surface);
- border: 1px solid var(--border-soft);
+ border: 1px solid var(--border);
border-radius: var(--radius);
+ box-shadow: var(--shadow-sm);
padding: $space-4 $space-5;
&--full {
diff --git a/frontend/src/styles/pages/_wordpress.scss b/frontend/src/styles/pages/_wordpress.scss
index 82e10466..780aa530 100644
--- a/frontend/src/styles/pages/_wordpress.scss
+++ b/frontend/src/styles/pages/_wordpress.scss
@@ -876,14 +876,15 @@
}
}
- // ---- Tab strip (14 flat tabs — accent underline, ids untouched) ----
+ // ---- Tab strip (segmented bar — pills in a bordered surface, matching the
+ // shared .app-detail-tabs treatment in _applications.scss so every detail
+ // page's nav reads the same) ----
.app-detail-tabs {
- gap: 2px;
- background: transparent;
- border: none;
- border-bottom: 1px solid var(--border-soft);
- border-radius: 0;
- padding: 0;
+ gap: 3px;
+ background: var(--surface);
+ border: 1px solid var(--border);
+ border-radius: var(--radius);
+ padding: 4px;
overflow-x: auto;
&::-webkit-scrollbar {
@@ -895,35 +896,33 @@
display: flex;
align-items: center;
gap: 7px;
- padding: 11px 14px;
- border-radius: 0;
- border-bottom: 2px solid transparent;
- color: var(--text-faint);
+ padding: 8px 13px;
+ border-radius: 7px;
+ color: var(--text-dim);
font-size: 13px;
- font-weight: $font-weight-normal;
+ font-weight: $font-weight-medium;
white-space: nowrap;
- transition: color 0.14s;
+ transition: color 0.14s, background 0.14s;
svg {
- color: var(--text-ghost);
+ color: var(--text-faint);
transition: color 0.14s;
flex-shrink: 0;
}
&:hover {
- background: none;
- color: var(--text-dim);
+ background: var(--surface-2);
+ color: var(--text);
svg {
- color: var(--text-faint);
+ color: var(--text-dim);
}
}
&.active {
- background: none;
- color: var(--text);
- border-bottom-color: var(--accent);
- font-weight: $font-weight-medium;
+ background: var(--accent-bg);
+ color: var(--accent-bright);
+ font-weight: $font-weight-semibold;
svg {
color: var(--accent-bright);
@@ -2662,10 +2661,8 @@
.app-detail-tab-skeleton {
width: 80px;
- height: 38px;
- border-radius: 0;
- background: transparent;
- border-bottom: 2px solid transparent;
+ height: 32px;
+ border-radius: 7px;
@include skeleton();
}