# Machine Rail Herdr's main layout with a Slack-style rail of computers inside the sidebar: pick a computer on the rail, one of its herdr-core sessions from the chips beside it, and the spaces and agents lists below show only that session. Tiles and chips take your names, colors and order. A Sessions window lists every hc session on every machine and connects or disconnects them. ![Machine Rail](preview.png) ## What you see - **Layout:** Herdr's `main` (titlebar none, traffic lights at 12,16; sidebar 268 px in `chrome`; tabs, panes as cards, Files/Changes panel, status bar), with the sidebar's `sidebar-lists` replaced by a row: a 52 px rail block, then a column of a 66 px header block over the lists. - **Rail (52 px, `canvas` background, 1 px `border` on the right):** tiles 36 px square, radius 10, 10 px apart from 10 px down, centered. - This computer first, a `monitor` icon (until renamed), then one tile per computer in the saved order, then a `+` tile that opens `machine-add`. - A tile shows the name's initials, 11.5 px bold: two words → their first letters; one word → its first two; a trailing `mac`/`-mac` dropped; upper-cased. - No color: `surface` with `muted` text; chosen: `accent` with `accent_foreground`. - With a color: 18% tint (`#rrggbb2e`) with the color as text; chosen: solid with white text. - Chosen tile: a 3×18 px `foreground` bar at the rail's left edge, 9 px down. - Several sessions: a count badge at the bottom right (−6, −6), 9 px `muted` on `canvas` with a `border`. - Not chosen and an agent there needs attention: a 9 px dot at the top right (−3, −3): `blocked`, else `done`, else `working`. - Every session of it unreachable: 45% opacity. - **Header (66 px, `chrome`, 1 px `border` below):** - Title row 28 px (10 px top, 14 px sides): a 7 px color dot when colored, then the computer's name, 13 px semibold. - Chips row 36 px (10 px sides, 4 px gap): one chip per session, 24 px high, 9 px padding, radius 6, 12 px: a 7 px color dot when colored, the session's name (`default` for the default session), its space count 10.5 px `dim` (or its state, `needs login`), and, when not chosen, a 6 px status dot for blocked or done; working instead gets an outline over the chip (radius 6, 1 px `working`) whose opacity loops 0.15 ↔ 0.72 every 1800 ms (`loop`, native). A light running round the border was tried: a turning svg (`spin`) paints over everything, so it can't be kept to a ring. Chosen: `selected` background, `foreground` text; others `muted`, `hover` on hover. - Last, a bordered 24 px chip `+` (`Manage sessions` for this computer) that opens the Sessions window. - **Spaces / Agents:** Herdr's own lists, filtered to the chosen session. An empty session shows one `+ New space` row; an unreachable one shows its state. A space row has no avatar: in its place the space's state (working spins, blocked/error a red dot, done a check, idle an empty ring); a Linear issue chip when the space is named after one and a key is found; a thin color stripe on the left edge only when the space was given a color (right-click). The details are in `session-spaces`' own recipe (herdr-app-session-spaces). - **Menu (popup 256×300 at the pointer, `popover`):** a `dim` 11 px title "Machine · name" or "Session · name"; "Rename" (`⌃⌘R` hint on computers), which becomes an input (hint "Name (empty: the original)") and a Save button; a row of nine 16 px round swatches and a `×` for none (the chosen one ringed in `foreground`); a divider; "Change icon…" (computers only; opens the icon window); "Move up"/"Move down" (chips: "Move left"/"Move right"); a divider; "Manage sessions" with `⌘⇧S`. - Colors: indigo `#5e6ad2`, ocean `#3d7ea6`, teal `#2f8a80`, moss `#5f8a5b`, amber `#b0873e`, rust `#b0634b`, rose `#b05a78`, plum `#7d62a8`, slate `#64748b`. - **Sessions window (`window` overlay, key `sessions`, kept, 920 px × 80%):** - A 48 px header: "Sessions", a search field (hint "Find a space or session", `/` key cap), ↻ and ×. - Left, 232 px on `chrome`: "Computers", then one row per computer ("This computer" first): a 26 px `monitor`/`server` tile with a reach dot (green `ansi2` / `dim`), the name, its target or host (and "n sessions" when more than one), and on the right the status dots of its spaces (blocked, working, done) and its space count. The chosen one on `selected`. - Right, the chosen computer: its name 16 px, target and host in mono, `+ New session`. - "Shown in the app · n": a card per connected session: a running dot (green / `dim`), the name (a small `default` tag on the default one), a terminal icon and count or "stopped", the sidebar entry's name in mono after a `layers` icon. Its spaces below as chips that select the space (the active one ringed in `accent`, agent status dots inside); past 12 a dashed `+N more` chip, and a dashed `+ space` chip last. `Disconnect` shows only on hover and asks for a second click (the card turns `blocked`, with Cancel). - "On this computer, not in the app · n": one 38 px row per other session with `+ Show in app` (this computer: "Here the app opens only the default session"). - Typing in the search replaces the right side with matches across every computer, grouped by computer: sessions by name (choosing one shows its computer) and spaces the app shows (choosing one selects it). The match is drawn in `accent`; ↑↓ and Enter pick. - A 30 px footer of key caps: ↑↓ computers, / find, n new session, r refresh, esc close; on the right, that disconnecting leaves terminals running. ## How it behaves - **Language:** every text in English and Korean (`i18n.js`, the same file in `machine-switch` and `sessions`): `language` in `mods/machine-switch/config.json`, else macOS `defaults read -g AppleLanguages`, else `$LC_ALL`/`$LC_MESSAGES`/`$LANG`, else English. Input hints are drawn beside the input (a placeholder can't change after the language is known). - **Grouping:** `hc machine ls --json` (every 15 s, `temporary` ones skipped) grouped by `host` (else target, else name). Within a computer, the entry without `session` first, then by session name. The computer's name is that entry's name, else the target. - **The view:** shared `"machine.view"` = the chosen machine entry's name (null for this computer). `session-spaces` and `session-agents` show only spaces whose `machine` equals it and agents whose address prefix (`name/t7`) equals it (no prefix = this computer). - **Choosing:** a tile picks the session last chosen there (`machine.last.`), else the first. A chip picks that session. Either then selects the space last active on that entry (`machine.space.`), else its first. - **Following:** on every render, when the active space changed and lives on another entry, the view moves there. The active space is remembered per entry. Except when the space you were on closed (exit in its last terminal): Herdr picks the next space, maybe on another entry, so the view stays and selects that entry's last space, else its first; with none left it shows the entry's empty list. - **Statuses:** a computer's or session's status is the most urgent of its spaces': blocked > done > working. - **Prefs:** shared `"machine.prefs"` = `{ order: [hostKey], sessionOrder: {hostKey: [entry]}, alias: {"g:host" | "s:entry": name}, color: {…: colorName} }`. This computer is `@local`. Ones not in an order keep their place after the ordered ones. - **Drag:** press a tile (or chip) and release on another to move it there (before it when coming from below, after it when coming from above). The dragged one dims to 45% and the target gets a 2 px `accent` ring. Press and release on the same one is a click. - **Icon window (popup 360×560 at the pointer, `props.iconFor`):** title "Icon · name" and ×; the tile at 56 px, then at 36 px as chosen (2 px `accent` ring), not chosen, and offline (45%); "Letters or emoji" input (up to 3 characters by grapheme, or one emoji; typing clears a picked icon; placeholder: the auto initials); "Icon": 88 Lucide icons in `mods/machine-switch/icons/` (37×30 cells, the picked one `hover` with an `accent` border; click again to unpick), 4 rows high, scrolling; "Image": a dashed drop zone (`on_drop`) with a "Paste ⌘V" button (⌘V anywhere in the window does the same when the clipboard holds no text) and "Remove" when set; errors under it in `blocked`; "Color": the nine swatches and ×; "Reset" (drops letters, icon, picture) and "Done". Saved in `machine.prefs.icon["g:"] = { text?, glyph?, image? }`; a tile shows image > icon > letters > initials (this computer: a monitor). A picture: `sh` with `osascript` (clipboard as PNG, else a copied file's path) and `sips` (to PNG, center square, 128 px) into `mods/machine-switch/icons/user/-