Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

shrink Shell page chrome so the terminal isn't pushed below the fold on mobile

[._.]/ Adam Eivya23aa7a15d27
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 60eebf20d6..1de7239c0d 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -162,3 +162,5 @@
- **Canon entries can be removed from a universe's Cast, Places and Objects buckets.** Every other bucket on a universe page — the Other category variations, the Composite sheets — has always carried a trailing X to drop an entry you no longer want, but the three canon trunks had no way to remove anything at all: an entry pulled in by an over-eager prose extraction, added from the Catalog by mistake, or simply written out of the world was stuck in the universe forever. All five buckets now behave the same way, with the same X in the same place on the card. Removal is deliberately narrow and says so in the button's tooltip and the confirming toast: the entry leaves *this universe's canon list* and nothing else is touched. Its rendered reference images and character reference sheets stay in the gallery, where they remain previewable and re-attachable to another entry, and the shared Catalog ingredient an entry may be linked to is left alone — that row is a universe-independent record other universes and series can embed, so deleting canon must not delete it. Locked entries are removable, because the lock exists to stop AI refine/differentiate passes from rewriting an entry, not to stop the user from deciding it does not belong. The removal goes through its own endpoint that filters the array inside the universe's write queue rather than composing the surviving list on the client and PATCHing it back from a possibly-stale read — the existing PATCH path already shields rendered images and reference-sheet pointers against that race, but not a sibling entry's pinned primary image, its lock state, or a description a refine rewrote while you were clicking. The card disappears on click and is restored, whole and in place, if the write fails. Because a universe merges across machines as a whole record by last-write-wins, the removal propagates to your peers on the next sync without any tombstone, and neither the catalog projection nor the boot reconciler — both of which only ever read canon and write outward — can put the entry back.
- **[issue-3563] "Continue Today's Routine" in POST no longer hands you the same drill over and over.** The routine always took the #1 recommendation, but the two signals that produce most recommendations — your weakest drill by recent accuracy, and a ladder you are partway up but not advancing — are windowed averages that a single rep barely moves. So the drill sitting at #1 before a run was still at #1 after it, and clicking Continue re-served the test just finished, indefinitely (Digit Span, in the report). Recommendations now know what you have already practiced today, from both scored sessions and the training log — Morse, Wordplay and Memory practice never post a scored session, so counting only sessions would have missed three of the surfaces that offer the Continue button. Anything already practiced today sinks below everything that has not been, which is enough for the routine to advance to the next thing on its own. Already-practiced items are demoted rather than dropped, so a day where you have done everything still shows what is up next instead of an empty panel, and each row in "Up next" now carries a Done today badge so the reordering reads as deliberate; they are still clickable, since practicing the same drill twice in a day is allowed — just not what the routine hands you. When nothing new is left, Continue ends the routine at the launcher and says so, rather than looping. A due memory item is matched by its item id and a ladder by its drill type, so switching off one practice mode cannot mark an unrelated one done, and the fallback "run a full self-test" is discharged only by an actual scored session.
+
+- **The Shell page gives the terminal roughly 300px more of a phone screen.** Everything above the terminal was laid out to wrap, so on a phone each strip claimed several rows: the title line pushed its Fullscreen/Restart/Stop/New buttons onto a second row, each session tab took a full row of its own (a live agent run's label is long enough to guarantee it) with the "+" button stranded on a third, and the quick-commands toolbar spread its hot keys, launchers and the "cd to app" dropdown across three rows. Together with the standing green banner explaining that a live TUI run is interactive, the chrome ate more vertical space than the terminal it was wrapped around. The banner is gone — the run's tab already marks itself with a bot icon, an accent tint and a pulsing dot, and what the banner actually said now lives in a tap-and-keyboard-reachable info tooltip beside the "N live" counter in the header, costing no vertical space at all (a plain `title` attribute would have hidden it from exactly the touch users this change is for). The header is one row that does not wrap: under `sm` the Connected pill collapses to its status dot — with the word kept for screen readers — and the session counter drops out, since the tabs below say the same thing. The tab strip and the quick-commands toolbar each scroll sideways instead of wrapping, so both cost one fixed row no matter how many sessions or commands there are, and tab labels truncate with the full name kept in the tooltip. Both scrollers hide their scrollbar and pin the swipe to the horizontal axis, the same recipe the shared tab bar uses — a platform scrollbar gutter would have eaten back the row each one is reclaiming. The "cd to app" dropdown sits outside the scrolling region — an absolutely-positioned menu inside one would be clipped — and shows just its folder icon on a phone. Desktop layout is unchanged apart from the tighter page padding under `md`.
diff --git a/client/src/components/shell/ShellSessionTabs.jsx b/client/src/components/shell/ShellSessionTabs.jsx
index 3ab9c49a4f..f09136cc5c 100644
--- a/client/src/components/shell/ShellSessionTabs.jsx
+++ b/client/src/components/shell/ShellSessionTabs.jsx
@@ -8,18 +8,30 @@ const shortId = (id) => id?.slice(0, 6) ?? '';
// distinct bot icon + accent tint + pulsing dot so they read as "live run you can
// watch and drive"; interactive shells use the terminal icon. All session actions
// are lifted to the parent via callbacks — this component owns no state.
+//
+// The strip scrolls horizontally instead of wrapping: on a phone a single long
+// agent label (`Claude Code TUI agent-6827af82`) would otherwise claim a whole
+// row per session and push the terminal below the fold. Labels truncate at a
+// fixed width for the same reason; the full name stays in the tooltip. The
+// scroller follows the repo idiom (`scrollbar-hide touch-pan-x`, as in
+// `ui/TabPills.jsx`) — a platform scrollbar gutter would eat back the row this
+// is reclaiming, and `touch-pan-x` stops Android resolving the swipe as a
+// vertical page scroll. Vertical spacing is the parent's `gap`, not an `mb-*`
+// here, so the page owns its own rhythm.
export default function ShellSessionTabs({ sessions, activeSessionId, onSwitch, onKill, onNew }) {
return (
- <div className="flex flex-wrap items-center gap-1.5 mb-3 pb-1">
+ <div className="flex items-center gap-1.5 overflow-x-auto scrollbar-hide touch-pan-x">
{sessions.map((s) => {
const isActive = s.sessionId === activeSessionId;
const label = s.label || s.cwd?.split('/').pop() || shortId(s.sessionId);
const isRun = s.external;
const TabIcon = isRun ? Bot : TerminalIcon;
+ const age = formatDurationMs(Date.now() - s.createdAt);
+ const title = `${isRun ? 'Live TUI run — ' : ''}${s.label || s.cwd || shortId(s.sessionId)} — ${age} old`;
return (
<div
key={s.sessionId}
- className={`flex items-center gap-1.5 px-2.5 py-1.5 rounded text-xs font-mono transition-colors cursor-pointer min-h-[40px] ${
+ className={`flex items-center gap-1.5 px-2.5 py-1.5 rounded text-xs font-mono transition-colors cursor-pointer min-h-[40px] shrink-0 ${
isActive
? 'bg-port-accent/20 text-port-accent border border-port-accent/40'
: isRun
@@ -28,12 +40,12 @@ export default function ShellSessionTabs({ sessions, activeSessionId, onSwitch,
}`}
onClick={() => !isActive && onSwitch(s.sessionId)}
{...clickableProps(() => !isActive && onSwitch(s.sessionId))}
- title={`${isRun ? 'Live TUI run — ' : ''}${s.label || s.cwd || shortId(s.sessionId)} — ${formatDurationMs(Date.now() - s.createdAt)} old`}
+ title={title}
>
<TabIcon size={12} className="shrink-0" />
- <span className="min-w-0 break-all">{label}</span>
+ <span className="truncate max-w-[9rem] sm:max-w-[18rem]">{label}</span>
{isRun && <span className="w-1.5 h-1.5 rounded-full bg-port-accent animate-pulse shrink-0" title="Live" />}
- <span className="text-[10px] opacity-60 shrink-0">{formatDurationMs(Date.now() - s.createdAt)}</span>
+ <span className="text-[10px] opacity-60 shrink-0">{age}</span>
<button
onClick={(e) => { e.stopPropagation(); onKill(s.sessionId); }}
className={`shrink-0 ml-0.5 p-0.5 rounded transition-colors ${
@@ -48,7 +60,7 @@ export default function ShellSessionTabs({ sessions, activeSessionId, onSwitch,
})}
<button
onClick={onNew}
- className="flex items-center gap-1 px-2 py-1.5 text-xs text-gray-500 hover:text-white hover:bg-port-border rounded transition-colors min-h-[40px]"
+ className="flex items-center gap-1 px-2 py-1.5 text-xs text-gray-500 hover:text-white hover:bg-port-border rounded transition-colors min-h-[40px] shrink-0"
title="New session" aria-label="New session"
>
<Plus size={14} />
diff --git a/client/src/pages/Shell.jsx b/client/src/pages/Shell.jsx
index dac8d44d93..8a4741ee12 100644
--- a/client/src/pages/Shell.jsx
+++ b/client/src/pages/Shell.jsx
@@ -5,6 +5,7 @@ import { readClipboard } from '../lib/clipboard';
import { useShellSession, MAX_SESSIONS } from '../hooks/useShellSession';
import TerminalHotKeys from '../components/shell/TerminalHotKeys';
import ShellSessionTabs from '../components/shell/ShellSessionTabs';
+import InfoTooltip from '../components/ui/InfoTooltip';
const QUICK_COMMANDS = [
{ label: 'claude', command: 'claude --dangerously-skip-permissions' },
@@ -35,7 +36,6 @@ export default function Shell() {
connected,
sessions,
activeSessionId,
- activeSession,
interactiveCount,
liveRunCount,
isLiveRun,
@@ -92,30 +92,50 @@ export default function Shell() {
if (showPasteInput) pasteInputRef.current?.focus();
}, [showPasteInput]);
+ const statusLabel = connected ? 'Connected' : 'Disconnected';
+
return (
<div className={isFullscreen
? 'fixed inset-0 z-[70] flex flex-col bg-port-bg p-2'
- : 'h-full flex flex-col p-4 md:p-6'}>
+ // Deliberately tighter than the app-wide `p-4 md:p-6` mobile gutter: every
+ // pixel here is a terminal row/column, and the chrome above it is already
+ // compressed to three fixed rows. `gap` (not per-child `mb-*`) owns the
+ // vertical rhythm so the tab strip doesn't bake page spacing into itself.
+ : 'h-full flex flex-col gap-2 md:gap-3 p-2 md:p-6'}>
{/* Header (hidden in fullscreen — the compact bottom bar takes over) */}
{!isFullscreen && (
- <div className="flex flex-wrap items-center gap-2 mb-3">
- <h1 className="text-xl font-semibold text-white">Shell</h1>
- <div className={`flex items-center gap-2 px-2 py-1 rounded text-sm ${
- connected ? 'bg-port-success/20 text-port-success' : 'bg-gray-500/20 text-gray-400'
- }`}>
+ // Single non-wrapping row on mobile: the status pill collapses to a bare dot
+ // and the session count drops out, so the action buttons stay on the title
+ // line instead of wrapping to a second row above the fold.
+ <div className="flex items-center gap-2">
+ <h1 className="text-xl font-semibold text-white shrink-0">Shell</h1>
+ <div
+ className={`flex items-center gap-2 shrink-0 text-sm px-2 py-1 rounded ${
+ connected ? 'text-port-success sm:bg-port-success/20' : 'text-gray-400 sm:bg-gray-500/20'
+ }`}
+ >
<div className={`w-2 h-2 rounded-full ${connected ? 'bg-port-success' : 'bg-gray-500'}`} />
- {connected ? 'Connected' : 'Disconnected'}
+ {/* The sr-only twin keeps the state announced when only the dot shows. */}
+ <span className="hidden sm:inline">{statusLabel}</span>
+ <span className="sr-only sm:hidden">{statusLabel}</span>
</div>
{interactiveCount > 0 && (
- <span className="text-xs text-gray-500 font-mono">{interactiveCount}/{MAX_SESSIONS}</span>
+ <span className="hidden sm:inline text-xs text-gray-500 font-mono shrink-0">{interactiveCount}/{MAX_SESSIONS}</span>
)}
{liveRunCount > 0 && (
- <span className="flex items-center gap-1 text-xs text-port-accent font-mono" title={`${liveRunCount} live TUI run${liveRunCount > 1 ? 's' : ''}`}>
+ <span className="flex items-center gap-1 text-xs text-port-accent font-mono shrink-0">
<Bot size={12} />
{liveRunCount} live
+ {/* The only surviving home for the live-run explainer the banner used
+ to carry — a `title` tooltip is unreachable by touch and keyboard,
+ which is most of this page's audience. Costs no vertical space. */}
+ <InfoTooltip label="About live TUI runs" align="end" panelClassName="w-60">
+ {liveRunCount} live TUI run{liveRunCount > 1 ? 's' : ''}. Open one to watch it — you can type to
+ answer or correct it, or Stop to end it. It won't idle-close while you have it open.
+ </InfoTooltip>
</span>
)}
- <div className="flex items-center gap-2 ml-auto">
+ <div className="flex items-center gap-2 ml-auto shrink-0">
<button
onClick={() => setIsFullscreen(true)}
className="flex items-center gap-1.5 px-2.5 py-2 bg-port-card hover:bg-port-border text-gray-300 hover:text-white rounded-lg text-sm transition-colors border border-port-border min-h-[40px]"
@@ -169,52 +189,47 @@ export default function Shell() {
/>
)}
- {/* Live TUI run banner — these views are interactive: type to answer or
- correct the model, or Stop to end it. It won't auto-close while open. */}
- {!isFullscreen && connected && isLiveRun && (
- <div className="flex items-center gap-2 mb-3 px-3 py-2 rounded bg-port-accent/10 border border-port-accent/30 text-port-accent text-xs">
- <Bot size={14} className="shrink-0" />
- <span>
- Live run <span className="font-mono">{activeSession?.label || 'TUI'}</span> — you can type to answer or correct it,
- or <span className="font-semibold">Stop</span> to end it. It won't idle-close while you have it open.
- </span>
- </div>
- )}
-
- {/* Quick commands toolbar */}
+ {/* Quick commands toolbar — one horizontally-scrollable row rather than a
+ wrapping grid, so it costs a fixed ~40px of vertical space no matter how
+ many quick commands there are. The folder dropdown sits OUTSIDE the
+ scroller: an absolutely-positioned menu is clipped by `overflow-x-auto`. */}
{!isFullscreen && connected && (
- <div className="flex items-center gap-2 mb-3 flex-wrap">
- <TerminalHotKeys
- sendCtrlB={sendCtrlB}
- sendCtrlC={sendCtrlC}
- handlePaste={handlePaste}
- sendNavKey={sendNavKey}
- showPasteInput={showPasteInput}
- setShowPasteInput={setShowPasteInput}
- pasteInputRef={pasteInputRef}
- handlePasteInputEvent={handlePasteInputEvent}
- sendImage={sendImage}
- />
- <div className="w-px h-6 bg-port-border" />
- {QUICK_COMMANDS.map(({ label, command }) => (
- <button
- key={label}
- onClick={() => sendCommand(command)}
- className="px-3 py-1.5 bg-port-card hover:bg-port-border text-gray-300 hover:text-white rounded text-xs font-mono transition-colors border border-port-border min-h-[40px]"
- title={command}
- >
- {label}
- </button>
- ))}
+ <div className="flex items-center gap-2">
+ <div className="flex items-center gap-2 flex-1 min-w-0 overflow-x-auto scrollbar-hide touch-pan-x">
+ <TerminalHotKeys
+ sendCtrlB={sendCtrlB}
+ sendCtrlC={sendCtrlC}
+ handlePaste={handlePaste}
+ sendNavKey={sendNavKey}
+ showPasteInput={showPasteInput}
+ setShowPasteInput={setShowPasteInput}
+ pasteInputRef={pasteInputRef}
+ handlePasteInputEvent={handlePasteInputEvent}
+ sendImage={sendImage}
+ />
+ <div className="w-px h-6 bg-port-border shrink-0" />
+ {QUICK_COMMANDS.map(({ label, command }) => (
+ <button
+ key={label}
+ onClick={() => sendCommand(command)}
+ className="px-3 py-1.5 bg-port-card hover:bg-port-border text-gray-300 hover:text-white rounded text-xs font-mono transition-colors border border-port-border min-h-[40px] shrink-0"
+ title={command}
+ >
+ {label}
+ </button>
+ ))}
+ </div>
{/* App folder cd selector */}
- <div className="relative ml-auto" ref={dropdownRef}>
+ <div className="relative shrink-0" ref={dropdownRef}>
<button
onClick={() => setFolderDropdownOpen(prev => !prev)}
- className="flex items-center gap-2 px-3 py-1.5 bg-port-card hover:bg-port-border text-gray-300 hover:text-white rounded text-xs transition-colors border border-port-border min-h-[40px]"
+ className="flex items-center gap-1.5 px-2.5 py-1.5 bg-port-card hover:bg-port-border text-gray-300 hover:text-white rounded text-xs transition-colors border border-port-border min-h-[40px]"
+ title="cd to app folder"
+ aria-label="cd to app folder"
>
<FolderOpen size={14} />
- cd to app
+ <span className="hidden sm:inline">cd to app</span>
<ChevronDown size={12} className={`transition-transform ${folderDropdownOpen ? 'rotate-180' : ''}`} />
</button>
{folderDropdownOpen && (