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.

feat(sidebar): compact quick-create FAB, move Test Sandbox into Dev Tools

Juan Denis03f075162f40
diff --git a/frontend/src/components/QuickCreate.jsx b/frontend/src/components/QuickCreate.jsx
index fc954414..02c18cc7 100644
--- a/frontend/src/components/QuickCreate.jsx
+++ b/frontend/src/components/QuickCreate.jsx
@@ -27,26 +27,26 @@ const CREATE_ITEMS = [
export function QuickCreate({ className, variant = 'icon' }) {
const navigate = useNavigate();
- // 'icon' — compact square button (mobile top bar). 'sidebar' — extended
- // "Create" pill pinned to the top of the sidebar (Gmail "Compose" pattern);
- // its menu opens downward since the trigger is no longer in the footer.
- const extended = variant === 'sidebar';
+ // 'icon' — compact square button (mobile top bar). 'sidebar' — small
+ // circular accent FAB (AI chat-bubble style) that lives on the first
+ // sidebar category row; its menu opens downward since the trigger sits at
+ // the top of the nav.
+ const fab = variant === 'sidebar';
return (
<DropdownMenu>
<DropdownMenuTrigger asChild>
<button
type="button"
- className={cn('quick-create', extended && 'quick-create--extended', className)}
+ className={cn('quick-create', fab && 'quick-create--fab', className)}
title="Create new…"
aria-label="Create new"
>
- <Plus size={16} />
- {extended && <span className="quick-create__label">Create</span>}
+ <Plus size={fab ? 13 : 16} />
</button>
</DropdownMenuTrigger>
<DropdownMenuContent
- side={extended ? 'bottom' : 'top'}
- align={extended ? 'start' : 'end'}
+ side={fab ? 'bottom' : 'top'}
+ align="end"
sideOffset={8}
>
{CREATE_ITEMS.map((item) => (
diff --git a/frontend/src/components/Sidebar.jsx b/frontend/src/components/Sidebar.jsx
index 38318f4f..b75b4665 100644
--- a/frontend/src/components/Sidebar.jsx
+++ b/frontend/src/components/Sidebar.jsx
@@ -213,6 +213,10 @@ const Sidebar = ({ mobileOpen = false, isMobile = false, onMobileClose = () => {
return groups;
}, [visibleItems]);
+ // First category that actually has visible items — its header row hosts the
+ // quick-create button.
+ const firstVisibleCat = SIDEBAR_CATEGORIES.find(cat => groupedItems[cat]);
+
// Auto-expand the active parent (or parent of active sub-item), auto-close others
useEffect(() => {
const path = location.pathname;
@@ -352,17 +356,22 @@ const Sidebar = ({ mobileOpen = false, isMobile = false, onMobileClose = () => {
</div>
)}
- <QuickCreate variant="sidebar" />
-
<WorkspaceSwitcher />
<div className="nav-scroll">
{SIDEBAR_CATEGORIES.map(cat => {
const items = groupedItems[cat];
if (!items) return null;
+ // The first category header row also carries the global
+ // quick-create button — a small circular accent "+" (AI
+ // chat-bubble style) next to the section label.
+ const isFirst = cat === firstVisibleCat;
return (
<React.Fragment key={cat}>
- <div className="nav-category">{CATEGORY_LABELS[cat]}</div>
+ <div className={`nav-category${isFirst ? ' nav-category--create' : ''}`}>
+ {isFirst ? <span>{CATEGORY_LABELS[cat]}</span> : CATEGORY_LABELS[cat]}
+ {isFirst && <QuickCreate variant="sidebar" />}
+ </div>
<nav className="nav">
{items.map(renderNavItem)}
</nav>
@@ -371,39 +380,56 @@ const Sidebar = ({ mobileOpen = false, isMobile = false, onMobileClose = () => {
})}
</div>
- {import.meta.env.DEV && (
+ {devMode && (
<>
<div className="nav-category nav-category--dev">Dev Tools</div>
<nav className="nav">
+ {import.meta.env.DEV && (
+ <>
+ <NavLink
+ to="/app-map"
+ className={({ isActive }) => `nav-item nav-item--dev ${isActive ? 'active' : ''}`}
+ >
+ <svg className="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
+ <polygon points="1 6 1 22 8 18 16 22 23 18 23 2 16 6 8 2 1 6"/>
+ <line x1="8" y1="2" x2="8" y2="18"/>
+ <line x1="16" y1="6" x2="16" y2="22"/>
+ </svg>
+ App Map
+ </NavLink>
+ <NavLink
+ to="/documentation"
+ className={({ isActive }) => `nav-item nav-item--dev ${isActive ? 'active' : ''}`}
+ >
+ <svg className="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
+ <path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"/>
+ <path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"/>
+ </svg>
+ Documentation
+ </NavLink>
+ <NavLink
+ to="/style-guide"
+ className={({ isActive }) => `nav-item nav-item--dev ${isActive ? 'active' : ''}`}
+ >
+ <svg className="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor">
+ <circle cx="13.5" cy="6.5" r="2.5"/><path d="M17 2H7a5 5 0 0 0-5 5v10a5 5 0 0 0 5 5h10a5 5 0 0 0 5-5V7a5 5 0 0 0-5-5z"/><path d="M9.5 14.5l-3 3"/><path d="M14.5 9.5l3-3"/>
+ </svg>
+ Style Guide
+ </NavLink>
+ </>
+ )}
+ {/* Test Sandbox is developer tooling, not an operator
+ surface: shown in dev builds and to admins with Site
+ Settings → Developer mode on — same useDevMode flag
+ the route guard reads. */}
<NavLink
- to="/app-map"
- className={({ isActive }) => `nav-item nav-item--dev ${isActive ? 'active' : ''}`}
- >
- <svg className="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
- <polygon points="1 6 1 22 8 18 16 22 23 18 23 2 16 6 8 2 1 6"/>
- <line x1="8" y1="2" x2="8" y2="18"/>
- <line x1="16" y1="6" x2="16" y2="22"/>
- </svg>
- App Map
- </NavLink>
- <NavLink
- to="/documentation"
+ to="/test-sandbox"
className={({ isActive }) => `nav-item nav-item--dev ${isActive ? 'active' : ''}`}
>
<svg className="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
- <path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"/>
- <path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"/>
- </svg>
- Documentation
- </NavLink>
- <NavLink
- to="/style-guide"
- className={({ isActive }) => `nav-item nav-item--dev ${isActive ? 'active' : ''}`}
- >
- <svg className="nav-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor">
- <circle cx="13.5" cy="6.5" r="2.5"/><path d="M17 2H7a5 5 0 0 0-5 5v10a5 5 0 0 0 5 5h10a5 5 0 0 0 5-5V7a5 5 0 0 0-5-5z"/><path d="M9.5 14.5l-3 3"/><path d="M14.5 9.5l3-3"/>
+ <path d="M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2"/><path d="M8.5 2h7"/><path d="M7 16h10"/>
</svg>
- Style Guide
+ Test Sandbox
</NavLink>
</nav>
</>
diff --git a/frontend/src/components/sidebarItems.js b/frontend/src/components/sidebarItems.js
index cb1f2387..804f1952 100644
--- a/frontend/src/components/sidebarItems.js
+++ b/frontend/src/components/sidebarItems.js
@@ -186,21 +186,9 @@ export const SIDEBAR_ITEMS = [
// The inbound-webhook console is no longer a sidebar page: it's server
// configuration, so it lives at Settings → Admin → Webhooks alongside the
// outbound notification subscriptions. /webhooks redirects there.
- {
- // Admin distro-matrix test console (Docker-backed runs, per-distro
- // logs). Sits next to Jobs under System.
- //
- // Developer tooling, not an operator surface: hidden unless this is a
- // local `npm run dev` build or an admin has turned on Site Settings →
- // Developer mode. The route is gated on the same condition, so a
- // production install neither shows nor serves it.
- id: 'test-sandbox',
- label: 'Test Sandbox',
- route: '/test-sandbox',
- requiresCondition: 'devMode',
- category: 'system',
- icon: '<path d="M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2"/><path d="M8.5 2h7"/><path d="M7 16h10"/>'
- },
+ // Test Sandbox (admin distro-matrix test console) is not a sidebar item
+ // either — it lives in the dev-only "Dev Tools" section in Sidebar.jsx,
+ // gated on the same useDevMode flag as its route guard.
{
// Redesign: Marketplace uses the top-bar layout (REDESIGN_MAP §6 dec. 3).
// Downloads now lives in the page's top bar (PageTopbar MARKET_TABS), not
diff --git a/frontend/src/styles/components/_notification-center.scss b/frontend/src/styles/components/_notification-center.scss
index 29ec862b..283908a4 100644
--- a/frontend/src/styles/components/_notification-center.scss
+++ b/frontend/src/styles/components/_notification-center.scss
@@ -227,7 +227,7 @@
}
// Global quick-create ("+") base button — compact square used in the mobile
-// top bar. The sidebar uses the extended variant (see layout/_sidebar.scss).
+// top bar. The sidebar uses the circular FAB variant (see layout/_sidebar.scss).
.quick-create {
display: inline-flex;
align-items: center;
diff --git a/frontend/src/styles/layout/_sidebar.scss b/frontend/src/styles/layout/_sidebar.scss
index 2d1d56fe..772dfa2e 100644
--- a/frontend/src/styles/layout/_sidebar.scss
+++ b/frontend/src/styles/layout/_sidebar.scss
@@ -265,41 +265,41 @@
text-overflow: ellipsis;
}
-// Quick-create — prominent "new anything" entry point pinned to the top of the
-// sidebar (Gmail "Compose" / Material extended-FAB pattern) instead of crowding
-// the footer strip next to the notification bell. Doubled class beats the base
-// `.quick-create` rules, which live in a later-imported stylesheet.
-.quick-create.quick-create--extended {
- width: 100%;
- height: 38px;
- margin: 0 0 0.75rem;
- padding: 0 12px;
- gap: 8px;
- justify-content: flex-start;
+// Quick-create — a small circular accent "+" (AI chat-bubble style) that rides
+// on the first sidebar category row, next to the section label. Doubled class
+// beats the base `.quick-create` rules, which live in a later-imported
+// stylesheet.
+.nav-category--create {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-right: 0.35rem;
+}
+
+.quick-create.quick-create--fab {
+ width: 22px;
+ height: 22px;
border: none;
- border-radius: 10px;
+ border-radius: 50%;
background: linear-gradient(160deg, var(--accent-bright), var(--accent));
- box-shadow: 0 4px 14px -2px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.2);
+ box-shadow: 0 2px 8px -1px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
color: #fff;
- font-size: 0.85rem;
- font-weight: $font-weight-medium;
flex-shrink: 0;
transition: filter 0.15s, transform 0.15s;
svg {
stroke: #fff;
- flex-shrink: 0;
}
&:hover {
background: linear-gradient(160deg, var(--accent-bright), var(--accent));
- border-color: transparent;
color: #fff;
- filter: brightness(1.1);
+ filter: brightness(1.12);
+ transform: translateY(-1px);
}
&:active {
- transform: translateY(1px);
+ transform: translateY(0);
}
}
@@ -787,16 +787,15 @@
gap: 0;
}
- // Quick-create collapses to a circular mini-FAB.
- .quick-create.quick-create--extended {
- width: 36px;
- height: 36px;
- padding: 0;
- margin: 0 auto 0.75rem;
+ // Category labels hide in the collapsed rail, but the row
+ // hosting quick-create stays so the "+" survives as a bare
+ // circular FAB.
+ .nav-category.nav-category--create {
+ display: flex;
justify-content: center;
- border-radius: 50%;
+ margin: 0.75rem 0 0.5rem;
- .quick-create__label {
+ span {
display: none;
}
}
@@ -865,16 +864,15 @@
max-width: 170px;
}
- // Quick-create shrinks to a compact accent icon button in the bar.
- .quick-create.quick-create--extended {
- width: 34px;
- height: 34px;
- padding: 0;
+ // Category labels are hidden in the bar, but keep the quick-create row
+ // visible as a bare circular FAB at the start of the nav strip.
+ .nav-category.nav-category--create {
+ display: flex;
+ align-items: center;
margin: 0;
- justify-content: center;
- border-radius: 9px;
+ flex-shrink: 0;
- .quick-create__label {
+ span {
display: none;
}
}