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(shell): one tabbed console + styled scope menus (port prototype chrome)

Juan Denis6a8e80d7f1f1
diff --git a/frontend/src/components/GlobalStatusBar.jsx b/frontend/src/components/GlobalStatusBar.jsx
index 23f97dab..4a10b513 100644
--- a/frontend/src/components/GlobalStatusBar.jsx
+++ b/frontend/src/components/GlobalStatusBar.jsx
@@ -11,9 +11,11 @@ import { useAuth } from '../contexts/AuthContext';
import { useNotifications } from '../contexts/NotificationsContext';
import { useOperations } from '../contexts/OperationsContext';
import { useServerkitAI } from '../contexts/AIContext';
+import { useShellDock } from '../contexts/ShellDockContext';
import { useWalkthroughs } from '../contexts/walkthroughContextValue';
import { useWorkspace } from '../contexts/WorkspaceContext';
import { timeAgo } from '../utils/time';
+import ShellDockTabs from './ShellDockTabs';
const SERVER_SCOPE_KEY = 'serverkit.activeServerScope';
@@ -35,15 +37,52 @@ function alertTone(item) {
return 'info';
}
+// Styled replacement for the old native <select> poppers — the browser menu
+// ignored the theme entirely (white list over a dark shell). Anchored above
+// its status-bar trigger, prototype env-menu look: dot · name · meta · check.
+function ScopeMenu({ label, options, value, onPick, wide = false }) {
+ return (
+ <div
+ className={`statusbar-menu${wide ? ' statusbar-menu--wide' : ''}`}
+ role="listbox"
+ aria-label={label}
+ >
+ <div className="statusbar-menu__head mono">{label}</div>
+ {options.map((option) => (
+ <button
+ key={option.id}
+ type="button"
+ role="option"
+ aria-selected={String(option.id) === String(value)}
+ className="statusbar-menu__option"
+ onClick={() => onPick(option.id)}
+ >
+ <span className={`statusbar-menu__swatch is-${option.tone || 'accent'}`} aria-hidden="true" />
+ <span className="statusbar-menu__copy">
+ <span className="statusbar-menu__name">{option.name}</span>
+ {option.meta && <span className="statusbar-menu__meta mono">{option.meta}</span>}
+ </span>
+ {String(option.id) === String(value) && (
+ <Check size={15} className="statusbar-menu__check" aria-hidden="true" />
+ )}
+ </button>
+ ))}
+ </div>
+ );
+}
+
function AlertsPanel({ onClose }) {
const { t } = useTranslation();
const navigate = useNavigate();
const notifications = useNotifications();
+ const { expanded } = useShellDock();
const [view, setView] = useState('attention');
const {
items = [], loading, markRead, markAllRead, dismissNotice,
} = notifications || {};
+ useEffect(() => { notifications?.refresh?.(); }, []); // eslint-disable-line react-hooks/exhaustive-deps
+
const visibleItems = useMemo(() => (
view === 'all'
? items
@@ -63,43 +102,36 @@ function AlertsPanel({ onClose }) {
};
return (
- <section className="shell-panel shell-alerts" aria-label={t('notifications.heading', 'Notifications')}>
+ <section className={`shell-panel shell-alerts${expanded ? ' is-expanded' : ''}`} aria-label={t('notifications.heading', 'Notifications')}>
<header className="shell-panel__head">
- <div className="shell-panel__tabs" role="tablist">
- <button
- type="button"
- className={view === 'attention' ? 'is-active' : ''}
- onClick={() => setView('attention')}
- role="tab"
- aria-selected={view === 'attention'}
- >
- {t('app.operationsDock.needsAttention', 'Needs attention')}
- </button>
- <button
- type="button"
- className={view === 'all' ? 'is-active' : ''}
- onClick={() => setView('all')}
- role="tab"
- aria-selected={view === 'all'}
- >
- {t('notifications.everything', 'Everything')}
- </button>
- </div>
+ <ShellDockTabs />
+ </header>
+ <div className="shell-panel__filters">
+ <button
+ type="button"
+ className={view === 'attention' ? 'is-active' : ''}
+ onClick={() => setView('attention')}
+ role="tab"
+ aria-selected={view === 'attention'}
+ >
+ {t('app.operationsDock.needsAttention', 'Needs attention')}
+ </button>
+ <button
+ type="button"
+ className={view === 'all' ? 'is-active' : ''}
+ onClick={() => setView('all')}
+ role="tab"
+ aria-selected={view === 'all'}
+ >
+ {t('notifications.everything', 'Everything')}
+ </button>
<span className="shell-panel__spacer" />
{items.some((item) => item.kind !== 'notice' && !item.read) && (
<button type="button" className="shell-panel__action" onClick={markAllRead}>
<Check size={13} /> {t('notifications.markAllRead', 'Mark all read')}
</button>
)}
- <button
- type="button"
- className="shell-panel__close"
- onClick={onClose}
- aria-label={t('common.actions.close', 'Close')}
- >
- <X size={15} />
- </button>
- </header>
+ </div>
<div className="shell-alerts__list">
{loading && items.length === 0 ? (
@@ -152,23 +184,34 @@ export default function GlobalStatusBar({ onOpenPalette }) {
const navigate = useNavigate();
const { isAdmin } = useAuth();
const notifications = useNotifications();
- const {
- activeOperations, attentionOperations, collapsed, setCollapsed,
- } = useOperations();
- const {
- open: recipesOpen, setOpen: setRecipesOpen, activeWalkthrough, activeProgress,
- } = useWalkthroughs();
- const {
- isOpen: assistantOpen, unread: assistantUnread, close: closeAssistant, toggle: toggleAssistant,
- } = useServerkitAI();
+ const { activeOperations, attentionOperations } = useOperations();
+ const { activeWalkthrough, activeProgress } = useWalkthroughs();
+ const { unread: assistantUnread } = useServerkitAI();
+ const { activeTab, toggleTab, close: closeDock } = useShellDock();
const {
activeWorkspaceId, clearActiveWorkspace, setActiveWorkspace,
} = useWorkspace();
const [workspaces, setWorkspaces] = useState([]);
const [servers, setServers] = useState([]);
const [serverId, setServerId] = useState(readServerScope);
- const [alertsOpen, setAlertsOpen] = useState(false);
const [setupHealth, setSetupHealth] = useState(null);
+ const [scopeMenu, setScopeMenu] = useState(null); // null | 'workspace' | 'server'
+
+ useEffect(() => {
+ if (!scopeMenu) return undefined;
+ const onPointerDown = (event) => {
+ if (!event.target.closest?.('.statusbar-popover')) setScopeMenu(null);
+ };
+ const onKeyDown = (event) => {
+ if (event.key === 'Escape') setScopeMenu(null);
+ };
+ document.addEventListener('mousedown', onPointerDown);
+ document.addEventListener('keydown', onKeyDown);
+ return () => {
+ document.removeEventListener('mousedown', onPointerDown);
+ document.removeEventListener('keydown', onKeyDown);
+ };
+ }, [scopeMenu]);
useEffect(() => {
let alive = true;
@@ -190,16 +233,6 @@ export default function GlobalStatusBar({ onOpenPalette }) {
if (!availableIds.has(String(serverId))) setServerId('local');
}, [serverId, servers]);
- useEffect(() => {
- if (!alertsOpen) return undefined;
- notifications?.refresh?.();
- const onEscape = (event) => {
- if (event.key === 'Escape') setAlertsOpen(false);
- };
- window.addEventListener('keydown', onEscape);
- return () => window.removeEventListener('keydown', onEscape);
- }, [alertsOpen, notifications]);
-
const workspaceName = workspaces.find(
(workspace) => String(workspace.id) === activeWorkspaceId,
)?.name || t('app.workspaceSwitcher.allWorkspaces', 'All workspaces');
@@ -215,88 +248,109 @@ export default function GlobalStatusBar({ onOpenPalette }) {
const unreadCount = notifications?.unreadCount || 0;
const setupSummary = setupHealth?.summary;
- const changeWorkspace = (event) => {
- const value = event.target.value;
+ const workspaceOptions = useMemo(() => ([
+ {
+ id: 'all',
+ name: t('app.workspaceSwitcher.allWorkspaces', 'All workspaces'),
+ meta: t('app.statusbar.allWorkspacesMeta', '{{count}} workspaces · everything you can see', { count: workspaces.length }),
+ tone: 'ghost',
+ },
+ ...workspaces.map((workspace) => ({
+ id: String(workspace.id),
+ name: workspace.name,
+ meta: workspace.member_count != null
+ ? t('app.statusbar.workspaceMembers', '{{count}} members', { count: workspace.member_count })
+ : workspace.description || null,
+ })),
+ ]), [t, workspaces]);
+
+ const serverOptions = useMemo(() => scopedServers.map((server) => ({
+ id: String(server.id),
+ name: server.name || server.id,
+ meta: server.hostname || server.ip_address || server.host || null,
+ tone: statusTone(server),
+ })), [scopedServers]);
+
+ const pickWorkspace = (value) => {
+ setScopeMenu(null);
+ if (String(value) === activeWorkspaceId) return;
if (value === 'all') clearActiveWorkspace();
else {
- const workspace = workspaces.find((item) => String(item.id) === value);
+ const workspace = workspaces.find((item) => String(item.id) === String(value));
if (workspace) setActiveWorkspace(workspace);
+ else return;
}
window.location.reload();
};
- const changeServer = (event) => {
- const value = event.target.value;
+ const pickServer = (value) => {
+ setScopeMenu(null);
setServerId(value);
try { localStorage.setItem(SERVER_SCOPE_KEY, value); } catch { /* ignore */ }
window.dispatchEvent(new CustomEvent('serverkit:server-scope', { detail: { serverId: value } }));
};
- const toggleOperations = () => {
- setAlertsOpen(false);
- setRecipesOpen(false);
- closeAssistant();
- setCollapsed(!collapsed);
- };
-
- const toggleRecipes = () => {
- setCollapsed(true);
- setAlertsOpen(false);
- closeAssistant();
- setRecipesOpen(!recipesOpen);
- };
-
- const toggleAlerts = () => {
- setCollapsed(true);
- setRecipesOpen(false);
- closeAssistant();
- setAlertsOpen(!alertsOpen);
- };
-
- const openAssistant = () => {
- setCollapsed(true);
- setRecipesOpen(false);
- setAlertsOpen(false);
- toggleAssistant();
- };
-
return (
<>
- {alertsOpen && <AlertsPanel onClose={() => setAlertsOpen(false)} />}
+ {activeTab === 'alerts' && <AlertsPanel onClose={closeDock} />}
<footer className="global-statusbar" aria-label={t('app.statusbar.shellStatus', 'ServerKit status and tools')}>
- <label className="statusbar-select statusbar-select--workspace" title={t('app.workspaceSwitcher.activeWorkspace', 'Active workspace')}>
- <Building2 size={13} aria-hidden="true" />
- <span className="statusbar-select__value">{workspaceName}</span>
- <ChevronUp size={12} aria-hidden="true" />
- <select value={activeWorkspaceId} onChange={changeWorkspace} aria-label={t('app.workspaceSwitcher.activeWorkspace', 'Active workspace')}>
- <option value="all">{t('app.workspaceSwitcher.allWorkspaces', 'All workspaces')}</option>
- {workspaces.map((workspace) => (
- <option key={workspace.id} value={String(workspace.id)}>{workspace.name}</option>
- ))}
- </select>
- </label>
+ <span className="statusbar-popover">
+ {scopeMenu === 'workspace' && (
+ <ScopeMenu
+ wide
+ label={t('app.workspaceSwitcher.activeWorkspace', 'Active workspace')}
+ options={workspaceOptions}
+ value={activeWorkspaceId}
+ onPick={pickWorkspace}
+ />
+ )}
+ <button
+ type="button"
+ className={`statusbar-select statusbar-select--workspace${scopeMenu === 'workspace' ? ' is-open' : ''}`}
+ onClick={() => setScopeMenu(scopeMenu === 'workspace' ? null : 'workspace')}
+ aria-haspopup="listbox"
+ aria-expanded={scopeMenu === 'workspace'}
+ aria-label={t('app.workspaceSwitcher.activeWorkspace', 'Active workspace')}
+ >
+ <Building2 size={13} aria-hidden="true" />
+ <span className="statusbar-select__value">{workspaceName}</span>
+ <ChevronUp size={12} aria-hidden="true" />
+ </button>
+ </span>
<span className="global-statusbar__separator" aria-hidden="true" />
- <label className="statusbar-select" title={t('app.statusbar.activeServer', 'Active server')}>
- <span className={`global-statusbar__dot is-${statusTone(selectedServer)}`} aria-hidden="true" />
- <Server size={13} className="global-statusbar__mobile-icon" aria-hidden="true" />
- <span className="statusbar-select__value mono">{selectedServer.name || selectedServer.id}</span>
- <ChevronUp size={12} aria-hidden="true" />
- <select value={String(serverId)} onChange={changeServer} aria-label={t('app.statusbar.activeServer', 'Active server')}>
- {scopedServers.map((server) => (
- <option key={server.id} value={String(server.id)}>{server.name || server.id}</option>
- ))}
- </select>
- </label>
+ <span className="statusbar-popover">
+ {scopeMenu === 'server' && (
+ <ScopeMenu
+ label={t('app.statusbar.activeServer', 'Active server')}
+ options={serverOptions}
+ value={serverId}
+ onPick={pickServer}
+ />
+ )}
+ <button
+ type="button"
+ className={`statusbar-select${scopeMenu === 'server' ? ' is-open' : ''}`}
+ onClick={() => setScopeMenu(scopeMenu === 'server' ? null : 'server')}
+ aria-haspopup="listbox"
+ aria-expanded={scopeMenu === 'server'}
+ aria-label={t('app.statusbar.activeServer', 'Active server')}
+ >
+ <span className={`global-statusbar__dot is-${statusTone(selectedServer)}`} aria-hidden="true" />
+ <Server size={13} className="global-statusbar__mobile-icon" aria-hidden="true" />
+ <span className="statusbar-select__value mono">{selectedServer.name || selectedServer.id}</span>
+ <ChevronUp size={12} aria-hidden="true" />
+ </button>
+ </span>
<span className="global-statusbar__separator" aria-hidden="true" />
<button
type="button"
- className={`global-statusbar__segment${!collapsed ? ' is-active' : ''}`}
- onClick={toggleOperations}
- aria-expanded={!collapsed}
+ className={`global-statusbar__segment${activeTab === 'ops' ? ' is-active' : ''}`}
+ onClick={() => toggleTab('ops')}
+ aria-expanded={activeTab === 'ops'}
aria-label={t('app.operationsDock.title', 'Operations')}
>
<Activity size={13} />
@@ -312,9 +366,9 @@ export default function GlobalStatusBar({ onOpenPalette }) {
<span className="global-statusbar__separator" aria-hidden="true" />
<button
type="button"
- className={`global-statusbar__segment${recipesOpen ? ' is-active' : ''}`}
- onClick={toggleRecipes}
- aria-expanded={recipesOpen}
+ className={`global-statusbar__segment${activeTab === 'recipes' ? ' is-active' : ''}`}
+ onClick={() => toggleTab('recipes')}
+ aria-expanded={activeTab === 'recipes'}
aria-label={activeWalkthrough?.title || t('app.walkthroughs.recipes', 'Recipes')}
>
<BookOpenCheck size={13} />
@@ -345,9 +399,9 @@ export default function GlobalStatusBar({ onOpenPalette }) {
<button
type="button"
- className={`global-statusbar__segment${alertsOpen ? ' is-active' : ''}`}
- onClick={toggleAlerts}
- aria-expanded={alertsOpen}
+ className={`global-statusbar__segment${activeTab === 'alerts' ? ' is-active' : ''}`}
+ onClick={() => toggleTab('alerts')}
+ aria-expanded={activeTab === 'alerts'}
aria-label={t('app.statusbar.alerts', 'Alerts')}
>
<Bell size={13} />
@@ -360,9 +414,9 @@ export default function GlobalStatusBar({ onOpenPalette }) {
<button
type="button"
- className={`global-statusbar__segment${assistantOpen ? ' is-active' : ''}`}
- onClick={openAssistant}
- aria-expanded={assistantOpen}
+ className={`global-statusbar__segment${activeTab === 'assistant' ? ' is-active' : ''}`}
+ onClick={() => toggleTab('assistant')}
+ aria-expanded={activeTab === 'assistant'}
aria-label={t('app.ai.assistant', 'Assistant')}
>
<Sparkles size={13} />
diff --git a/frontend/src/components/OperationsDock.jsx b/frontend/src/components/OperationsDock.jsx
index a2239c2c..85ebf3a5 100644
--- a/frontend/src/components/OperationsDock.jsx
+++ b/frontend/src/components/OperationsDock.jsx
@@ -17,6 +17,7 @@ import { useTranslation } from 'react-i18next';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import { useOperations } from '../contexts/OperationsContext';
+import { useShellDock } from '../contexts/ShellDockContext';
import { useToast } from '../contexts/ToastContext';
import { useConfirm } from '../hooks/useConfirm';
import { usePolling } from '../hooks/usePolling';
@@ -26,6 +27,7 @@ import { operationKey } from '../services/operations';
import { formatDuration } from '../utils/time';
import IconButton from './IconButton';
import FormField from './FormField';
+import ShellDockTabs from './ShellDockTabs';
import Pill from './ds/Pill';
import { statusKind, statusLabel } from './ds/status';
@@ -229,6 +231,7 @@ export default function OperationsDock({ hideLauncher = false, statusbarMode = f
openOperation,
setCollapsed,
} = useOperations();
+ const { activeTab, expanded } = useShellDock();
const [view, setView] = useState('active');
const [now, setNow] = useState(Date.now());
const logRef = useRef(null);
@@ -317,9 +320,14 @@ export default function OperationsDock({ hideLauncher = false, statusbarMode = f
count: activeOperations.length,
});
+ // In statusbar mode the shell dock decides which console tab is visible;
+ // outside it the legacy collapsed/launcher behaviour is untouched.
+ const visible = statusbarMode ? activeTab === 'ops' : !collapsed;
+ if (statusbarMode && !visible) return null;
+
return (
- <div className={`operations-dock${statusbarMode ? ' operations-dock--statusbar' : ''}${collapsed ? ' is-collapsed' : ' is-open'}`}>
- {collapsed ? (
+ <div className={`operations-dock${statusbarMode ? ' operations-dock--statusbar' : ''}${visible ? ' is-open' : ' is-collapsed'}`}>
+ {!visible ? (
hideLauncher ? null : <Button
type="button"
className="operations-dock__launcher"
@@ -334,27 +342,44 @@ export default function OperationsDock({ hideLauncher = false, statusbarMode = f
{unreadCount > 0 && <span className="operations-dock__unread" aria-label={t('app.operationsDock.unreadCount', '{{count}} unread', { count: unreadCount })}>{unreadCount}</span>}
</Button>
) : (
- <section className="operations-dock__panel" aria-label={t('app.operationsDock.title', 'Operations')}>
+ <section
+ className={`operations-dock__panel${statusbarMode && expanded ? ' is-expanded' : ''}`}
+ aria-label={t('app.operationsDock.title', 'Operations')}
+ >
<header className="operations-dock__header">
- <div className="operations-dock__heading">
- <span className="operations-dock__icon"><Activity size={16} /></span>
- <div>
- <h2>{t('app.operationsDock.title', 'Operations')}</h2>
- <span>{activeLabel}</span>
- </div>
- </div>
- <div className="operations-dock__header-actions">
- <IconButton
- icon={<RotateCcw size={15} />}
- label={t('common.actions.refresh', 'Refresh')}
- onClick={refresh}
- />
- <IconButton
- icon={<X size={16} />}
- label={t('app.operationsDock.collapse', 'Collapse Operations dock')}
- onClick={() => setCollapsed(true)}
+ {statusbarMode ? (
+ <ShellDockTabs
+ controls={(
+ <IconButton
+ icon={<RotateCcw size={15} />}
+ label={t('common.actions.refresh', 'Refresh')}
+ onClick={refresh}
+ />
+ )}
/>
- </div>
+ ) : (
+ <>
+ <div className="operations-dock__heading">
+ <span className="operations-dock__icon"><Activity size={16} /></span>
+ <div>
+ <h2>{t('app.operationsDock.title', 'Operations')}</h2>
+ <span>{activeLabel}</span>
+ </div>
+ </div>
+ <div className="operations-dock__header-actions">
+ <IconButton
+ icon={<RotateCcw size={15} />}
+ label={t('common.actions.refresh', 'Refresh')}
+ onClick={refresh}
+ />
+ <IconButton
+ icon={<X size={16} />}
+ label={t('app.operationsDock.collapse', 'Collapse Operations dock')}
+ onClick={() => setCollapsed(true)}
+ />
+ </div>
+ </>
+ )}
</header>
<div className="operations-dock__tabs" role="tablist">
diff --git a/frontend/src/components/ShellDockTabs.jsx b/frontend/src/components/ShellDockTabs.jsx
new file mode 100644
index 00000000..dd2631ce
--- /dev/null
+++ b/frontend/src/components/ShellDockTabs.jsx
@@ -0,0 +1,82 @@
+import { Maximize2, Minimize2, X } from 'lucide-react';
+import { useTranslation } from 'react-i18next';
+
+import { useNotifications } from '../contexts/NotificationsContext';
+import { useOperations } from '../contexts/OperationsContext';
+import { useServerkitAI } from '../contexts/AIContext';
+import { useShellDock } from '../contexts/ShellDockContext';
+import { useWalkthroughs } from '../contexts/walkthroughContextValue';
+
+// Shared header strip for every shell console panel. Wherever a panel opens
+// (Operations, Alerts, Recipes bottom console; Assistant right drawer), the
+// same four tabs sit on top so switching surfaces is one click, like moving
+// between tabs of a single console rather than four unrelated popovers.
+export default function ShellDockTabs({ controls = null, expandable = true }) {
+ const { t } = useTranslation();
+ const {
+ activeTab, openTab, close, expanded, setExpanded,
+ } = useShellDock();
+ const { activeOperations, attentionOperations } = useOperations();
+ const notifications = useNotifications();
+ const { activeWalkthrough, activeProgress } = useWalkthroughs();
+ const { unread: assistantUnread } = useServerkitAI();
+
+ const operationsBadge = activeOperations.length + attentionOperations.length;
+ const tabs = [
+ { id: 'ops', label: t('app.operationsDock.title', 'Operations'), badge: operationsBadge || null },
+ { id: 'alerts', label: t('app.statusbar.alerts', 'Alerts'), badge: notifications?.unreadCount || null },
+ {
+ id: 'recipes',
+ label: t('app.walkthroughs.recipes', 'Recipes'),
+ badge: activeWalkthrough
+ ? `${activeProgress?.count || 0}/${activeProgress?.total || 0}`
+ : null,
+ },
+ { id: 'assistant', label: t('app.ai.assistant', 'Assistant'), badge: assistantUnread || null },
+ ];
+
+ return (
+ <div className="shell-dock-tabs" role="tablist" aria-label={t('app.statusbar.consolePanels', 'Console panels')}>
+ {tabs.map((tab) => (
+ <button
+ key={tab.id}
+ type="button"
+ role="tab"
+ aria-selected={activeTab === tab.id}
+ className={`shell-dock-tabs__tab${activeTab === tab.id ? ' is-active' : ''}`}
+ onClick={() => openTab(tab.id)}
+ >
+ {tab.label}
+ {tab.badge ? <span className="shell-dock-tabs__badge mono">{tab.badge}</span> : null}
+ </button>
+ ))}
+ <span className="shell-dock-tabs__spacer" />
+ {controls}
+ {expandable && (
+ <button
+ type="button"
+ className="shell-dock-tabs__control"
+ onClick={() => setExpanded(!expanded)}
+ aria-pressed={expanded}
+ aria-label={expanded
+ ? t('app.statusbar.collapsePanel', 'Collapse panel')
+ : t('app.statusbar.expandPanel', 'Expand panel')}
+ title={expanded
+ ? t('app.statusbar.collapsePanel', 'Collapse panel')
+ : t('app.statusbar.expandPanel', 'Expand panel')}
+ >
+ {expanded ? <Minimize2 size={14} /> : <Maximize2 size={14} />}
+ </button>
+ )}
+ <button
+ type="button"
+ className="shell-dock-tabs__control"
+ onClick={close}
+ aria-label={t('common.actions.close', 'Close')}
+ title={t('app.statusbar.closeEsc', 'Close (Esc)')}
+ >
+ <X size={15} />
+ </button>
+ </div>
+ );
+}
diff --git a/frontend/src/components/WalkthroughHub.jsx b/frontend/src/components/WalkthroughHub.jsx
index 350ecf38..8774b729 100644
--- a/frontend/src/components/WalkthroughHub.jsx
+++ b/frontend/src/components/WalkthroughHub.jsx
@@ -1,249 +1,233 @@
import {
- ArrowRight,
BookOpenCheck,
Boxes,
Check,
- ChevronLeft,
- Circle,
Clock3,
- ListChecks,
- RotateCcw,
ShieldCheck,
- X,
+ Square,
} from 'lucide-react';
-import { useState } from 'react';
+import { useEffect, useMemo, useState } from 'react';
+import { useNavigate } from 'react-router-dom';
import { useTranslation } from 'react-i18next';
import { Button } from '@/components/ui/button';
+import { useShellDock } from '../contexts/ShellDockContext';
import { useWalkthroughs } from '../contexts/walkthroughContextValue';
import { getWalkthroughProgress } from '../services/walkthroughState';
import Pill from './ds/Pill';
-import IconButton from './IconButton';
-
+import ShellDockTabs from './ShellDockTabs';
const ICONS = { service: Boxes, security: ShieldCheck };
-function WalkthroughCard({ walkthrough, state, onStart, t }) {
- const Icon = ICONS[walkthrough.icon] || BookOpenCheck;
- const progress = getWalkthroughProgress(state, walkthrough);
- const status = progress.entry?.status;
- const completed = status === 'completed';
- const active = status === 'active';
-
+// Recipes console — the prototype's guided-walkthrough surface: a library of
+// recipe cards, and for the running recipe a split view with the step rail on
+// the left and one step's story + deep-link action on the right. The engine
+// (auto-completion via routes/signals/checks, saved progress) is untouched;
+// only the shell changed from a floating card stack to the docked console.
+function RecipeLibrary({ walkthroughs, state, onStart, onStop, t }) {
return (
- <article className={`walkthrough-card walkthrough-card--${walkthrough.tone}`}>
- <div className="walkthrough-card__icon"><Icon size={18} /></div>
- <div className="walkthrough-card__body">
- <div className="walkthrough-card__meta">
- <span><Clock3 size={12} /> {walkthrough.duration}</span>
- {completed && <Pill kind="green">{t('app.walkthroughs.completed', 'Completed')}</Pill>}
- {active && <Pill kind="cyan">{progress.count}/{progress.total}</Pill>}
- </div>
- <h3>{walkthrough.title}</h3>
- <p>{walkthrough.description}</p>
- <Button
- type="button"
- variant={active ? 'default' : 'outline'}
- size="sm"
- onClick={() => onStart(walkthrough.id)}
- >
- {completed ? <RotateCcw size={14} /> : <ArrowRight size={14} />}
- {completed
- ? t('app.walkthroughs.runAgain', 'Run again')
- : active
- ? t('app.walkthroughs.resume', 'Resume')
- : t('app.walkthroughs.start', 'Start walkthrough')}
- </Button>
- </div>
- </article>
- );
-}
-
-function ActiveWalkthrough({ walkthrough, progress, currentStep, onBrowse, t }) {
- const {
- checkCurrent,
- dismiss,
- goToCurrent,
- } = useWalkthroughs();
- const Icon = ICONS[walkthrough.icon] || BookOpenCheck;
- const [checking, setChecking] = useState(false);
-
- const performAction = async () => {
- if (!currentStep?.check) {
- goToCurrent();
- return;
- }
- setChecking(true);
- try { await checkCurrent(); } finally { setChecking(false); }
- };
-
- return (
- <>
- <header className="walkthrough-hub__active-head">
- <Button type="button" variant="ghost" size="sm" onClick={onBrowse}>
- <ChevronLeft size={14} /> {t('app.walkthroughs.allGuides', 'All guides')}
- </Button>
- <div className={`walkthrough-hub__active-icon is-${walkthrough.tone}`}><Icon size={19} /></div>
- <span className="walkthrough-hub__eyebrow">
- {t('app.walkthroughs.guidedOutcome', 'Guided outcome')}
- </span>
- <h2>{walkthrough.title}</h2>
- <div className="walkthrough-hub__progress-copy">
- <span>{t('app.walkthroughs.stepCount', 'Step {{current}} of {{total}}', {
- current: Math.min(progress.count + 1, progress.total),
- total: progress.total,
- })}</span>
- <strong>{progress.percent}%</strong>
- </div>
- <progress max="100" value={progress.percent} aria-label={t('app.walkthroughs.progress', 'Walkthrough progress')} />
- </header>
-
- <ol className="walkthrough-hub__steps">
- {walkthrough.steps.map((step, index) => {
- const done = progress.completed.includes(step.id);
- const current = currentStep?.id === step.id;
- return (
- <li
- key={step.id}
- className={`${done ? 'is-done' : ''}${current ? ' is-current' : ''}`}
- aria-current={current ? 'step' : undefined}
+ <div className="shell-recipes__grid">
+ {walkthroughs.map((walkthrough) => {
+ const Icon = ICONS[walkthrough.icon] || BookOpenCheck;
+ const progress = getWalkthroughProgress(state, walkthrough);
+ const status = progress.entry?.status;
+ const active = status === 'active';
+ const completed = status === 'completed';
+ return (
+ <div key={walkthrough.id} className={`shell-recipes__card${active ? ' is-active' : ''}`}>
+ <button
+ type="button"
+ className="shell-recipes__card-hit"
+ onClick={() => onStart(walkthrough.id)}
>
- <span className="walkthrough-hub__step-marker">
- {done ? <Check size={13} /> : current ? <Circle size={11} /> : index + 1}
- </span>
- <div>
- <strong>{step.title}</strong>
- {(current || done) && <p>{step.description}</p>}
- </div>
- </li>
- );
- })}
- </ol>
-
- {currentStep && (
- <div className="walkthrough-hub__next">
- <span>{t('app.walkthroughs.now', 'Now')}</span>
- <strong>{currentStep.title}</strong>
- <p>{currentStep.description}</p>
- <Button type="button" onClick={performAction} disabled={checking}>
- {checking
- ? t('common.checking', 'Checking…')
- : currentStep.action}
- {!checking && <ArrowRight size={15} />}
- </Button>
- </div>
- )}
-
- <footer className="walkthrough-hub__footer">
- <span>{t('app.walkthroughs.progressSaved', 'Progress is saved to your account.')}</span>
- <Button type="button" variant="ghost" size="sm" onClick={() => dismiss(walkthrough.id)}>
- {t('app.walkthroughs.stop', 'Stop walkthrough')}
- </Button>
- </footer>
- </>
+ <span className={`shell-recipes__card-icon is-${walkthrough.tone}`}><Icon size={16} /></span>
+ <span className="shell-recipes__card-name">{walkthrough.title}</span>
+ <span className="shell-recipes__card-desc">{walkthrough.description}</span>
+ </button>
+ <span className="shell-recipes__card-meta mono">
+ <Clock3 size={11} aria-hidden="true" />
+ {t('app.walkthroughs.stepsMeta', '{{count}} steps · {{duration}}', {
+ count: walkthrough.steps.length,
+ duration: walkthrough.duration,
+ })}
+ {completed && <Pill kind="green">{t('app.walkthroughs.completed', 'Completed')}</Pill>}
+ {active && <Pill kind="cyan">{progress.count}/{progress.total}</Pill>}
+ {active && (
+ <button
+ type="button"
+ className="shell-recipes__card-stop"
+ onClick={() => onStop(walkthrough.id)}
+ >
+ <Square size={10} aria-hidden="true" /> {t('app.walkthroughs.stopShort', 'Stop')}
+ </button>
+ )}
+ </span>
+ </div>
+ );
+ })}
+ </div>
);
}
-export default function WalkthroughHub({ hideLauncher = false, statusbarMode = false }) {
+export default function WalkthroughHub() {
const { t } = useTranslation();
+ const navigate = useNavigate();
+ const { activeTab, expanded } = useShellDock();
const {
state,
- open,
- setOpen,
walkthroughs,
activeWalkthrough,
activeProgress,
currentStep,
start,
+ dismiss,
+ completeStep,
+ checkCurrent,
} = useWalkthroughs();
const [browse, setBrowse] = useState(false);
+ const [viewStepId, setViewStepId] = useState(null);
+ const [checking, setChecking] = useState(false);
- const showActive = activeWalkthrough && !browse;
- const completedCount = walkthroughs.filter(
- (walkthrough) => state.progress?.[walkthrough.id]?.status === 'completed',
- ).length;
+ // Follow the walkthrough that is running: switching recipes resets the
+ // step selection back to "wherever the engine is".
+ useEffect(() => {
+ setViewStepId(null);
+ setBrowse(false);
+ }, [activeWalkthrough?.id]);
+
+ const steps = activeWalkthrough?.steps || [];
+ const viewStep = useMemo(() => {
+ const chosen = steps.find((step) => step.id === viewStepId);
+ return chosen || currentStep || steps[steps.length - 1] || null;
+ }, [currentStep, steps, viewStepId]);
+ const viewIndex = viewStep ? steps.indexOf(viewStep) : -1;
+
+ if (activeTab !== 'recipes') return null;
+
+ const showLibrary = !activeWalkthrough || browse;
+ const completedSteps = activeProgress?.completed || [];
+ const isDone = viewStep ? completedSteps.includes(viewStep.id) : false;
+ const isCurrent = viewStep && currentStep && viewStep.id === currentStep.id;
+ const isLast = viewIndex === steps.length - 1;
+
+ const runAction = async () => {
+ if (!viewStep) return;
+ // Verification steps (e.g. 2FA) run the live check instead of a jump;
+ // every other step deep-links to the page that hosts the work, with
+ // the console staying open underneath.
+ if (viewStep.check && isCurrent) {
+ setChecking(true);
+ try { await checkCurrent(); } finally { setChecking(false); }
+ return;
+ }
+ if (viewStep.path) navigate(viewStep.path);
+ };
- const launch = () => {
- setBrowse(!activeWalkthrough);
- setOpen(!open);
+ const markDoneNext = () => {
+ if (!activeWalkthrough || !viewStep) return;
+ completeStep(activeWalkthrough.id, viewStep.id);
+ setViewStepId(null);
};
- const selectWalkthrough = (id) => {
+ const startRecipe = (id) => {
start(id);
setBrowse(false);
+ setViewStepId(null);
};
return (
- <div className={`walkthrough-shell${statusbarMode ? ' walkthrough-shell--statusbar' : ''}${open ? ' is-open' : ''}`}>
- {!hideLauncher && <Button
- type="button"
- className="walkthrough-shell__launcher"
- variant="outline"
- onClick={launch}
- aria-expanded={open}
- aria-controls="walkthrough-hub"
- >
- <BookOpenCheck size={16} />
- <span>{activeWalkthrough
- ? t('app.walkthroughs.activeGuide', 'Guide · {{count}}/{{total}}', {
- count: activeProgress.count,
- total: activeProgress.total,
- })
- : t('app.walkthroughs.guides', 'Guides')}</span>
- </Button>}
-
- {open && (
- <aside id="walkthrough-hub" className="walkthrough-hub" aria-label={t('app.walkthroughs.guides', 'Guides')}>
- <div className="walkthrough-hub__topline">
- <span><ListChecks size={14} /> {t('app.walkthroughs.operatorGuides', 'Operator guides')}</span>
- <IconButton
- icon={<X size={15} />}
- label={t('common.actions.close', 'Close')}
- onClick={() => setOpen(false)}
- />
- </div>
+ <section
+ className={`shell-panel shell-recipes${expanded ? ' is-expanded' : ''}`}
+ aria-label={t('app.walkthroughs.recipes', 'Recipes')}
+ >
+ <header className="shell-panel__head">
+ <ShellDockTabs />
+ </header>
- {showActive ? (
- <ActiveWalkthrough
- walkthrough={activeWalkthrough}
- progress={activeProgress}
- currentStep={currentStep}
- onBrowse={() => setBrowse(true)}
- t={t}
- />
- ) : (
- <div className="walkthrough-hub__library">
- <header>
- <span className="walkthrough-hub__eyebrow">
- {t('app.walkthroughs.learnByDoing', 'Learn by doing')}
- </span>
- <h2>{t('app.walkthroughs.makeTheNextMove', 'Make the next move')}</h2>
- <p>{t(
- 'app.walkthroughs.libraryDescription',
- 'Walkthroughs guide the controls. Recipes automate the server work underneath.',
- )}</p>
- <span className="walkthrough-hub__library-count">
- {t('app.walkthroughs.completedCount', '{{count}} of {{total}} completed', {
- count: completedCount,
- total: walkthroughs.length,
+ {showLibrary ? (
+ <RecipeLibrary
+ walkthroughs={walkthroughs}
+ state={state}
+ onStart={startRecipe}
+ onStop={(id) => dismiss(id)}
+ t={t}
+ />
+ ) : (
+ <div className="shell-recipes__split">
+ <div className="shell-recipes__rail">
+ <div className="shell-recipes__railhead">
+ <div className="shell-recipes__railtitle">
+ <strong>{activeWalkthrough.title}</strong>
+ <span className="mono">
+ {t('app.walkthroughs.doneCount', '{{count}} of {{total}} done', {
+ count: activeProgress?.count || 0,
+ total: activeProgress?.total || steps.length,
})}
</span>
- </header>
- <div className="walkthrough-hub__cards">
- {walkthroughs.map((walkthrough) => (
- <WalkthroughCard
- key={walkthrough.id}
- walkthrough={walkthrough}
- state={state}
- onStart={selectWalkthrough}
- t={t}
- />
- ))}
</div>
+ <Button type="button" variant="ghost" size="sm" onClick={() => setBrowse(true)}>
+ {t('app.walkthroughs.allRecipes', 'All recipes')}
+ </Button>
+ </div>
+ <div className="shell-recipes__steps" role="tablist" aria-label={activeWalkthrough.title}>
+ {steps.map((step, index) => {
+ const done = completedSteps.includes(step.id);
+ const viewing = viewStep && step.id === viewStep.id;
+ return (
+ <button
+ key={step.id}
+ type="button"
+ role="tab"
+ aria-selected={viewing}
+ className={`shell-recipes__step${viewing ? ' is-viewing' : ''}${done ? ' is-done' : ''}`}
+ onClick={() => setViewStepId(step.id)}
+ >
+ <span className="shell-recipes__step-marker">
+ {done ? <Check size={12} /> : <span className="mono">{index + 1}</span>}
+ </span>
+ <span className="shell-recipes__step-title">{step.title}</span>
+ </button>
+ );
+ })}
+ </div>
+ </div>
+
+ {viewStep && (
+ <div className="shell-recipes__detail">
+ <div className="shell-recipes__eyebrow mono">
+ {t('app.walkthroughs.stepCount', 'Step {{current}} of {{total}}', {
+ current: viewIndex + 1,
+ total: steps.length,
+ })}
+ </div>
+ <h3 className="shell-recipes__step-heading">{viewStep.title}</h3>
+ <p className="shell-recipes__body">{viewStep.description}</p>
+ <footer className="shell-recipes__foot">
+ <Button type="button" size="sm" onClick={runAction} disabled={checking}>
+ {checking ? t('common.checking', 'Checking…') : viewStep.action}
+ </Button>
+ {!viewStep.check && !isDone && (
+ <Button type="button" variant="outline" size="sm" onClick={markDoneNext}>
+ {isLast
+ ? t('app.walkthroughs.markDone', 'Mark done')
+ : t('app.walkthroughs.doneNextStep', 'Done · next step')}
+ </Button>
+ )}
+ <span className="shell-panel__spacer" />
+ <Button
+ type="button"
+ variant="ghost"
+ size="sm"
+ disabled={viewIndex <= 0}
+ onClick={() => setViewStepId(steps[Math.max(0, viewIndex - 1)]?.id)}
+ >
+ {t('common.actions.back', 'Back')}
+ </Button>
+ </footer>
</div>
)}
- </aside>
+ </div>
)}
- </div>
+ </section>
);
}
diff --git a/frontend/src/contexts/ShellDockContext.jsx b/frontend/src/contexts/ShellDockContext.jsx
new file mode 100644
index 00000000..16d53fe1
--- /dev/null
+++ b/frontend/src/contexts/ShellDockContext.jsx
@@ -0,0 +1,81 @@
+import {
+ createContext, useCallback, useContext, useEffect, useMemo, useState,
+} from 'react';
+
+import { useOperations } from './OperationsContext';
+import { useServerkitAI } from './AIContext';
+import { useWalkthroughs } from './walkthroughContextValue';
+
+// One console, four tabs (Operations · Alerts · Recipes · Assistant), exactly
+// one visible at a time — the prototype's bottom-edge console. Open state for
+// three of the tabs already lives in feature contexts that pages drive
+// directly (e.g. "Ask AI" buttons call useServerkitAI().open()), so this
+// provider doesn't own their state: it derives the active tab and flips the
+// underlying contexts in concert. Priority on conflicting opens: assistant >
+// recipes > operations — closing the winner reveals the panel underneath.
+const ShellDockContext = createContext(null);
+
+export function ShellDockProvider({ children }) {
+ const { collapsed, setCollapsed } = useOperations();
+ const { isOpen: assistantOpen, open: openAssistant, close: closeAssistant } = useServerkitAI();
+ const { open: recipesOpen, setOpen: setRecipesOpen } = useWalkthroughs();
+ const [alertsOpen, setAlertsOpen] = useState(false);
+ const [expanded, setExpanded] = useState(false);
+
+ const activeTab = assistantOpen
+ ? 'assistant'
+ : recipesOpen
+ ? 'recipes'
+ : !collapsed
+ ? 'ops'
+ : alertsOpen
+ ? 'alerts'
+ : null;
+
+ const openTab = useCallback((tab) => {
+ setCollapsed(tab !== 'ops');
+ setRecipesOpen(tab === 'recipes');
+ setAlertsOpen(tab === 'alerts');
+ if (tab === 'assistant') openAssistant();
+ else closeAssistant();
+ }, [closeAssistant, openAssistant, setCollapsed, setRecipesOpen]);
+
+ const close = useCallback(() => openTab(null), [openTab]);
+
+ const toggleTab = useCallback((tab) => {
+ openTab(activeTab === tab ? null : tab);
+ }, [activeTab, openTab]);
+
+ // Escape closes the console. The assistant and any open dialog handle
+ // their own Escape first (focus trap / Radix preventDefault), so only act
+ // on unclaimed presses outside text inputs.
+ useEffect(() => {
+ if (!activeTab || activeTab === 'assistant') return undefined;
+ const onKeyDown = (event) => {
+ if (event.key !== 'Escape' || event.defaultPrevented) return;
+ const target = document.activeElement;
+ const tag = target?.tagName;
+ if (tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT' || target?.isContentEditable) return;
+ close();
+ };
+ window.addEventListener('keydown', onKeyDown);
+ return () => window.removeEventListener('keydown', onKeyDown);
+ }, [activeTab, close]);
+
+ const value = useMemo(() => ({
+ activeTab,
+ openTab,
+ toggleTab,
+ close,
+ expanded,
+ setExpanded,
+ }), [activeTab, close, expanded, openTab, toggleTab]);
+
+ return <ShellDockContext.Provider value={value}>{children}</ShellDockContext.Provider>;
+}
+
+export function useShellDock() {
+ const context = useContext(ShellDockContext);
+ if (!context) throw new Error('useShellDock must be used within ShellDockProvider');
+ return context;
+}
diff --git a/frontend/src/layouts/DashboardLayout.jsx b/frontend/src/layouts/DashboardLayout.jsx
index 3487dd88..46c03735 100644
--- a/frontend/src/layouts/DashboardLayout.jsx
+++ b/frontend/src/layouts/DashboardLayout.jsx
@@ -20,6 +20,7 @@ import { useShortcut } from '../hooks/useShortcut';
import { useTranslation } from 'react-i18next';
import { OperationsProvider } from '../contexts/OperationsContext';
import { WalkthroughProvider } from '../contexts/WalkthroughContext';
+import { ShellDockProvider } from '../contexts/ShellDockContext';
import WalkthroughHub from '../components/WalkthroughHub';
import GlobalStatusBar from '../components/GlobalStatusBar';
@@ -100,12 +101,22 @@ const DashboardLayout = () => {
ensureContributions();
}, []);
+ // The sidebar "+" (QuickCreate) opens the palette. It lives outside this
+ // component's state, so it asks via a window event rather than prop
+ // drilling through Sidebar.
+ useEffect(() => {
+ const openPalette = () => setPaletteOpen(true);
+ window.addEventListener('serverkit:open-palette', openPalette);
+ return () => window.removeEventListener('serverkit:open-palette', openPalette);
+ }, []);
+
return (
<OperationsProvider>
<LogsDrawerProvider>
<AIProvider>
<ConfirmProvider>
<WalkthroughProvider>
+ <ShellDockProvider>
<div className="dashboard-layout">
<StagingBanner />
<MobileTopBar navOpen={navOpen} onToggle={() => setNavOpen(prev => !prev)} />
@@ -134,6 +145,7 @@ const DashboardLayout = () => {
<GlobalStatusBar onOpenPalette={() => setPaletteOpen(true)} />
<PluginLoader api={api} />
</div>
+ </ShellDockProvider>
</WalkthroughProvider>
</ConfirmProvider>
</AIProvider>
diff --git a/frontend/src/styles/components/_global-statusbar.scss b/frontend/src/styles/components/_global-statusbar.scss
index 224c279e..0c7de502 100644
--- a/frontend/src/styles/components/_global-statusbar.scss
+++ b/frontend/src/styles/components/_global-statusbar.scss
@@ -114,11 +114,12 @@
}
.statusbar-select {
- position: relative;
cursor: pointer;
+ @include focus-ring();
+
+ &:hover { color: var(--text-dim); background: var(--surface-3); }
- &:hover,
- &:focus-within { color: var(--text-dim); background: var(--surface-3); }
+ &.is-open { color: var(--text); background: var(--surface-3); }
&--workspace { color: var(--text-dim); }
@@ -130,15 +131,107 @@
}
> svg:last-of-type { opacity: 0.58; }
+}
- select {
- position: absolute;
- inset: 0;
+// Anchor wrapper: the trigger stays in the bar's flex row, the menu floats
+// above it. Both scope menus share the anchor class so one outside-click
+// listener can tell "inside a popover" from "anywhere else".
+.statusbar-popover {
+ position: relative;
+ display: inline-flex;
+ min-width: 0;
+}
+
+// Prototype env-menu, themed: dark card, dot · name · meta rows, check on the
+// current row. Replaces the native select popup that ignored the theme.
+.statusbar-menu {
+ position: absolute;
+ inset-block-end: calc(100% + 8px);
+ inset-inline-start: 0;
+ z-index: 2;
+ min-width: 280px;
+ max-height: min(46vh, 380px);
+ overflow-y: auto;
+ padding: 5px;
+ border: 1px solid var(--border-strong);
+ border-radius: 12px;
+ background: var(--surface-2);
+ box-shadow: var(--shadow-lg);
+ animation: statusbar-menu-enter 140ms ease-out;
+
+ &--wide { min-width: 308px; }
+
+ &__head {
+ padding: 7px 10px 5px;
+ color: var(--text-ghost);
+ font-size: 10px;
+ font-weight: $font-weight-medium;
+ letter-spacing: 0.12em;
+ text-transform: uppercase;
+ }
+
+ &__option {
+ display: flex;
+ align-items: center;
width: 100%;
- height: 100%;
- opacity: 0;
+ gap: 11px;
+ padding: 9px 10px;
+ border: 0;
+ border-radius: 9px;
+ background: transparent;
+ color: var(--text);
+ font: inherit;
+ text-align: start;
cursor: pointer;
+ transition: background-color 100ms ease;
+ @include focus-ring();
+
+ &:hover { background: var(--surface-3); }
+ }
+
+ &__swatch {
+ width: 9px;
+ height: 9px;
+ flex: 0 0 auto;
+ border-radius: 50%;
+ background: var(--accent);
+
+ &.is-ghost { background: var(--text-ghost); }
+ &.is-online { background: var(--green); box-shadow: 0 0 6px var(--green); }
+ &.is-idle { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
+ &.is-down { background: var(--red); box-shadow: 0 0 6px var(--red); }
}
+
+ &__copy {
+ display: flex;
+ min-width: 0;
+ flex: 1;
+ flex-direction: column;
+ }
+
+ &__name {
+ overflow: hidden;
+ font-size: 13px;
+ font-weight: 550;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+
+ &__meta {
+ margin-block-start: 1px;
+ color: var(--text-faint);
+ font-size: 10.5px;
+ }
+
+ &__check {
+ flex: 0 0 auto;
+ color: var(--accent-bright);
+ }
+}
+
+@keyframes statusbar-menu-enter {
+ from { opacity: 0; transform: translateY(5px); }
+ to { opacity: 1; transform: none; }
}
// Shared bottom panel shell (Alerts; Operations and Recipes receive matching
@@ -158,41 +251,50 @@
box-shadow: 0 -20px 45px rgba(0, 0, 0, 0.18);
animation: shell-panel-enter 160ms ease-out;
+ &.is-expanded { height: min(62vh, 720px); }
+
&__head,
&__footer,
- &__tabs {
+ &__filters {
display: flex;
align-items: center;
}
&__head {
- min-height: 39px;
+ min-height: 38px;
flex: 0 0 auto;
gap: $space-2;
- padding-inline: $space-2;
+ padding-inline: 8px 8px;
border-block-end: 1px solid var(--border-soft);
}
- &__tabs { gap: 2px; }
+ // Secondary row under the shared tab strip: per-panel view filters plus
+ // panel-scoped actions (prototype cp-filters).
+ &__filters {
+ flex: 0 0 auto;
+ gap: 2px;
+ padding: 6px 8px;
+ border-block-end: 1px solid var(--border-soft);
+ }
- &__tabs button,
- &__action,
- &__close {
- min-height: 26px;
+ &__filters button,
+ &__action {
+ min-height: 22px;
border: 0;
border-radius: $radius-sm;
background: transparent;
- color: var(--text-faint);
+ color: var(--text-ghost);
font-size: $font-size-xs;
+ white-space: nowrap;
cursor: pointer;
@include focus-ring();
- &:hover { color: var(--text); background: var(--surface-2); }
+ &:hover { color: var(--text-dim); background: var(--surface-2); }
}
- &__tabs button {
- padding-inline: $space-3;
- &.is-active { color: var(--text); background: var(--surface-3); }
+ &__filters button {
+ padding-inline: $space-2;
+ &.is-active { color: var(--text-dim); background: var(--surface-3); }
}
&__action {
@@ -200,12 +302,7 @@
align-items: center;
gap: $space-1;
padding-inline: $space-2;
- }
-
- &__close {
- display: grid;
- width: 28px;
- place-items: center;
+ color: var(--text-faint);
}
&__spacer { flex: 1; }
@@ -238,6 +335,70 @@
}
}
+// The console's shared header strip: the four surface tabs plus the
+// expand/close controls. Rendered by every panel so switching consoles feels
+// like flipping tabs on one panel (prototype cp-head/cp-tabs).
+.shell-dock-tabs {
+ display: flex;
+ align-items: center;
+ flex: 1;
+ min-width: 0;
+ gap: 2px;
+
+ &__tab {
+ display: inline-flex;
+ align-items: center;
+ gap: 7px;
+ height: 26px;
+ padding: 0 10px;
+ border: 0;
+ border-radius: 6px;
+ background: transparent;
+ color: var(--text-faint);
+ font-size: 12.5px;
+ white-space: nowrap;
+ cursor: pointer;
+ transition: color 120ms ease, background-color 120ms ease;
+ @include focus-ring();
+
+ &:hover { color: var(--text-dim); background: var(--surface-2); }
+ &.is-active { color: var(--text); background: var(--surface-3); }
+ }
+
+ &__badge {
+ padding: 1px 5px;
+ border-radius: 20px;
+ font-size: 10px;
+ @include status-variant(var(--accent-bright), var(--accent-bg));
+ }
+
+ &__spacer { flex: 1; min-width: $space-2; }
+
+ &__control {
+ display: grid;
+ width: 26px;
+ height: 26px;
+ flex: 0 0 auto;
+ place-items: center;
+ border: 0;
+ border-radius: 6px;
+ background: transparent;
+ color: var(--text-faint);
+ cursor: pointer;
+ @include focus-ring();
+
+ &:hover { color: var(--text); background: var(--surface-3); }
+ }
+
+ // The refresh IconButton passed in as a control matches the square look.
+ .icon-button {
+ width: 26px;
+ height: 26px;
+ border: 0;
+ background: transparent;
+ }
+}
+
.shell-alerts {
&__list {
flex: 1;
@@ -342,44 +503,28 @@
animation: shell-panel-enter 160ms ease-out;
}
- .operations-dock__header { grid-area: header; min-height: 39px; padding-block: $space-1; }
+ .operations-dock__panel.is-expanded { height: min(62vh, 720px); }
+
+ .operations-dock__header {
+ grid-area: header;
+ min-height: 38px;
+ padding: 0 8px;
+ border-block-end: 1px solid var(--border-soft);
+ }
.operations-dock__tabs { grid-area: tabs; }
.operations-dock__list { grid-area: list; border-inline-end: 1px solid var(--border-soft); border-block-end: 0; }
.operations-dock__detail { grid-area: detail; }
}
-// Operator walkthroughs become Recipes in the bottom bar. The established
-// walkthrough engine and saved progress stay intact; only its shell changes.
-.walkthrough-shell.walkthrough-shell--statusbar {
- inset-inline: $sidebar-width 0;
- inset-block-end: var(--sk-statusbar-height);
- z-index: $z-shell-panel;
-
- .walkthrough-hub {
- position: static;
- width: 100%;
- height: min(360px, 60vh);
- max-height: none;
- border: 0;
- border-block-start: 1px solid var(--border-strong);
- border-radius: 0;
- box-shadow: 0 -20px 45px rgba(0, 0, 0, 0.18);
- }
-
- .walkthrough-hub__library { flex: 1; }
- .walkthrough-hub__cards { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
-}
-
// Leave the shared shell edge visible while the assistant is docked right.
.dashboard-layout .sk-ai-drawer {
inset-block-end: var(--sk-statusbar-height);
}
-// Reserve the bottom edge for the status bar on every shell variant.
-.dashboard-layout .sidebar {
- height: calc(100vh - var(--sk-statusbar-height));
-}
-
+// The status bar spans only the content column (inset-inline starts at the
+// sidebar edge), so the sidebar keeps its full 100vh height — shortening it
+// here left a dead 30px hole under the user card. Mobile is different: the
+// bar goes full-width there, so the drawer override below still applies.
.dashboard-layout .main-content {
padding-block-end: calc(#{$space-10} + var(--sk-statusbar-height));
@@ -395,8 +540,7 @@
[data-layout='rail'] {
.global-statusbar,
.shell-panel,
- .operations-dock.operations-dock--statusbar,
- .walkthrough-shell.walkthrough-shell--statusbar {
+ .operations-dock.operations-dock--statusbar {
inset-inline-start: $sidebar-rail-width;
}
}
@@ -404,8 +548,7 @@
[data-layout='topbar'] {
.global-statusbar,
.shell-panel,
- .operations-dock.operations-dock--statusbar,
- .walkthrough-shell.walkthrough-shell--statusbar {
+ .operations-dock.operations-dock--statusbar {
inset-inline-start: 0;
}
@@ -422,8 +565,7 @@
.global-statusbar,
.shell-panel,
- .operations-dock.operations-dock--statusbar,
- .walkthrough-shell.walkthrough-shell--statusbar {
+ .operations-dock.operations-dock--statusbar {
inset-inline: 0;
}
@@ -460,13 +602,8 @@
border-block-end: 1px solid var(--border-soft);
}
- .walkthrough-shell.walkthrough-shell--statusbar .walkthrough-hub,
.shell-panel { height: min(68vh, 620px); }
- .walkthrough-shell.walkthrough-shell--statusbar .walkthrough-hub__cards {
- grid-template-columns: 1fr;
- }
-
.dashboard-layout .sidebar { height: calc(100dvh - var(--sk-statusbar-height)); }
.dashboard-layout .main-content {
@@ -487,6 +624,5 @@
@media (prefers-reduced-motion: reduce) {
.shell-panel,
- .operations-dock.operations-dock--statusbar .operations-dock__panel,
- .walkthrough-shell.walkthrough-shell--statusbar .walkthrough-hub { animation: none; }
+ .operations-dock.operations-dock--statusbar .operations-dock__panel { animation: none; }
}
diff --git a/frontend/src/styles/components/_walkthroughs.scss b/frontend/src/styles/components/_walkthroughs.scss
index 5659b84d..2c5277e0 100644
--- a/frontend/src/styles/components/_walkthroughs.scss
+++ b/frontend/src/styles/components/_walkthroughs.scss
@@ -1,338 +1,264 @@
-// Guided outcomes — a compact operator field manual beside the page, not a
-// modal tour that blocks the controls it is trying to teach.
-.walkthrough-shell {
- position: fixed;
- inset-inline-start: calc(#{$sidebar-width} + 168px);
- inset-block-end: $space-4;
- z-index: 1060;
- font-family: $font-main;
-
- &.is-open { z-index: 1120; }
-
- &__launcher {
- min-height: 42px;
- gap: $space-2;
- border-color: var(--border-strong);
- border-radius: 999px;
- background: var(--surface);
- color: var(--text);
- box-shadow: $shadow-lg;
-
- svg { color: var(--amber); }
+// Recipes console (walkthrough engine UI). Docked into the shared shell
+// console above the status bar — geometry comes from .shell-panel; this file
+// owns the recipe library grid and the running recipe's split layout.
+
+.shell-recipes {
+ // Library — recipe cards (prototype rc-grid/rc-card).
+ &__grid {
+ display: grid;
+ flex: 1;
+ grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
+ gap: 10px;
+ align-content: start;
+ overflow-y: auto;
+ padding: 12px;
}
-}
-.walkthrough-hub {
- position: absolute;
- inset-inline-start: 0;
- inset-block-end: 0;
- display: flex;
- flex-direction: column;
- width: min(390px, calc(100vw - #{$sidebar-width} - #{$space-8}));
- max-height: min(760px, calc(100vh - #{$space-8}));
- overflow: hidden;
- border: 1px solid var(--border-strong);
- border-radius: $radius-lg;
- background:
- linear-gradient(var(--border-soft) 1px, transparent 1px),
- linear-gradient(90deg, var(--border-soft) 1px, transparent 1px),
- var(--surface);
- background-size: 24px 24px;
- box-shadow: $shadow-lg;
- animation: walkthrough-enter 180ms ease-out;
-
- &__topline {
+ &__card {
display: flex;
- align-items: center;
- justify-content: space-between;
- min-height: 45px;
- padding: $space-2 $space-3 $space-2 $space-4;
- border-bottom: 1px solid var(--border-strong);
- background: color-mix(in srgb, var(--surface) 94%, transparent);
-
- > span {
- display: inline-flex;
- align-items: center;
- gap: $space-2;
- color: var(--text-faint);
- font-family: var(--mono);
- font-size: 10px;
- font-weight: $font-weight-semibold;
- letter-spacing: 0.11em;
- text-transform: uppercase;
- }
+ flex-direction: column;
+ border: 1px solid var(--border-soft);
+ border-radius: 11px;
+ background: var(--surface-2);
+ transition: border-color 130ms ease;
+
+ &:hover { border-color: var(--accent-dim); }
+ &.is-active { border-color: var(--accent-dim); }
}
- &__eyebrow {
- color: var(--amber);
- font-family: var(--mono);
- font-size: 10px;
- font-weight: $font-weight-semibold;
- letter-spacing: 0.13em;
- text-transform: uppercase;
+ &__card-hit {
+ display: flex;
+ flex: 1;
+ flex-direction: column;
+ align-items: flex-start;
+ padding: 13px 13px 0;
+ border: 0;
+ background: transparent;
+ color: inherit;
+ font: inherit;
+ text-align: start;
+ cursor: pointer;
+ @include focus-ring();
}
- &__library,
- &__steps {
- overflow-y: auto;
- overscroll-behavior: contain;
+ &__card-icon {
+ display: grid;
+ width: 28px;
+ height: 28px;
+ margin-block-end: 10px;
+ place-items: center;
+ border-radius: 8px;
+ @include status-variant(var(--accent-bright), var(--accent-bg));
+
+ &.is-cyan { color: var(--cyan); background: color-mix(in srgb, var(--cyan) 13%, transparent); }
+ &.is-amber { color: var(--amber); background: color-mix(in srgb, var(--amber) 13%, transparent); }
}
- &__library {
- padding: $space-5;
- background: color-mix(in srgb, var(--surface) 97%, transparent);
+ &__card-name {
+ font-size: 13px;
+ font-weight: 550;
+ }
- > header {
- padding: $space-1 0 $space-5;
- border-bottom: 1px solid var(--border-soft);
- }
+ &__card-desc {
+ margin-block-start: 3px;
+ color: var(--text-faint);
+ font-size: 11.5px;
+ line-height: 1.5;
+ }
- h2 {
- margin: $space-2 0 $space-2;
- color: var(--text);
- font-size: 1.35rem;
- letter-spacing: -0.025em;
- }
+ &__card-meta {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ padding: 9px 13px 12px;
+ color: var(--text-faint);
+ font-size: 10.5px;
- p {
- max-width: 34ch;
- margin: 0;
- color: var(--text-muted);
- font-size: $font-size-sm;
- line-height: 1.55;
- }
+ svg { flex: 0 0 auto; }
}
- &__library-count {
- display: inline-block;
- margin-top: $space-3;
+ &__card-stop {
+ display: inline-flex;
+ align-items: center;
+ gap: 4px;
+ margin-inline-start: auto;
+ padding: 2px 7px;
+ border: 0;
+ border-radius: 6px;
+ background: transparent;
color: var(--text-faint);
- font-family: var(--mono);
- font-size: 10px;
+ font: inherit;
+ cursor: pointer;
+ @include focus-ring();
+
+ &:hover { color: var(--red); background: var(--red-bg); }
}
- &__cards {
- display: grid;
- gap: $space-3;
- padding-top: $space-4;
+ // Running recipe — step rail left, story right (prototype cp-split).
+ &__split {
+ display: flex;
+ flex: 1;
+ min-height: 0;
}
- &__active-head {
- position: relative;
- padding: $space-3 $space-5 $space-5;
- border-bottom: 1px solid var(--border-strong);
- background: color-mix(in srgb, var(--surface) 96%, transparent);
+ &__rail {
+ display: flex;
+ width: 344px;
+ flex: 0 0 auto;
+ flex-direction: column;
+ min-height: 0;
+ border-inline-end: 1px solid var(--border-soft);
+ }
- > .btn { margin-inline-start: -$space-3; margin-bottom: $space-4; }
+ &__railhead {
+ display: flex;
+ flex: 0 0 auto;
+ align-items: center;
+ gap: 10px;
+ padding: 9px 10px 9px 12px;
+ border-block-end: 1px solid var(--border-soft);
+ }
- h2 {
- max-width: 16ch;
- margin: $space-2 0 $space-4;
- color: var(--text);
- font-size: 1.28rem;
- line-height: 1.15;
- letter-spacing: -0.025em;
- }
+ &__railtitle {
+ display: flex;
+ min-width: 0;
+ flex: 1;
+ flex-direction: column;
- progress {
- display: block;
- width: 100%;
- height: 5px;
+ strong {
overflow: hidden;
- border: 0;
- border-radius: 999px;
- background: var(--surface-3);
- color: var(--amber);
- appearance: none;
-
- &::-webkit-progress-bar { background: var(--surface-3); }
- &::-webkit-progress-value { background: var(--amber); }
- &::-moz-progress-bar { background: var(--amber); }
+ font-size: 12.5px;
+ font-weight: 550;
+ text-overflow: ellipsis;
+ white-space: nowrap;
}
- }
- &__active-icon {
- position: absolute;
- inset-inline-end: $space-5;
- inset-block-start: 58px;
- display: grid;
- width: 40px;
- height: 40px;
- place-items: center;
- border: 1px solid var(--border-strong);
- border-radius: $radius-md;
- background: var(--surface-2);
+ .mono {
+ margin-block-start: 2px;
+ color: var(--text-faint);
+ font-size: 10.5px;
+ }
+ }
- &.is-cyan { color: var(--cyan); }
- &.is-amber { color: var(--amber); }
+ &__steps {
+ flex: 1;
+ min-height: 0;
+ overflow-y: auto;
}
- &__progress-copy {
+ &__step {
display: flex;
+ width: 100%;
align-items: center;
- justify-content: space-between;
- margin-bottom: $space-2;
- color: var(--text-faint);
- font-family: var(--mono);
- font-size: 10px;
-
- strong { color: var(--text); }
- }
+ gap: 10px;
+ padding: 9px 12px;
+ border: 0;
+ border-inline-start: 2px solid transparent;
+ background: transparent;
+ color: var(--text-dim);
+ font: inherit;
+ font-size: 12.5px;
+ text-align: start;
+ cursor: pointer;
+ @include focus-ring();
+
+ &:hover { background: var(--surface-2); }
+
+ &.is-viewing {
+ border-inline-start-color: var(--accent);
+ background: var(--surface-2);
+ color: var(--text);
+ }
- &__steps {
- min-height: 150px;
- margin: 0;
- padding: $space-4 $space-5;
- list-style: none;
- background: color-mix(in srgb, var(--surface) 97%, transparent);
-
- li {
- position: relative;
- display: grid;
- grid-template-columns: 24px minmax(0, 1fr);
- gap: $space-3;
- padding: $space-2 0 $space-3;
+ &.is-done .shell-recipes__step-title {
color: var(--text-ghost);
-
- &:not(:last-child)::after {
- position: absolute;
- inset-inline-start: 11px;
- inset-block-start: 31px;
- width: 1px;
- height: calc(100% - 21px);
- background: var(--border-soft);
- content: '';
- }
-
- &.is-current { color: var(--text); }
- &.is-done { color: var(--text-muted); }
-
- strong {
- display: block;
- padding-top: 2px;
- font-size: $font-size-sm;
- font-weight: $font-weight-semibold;
- }
-
- p {
- margin: $space-1 0 0;
- color: var(--text-faint);
- font-size: 11px;
- line-height: 1.45;
- }
+ text-decoration: line-through;
}
}
&__step-marker {
- position: relative;
- z-index: 1;
display: grid;
- width: 24px;
- height: 24px;
+ width: 20px;
+ height: 20px;
+ flex: 0 0 auto;
place-items: center;
border: 1px solid var(--border-strong);
border-radius: 50%;
- background: var(--surface);
- color: var(--text-ghost);
- font-family: var(--mono);
- font-size: 9px;
-
- .is-current & {
- border-color: var(--amber);
- color: var(--amber);
- box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 12%, transparent);
- }
+ color: var(--text-faint);
+ font-size: 10px;
- .is-done & {
- border-color: var(--green);
- background: color-mix(in srgb, var(--green) 12%, var(--surface));
- color: var(--green);
+ .shell-recipes__step.is-done & {
+ @include status-variant(var(--green), var(--green-bg), var(--green));
}
}
- &__next {
- margin: 0 $space-4 $space-4;
- padding: $space-4;
- border: 1px solid color-mix(in srgb, var(--amber) 42%, var(--border));
- border-inline-start-width: 3px;
- border-radius: $radius-md;
- background: color-mix(in srgb, var(--amber) 9%, var(--surface));
-
- > span {
- display: block;
- margin-bottom: $space-1;
- color: var(--amber);
- font-family: var(--mono);
- font-size: 9px;
- font-weight: $font-weight-semibold;
- letter-spacing: 0.12em;
- text-transform: uppercase;
- }
-
- > strong { color: var(--text); font-size: $font-size-sm; }
- p { margin: $space-2 0 $space-3; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
- .btn { width: 100%; justify-content: space-between; }
+ &__step-title {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
}
- &__footer {
+ &__detail {
display: flex;
- align-items: center;
- justify-content: space-between;
- gap: $space-3;
- padding: $space-2 $space-4;
- border-top: 1px solid var(--border-soft);
- background: var(--surface-2);
-
- > span { color: var(--text-ghost); font-family: var(--mono); font-size: 9px; }
+ flex: 1;
+ flex-direction: column;
+ min-height: 0;
+ min-width: 0;
+ padding: 12px 14px;
}
-}
-.walkthrough-card {
- display: grid;
- grid-template-columns: 38px minmax(0, 1fr);
- gap: $space-3;
- padding: $space-4;
- border: 1px solid var(--border);
- border-radius: $radius-md;
- background: var(--surface-2);
- transition: border-color 150ms ease, transform 150ms ease;
-
- &:hover { border-color: var(--border-strong); transform: translateY(-1px); }
+ &__eyebrow {
+ color: var(--text-ghost);
+ font-size: 10px;
+ letter-spacing: 0.06em;
+ text-transform: uppercase;
+ }
- &__icon {
- display: grid;
- width: 38px;
- height: 38px;
- place-items: center;
- border: 1px solid var(--border);
- border-radius: $radius-sm;
- background: var(--surface);
+ &__step-heading {
+ margin: 2px 0 10px;
+ font-size: 14px;
+ font-weight: 550;
}
- &--cyan &__icon { color: var(--cyan); }
- &--amber &__icon { color: var(--amber); }
+ &__body {
+ flex: 1;
+ max-width: 62ch;
+ margin: 0;
+ overflow-y: auto;
+ color: var(--text-dim);
+ font-size: 13px;
+ line-height: 1.7;
+ text-wrap: pretty;
+ }
- &__meta {
+ &__foot {
display: flex;
- min-height: 20px;
+ flex: 0 0 auto;
align-items: center;
- gap: $space-2;
+ gap: 8px;
+ margin-block-start: 12px;
+ padding-block-start: 12px;
+ border-block-start: 1px solid var(--border-soft);
+ }
+}
- > span:first-child {
- display: inline-flex;
- align-items: center;
- gap: $space-1;
- margin-inline-end: auto;
- color: var(--text-ghost);
- font-family: var(--mono);
- font-size: 9px;
+@media (max-width: $breakpoint-md) {
+ .shell-recipes {
+ &__grid { grid-template-columns: 1fr; }
+
+ &__split { flex-direction: column; }
+
+ &__rail {
+ width: auto;
+ max-height: 42%;
+ border-inline-end: 0;
+ border-block-end: 1px solid var(--border-soft);
}
}
-
- h3 { margin: $space-2 0 $space-1; color: var(--text); font-size: $font-size-sm; }
- p { margin: 0 0 $space-3; color: var(--text-faint); font-size: 11px; line-height: 1.45; }
}
+// Step target highlight — applied by WalkthroughContext to the on-page
+// element the current step points at.
.is-walkthrough-target {
position: relative;
z-index: 2;
@@ -341,32 +267,11 @@
animation: walkthrough-target-pulse 1.8s ease-in-out infinite;
}
-@keyframes walkthrough-enter {
- from { opacity: 0; transform: translateY(8px) scale(0.985); }
- to { opacity: 1; transform: translateY(0) scale(1); }
-}
-
@keyframes walkthrough-target-pulse {
0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--amber) 0%, transparent); }
50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--amber) 14%, transparent); }
}
-@media (max-width: $breakpoint-md) {
- .walkthrough-shell {
- inset-inline: $space-3;
- inset-block-end: calc(#{$space-3} + env(safe-area-inset-bottom));
-
- &__launcher { margin-inline-start: auto; }
- }
-
- .walkthrough-hub {
- width: 100%;
- max-height: min(78vh, 700px);
- border-radius: $radius-lg $radius-lg 0 0;
- }
-}
-
@media (prefers-reduced-motion: reduce) {
- .walkthrough-hub,
.is-walkthrough-target { animation: none; }
}
diff --git a/frontend/src/styles/layout/_sidebar.scss b/frontend/src/styles/layout/_sidebar.scss
index 2d56c4f1..28aaa041 100644
--- a/frontend/src/styles/layout/_sidebar.scss
+++ b/frontend/src/styles/layout/_sidebar.scss
@@ -491,9 +491,10 @@
flex-shrink: 0;
}
-// Sidebar Footer
+// Sidebar Footer — compact rail like the prototype's sb-foot: the divider
+// hugs the user card instead of floating a full spacing unit above it.
.sidebar-footer {
- padding: 1rem 0;
+ padding: 11px 0;
margin-top: auto;
border-top: 1px solid $border-subtle;
flex-shrink: 0;