# ServerKit Redesign Map > Status: **pass 1 COMPLETE — pass 2 (parity) IN PROGRESS (2026-06-11)** — all 22 view-groups shipped a first > restyle on `dev`, but a fresh audit against the prototype (`_serverkit_design_extract`) found the pass-1 work > stops short of real parity on several pages. See **§8** for the ranked gap list. Remaining: §8 parity items, > §5 backend gaps, open §6 decisions 3/4/5/6. · Owner: Juan · > Source design: clickable prototype (`ServerKit.zip` → `serverkit/view_*.jsx` + `styles.css`) · Target: the live > modular app under `frontend/src` + `backend/app`. This is the working map for adopting the new ServerKit design across the app. It was built by comparing **every prototype view** against its **current production page** (22 view-groups analyzed). Read §0–§1 first; they set the thesis and the rules. §4 is the per-page checklist. §5 is the backend work. §6 is the decisions that are yours to make. --- ## 0. What this redesign actually is **It is a front-end re-skin + information-architecture (IA) overhaul — not a feature build.** The prototype is a *standalone clickable mockup* (React via CDN + Babel, mock `window.DATA`). The live app **already implements ~90% of what it shows** at the backend (62 API blueprints, 100+ services, 60+ models) and mostly at the frontend too (45+ pages). So for most views the work is: **restyle the existing page into the new visual language, reshuffle its IA, and slot the result into the existing modular structure** — *not* a rewrite. A recurring trap: **the prototype is frequently a _subset_ of the live app** (Servers, Docker, Files, Git, Security, Email all show *less* than we already ship). Taking it literally would delete working capabilities (tabs, filters, bulk actions, file browsers, webhook management, agent fleet rails). The rule is **restyle + selectively borrow IA, re-home what the mockup omits, never silently drop a working feature.** --- ## 1. The modularity contract (golden rules) These keep the redesign inside the structure you already like: 1. **Remap token _values_ behind existing token _names_.** The new palette (periwinkle accent `#6d7cff`, 3-tier surface ramp, 4-tier text, new `cyan`/`violet` semantics, `*-bg` washes) lands in `styles/_theme-variables.scss` + `styles/_variables.scss` by **changing values**, not renaming. Every page's SCSS reads `$bg-*/$text-*/$accent-*` today — a repo-wide rename is the one thing that would break everything. Add genuinely new tokens (`--cyan`, `--violet`, `--accent-bright`) **additively**. Keep light-theme overrides and the `*-raw` values used by SCSS `fade()` in sync. 2. **One feature = one page + one SCSS partial + one API module.** Restyling a page touches `pages/X.jsx` and `styles/pages/_x.scss` (and its `services/api/x.js` only if a new endpoint is added). Don't fork a new architecture. 3. **Build shared primitives once (§3), then consume them everywhere.** No per-page bespoke pills/charts/tables. 4. **Preserve the superset.** When the mockup shows fewer tabs/controls than today, re-home the missing ones (a drawer section, a settings sub-route, a secondary surface) — don't delete them. 5. **Keep deep-linking working.** Tabs are wired through `useTabParam`/`VALID_TABS`. If you change a tab set, update `VALID_TABS` and add redirects for old `?tab=` values. 6. **Bind to real `api.*`.** Drop all `window.DATA` mock wiring from the prototype; it is throwaway. 7. **One logical change per commit**, focused diffs, branch prefixes (`feature/redesign-*`). --- ## 2. Phase 0 — Design System & Chrome foundation (do this first) Everything else depends on this. Effort: **L**. **Status: ✅ done (2026-06-07)** — tokens remapped (dark/light/system) + prototype tokens added; IBM Plex self-hosted; accent ramp runtime-derived in `ThemeContext`; shared primitives built in `components/ds/`; sidebar restyled (gradient rail, mono section headers, left accent bar, dimmed icons, restyled footer/user-menu, 250px). SCSS compiles, ESLint 0 errors. Git stays **plugin-owned** under Infrastructure (no core duplicate — avoids a dead link when the plugin is off). - **Fonts** → IBM Plex Sans + IBM Plex Mono, **self-hosted** (OFL-licensed `.woff2` vendored in `frontend/public/fonts/` via `frontend/scripts/fetch-fonts.mjs`, declared in `styles/base/_fonts.scss`). **No Google Fonts / third-party CDN** — a self-hosted control panel must not leak every visitor's IP + usage to Google, and self-hosting also works on air-gapped/offline installs. `$font-main`/`$font-mono` retargeted in `_variables.scss`; `system-ui` fallback keeps the app working if the woff2 files are absent. - **Tokens** → remap in `_theme-variables.scss`/`_variables.scss` per rule §1.1: surface ramp (`--surface`/`-2`/`-3` + near-black bg), 4-tier text (`--text`/`-dim`/`-faint`/`-ghost`), accent `#6d7cff` + `--accent-bright`/`--accent-dim`/`--accent-bg`/`--accent-glow`, **new** `--cyan`/`--violet` (+ `-bg`), radius scale (10/7/14), shadow scale, and the `.app` radial accent wash. - **Sidebar** (`styles/layout/_sidebar.scss` + `components/Sidebar.jsx` + `components/sidebarItems.js`): gradient bg, 34px gradient logo tile, mono-uppercase section headers, left accent bar + glow on active item, optional per-item **badge dot** slot. Add a top-level **Git** item under Infrastructure; align preset membership to the prototype (Full / Web Hosting / Email Admin / Docker-DevOps / Minimal). **Keep** the current richer structure: collapsible sub-items, `WorkspaceSwitcher`, plugin-nav injection, dev-tools group. (Preset persistence via `sidebar_config`, theme/accent via `ThemeContext` localStorage — both already exist; verify the dark/light/**system** trio.) --- ## 3. Shared component library (build once → reused everywhere) These recur across nearly every view. Build them in `components/ui/` (or `components/common/`) with styles in new partials (`styles/components/_charts.scss`, `_datatable.scss`, `_drawer.scss`, `_kpi.scss`). **This is the highest-leverage work in the whole redesign** — most page tasks become trivial once these exist. | Primitive | New / Reuse | Used by | Notes | |---|---|---|---| | **Pill / StatusPill** | NEW | ~all | dot + label, kinds green/amber/red/gray/cyan. Replaces ad-hoc `Badge`/bespoke pills. | | **EnvTag** | NEW | wp, services, dashboard, workspaces | PROD / DEV / STAGING / SERVICE colored tag. | | **SegControl** | NEW | dashboard, monitoring, backups, services, security, appearance, filters | segmented toggle; replaces native `` → `SegControl` (Type + Sort selects kept — capability superset); bulk-select/row-select kept via `is-selected`. Omitted CPU/Memory/Server columns (no list payload — §5). Remaining in this group: - Detail: no back-link ("‹ All services"), title row stacks instead of inline h1+Pill (LOW). - NewService: demo's 4 method cards vs live 3 (Docker-image + scratch = §5 backend gap); 2-col review-panel layout is a deliberate improvement — keep. - Backend (§5): metrics-history AreaCharts, real template catalog (live has 1 hardcoded template). ### 8.3 Terminal / Console — ✅ **Terminal tab shipped 2026-06-11** (rail IA still §5) The Terminal page now has an actual terminal: a **Terminal tab** (`.term-shell`: demo-style target rail with glowing status dots + xterm pane) hosting `RemoteTerminal` against paired agent servers. This required fixing the whole output path — `RemoteTerminal` referenced a **nonexistent `SocketContext`** and listened for a `terminal:` event nothing emits; rewired to `services/socket.js` + new `subscribe_terminal` / `unsubscribe_terminal` handlers in `sockets.py` that join the browser into the gateway's `server__terminal:` stream room (agent PTY → gateway `server_stream` → xterm), with reconnect re-subscribe. 'logs' stays the default landing (shell needs a connected agent; panel-host PTY = §5 gap, local is rejected by TerminalService). Still §5: the unified all-targets rail (WP/DBs/containers groups) + live non-file log streaming. **Verified live end-to-end 2026-06-12** (WSL agent → panel → browser xterm: `echo` round-trip clean). Fixes shipped while testing: **keystroke serialization** in RemoteTerminal (each key was its own HTTP POST — parallel POSTs reordered fast typing into scrambled input; now queued + flushed sequentially); page header → `PageTopbar`; rail rows got server icons + right-aligned glowing dots; shell pane flush against the rail (demo con-main). Agent repo fixes found en route: **Linux build was broken** (`agentui/pairer.go` called Windows-only `isServiceInstalled`/`waitForServiceStopped` — stubs added to `platform_other.go`) and **`register` panicked** (`-c` shorthand collision with global `--config`). NOTE: agent PTY is Unix-only — Windows agents return "pty: unsupported" (ConPTY = future agent work). ### 8.4 WordPress — ✅ **JSX-only parts done 2026-06-11** - List: **bulk-select shipped** — header + per-row checkboxes, accent `is-selected` rows, bulkbar with Start/Stop/Update-core/Backup/Clear-cache fanned out per site over the real APIs (unarchive/archive/ updateCore/createSnapshot/flushCache), each scoped by an `applies` filter (e.g. Stop only hits running sites). Restart/bulk-Delete skipped (no site-level restart API; delete too destructive for bulk). - Detail: **posture ScoreGauge shipped** in the Security tab — score computed client-side from 3 real signals (integrity clean, WP_DEBUG off, no critical/high vulns) with a checklist; unrun checks stay out of the score. **PHP version added to the header subtitle** (`site.application.php_version`). - Still §5 (data missing): Plugins/Visits/Uptime/Server/Env list columns (`get_sites` enrichment), largest-tables + gauge bars (no table-size endpoint), response-time chart, referrers/devices bars, FilesDrawer w/ code viewer. ### 8.5 Files — ✅ **done 2026-06-11** Shipped: **`file-manager/highlight.js`** (the demo's `hlCode` line tinting — kw/str/num/cmt/var tokens; PHP/JS keywords; escapes before inserting markup) rendered as `.pv-code` (line-number gutter on `--bg-code`) in the PreviewDrawer's read view — editing keeps the textarea, files >4000 lines fall back to plain; **Quick-access rail group** (Sites `/var/www`, Stack `/opt/serverkit`, Web config `/etc/nginx`, Logs `/var/log`); topbar `meta` shows the browse target (remote agent name / "panel host"); breadcrumb `›` icons → demo mono `/`; ext-badge on image thumbs now always visible. ### 8.6 Docker — ✅ **done 2026-06-11** (2 of 4 items were non-issues) KPI icon tone-wash: **false alarm** — verified `.sk-kpi__icon--*` rules + `tone` props are correct end-to-end. **Per-container accent dot shipped**: hue-hashed identity dot in the name cell (demo `.dot-ico`), dimmed when stopped (status lives in the Status pill). Projects KPI: **skipped** — compose-project labels only exist on per-container inspect, a count needs an extra fetch per target, and the 4th KPI slot already carries real Networks data. Logs modal→drawer stays blocked on §6.3. ### 8.7 Workspaces — ✅ **done 2026-06-11 (commit 2312cf4)** Built `/workspaces/:id` **WorkspaceDetail** on real data: site-header hero (brand tile, active/status Pill, mono meta), Workspace info card + live Resources counts, accent-underline tabs (Servers/Services/Sites/Members) over `sk-dtable` rows with Manage links + move-in/out pickers; member add/remove + per-app Share ACL re-homed from the old list modals; Set active (mirrors WorkspaceSwitcher localStorage scope), Settings edit (updateWorkspace), Archive/Restore/Delete. List cards now navigate to detail (demo "Open ›" footer) and the scoped workspace gets the `.ws-card.active` accent wash. Still §5-deferred: plan/billing, aggregated CPU/MEM usage bars, member `last_active`. ### 8.8 Marketplace — effectively done Matches the demo's spirit; intentional IA deltas (tabs, sidebar categories) preserve live capabilities. Optional: horizontal `.cat-chips` row above the grid, 3rd-party integration cards (§5 OAuth). ### Recommended order 1. **8.0 Agent Fleet + Fleet Monitor retint** — kills the "different app" jump. ✅ **done 2026-06-11** 2. **8.1 Databases de-cardify + tints + editor** — the called-out page; mostly SCSS + small JSX. ✅ **flush layout + cell tints + dot glow + `+` pill + ctx items done 2026-06-11; SQL gutter/highlight follow-up** 3. **8.2 Services list → `.sk-dtable` + `SegControl` + src-badge.** 4. **8.4 WP list bulk-select + detail ScoreGauge/gauges** (JSX-only parts). 5. **8.5 Files highlight.js + quick-access.** 6. **8.6 Docker smalls.** 7. **8.3 Terminal IA** (needs §5). 8. ~~**8.7 WorkspaceDetail**~~ ✅ **done 2026-06-11** (plan/billing/usage still §5). 9. **8.8 Marketplace optionals.** --- *Generated from a 22-agent comparison of the prototype vs the live codebase, re-audited 2026-06-11 (§8). Update this file as decisions land and pages ship.*