# Black Precision A matte-black Herdr layout for reading agent-written markdown beside the agent. The left sidebar lists spaces and agents; the middle is the active tab's terminals; the right is a document reader on its own, slightly lifted surface; a thin instrument-style status bar runs along the bottom of the work area. Almost everything is flat color and hairlines, with one blue accent and green for things that are alive or done. ![Black Precision](preview.png) ## What you see Left to right, a root `row` with a 1px `border` divider and no titlebar (`titlebar: none`; the brand block drags the window). - **Sidebar**, `column`, 268px (min 44, max 480), background `chrome` (`#000000`). Top to bottom: the shipped `workspace-chrome` brand block (46px), then spaces and agents lists, equal weight (min 90 each), then the shipped `workspace-chrome` footer (69px). Spaces are plain text rows (no letter tiles); the active row has a `raised` (`#0d1017`) background. - **Work area**, `column`: the shipped `tabs` bar (42px), then `work-body`, then the status bar (34px). - **Work body**, `row`, padding 0, gap 0, 1px `border` divider. Left: the active tab's panes, weight 3 (min 320), pane `background` = the terminal color (`#050506`), **no border, no focus ring, radius 0, gap 0**, with the shipped `pane` header (30px, always shown) and `lone: true`. Right: the panel, weight 2 (min 260, max 900), a `stack` holding the reader (`bp-reader`, the default) and the shipped `changes` panel. - **Reader** background is `surface` (`#0a0c11`): a deep ink with a faint blue cast, deliberately a different shade from the terminal. Header 44px with a back arrow, the path (folder dim, filename bright) and a **Raw** toggle. Body padding 22px 28px, text column capped at 720px. Footer 36px pager (`← Prev 2 / 5 Next →`) when the document is longer than a page. - **Type:** terminals JetBrains Mono 13px; UI Geist. Terminal padding `[14, 12]`. - **Color** (theme `black-precision`, one dark theme): terminal `#050506`, bars `#000000`, surface `#0a0c11`, raised/hover/selected `#0d1017`, border `#14161b`, input `#1d2029`, text `#e6e8ee`, muted `#8b90a0`, dim `#6b7080`, accent blue `#5aa2ff`, working/ticks green `#5fd38d`, blocked amber `#e5b567`, idle `#4a4e5c`. ANSI colors are in `themes/black-precision.json`. ## How it behaves - **Agent status:** working = green dot, needs you = amber, idle = dim (the shipped `agents` list, recolored by the theme). Status bar counts mirror them. - **Reader, a document opens** when you click a file in its tree (the shipped Files behavior). The open file **re-reads itself** when the folder changes on disk. **Raw** swaps the rendered view for the source with line numbers; a second click returns. - **Location bar** (44px, top of the reader, the same height as the tab bar): the path as clickable mono breadcrumbs, `~ / Projects / atlas`, last part bright and the others dim; clicking a folder makes it the tree root; more than four parts collapse the front into `…`. Clicking the empty part of the bar (or the `bp-reader.edit` command) turns it into an inline path field with a 1px accent underline and no box; Enter opens a file or folder (`~` and relative paths work), Escape or clicking away cancels, a bad path shows `No such file or folder` in amber until clicked. A folder icon at the right opens the system folder picker. With a document open the bar shows its path (last part not a link), a `←` back arrow and the Raw toggle. The chosen root is remembered per space. - **Keys:** `keys-example/keys.json` binds `alt-o` to `bp-reader.edit`; merge it into your `keys.json` (check `alt-o` is free). - **Paging:** a markdown file is split into pages of about 12,000 characters, preferring to break before an `#`, `##` or `###` heading after about 6,000, and never inside a code fence. Only the current page is drawn. Changing page resets scroll. - **Markdown elements** (parsed in `md.js`): - `#` white 26px; `##` a dim `##` marker then green 18px; `###` a dim `###` marker then blue 15px; deeper headings white 14px. - Paragraphs, list text and quote text use Herdr's native `TextView.markdown`, so bold, italic, inline code and links are native. Links are the accent blue. - Task list: done = a 16px green rounded square with a dark `✓`; open = a 16px square with a 1px `idle` border and muted text. Plain bullets are a dim `•`, numbered items a dim mono `1.`. - Quote: a 3px accent bar, stretched to the text height, then the text. - Code block: `chrome` background, 1px `border`, radius 8, padding 14, mono 12px, a tracked language label. Up to 80 lines get token colors (comment dim, string green, keyword violet `ansi5`, number amber); longer blocks are plain. - Table: tracked caps header in `dim` over a `input` rule, rows on `border` hairlines, first column bright, others muted; in the last column `done`, `shipped`, `merged` are green mono, `open`, `todo`, `blocked` amber mono, `wip` blue mono. - `---` is a 1px `border` line. - **Status bar:** bold number + tiny tracked caps label, repeated for `AGENTS`, `WORKING` (green when above zero), `NEEDS YOU` (amber when above zero), `BRANCH`; the palette hint is on the right. There is no letter-spacing in GPUI, so tracking is a hair space (`U+200A`) between capitals. ## Built from - `layouts/black-precision.json`: the node tree above (ids `root`, `sidebar`, `brand`, `sidebar-lists`, `spaces`, `agents`, `sidebar-footer`, `work`, `tabs`, `work-body`, `main`, `panel`, `panel-body`, `files`, `changes`, `status`). Root look: `theme: black-precision`, `ui_font: Geist`, `font: JetBrains Mono`, `font_size: 13`, `terminal_padding: [14, 12]`, `preview: layouts/black-precision.png`. - `themes/black-precision.json`: background, foreground, selection, cursor, 16 ANSI colors, and the `colors` overrides listed above. - `mods/bp-reader`: a clone of Herdr's `files` mod (file tree unchanged) plus `md.js`, the markdown renderer (`parse` and `render`: blocks to GPUI elements, `TextView.markdown` for inline text), paging, the Raw toggle, live re-read through `watchFolder`, and an optional `file` prop that opens a path directly. - `mods/bp-spaces`: a clone of Herdr's `spaces` mod with the green letter tile removed from each space row. - `mods/bp-status`: the readout bar, using `spaces()`, `agents()`, `theme()`, `run("app.palette")`. - Shipped mods used as-is: `workspace-chrome`, `agents`, `tabs`, `pane`, `changes`. - Uses `exec` (`sh`, `git`), `readTextFile`, `watchFolder`, and no network. ## Watch out - **Bold needs a system font.** In Herdr 0.1.10 the bundled Geist, Geist Mono and JetBrains Mono never render bold, at any weight. Headings (`md.js`) and the status numbers (`bp-status`) therefore set `font_family` to `Noto Sans` with weight 700 (Liberation Sans also works). If it is not installed they fall back to regular weight. - **Inline code** is a native chip and cannot be recolored; it stays white. - **TextView ignores color.** Neither HTML tags nor spans recolor text in `TextView`, which is why headings, ticks, quotes, code and tables are drawn by hand and only inline text is native. Do not replace `md.js` with one `TextView.markdown` call and expect color. - **Do not render a whole large file at once.** Mods redraw on every live-data change; a 238 KB file in a single `TextView` froze the app. Keep the paging. - A layout needs the shipped `workspace-chrome` mod's SVG assets (`mods/workspace-chrome/*.svg`); `bp-spaces` references them. - Clones do not update with Herdr. Tested on app 0.1.10. - The **Agents** list only shows agents that report their status; a plain terminal running an agent may show "0 agents". ## Done when 1. `herdr-app check` passes for `bp-reader`, `bp-spaces`, `bp-status`, and `layout.switch black-precision` produces no `layout.error`. 2. No border or focus ring appears around the active terminal pane. 3. The reader's background is visibly different from the terminal's. 4. Opening a markdown file shows a green `##` heading, green ticks on done items, a blue quote bar and a colored code block. 5. Opening a document of 200 KB or more pages into many pages and the app stays responsive (idle CPU in single digits). 6. Editing the open file on disk updates the reader within a few seconds. 7. Space rows show no letter tiles; the status bar shows the four readouts.