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.

Refactor sidebar, workspace list, and Git settings UI

Juan Denis10ca0b3970aa
diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx
index da66959b..df0d3434 100644
--- a/frontend/src/App.jsx
+++ b/frontend/src/App.jsx
@@ -309,7 +309,7 @@ function AppRoutes() {
</Route>
<Route path="services/:id" element={<ServiceDetail />} />
<Route path="services/:id/:tab" element={<ServiceDetail />} />
- {/* Settings sub-section in the URL (e.g. .../settings/repository)
+ {/* Settings sub-section in the URL (e.g. .../settings/git)
so the Settings left-nav is shareable and survives a refresh. */}
<Route path="services/:id/:tab/:section" element={<ServiceDetail />} />
<Route path="apps" element={<Navigate to="/services" replace />} />
diff --git a/frontend/src/components/Sidebar.jsx b/frontend/src/components/Sidebar.jsx
index 3c159134..4418d3ec 100644
--- a/frontend/src/components/Sidebar.jsx
+++ b/frontend/src/components/Sidebar.jsx
@@ -495,25 +495,25 @@ const Sidebar = ({ mobileOpen = false, isMobile = false, onMobileClose = () => {
</div>
)}
<div className="sidebar-footer__row">
+ <button
+ type="button"
+ className="user-mini"
+ onClick={() => setMenuOpen(!menuOpen)}
+ aria-haspopup="true"
+ aria-expanded={menuOpen}
+ aria-controls="user-context-menu"
+ >
+ <span className="user-avatar" aria-hidden="true">
+ {user?.username?.charAt(0).toUpperCase() || 'U'}
+ </span>
+ <span className="user-meta">
+ <span className="user-handle">{user?.username || 'User'}</span>
+ <span className="user-status">Online</span>
+ </span>
+ <ChevronUp size={14} className={`user-menu-arrow ${menuOpen ? 'open' : ''}`} aria-hidden="true" />
+ </button>
<NotificationBell />
</div>
- <button
- type="button"
- className="user-mini"
- onClick={() => setMenuOpen(!menuOpen)}
- aria-haspopup="true"
- aria-expanded={menuOpen}
- aria-controls="user-context-menu"
- >
- <span className="user-avatar" aria-hidden="true">
- {user?.username?.charAt(0).toUpperCase() || 'U'}
- </span>
- <span className="user-meta">
- <span className="user-handle">{user?.username || 'User'}</span>
- <span className="user-status">Online</span>
- </span>
- <ChevronUp size={14} className={`user-menu-arrow ${menuOpen ? 'open' : ''}`} aria-hidden="true" />
- </button>
</div>
</aside>
);
diff --git a/frontend/src/components/service-detail/SettingsTab.jsx b/frontend/src/components/service-detail/SettingsTab.jsx
index e57d8a7e..c71f60e6 100644
--- a/frontend/src/components/service-detail/SettingsTab.jsx
+++ b/frontend/src/components/service-detail/SettingsTab.jsx
@@ -33,7 +33,7 @@ const SVC_SETTINGS_GROUPS = [
{ id: 'domain', label: 'Domain & SSL', icon: Shield },
],
},
- { label: 'Connections', items: [{ id: 'repository', label: 'Repository', icon: GitBranch }] },
+ { label: 'Connections', items: [{ id: 'git', label: 'Git', icon: GitBranch }] },
{ label: 'Advanced', items: [{ id: 'danger', label: 'Danger Zone', icon: AlertTriangle }] },
];
@@ -248,9 +248,9 @@ const SettingsTab = ({ app, deployConfig, domains, primaryDomain, onUpdate }) =>
{/* Repository — the same shared RepoConnectForm the WordPress Git
settings use (provider picker + URL fallback, connected summary
with Disconnect), wired to the service deployment API. */}
- {section === 'repository' && (
+ {section === 'git' && (
<div className="svc-settings__section">
- <h3 className="svc-settings__section-title">Repository</h3>
+ <h3 className="svc-settings__section-title">Git</h3>
<RepoConnectForm
gitStatus={gitStatus}
onConnect={handleConnectRepo}
diff --git a/frontend/src/pages/ServiceDetail.jsx b/frontend/src/pages/ServiceDetail.jsx
index 4a2afd2c..4e3b3eae 100644
--- a/frontend/src/pages/ServiceDetail.jsx
+++ b/frontend/src/pages/ServiceDetail.jsx
@@ -427,7 +427,7 @@ const ServiceDetail = () => {
)}
</span>
) : deployConfig ? (
- <div className="svc-detail__repo-pill" onClick={() => navigate(`/services/${id}/settings/repository`)}>
+ <div className="svc-detail__repo-pill" onClick={() => navigate(`/services/${id}/settings/git`)}>
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<circle cx="18" cy="18" r="3"/>
<circle cx="6" cy="6" r="3"/>
@@ -441,7 +441,7 @@ const ServiceDetail = () => {
)}
</div>
) : (
- <button className="svc-detail__connect-repo" onClick={() => navigate(`/services/${id}/settings/repository`)}>
+ <button className="svc-detail__connect-repo" onClick={() => navigate(`/services/${id}/settings/git`)}>
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<circle cx="18" cy="18" r="3"/>
<circle cx="6" cy="6" r="3"/>
diff --git a/frontend/src/pages/Workspaces.jsx b/frontend/src/pages/Workspaces.jsx
index a3d26b93..abcd3fcd 100644
--- a/frontend/src/pages/Workspaces.jsx
+++ b/frontend/src/pages/Workspaces.jsx
@@ -4,11 +4,12 @@ import api from '../services/api';
import { useToast } from '../contexts/ToastContext';
import Spinner from '../components/Spinner';
import EmptyState from '../components/EmptyState';
-import { LayoutGrid, Plus, ChevronRight } from 'lucide-react';
-import { PageTopbar, Pill, ServiceTile } from '@/components/ds';
+import { LayoutGrid, Plus, ChevronRight, Search } from 'lucide-react';
+import { PageTopbar, Pill, SegControl, ServiceTile } from '@/components/ds';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { Textarea } from '@/components/ui/textarea';
+import { Checkbox } from '@/components/ui/checkbox';
// Matches WorkspaceSwitcher: the active workspace id lives in localStorage.
const ACTIVE_KEY = 'active_workspace_id';
@@ -27,6 +28,9 @@ const Workspaces = () => {
const navigate = useNavigate();
const [workspaces, setWorkspaces] = useState([]);
const [loading, setLoading] = useState(true);
+ const [statusFilter, setStatusFilter] = useState('all'); // all | active | inactive
+ const [search, setSearch] = useState('');
+ const [selectedIds, setSelectedIds] = useState(new Set());
const [showCreateModal, setShowCreateModal] = useState(false);
const [form, setForm] = useState({ name: '', description: '', max_servers: 0, max_users: 0, primary_color: '#6d7cff' });
@@ -59,6 +63,17 @@ const Workspaces = () => {
if (loading) return <div className="page-container workspaces-page"><Spinner /></div>;
+ const q = search.trim().toLowerCase();
+ const shownWorkspaces = workspaces.filter(ws => {
+ const matchesStatus = statusFilter === 'all'
+ || (statusFilter === 'active' ? ws.status === 'active' : ws.status !== 'active');
+ const matchesSearch = q === '' || [ws.name, ws.slug, ws.description]
+ .some(v => v && String(v).toLowerCase().includes(q));
+ return matchesStatus && matchesSearch;
+ });
+
+ const activeCount = workspaces.filter(ws => ws.status === 'active').length;
+
return (
<div className="page-container workspaces-page">
<PageTopbar
@@ -78,61 +93,136 @@ const Workspaces = () => {
icon={LayoutGrid}
title="No workspaces yet"
description="Create one to isolate servers by team or project."
+ action={
+ <Button onClick={() => setShowCreateModal(true)}>
+ New Workspace
+ </Button>
+ }
/>
) : (
- <>
- <div className="ws-listhead">
- <h2>Your Workspaces</h2>
- <span className="ws-listhead__hint">open a workspace to manage its resources</span>
+ <div className="wp-list">
+ <div className="wp-list__toolbar">
+ <SegControl
+ value={statusFilter}
+ onChange={setStatusFilter}
+ options={[
+ { value: 'all', label: 'All', count: workspaces.length },
+ { value: 'active', label: 'Active', count: activeCount },
+ { value: 'inactive', label: 'Inactive', count: workspaces.length - activeCount },
+ ]}
+ />
+ <div className="wp-list__search">
+ <Search size={15} aria-hidden="true" />
+ <input
+ type="text"
+ value={search}
+ onChange={e => setSearch(e.target.value)}
+ placeholder="Search workspaces…"
+ aria-label="Search workspaces"
+ />
+ </div>
</div>
- <div className="ws-grid">
- {workspaces.map(ws => {
- const since = formatSince(ws.created_at);
- const isCurrent = activeId === String(ws.id);
- return (
- <div
- key={ws.id}
- className={`ws-card is-clickable ${isCurrent ? 'active' : ''}`}
- role="link"
- tabIndex={0}
- onClick={() => navigate(`/workspaces/${ws.id}`)}
- onKeyDown={(e) => { if (e.key === 'Enter') navigate(`/workspaces/${ws.id}`); }}
- >
- <div className="ws-card__top">
- <ServiceTile name={ws.name} size={38} gradient={ws.primary_color || undefined} />
- {isCurrent
- ? <Pill kind="green">active</Pill>
- : <Pill kind={ws.status === 'active' ? 'green' : 'amber'}>{ws.status}</Pill>}
- </div>
- <div className="ws-card__name">{ws.name}</div>
- <div className="ws-card__meta">/{ws.slug}{since ? ` · since ${since}` : ''}</div>
- {ws.description && <p className="ws-card__desc">{ws.description}</p>}
- <div className="ws-card__stats">
- <div>
- <div className="v">{ws.member_count}</div>
- <div className="l">Member{ws.member_count !== 1 ? 's' : ''}</div>
- </div>
- {ws.max_servers > 0 && (
- <div>
- <div className="v">{ws.max_servers}</div>
- <div className="l">Max Servers</div>
- </div>
- )}
- {ws.max_users > 0 && (
- <div>
- <div className="v">{ws.max_users}</div>
- <div className="l">Max Users</div>
- </div>
- )}
- </div>
- <div className="ws-card__open">
- Open <ChevronRight size={14} />
- </div>
- </div>
- );
- })}
+
+ {selectedIds.size > 0 && (
+ <div className="wp-list__bulkbar">
+ <span className="wp-list__bulkcount">{selectedIds.size} selected</span>
+ <div className="wp-list__bulkactions">
+ <Button variant="ghost" size="sm" onClick={() => setSelectedIds(new Set())}>
+ Clear
+ </Button>
+ </div>
+ </div>
+ )}
+
+ <div className="wp-list__card">
+ <table className="sk-dtable">
+ <thead>
+ <tr>
+ <th className="wp-list__ck">
+ <Checkbox
+ checked={shownWorkspaces.length > 0 && shownWorkspaces.every(ws => selectedIds.has(ws.id))}
+ onCheckedChange={(checked) => {
+ setSelectedIds(checked ? new Set(shownWorkspaces.map(ws => ws.id)) : new Set());
+ }}
+ aria-label="Select all workspaces"
+ />
+ </th>
+ <th>Workspace</th>
+ <th>Slug</th>
+ <th>Members</th>
+ <th>Servers</th>
+ <th>Users</th>
+ <th>Status</th>
+ <th className="wp-list__action" />
+ </tr>
+ </thead>
+ <tbody>
+ {shownWorkspaces.map(ws => {
+ const since = formatSince(ws.created_at);
+ const isCurrent = activeId === String(ws.id);
+ return (
+ <tr
+ key={ws.id}
+ className={`is-clickable ${selectedIds.has(ws.id) ? 'is-selected' : ''}`}
+ onClick={() => navigate(`/workspaces/${ws.id}`)}
+ >
+ <td className="wp-list__ck" onClick={e => e.stopPropagation()}>
+ <Checkbox
+ checked={selectedIds.has(ws.id)}
+ onCheckedChange={(checked) => {
+ setSelectedIds(prev => {
+ const next = new Set(prev);
+ if (checked) next.add(ws.id);
+ else next.delete(ws.id);
+ return next;
+ });
+ }}
+ aria-label={`Select ${ws.name || `workspace ${ws.id}`}`}
+ />
+ </td>
+ <td>
+ <div className="sk-cell-name">
+ <ServiceTile
+ name={ws.name}
+ size={30}
+ gradient={ws.primary_color || undefined}
+ className="wp-list__tile"
+ aria-hidden="true"
+ />
+ <span>
+ <div>{ws.name}</div>
+ {ws.description && (
+ <div className="sk-cell-sub">{ws.description}</div>
+ )}
+ {since && !ws.description && (
+ <div className="sk-cell-sub">since {since}</div>
+ )}
+ </span>
+ </div>
+ </td>
+ <td className="sk-cell-mono">/{ws.slug}</td>
+ <td className="sk-cell-mono">{ws.member_count ?? 0}</td>
+ <td className="sk-cell-mono">{ws.max_servers > 0 ? ws.max_servers : '—'}</td>
+ <td className="sk-cell-mono">{ws.max_users > 0 ? ws.max_users : '—'}</td>
+ <td>
+ {isCurrent ? (
+ <Pill kind="green">active</Pill>
+ ) : (
+ <Pill kind={ws.status === 'active' ? 'green' : 'amber'}>
+ {ws.status || 'unknown'}
+ </Pill>
+ )}
+ </td>
+ <td>
+ <ChevronRight size={16} className="wp-list__chev" />
+ </td>
+ </tr>
+ );
+ })}
+ </tbody>
+ </table>
</div>
- </>
+ </div>
)}
{showCreateModal && (
diff --git a/frontend/src/styles/components/_notification-center.scss b/frontend/src/styles/components/_notification-center.scss
index e70272ae..556eec5f 100644
--- a/frontend/src/styles/components/_notification-center.scss
+++ b/frontend/src/styles/components/_notification-center.scss
@@ -46,7 +46,8 @@
&__panel {
position: absolute;
bottom: calc(100% + 10px); // open upward (sidebar footer)
- right: 0;
+ left: 0;
+ right: auto;
width: 340px;
max-width: calc(100vw - 32px);
background: $bg-elevated;
@@ -57,6 +58,8 @@
overflow: hidden;
display: flex;
flex-direction: column;
+ animation: skNotifPanelIn 0.18s ease-out;
+ transform-origin: bottom left;
}
&__head {
@@ -166,11 +169,29 @@
}
}
-// In the sidebar footer, give the bell its own row above the user button.
+// In the sidebar footer, keep the user menu and notification bell on one row
+// so the footer feels like a single control strip instead of a floating icon.
.sidebar-footer__row {
display: flex;
- justify-content: flex-start;
- margin-bottom: 8px;
+ align-items: stretch;
+ gap: 8px;
+
+ .user-mini {
+ flex: 1;
+ min-width: 0;
+ }
+
+ .sk-notif {
+ display: flex;
+ align-items: stretch;
+ }
+
+ .sk-notif__bell {
+ width: 38px;
+ height: auto;
+ min-height: 34px;
+ align-self: stretch;
+ }
}
// In the mobile top bar the bell sits at the top, so the panel opens downward.
@@ -183,5 +204,51 @@
.mobile-topbar .sk-notif__panel {
top: calc(100% + 10px);
bottom: auto;
+ left: auto;
right: 8px;
+ transform-origin: top right;
+}
+
+@keyframes skNotifPanelIn {
+ from {
+ opacity: 0;
+ transform: translateY(6px) scale(0.96);
+ }
+ to {
+ opacity: 1;
+ transform: translateY(0) scale(1);
+ }
+}
+
+// Top bar layout: the bell sits at the far right, so the panel opens downward
+// and extends to the left so it stays inside the viewport.
+@media (min-width: ($breakpoint-md + 1)) {
+ [data-layout="topbar"] .sk-notif__panel {
+ top: calc(100% + 10px);
+ bottom: auto;
+ left: auto;
+ right: 0;
+ transform-origin: top right;
+ }
+}
+
+// Compact rail layout: when collapsed there isn't room for the bell beside the
+// avatar, so stack them vertically.
+@media (min-width: ($breakpoint-md + 1)) {
+ [data-layout="rail"] .sidebar:not(:hover):not(:focus-within) .sidebar-footer__row {
+ flex-direction: column;
+ align-items: center;
+ gap: 6px;
+
+ .user-mini {
+ flex: 0 0 auto;
+ width: auto;
+ }
+
+ .sk-notif__bell {
+ width: 34px;
+ min-height: 34px;
+ align-self: center;
+ }
+ }
}
diff --git a/frontend/src/styles/layout/_sidebar.scss b/frontend/src/styles/layout/_sidebar.scss
index f3bdb4d8..d0ddf699 100644
--- a/frontend/src/styles/layout/_sidebar.scss
+++ b/frontend/src/styles/layout/_sidebar.scss
@@ -624,7 +624,7 @@
display: flex;
align-items: center;
gap: 10px;
- width: 100%;
+ width: auto;
padding: 0.5rem;
cursor: pointer;
border: none;
diff --git a/frontend/src/styles/pages/_wordpress.scss b/frontend/src/styles/pages/_wordpress.scss
index 5e641848..c0914c1a 100644
--- a/frontend/src/styles/pages/_wordpress.scss
+++ b/frontend/src/styles/pages/_wordpress.scss
@@ -235,6 +235,8 @@
padding-right: 0;
}
+ &__action { width: 70px; }
+
&__card {
background: var(--surface);
border: 1px solid var(--border-soft);
diff --git a/frontend/src/styles/pages/_workspaces.scss b/frontend/src/styles/pages/_workspaces.scss
index fb0c045e..db1532b5 100644
--- a/frontend/src/styles/pages/_workspaces.scss
+++ b/frontend/src/styles/pages/_workspaces.scss
@@ -4,134 +4,8 @@
.workspaces-page {
- // ── list section head (mono eyebrow) ────────────────────
- .ws-listhead {
- display: flex;
- align-items: baseline;
- justify-content: space-between;
- gap: $space-4;
- margin: $space-5 0 $space-3;
-
- h2 {
- margin: 0;
- font-family: var(--mono);
- font-size: 10.5px;
- font-weight: $font-weight-semibold;
- letter-spacing: 0.08em;
- text-transform: uppercase;
- color: var(--text-faint);
- }
-
- &__hint {
- font-family: var(--mono);
- font-size: 11px;
- color: var(--text-ghost);
- }
- }
-
- // ── workspace cards (prototype .ws-card) ────────────────
- .ws-grid {
- display: grid;
- grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
- gap: $space-4;
- }
-
- .ws-card {
- display: flex;
- flex-direction: column;
- padding: 18px;
- background: var(--surface);
- border: 1px solid var(--border-soft);
- border-radius: var(--radius);
- transition: border-color 0.14s, transform 0.14s, box-shadow 0.14s;
-
- &:hover {
- border-color: var(--border-strong);
- transform: translateY(-2px);
- box-shadow: var(--shadow-md);
- }
-
- &__top {
- display: flex;
- align-items: flex-start;
- justify-content: space-between;
- gap: $space-3;
- margin-bottom: 10px;
-
- .sk-tile { border-radius: 11px; }
- }
-
- &__name {
- font-size: 15px;
- font-weight: $font-weight-semibold;
- color: var(--text);
- }
-
- &__meta {
- margin-top: 2px;
- font-family: var(--mono);
- font-size: 11px;
- color: var(--text-faint);
- }
-
- &__desc {
- margin: $space-2 0 0;
- font-size: 12.5px;
- line-height: 1.5;
- color: var(--text-dim);
- display: -webkit-box;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- overflow: hidden;
- }
-
- // count strip (prototype .ws-stat) — member count + quota caps
- &__stats {
- display: flex;
- gap: 18px;
- margin: 14px 0;
-
- .v {
- font-family: var(--mono);
- font-size: 17px;
- font-weight: $font-weight-semibold;
- color: var(--text);
- }
-
- .l {
- margin-top: 2px;
- font-size: 10.5px;
- letter-spacing: 0.05em;
- text-transform: uppercase;
- color: var(--text-faint);
- }
- }
-
- &.is-clickable { cursor: pointer; }
-
- // the active (scoped) workspace — prototype `.ws-card.active`
- &.active {
- border-color: var(--accent-dim);
- background:
- linear-gradient(160deg, var(--accent-bg-soft), transparent 70%),
- var(--surface);
- }
-
- // bottom-right "Open ›" affordance (prototype card footer)
- &__open {
- display: flex;
- align-items: center;
- justify-content: flex-end;
- gap: 5px;
- margin-top: auto; // pin to bottom → equal-height cards
- padding-top: 14px;
- font-size: 12.5px;
- color: var(--text-faint);
- transition: color 0.14s;
- }
-
- &:hover .ws-card__open { color: var(--accent-bright); }
- }
+ // Dense table list reuses the WordPress .wp-list + .sk-dtable primitives.
+ .wp-list { padding: $space-4; }
// ── modals: mono eyebrow headings + soft separators ─────
.modal-body {