feat(web): rework layout and quality of life (#12)
- App shell: top bar with connection state and Chat/Terminal toggles, per-column scrolling, sidebar only on the Notebooks page. - Hash routes (#/notebooks/<path>, #/hosts, #/settings) so reloads and links keep the open notebook and page. - Parameters sit beside the notebook on wide screens, collapsible, with missing-count summary and Reset; non-secret values are remembered per notebook in localStorage (secrets and undeclared names never stored). - Sticky notebook header with breadcrumbs, check summary and run-all; Ctrl/Cmd+S saves the Markdown draft. - Step cards show target, one deduplicated hint for missing values and copy feedback. - Shared Dialog, Menu and CopyButton components; notebook and host actions move into menus and modal dialogs. - Hosts page as a compact list; Settings split into cards with sign out for this browser.
This commit is contained in:
@@ -9,8 +9,10 @@ import type { TerminalClientMessage } from "@shellbook/core";
|
||||
export function TerminalSlot({
|
||||
collapsed = false,
|
||||
connect = terminalTransport,
|
||||
onClose,
|
||||
}: {
|
||||
collapsed?: boolean;
|
||||
onClose?: () => void;
|
||||
connect?: (session: string) => TerminalTransport;
|
||||
}) {
|
||||
const container = useRef<HTMLDivElement>(null);
|
||||
@@ -105,18 +107,26 @@ export function TerminalSlot({
|
||||
if (!collapsed) refit.current();
|
||||
}, [collapsed]);
|
||||
return (
|
||||
<aside className="terminal" aria-label="Terminal panel" hidden={collapsed}>
|
||||
<h2>Terminal · main</h2>
|
||||
<p>
|
||||
Run `claude` here — it edits notebooks in this workspace; the view
|
||||
reloads live.
|
||||
</p>
|
||||
<div className="actions">
|
||||
<span role="status">{state}</span>
|
||||
<aside className="terminal side-panel" aria-label="Terminal panel" hidden={collapsed}>
|
||||
<header className="panel-header">
|
||||
<h2>Terminal</h2>
|
||||
<span role="status" className={`dot-status ${state === "Connected" ? "ok" : state === "Disconnected" ? "bad" : ""}`}>
|
||||
{state}
|
||||
</span>
|
||||
{state === "Disconnected" && (
|
||||
<button onClick={() => setAttempt((n) => n + 1)}>Reconnect</button>
|
||||
)}
|
||||
</div>
|
||||
<span className="spacer" />
|
||||
{onClose && (
|
||||
<button className="icon" aria-label="Close terminal" onClick={onClose}>
|
||||
×
|
||||
</button>
|
||||
)}
|
||||
</header>
|
||||
<p className="muted">
|
||||
tmux session “main” on the ShellBook server. Run <code>claude</code>{" "}
|
||||
here; notebook edits show up live.
|
||||
</p>
|
||||
<div className="terminal-screen" ref={container} />
|
||||
</aside>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user