# Veggie A bright, playful Herdr window where every space is a little geometric vegetable with white eyes. A narrow rail on the left lists the vegetables, a floating capsule at the top shows the current space and its tabs, tabs and panes show a growth stage (seed → sprout → ripe vegetable) for the agent inside, and a harvest card pops up in the bottom-right corner when a background agent finishes. Light by default, a dark "night garden" when the system is dark. ![Veggie](preview.png) ## What you see Left to right, top to bottom: - **Rail** (left, 76 px wide, `chrome` background, 1 px `border` divider). On macOS it leaves 50 px at the top for the traffic lights (12 px elsewhere). One 50×50 tile per space, corner radius 15, holding a 34 px vegetable. The current space's tile has the `selected` background. A 10 px status dot (2 px `chrome` ring) sits 4 px from the tile's top-right corner when the space is working, blocked or done. At the bottom: + (new space), gear (settings) and › (expand), each a 36 px button with a 17 px icon. - **Expanded rail** (264 px wide): a "SPACES" header (11 px, `dim`) with a +, then one 40 px row per space: a 26 px vegetable, the name in 13.5 px, a status dot, and `⌃1`…`⌃9` in 11 px `dim` for the first nine. Then an "AGENTS" header and one 42 px row per agent: a 22 px growth-stage icon in the agent's space colors, the program name (13 px), "space · tab" underneath (11 px `dim`; the tab is left out when it only has a number), and a status word on the right: 生长中 (working), 等你 (blocked), 成熟了 (done). With no agents it shows "还没有运行中的 Agent". The footer, above a 1 px line, has the gear and ‹ (collapse). - **Top bar** (50 px, `canvas`, drags the window). Centered: a 38 px pill (`background` fill, 1 px `border`, small shadow, fully rounded) holding the space's 24 px vegetable and its name (14 px medium, max 220 px). After it come the tab pills: 30 px tall, fully rounded, 12.5 px text, each starting with an 18 px growth-stage icon. The current tab is filled with the space color mixed 84 % toward white, with text in the space color mixed 35 % toward black (in dark mode: 78 % toward `#141a16`, and text 25 % toward white). Other tabs have no fill and `muted` text. Then a + button. On the far right, 12 px in: 32 px Files and Changes toggles. - **Work area**: 8 px top and bottom and 12 px side padding, 10 px gaps. Every pane is a card with radius 16, a 1 px `border` (`input` while focused), and a 28 px header: a 16 px growth-stage icon, the program name (medium, max 260 px), and the folder in `dim` (home shown as `~`). Blocked panes get a rounded "等你" tag (`blocked` text on a 15 % `blocked` fill). - **Side panel** (hidden by default, 368 px, radius 16, 1 px `border`): Herdr's Files and Changes. - **Harvest card** (floating, right edge, bottom): 286 px wide. A "收获" header with a ×, up to 3 rows of 48 px, each with a 34 px ripe vegetable, " 的成熟了" or " 的在等你" (13 px medium), and the program name under it. Blocked rows end in a 7 px `blocked` dot. A "还有 N 个" line follows when there are more. **Vegetables** (48×48 SVGs, 3 one-color layers each): tomato 番茄, carrot 胡萝卜, eggplant 茄子, broccoli 西兰花, mushroom 蘑菇, onion 洋葱, radish 萝卜, corn 玉米. The body uses the space color, the leaf/stem is the color mixed 35 % toward black (mushroom stem: 55 % toward white), and the eyes are always `#ffffff`. Growth stages: seed (one tilted ellipse) and sprout (a soil mound with a stem and two leaves; the leaves use the leaf shade). **Palette** (12): `#ff4fa3 #ff6a00 #8b5cf6 #10c26b #ff3b30 #ffc400 #2f80ff #14b8a6 #38bdf8 #84cc16 #a0522d #1f1f1f`. **Themes**: `veggie` (light) has background `#ffffff`, chrome `#fafafa`, selected `#ebebec`, border `#ebebec`, input `#d4d4d8`, accent `#10c26b` and GitHub-light ANSI colors. `veggie-night` (dark) has background `#141a16`, chrome `#101511`, popover `#1b221d`, selected `#2a342d`, border `#262f29`, foreground `#e6ebe7` and accent `#3ddc84`. ## How it behaves - **Agent status → icon**: idle, or a plain shell (no status) = seed; working = sprout pulsing in opacity 0.45↔1 every 1200 ms; done or blocked = the ripe vegetable. The same mapping drives tabs, pane headers, agent rows and the harvest card. Status dots: `working` (pulsing 0.35↔1 every 1100 ms), `blocked`, `done`. - **Rail**: click a vegetable to select its space. Right-click opens a 248×440 popup: the space's vegetable and name at the top, a 4-column grid of the 8 vegetables (46 px tiles, 2 px `accent` ring on the current one), 12 color swatches (2 px `foreground` ring on the current one), then 重命名 (`space.rename`) and 关闭 space (`space.close`). Picks apply at once and are remembered. - New spaces get the vegetable and color used least so far. Closed spaces are dropped from the store. - **Expand/collapse**: › and ‹ buttons, or `cmd-b` in this layout. It resizes `sidebar` between 76 and 264 px, and Herdr remembers the width. - **Top bar**: click the space pill to rename the space. Click a tab to select it, double-click to rename, drag one onto another to reorder, and right-click for Herdr's tab menu. Scrolling the wheel over the bar switches tabs. + opens Herdr's new-menu. The Files and Changes buttons show or hide the panel on that child. - **Pane header**: click to focus. On hover it shows split right, split down, zoom/unzoom and close. - **Harvest**: an agent joins the card when its status changes from something else to done or blocked while it isn't focused. Agents seen for the first time don't count. Newest is on top, with one entry per agent. When a row appears, its vegetable drops 12 px onto its spot with a spring. Clicking a row focuses that pane and removes the row. A row also leaves on its own when its agent gets focus, its status moves on, or the agent goes away. × clears the card. With no rows the card draws nothing. - **Light/dark** follows the system (or `appearance` in settings.json). - **Keys** (Herdr defaults): `ctrl-1…9` select spaces and `cmd-1…9` select tabs. ## Built from - `layouts/veggie.json`: the root `row` (titlebar none, traffic_lights [16, 18], theme `{light: "veggie", dark: "veggie-night"}`, terminal_padding [14, 12]) holds: - `sidebar` column (px 76) containing `rail`, a block with `window_drag` and `{mod: "veggie", props: {part: "rail"}}` - `work` column containing: - `tabs` block (px 50, `window_drag`, part `top`) - `work-body` row (padding [8, 12], gap 10) with `main` (`{tab: "active", pane: {..., header: {content: {mod: "veggie"}, height: 28, position: "top", reveal: "always"}, lone: true}}`) and `panel` (hidden column, stack `panel-body` holding the shipped `files` and `changes`) - root `floating`: `[{id: "harvest", content: {mod: "veggie", props: {part: "harvest"}}, edge: "right", align: "end"}]` - `mods/veggie/` is one mod with several roles: - `main.js` picks a role. `props().pane` means pane header; `part` is `rail`, `top`, `menu` or `harvest`. - `veg.js` holds the vegetables, palette, `mix`, `soft`/`ink` (light/dark aware), `lookOf`/`setLook`/`assignLooks` (stored in `shared("veggie.spaces")` as `{spaceId: {veg, color}}`), `vegIcon` and `stageIcon`. - `pane.js` draws the pane header; `harvest.js` draws the harvest card. - `veg/*.svg` holds the art, `sounds/harvest.wav` a 0.55 s two-note pluck (E6 then A6), and `keys.json` holds `{"layout:veggie": {"cmd-b": "veggie.toggle"}}`. - `herdr` functions used: `spaces`, `panes`, `agents`, `setAgentOrder`, `run`, `openOverlay`, `closeOverlay`, `props`, `theme`, `settings`, `window`, `shared`, `setShared`, `layout`, `nextCommand`, `home`. - Commands it runs: `space.select/new/rename/close`, `tab.select/rename/move`, `pane.focus/split/zoom/close`, `layout.resize/show/hide/select`, `app.settings`. - Shipped mods and icons it uses: `menu` (tab right-click), `new-menu`, `files`, `changes`, and icons from `mods/workspace-chrome/`, `mods/pane/`, `mods/files/` and `mods/changes/`. - It runs no programs and makes no network calls. ## Watch out - A pane header copy only gets `{pane, terminal}` as props, so it is detected by `props().pane` and not by `part`. - Only the `rail` copy listens to `nextCommand()`. If another copy also awaited it, the copies would compete for the command. - Herdr's own toast is global: this layout can't replace it, so it still shows next to the harvest card. - `harvest` draws `div()` when it is empty, so the floating block disappears. - The bounce needs one re-render after a row appears. It uses `cx.timer.after(40)` and never a repeating timer. - Themes must be copied to `themes/`. A layout folder alone isn't enough. - `install.sh` merges `keys.json` and asks before replacing a key that is already bound. It only sets `sounds.done` in settings.json if you answer y. It backs up both files first. - Built and checked on macOS with Herdr 0.1.11 only. ## Done when - `herdr-app check ~/.config/herdr-app/mods/veggie` passes, and `herdr-app status` lists no veggie errors. - `layout.switch {name: "veggie"}` shows the rail, the capsule and the pane cards. Every space has a vegetable, and right-click changes it and its color for good. - `herdr-app do veggie.toggle` switches the rail between 76 and 264 px. Expanded, it lists spaces with `⌃N` and agents with their status words. - Splitting a pane gives both panes a header with a seed icon. - When an agent in a background tab finishes, the harvest card appears, and clicking it jumps to that agent. - With `"appearance": "dark"` in settings.json, the window turns into the dark night garden and the current tab stays readable.