# Screenshot mode A switch in the Spaces sidebar that hides the names of chosen spaces, machines and tabs so the window can be screenshotted or screen-shared safely. Hover a space, a machine header or a tab and click its eye to choose how it shows. Or add phrases to a hide list (Hide phrases… in the gear beside "Spaces"), and anything whose name, title, folder, repo or branch contains one is hidden automatically. A phrase can have an alias: with "top secret client name" → "bob", a space called "top secret client name api" shows as "bob api". Then turn screenshot mode on with the eye beside "Spaces" or Cmd+Shift+H. Hidden spaces without an alias read "Space 2", hidden machines read "Machine 1", and their tabs, agents, pane titles, folders, repos and branches are masked across the window. Unmarked spaces stay as they are. A demo mode swaps the whole sidebar for a made-up world, for screenshots that need no hiding at all. ![Screenshot mode](preview.png) ## What you see - **Spaces header** (31px tall, 11.5px dim text, 16px left padding). It reads "Spaces", or "Spaces · screenshot mode" while the mode is on. The title truncates so the buttons always fit. To the left of the existing + button sit two 26×26 buttons (14px icons, 6px radius): a gear (`settings.svg`, `accent` while demo mode is on, else `dim`) that opens the options popup, then an eye. It shows an open eye in `theme().dim` while off, and a crossed-out eye in `theme().accent` while on, with a "Screenshot mode" tooltip. - **Options popup.** A 270 by 258 popup under the gear, `popover` background, 12.8px text. Rows in order: Screenshot mode (switch), Denser rows (switch), a divider, "Hide phrases…" with a dim hint ("3 phrases hide matching names", or "None yet. Names with a phrase get hidden") that closes the popup and opens the phrase dialog, a divider, then Demo mode (switch). Each switch row has a name and a one-line dim hint. The action `screenshot-spaces.options` opens it too. - **Phrase dialog.** A Herdr dialog (380 wide, sized to content) with `popover` background and 18px padding. It has a 15px semibold "Hide phrases" title with a dim "Esc" at the right, then an 11.5px `muted` explanation: "In screenshot mode, any space, machine, tab or terminal whose name, title, folder, repo or branch contains one of these (any case) is hidden." A second `muted` line: "With an alias, the phrase is swapped for it ("top secret client name" shows as "bob"). Without one, the name becomes "Space 2" or similar. Click a phrase to edit it." Below that are two 34px inputs side by side (8px radius, `background` fill, 8px gap): "Phrase to hide" filling the width with an `accent` border, then "Alias (optional)", 140px wide with an `input` border. Then comes the list, 30px per row (at least one row, at most 220px) and scrolling: one 28px `raised` row per phrase, showing the phrase, then "→ bob" in `muted` (or "no alias" in `dim`), then a 12px × button. With no phrases it shows a dim "No phrases yet.". ![Hide phrases dialog](phrases.png) A `solid` "Done" button sits at the bottom right. - **Row eyes.** Each space row, tab row in the space tree, tab pill in the tab bar and remote machine header shows a 12px eye at its right end on hover. The eye is open when the item is not hidden, and crossed out (`accent`) when it is hidden, whether marked by hand or matched by a phrase. While the mode is off, hidden items keep showing their crossed-out eye without hover so you can see what will be hidden. While the mode is on, the eyes only appear on hover, so a screenshot shows nothing. - **Row choices.** Clicking a row's eye opens the phrase dialog (taller, 600px) with that space, machine or tab at the top. It shows the real name, what it shows now ("Visible", "Visible (phrases ignored)", "Blurred", "Renamed to …", "Hidden by a phrase below") and three radio options. Visible adds its key to `shown`, so phrases stop hiding it. A hand mark, or a hidden space or machine above it, still hides it. Blur marks it by hand. Rename shows a "Show it as…" box with an Apply button (Enter works too) and adds a phrase of the exact name with that alias. Picking Rename with the box empty only selects it and waits for an alias. Visible and Blur never change the phrase list, and a line under the options says so. The full phrase list stays below. The header's Esc is a bordered button that closes the dialog. - **Secrets in the dialog.** The phrase dialog smudges every phrase in its list and the row's real name until the eye in its header (next to "Esc") is clicked; it starts hidden each time the dialog opens. Aliases, the status line and what is typed stay readable. While hidden, clicking a phrase doesn't load it into the boxes (its tooltip says to show the phrases first). - **Smudged spaces smudge everything in them.** A hidden space that shows as a smudge (marked by hand, or no alias for its name; `spaceSmudged(w)` in `privacy.js`) smudges its contents too: tab names in the tree and the tab bar, agent titles, sub-agent names in the tree and the agents panel, the pane header's folder, and its repo and branch. Program names ("Claude Code", "zsh") stay readable. An aliased space keeps swapping phrases in its contents as before. - **Aliases.** When the text shown contains only phrases that have aliases, each phrase is replaced by its alias (case-insensitive, every occurrence, longest phrase first) and the rest of the text stays. This covers space and machine names, tab names, pane titles and folders, agent rows, and repo and branch text. If the text contains a phrase without an alias, contains no phrase at all (it was hidden through its folder or its machine), or belongs to an item marked by hand with an eye, the stand-in below is used instead. - **Masked space row.** Without an alias, the name becomes a smudge (a soft bar in one of four widths, by the name's length; the real text is never drawn): `privacy.js` returns a private-use marker (U+E001 to U+E004 for names up to 6, 12, 20 and more characters) and `show(text, t)` draws each marker as a 34, 58, 86 or 116px by 9px rounded bar in `muted` at 35% opacity. Text around a marker ("· " before it) stays text. The avatar keeps its color but shows "•" instead of the first letter. The repo, branch and ahead/behind tail is dropped. - **Masked machine.** The header, the "New space on" rows of the new menu and the agents list show a smudge. "This computer" is never masked. - **Tab bar.** A masked tab (its space is masked, or its name or any of its terminals' title, folder or branch matches a phrase) shows its program's name ("Claude Code", "zsh"), or "Tab N" when there is no program. Every pill is tinted in its tab's color: the selected one at about 18% fill with a 60% border, the others at about 9% fill with a 30% border. Right-clicking a pill opens `tab-menu`. - **Agents list.** Agents in a masked space show the masked space name. In a smudged space their titles and sub-agents are smudged too; in an aliased one the aliases are swapped into them. The list is always by priority (Needs you, Done, Working, Idle, with Pinned on top). The shipped mod's "Grouped by space" view and its sort button are removed. Rows show the tab (or the agent's title) on the first line and, on a second 11px line, the space and the machine, both masked. - **Demo mode.** While `shared("demo")` is true, every mod here reads spaces, tabs, panes, agents and terminals from `demo.js` instead of Herdr: four made-up spaces with their tabs and seven agents whose states move on a timer (`shared("demo.tick")`). Only this computer shows in the machine list. Clicking a made-up tab or space selects it (`shared("demo.sel")`) instead of running a Herdr action, and the tab bar, agents list, status bar and pane headers follow that selection. Pins and drag order are not saved in demo mode. Privacy still applies on top, but nothing real is drawn. In the Sit & Watch layout the card and pane colors follow the made-up tab too. - **Demo session.** In a layout whose terminal block sits in a stack with id `main-stack` (children `main` and `demo-session`), `screenshot-spaces` selects `demo-session` while demo is on. That mod draws a made-up Claude Code style session for the selected made-up tab: its own script, header, program and tab color, typed out line by line while working, ending on a permission prompt when blocked, finished when done. It paints the pane gradient and focus color it reads from the layout's `main` block, so it matches the real panes. When demo goes off it hands the area back to `main`. A layout without `main-stack` is left alone. - **Git line.** A space's repo, branch and ahead/behind sit on a second, 11px line under its name, so the name gets the full row (44px tall). Dense rows keep them on one line after the name. - **Space tree.** A chevron at the right end of each space row lists its tabs under it. When another space is selected it opens, every other space closes (hand-opened ones too) and its machine unfolds, so the selected tab's row is on screen: the list can't be scrolled from code, since only virtual lists can and their rows take no clicks. Selecting any tab also reopens its space if it was closed by hand. Other spaces can still be opened by hand until the next change of space. A tab with one pane is one row: the pane's program icon, the tab name, and after a dimmed "·" the agent's own title or the shell's last command (left out when it repeats the tab or program name). A tab split into several panes is a tab row with a row per pane under it. Agents' live sub-agents nest under them. Clicking a tab selects it, a pane row focuses that pane, and a sub-agent opens in peek. Names go through the same tab masking as the tab bar. The last command comes from the `cmd` label that `screenshot-mode/last-command.zsh` sets (a zsh `preexec` hook running `hc label $HC_TERMINAL_ID cmd=...`; a command typed with a leading space clears it). Screenshot mode never shows commands, since they can hold tokens that no phrase would catch. - **Timing.** Agent rows in both panels, and shell rows in the space tree, show "12 min" while running and "12 min / 3 min ago" after (how long the last turn or command ran, and when it ended). Agent turns are timed from what each mod sees: a turn starts when the agent turns working and ends when it stops, kept in the mod's localStorage (`timing.js`, the same file in both mods). An agent not yet seen working falls back to the agents panel's old "10m" age, or nothing in the tree. The core's `status_ms` would be better but `terminals()` doesn't keep it current. For shells, `last-command.zsh` also sets `cmd_start` and `cmd_end` labels (ms). - **Folding and dense rows.** Clicking the "Spaces" or "Agents" title folds that section to its header (31px and 42px): the mod finds its own layout block by `content.mod` and runs `layout.resize {id, weight: 0}`, so the block's `min` holds it at header height, then puts back the size it had on unfold. A fixed `px` size didn't stay put when other blocks resized, so each render folds the block again (at most once a second) if its weight isn't 0. Folded, the title shows a count (and for Agents the most urgent state). Dense rows (the Denser rows switch in the options popup, and a list icon in the Agents header) switch: one-line agent rows with the space and machine dimmed after the name, and 24px space rows without the tab tree. Both states live in each mod's localStorage (`section.js`, the same file in both mods). Layout blocks clamp to their `min`, so a layout needs `min` of 31 and 42 on those blocks for folding to reach the header. - **Space and tab colors.** Each space's avatar color (shared `space.colors`) and each tab's own color (shared `tab.colors`, by tab id) are read by `colors.js`, the same file in every mod here. A tab without its own color uses its space's. The color tints what belongs to it: a faint wash (about 6%) behind a space's row in the Spaces list and its tree rows, stronger (about 22%) on the shown space and the selected tab row, every tab pill in the tab bar, and the pane header (wash, plus a bottom edge in the color while focused). The Spaces and Agents title bars are 30px, rounded at the top, with a wash and a bottom edge in the shown tab's color. The focused pane's outline stays the layout's `focus` color, which a mod can't set per space or tab. A color that isn't `#rrggbb` leaves the plain look. A space's right-click menu has a row of the six avatar colors under Rename, then a hex box (applied as soon as it reads as `#rrggbb`) and, on macOS, a Pick… button that opens the system color picker (`custom-color.js`). A tab's right-click menu (`tab-menu`) has the same rows, with a first ring in the space's color that clears the tab's own color. The menus stay open so colors can be tried. - **Pane header.** In a masked space the terminal title falls back to the program name and the folder text is blank. - **Status bar.** A masked machine shows as a smudge. The branch is hidden when the active space is masked or the branch matches a phrase. - **Repo and branch tail.** In the Spaces list it is also dropped when the repo or branch matches a phrase. ## How it behaves - Agent statuses (working, blocked, done, idle) look exactly as in Herdr's shipped mods. Only text changes. - Clicking a row's eye opens the phrase dialog for that row. An eye click never selects the space or tab, or folds the machine. - Marking a machine, or a phrase matching its name, masks every space on it. - A space is hidden when it is marked, its machine is hidden, or its name or folder matches a phrase and it isn't set to Visible. A tab is hidden when its space is, it is marked, or its name or any terminal in it (title, folder, branch) matches and it isn't set to Visible. Only that tab is masked then, not its space. - In the phrase dialog, Enter in either input adds the trimmed phrase with its alias. Blanks are dropped, and re-adding a phrase (any case) replaces its alias. Clicking a row loads the phrase and alias back into the inputs for editing. × removes one, and Esc or Done closes it. Changes apply at once everywhere. - Clicking the header eye, or the key `cmd-shift-h` (action `screenshot-spaces.privacy`), toggles the mode. Every mod re-renders at once because the state is shared. - The marked list and the on/off flag persist across restarts (shared state). - The gear opens the options popup. Its switches apply at once and the popup stays open. Hide phrases… closes it and opens the phrase dialog. The action `screenshot-spaces.demo` toggles demo mode, `screenshot-spaces.phrases` opens the phrase dialog, `screenshot-spaces.demo-s` selects made-up space N, and `screenshot-spaces.space-color-` sets the shown space's color (both for scripted screenshots). ## Built from Six clones of Herdr 0.1.10's shipped mods plus `demo-session`. The five `screenshot-*` mods each have the same `privacy.js` and `colors.js` copied into their folders. `demo.js` is copied into `screenshot-spaces`, `screenshot-agents`, `screenshot-tabs`, `screenshot-status` and `demo-session`. `tab-menu` has `colors.js` only, and `screenshot-spaces` and `tab-menu` share `custom-color.js`. | Mod | Cloned from | Replaces in the layout | | --- | --- | --- | | `screenshot-spaces` | `spaces` | the Spaces sidebar block | | `screenshot-agents` | `agents` | the Agents sidebar block | | `screenshot-tabs` | `tabs` | the tab bar block | | `screenshot-status` | `workspace-status` | the status bar block | | `screenshot-pane` | `pane` | the pane `header.content.mod` | | `tab-menu` | `menu` | nothing: a popup the other mods open on a tab's right-click | | `demo-session` | (new) | the `demo-session` child of a `main-stack` stack, if the layout has one | - **State.** It lives in `shared("privacy")` as `{ on: boolean, hidden: string[], shown: string[], phrases: { text, alias }[] }` (a plain string in `phrases` reads as a phrase with no alias), with keys `space:`, `machine:` and `tab:`. `hidden` holds rows set to Blur and `shown` rows set to Visible. Remote space ids keep their `machine/` prefix. `setShared("privacy", …)` writes it. Tab colors live in `shared("tab.colors")` as `{ : mark }`, where a mark is a `MARK` name (`ansi1` to `ansi6`) or `#rrggbb`. - **`privacy.js` exports.** `privacyOn`, `isMarked(key)`, `isShown(key)`, `setChoice(key, how)` (`"smudge"`, `"show"` or `"none"`, in one write), `toggleMarked(key)`, `togglePrivacy()`, `spaceKey(id)`, `machineKey(name)`, `tabKey(id)`, `spaceMasked(spaceOrId)`, `machineMasked(name)`, `spaceName(space)`, `machineName(name)`, `spaceOfTab(tabId)`, `tabMasked(tabId)`, `phrases()` (always `{ text, alias }`), `setPhrases(list)`, `matches(...texts)` (case-insensitive substring), `aliased(text)` (the text with aliases swapped in, or null), `tabText(tabId, text, fallback)` and `spaceText(space, text, fallback)` (the text as shown: real, aliased, smudged when its space is smudged, or the fallback), `spaceSmudged(space)` (hidden and shown as a smudge), `smudge(text)` (the marker for a smudge of that text's length) and `show(text, t)` (the text as an element, smudges drawn as bars), and `machineHidden`, `spaceHidden` and `tabHidden` (the same tests ignoring whether the mode is on, for the sidebar's eyes). It reads `spaces()`, `panes()`, `shared` and `setShared` from `herdr`, and `div` and `h_flex` for `show`. - **screenshot-spaces.** It adds `nextCommand` in `init` (a loop that toggles on `"privacy"`), a `hoverRow` id set by `on_hover` on rows and machine headers, an `eye(id, key, hidden, t, name)` helper (a click opens the phrase dialog for that row). The options popup is the same mod with `props: { options: true }` (`init` focuses it, `render` returns it). The same mod is the phrase dialog: `openOverlay({ mod: "screenshot-spaces", kind: "dialog", width: 400, height: 420, props: { phrases: true } })`, or 600 tall with `target: { key, name }` from a row's eye. With `props().phrases`, `init` sets up two `InputState`s (submit in either adds the phrase), plus a third for the target's alias, and skips the sidebar's git and machine timers, and `render` returns the dialog. Icons are `mods/screenshot-spaces/eye.svg` and `eye-off.svg` (24×24, stroke `currentColor`, width 2, drawn with `svg()`). It is also the new menu: `props: { newMenu: true, space, own, linked, remotes }`. The header's + opens it for the active space (`own: false`) and right-clicking a space opens it for that space (`own: true`). It lists Terminal and the installed agents (keys 1 to 9) for that space, New space plus "New space on" each connected machine (masked), and New/Open worktree. With `own` it also shows the space's masked name, Rename and the color rows at the top, and Remove worktree (for a linked worktree) and Close space at the bottom. The agent list shows at most 8 rows (6 on a space's own menu) and scrolls, so the space's items stay inside the 652px popup. Right-clicking a tab or pane row in the space tree opens `tab-menu` for that tab. It replaces the shipped `menu` mod's space menu and the old "New space on" chooser. - **screenshot-agents.** A `sn(a)` helper gives the space name through `spaceName`. Every `a.space_name` uses it. `label(a)` returns `a.program?.name` for a masked tab. The machine tag goes through `machineName`. Right-clicking an agent row opens `tab-menu` for its tab. - **screenshot-tabs.** The pill name is `tabMasked(c.id) ? program?.name ?? \`Tab ${i + 1}\` : `. The `+` opens Herdr's shipped `new-menu` (a 250 by 512 popup). - **screenshot-pane.** `masked = tabMasked(p.tab)`. The title skips `p.title` when masked and the folder renders "". - **screenshot-status.** `machineName(space.machine)`, and the branch label only when `!spaceMasked(space) && !(privacyOn() && matches(space.branch))`. Each render also calls `syncGradient()` from `gradient.js`. It does nothing unless the shown layout is `sit-and-watch`, where it repaints that layout's card and pane backgrounds and edges in the shown tab's color with `layout.set`. - **Programs and files.** The mods run only what the shipped mods already run: `git` (branch and status for the Spaces list, via `exec`) and `hc machine ls --json`. They make no network requests and read no files outside their folders. ## Watch out - A mod cannot import another mod's files (`../other-mod/x.js` fails `herdr-app check` with "resolves outside the application directory"). So `privacy.js`, `colors.js`, `custom-color.js` and `demo.js` are copied into every folder that uses them. Keep the copies identical. - The header used to draw its own help box on hover. It is gone, and the eye carries `.tooltip(...)` instead. - An absolute overlay must be the root's last child, or the list paints over it. - `mod.clone` rewrites `mods//…` asset paths. When renaming a clone, rewrite them too: `mods/screenshot-tabs/win-*.svg`, `mods/screenshot-pane/*.svg`, `mods/screenshot-spaces/eye*.svg`, and the spaces mod's own overlays (`openOverlay({ mod: "screenshot-spaces" })` for the phrase dialog and the new menu). - A dialog sizes to its content, so a `flex_1().min_h(0)` list inside it collapses to nothing. A scrolling list with only `max_h(220)` grows to the full 220px and pushes Done out of the dialog. Give it an explicit height: `h(Math.min(Math.max(count, 1) * 30, 220))`. - Saving a mod reloads it in place without re-running `init`. A flag set there won't show until the next start. - It cannot mask what a terminal prints (shell prompts with user and host, paths in output), the Cmd+P picker, the Files and Changes panels, menus or other mods. Sub-agent rows keep their own names unless their space is smudged. - The key is `cmd-` (macOS). On Linux or Windows bind `ctrl-shift-h` or similar instead. The help text says Cmd+Shift+H either way. - These are clones of Herdr 0.1.10's mods. On a later Herdr, a fresh build from this recipe on top of new clones is safer than copying the files. - To use it, point your own (cloned) layout's blocks at the five `screenshot-*` mods. `tab-menu` needs no block. For the demo session, wrap the terminal block in a block with `"id": "main-stack", "type": "stack"` whose children are the `main` block and a block with `"id": "demo-session"` and `"content": { "mod": "demo-session" }`. The installer has to do this, since the mod ships no layout. ## Done when 1. `herdr-app check ~/.config/herdr-app/mods/` passes. 2. The layout's spaces, agents, tab bar, status bar and pane header blocks name the `screenshot-*` mods, and `herdr-app status` shows `"errors": []`. 3. Clicking the gear beside "Spaces" opens the options popup with Screenshot mode, Denser rows, Hide phrases… and Demo mode. 4. Clicking a space's eye with the mode off leaves a crossed-out eye on that row, and `shared("privacy").hidden` contains `space:`. 5. Cmd+Shift+H changes the header to "Spaces · screenshot mode". The marked space reads as a smudge with a "•" avatar and no git tail. Its tabs show program names, its agents show the smudge, its pane header has no folder, and the status bar has no branch. 6. Marking a remote machine and turning the mode on shows "Machine 1" in the sidebar header, the new menu, the agents list and the status bar, and masks every space on it. 7. Hide phrases… in the options popup opens "Hide phrases". Adding a phrase found in a space's name (mode on) turns that row into a smudge without any eye click, and with the mode off its row shows a crossed-out eye. Clicking that eye opens the dialog. Removing the phrase brings the name back. 8. Adding "top secret client name" with alias "bob": a space named "top secret client name api" reads "bob api", and a terminal titled "notes on top secret client name" shows "notes on bob" in its pane header. A space also marked by hand still shows a smudge. 9. A phrase found only in one tab's terminal title or folder masks that tab's pill, pane header and agent rows, but not the space name. 10. Cmd+Shift+H again restores every real name. Marks survive a restart. 11. Hovering a tab pill shows its eye. Picking Blur in its dialog smudges that tab's pill, tree row and pane header in screenshot mode, and `shared("privacy").hidden` contains `tab:`. Picking Visible for a row hidden by a phrase shows its real name while the phrase stays in the list. 12. Right-clicking a tab and picking a color tints its pill and pane header in it. The ring in the space's color puts the space's color back. 13. Demo mode on: the Spaces list shows four made-up spaces, the agents list seven made-up agents, and with a `main-stack` layout the terminal area shows a made-up session. Off: every real space and terminal comes back.