# HerdrNeXt Herdr as a NeXTSTEP 3.3 workspace: a slate desk, a main menu at top left named after the active application, black title bars on the focused pane, a Dock of 64 px tiles down the right edge and miniwindows along the foot. Spaces are Dock tiles, tabs are miniwindows, and two working applications ride along: a File Viewer with a column browser, and Mail, where agents write to you when they finish or need you. ![HerdrNeXt](preview.png) ## What you see Everything uses four grays and one slate: desk `#555577`, face `#aaaaaa`, shadow `#555555`, `#000000`, `#ffffff`. UI text is TeX Gyre Heros 13 px with a 16 px line. Terminals are Inconsolata 16 px, black on white. There is no system title bar. Left to right, top to bottom: - **Main menu** (118 px wide, in a 126 px column, top left; 26 px lower on macOS to leave room for the window buttons). Title row 22 px: 1 px white, 19 px black with bold white text, 1 px `#555555`, 1 px black. Then rows of 20 px: 1 px white, 17 px `#aaaaaa`, 1 px `#555555`, 1 px black. Rows: Info, Space, Tab, Pane, Tools, Windows, Services (each with a small arrow), Hide, Quit. The title is the focused pane's program: Terminal for a shell, Edit for a mod pane, else the program's name. - **Panes** in the main block, 8 px padding and gap, 1 px black border, white background. Each has a 22 px header: 1 px ledge (`#aaaaaa` when focused, white when not), 19 px bar, 1 px `#555555`, 1 px black. The focused bar is black with white bold text; others are `#aaaaaa` with black text. Miniaturize button on the left, close on the right, both 18 px raised squares. The title is centered: `Terminal — ~/path`, or the program's name in place of Terminal. - **Shelf** (68 px, along the foot, left of the Dock). One 64 px tile per tab of the shown space, with a 12 px black name strip at the top, the program's icon, and a status badge. The shown tab's tile is white. The last tile starts something new. - **Dock** (68 px, full height, right edge, tiles end 3 px from it). Tiles are 64 px: 2 px white top and left, `#555555` then black bottom and right, face a diagonal gradient `#aaaaaa` to `#555555`. In order: the Holstein cube; a live clock (green on black time strip, white calendar page); File Viewer cabinet; Mail envelope with a red unread count; one tile per space (folder, name strip, machine prefix for remote spaces, white when shown). The Recycler sits at the foot. The tile list scrolls when it runs out of room. ## How it behaves Agent status shows on space tiles and tab tiles: - **working:** a spinning disc badge, bottom right. - **blocked:** a red stop sign, flashing. - **done:** an envelope badge. - **idle or nothing running:** three small dots, bottom left, on space tiles. Clicks: - A menu row with an arrow opens a titled submenu beside it; others act at once. Space lists every space, Windows every tab, Tools opens File Viewer, Mail and the palette, Services > Layouts switches layout. Hide minimizes the window. Quit asks first; agents keep running. - Dock: cube opens Info, clock opens Herdr's settings, a space tile selects it, right-click a space tile for New Terminal, Rename, Close. Recycler asks, then closes the shown tab. - Shelf: click a tile to show that tab (it brings a miniaturized one back), right-click for Rename and Close. The last tile lists Terminal and every installed agent. - Title bar: click focuses, double-click zooms, right-click shows the window menu. Miniaturize settles the tab and shows the next one. Close closes the pane. File Viewer (a 640x430 movable window): a shelf of up to 8 spaces, an Up button, the path, a count, Open in Edit, then a three-column browser with NeXT's scroller: on the left, both arrows at the foot, a dimpled knob in a checkered trough. Choosing a folder opens the next column. A double click on a file opens it read-only in an Edit pane to the right. Mail (a 620x540 movable window titled Active.mbox): Previous, Next, Go To and Delete; a message list; a dimple; the letter. Each time an agent turns blocked or done, a message is filed. Opening one marks it read and shows the agent's screen. Replying types into the agent. Go To focuses the agent and closes Mail. A welcome message from The Herd is there on first run. The boot panel shows when the layout opens, at most every 30 minutes: a hatched wordmark, a ticking bar, a line of status ("Counting sheep: 4") and the cube, about 3 s on a `#555555` screen, with a rising chime. ## Built from Layout tree: root row > [screen column > [desk row > [menu block, main tab block], shelf block], dock block]. `resizable: false` throughout, `titlebar: none`, `traffic_lights: [8, 6]`, `theme: HerdrNeXt`, and the menu, shelf and Dock blocks have `window_drag: true`. One mod, `mods/HerdrNeXt/`, with roles chosen by `props.role`: `menu`, `submenu`, `dock`, `shelf`, `window` (the pane header), `panel`, `workspace`, `mail`, `edit`, `boot`. `kit.js` holds the colors, edges, tiles, title bars and scroller. `mailbox.js` watches `agents()` from the Dock's render and files messages in `shared("HerdrNeXt.mail")`, 200 at most. It uses no other mod, though Herdr's own `toast` and `prompt` still appear. Commands: `space.new|rename|close|select`, `tab.new|rename|close|select|settle|unsettle`, `pane.split|zoom|close|focus`, `agent.focus`, `layout.switch`, `app.settings|help|palette`, `window.minimize|close`. Mod commands `HerdrNeXt.workspace`, `.mail`, `.info` and `.boot` go to the Dock's `nextCommand()`. Programs: `ls -1p` through `exec` (with `on` for remote spaces), `hc read`, `hc send`. Files through `readTextFile`. No network. Art: `tools/art.py` draws every SVG and the wordmark; `tools/sounds.sh` synthesizes `boot.mp3` and `alert.mp3`. Fonts load from `mods/HerdrNeXt/fonts/`. ## Watch out - `hc send` refuses a blocked agent, because typing answers its dialog. Mail passes `--force` only when the agent is blocked, and the button then reads Answer. Keep `--` before the text so a reply starting with a dash stays text. - `cx` is only good during the call that received it. Saving a render's `cx` for a later click throws `cx is no longer valid`, and that shows only in the app's log, never in `herdr-app status` or `check`. Pass the handler's own `cx` down. - Click events carry no position. Submenus work out where they open from their parent's position, and one opened at the pointer opens its children at the pointer. - A pane gets one header, so there is no resize bar on panes. The app windows draw theirs, but it doesn't resize anything. - Overlays are fixed size, so the scrollers work from known heights. - The boot panel can wait under Herdr's What's New card until that closes. - `ls` means the File Viewer won't work on Windows. - A white terminal needs dark ANSI colors: the theme maps ansi 7 and 15 to dark values, so "white" text stays readable. - Menus show no keyboard letters, because none are bound. ## Done when - `herdr-app check mods/HerdrNeXt` passes and `layout.switch {"name":"HerdrNeXt"}` shows the desk, Dock, shelf and menu with no system title bar. - The menu title changes when focus moves from a shell to an agent to an Edit pane. - `printf '\e]7501;state=blocked:app=my-agent\e\\'` in a space puts a flashing stop sign on its tile and a new unread message in Mail. - Sending a reply from Mail to a blocked test agent reaches its terminal. - Choosing folders in the File Viewer opens columns, the scroller arrows move a long list, and a double click opens Edit. - Miniaturize shows the next tab and its tile brings it back. - Quit closes the window and `hc ls` still lists every terminal.