# Perch A small floating dock for Herdr that keeps projects, SSH machines, scripts, and commands within reach. It appears on demand without moving the workspace. A built-in Today pin opens a local Git recap, with commits and uncommitted changes grouped by the projects the person selects. ![Perch](preview.png) ## What you see - A bottom-center launcher labeled **Perch**, 65 × 25 logical pixels, with a 13 px outline pin icon and 10 px text. The layout's floating-block frame may add padding. It disappears while the dock is open. - The dock is a translucent tray, 56 px high, with 8 px horizontal padding, 4 px gaps, a 1 px theme border, and 12 px outer corners. Its width fits the pins: `max(166, pinCount × 68 + 86)`, capped by its 630 px host. It overlays the workspace; it reserves no terminal space. - Up to eight 64 × 48 px pin cells. Each has a centered 19 px outline icon, a small shortcut number independently positioned at the top right, and a centered, truncated 11 px name below. The number must not push the icon off center. - Six pin colors: `#f0a847`, `#76b9ad`, `#a99ae5`, `#df91ae`, `#8aafe4`, and `#a8bf7a`. Projects use folder icons, machines server icons, commands terminal icons, scripts file icons, and Today a clock. Backgrounds, borders, selected states, and text follow `theme()` so the person's theme remains in charge. - A divider follows the pins, then a ghost plus button and a down chevron. No large filled tiles, labels above the dock, or permanent full-width bar. - The plus button expands a 560 px-wide picker above the tray inside the same 630 × 440 px overlay host. It has a 15 px **Pin something** heading, a quiet **New pin** action, a 32 px search input, and a 264 px scrolling list of flat 44 px rows. Each row shows an outline icon, a name, a muted destination, a type, and **Pin** on hover/selection or **Pinned** when already present. A 10 px footer explains drag, right-click, and Enter. There are no category tabs. - Right-clicking a pin replaces the picker with a compact editor: name, destination and (for commands/scripts) working directory, six color choices, Unpin, Back, and Save pin. Today has only name and color; its projects are configured in its own panel. - The Today panel is a separate 600 × 490 px window near the bottom center. Its header contains a clock, **Today's work**, Projects, Refresh, and close. Below are the local date, total commits, and number of projects with working changes. Project sections show counts, last commit age, up to two commit subjects, and a chevron. Expanding reveals all commit subjects with short hashes and current changed paths with status letters. Project names open their workspaces. The bottom has a quiet local-Git explanation and **Full recap ↗**. - Full recap opens a normal Herdr mod tab with all sections expanded initially and a scrolling body. Projects opens a folder checklist with an **Add project…** folder picker. A fresh installation has no selected folders. ## How it behaves - Clicking Perch or pressing `cmd-shift-space` toggles the dock. Escape, clicking outside the dock, or its down chevron closes it. The dock is a `kind: "window"` overlay with no native frame, a remembered position key, and a bottom-aligned content host. Opening it hides the launcher rather than leaving two overlapping controls. - The compact dock supports arrows and Enter, or numbers 1–8 to launch pins. Typing opens the picker with that text. Number shortcuts do not launch anything while browsing or editing. Picker Up/Down changes selection; Enter pins the selected row. Left/Right continue to move the input caret. - Discovery combines local Git projects under `~/Documents/projects`, `~/Projects`, `~/Developer`, and `~/Code` (up to one grouping-folder level), scripts under those repositories' `scripts/` folders, scripts in `~/bin` and `~/.local/bin`, SSH aliases from `~/.ssh/config`, and Herdr's machines/spaces. Use real folder basenames, not possibly stale workspace labels. Deduplicate by kind, machine, and destination. Omit the home directory as a project. Recent launches sort first. - A fresh dock starts with Today only. It never bundles the author's project paths, SSH hosts, commands, state, or personal theme. Clicking or dragging a picker result pins it; duplicate destinations are ignored. Finder file/folder drops are classified into projects, scripts, or files. Keep at most eight pins. - Dragging more than four pixels starts pin reordering; preview the order under the pointer and persist on release. A click without a drag launches. Right-click edits. Pinning and editing never execute a command. - Project launch first verifies the folder exists. Focus an existing local pane whose live `cwd` matches; otherwise create a project space explicitly on this computer. Do not use stale space-folder metadata or select a remote pane with the same path. - A registered machine pin selects an existing space on that machine or creates one there. A custom SSH destination starts `ssh` with the destination as a separate argv argument. Reject destinations containing shell commands/options. Existing SSH authentication remains the person's responsibility. - Commands/scripts show their exact command and working directory once before first execution for that destination/folder. On confirmation, open a visible terminal. Script paths are shell-quoted literally; Python scripts use Python 3, JavaScript uses Node, and shell scripts use zsh. Missing local paths show an actionable error and keep the dock open. Commands are not silently run in the background. - The Today reader runs on open and Refresh, and after changing project selection. It reads only selected Git roots. It uses the current local day from midnight through the refresh instant, deduplicated commits reachable from local branches and HEAD, filtered by each repository's configured Git email (or name fallback). It uses commit timestamps. Current staged, unstaged, and untracked items are shown separately; their age is not inferred. Handle renames and unusual file names using NUL-delimited status output. A missing/unreadable repository does not hide the other projects. Empty repositories still show uncommitted items. With no Git identity, show an explanation rather than attributing other people's commits to the user. - Selecting folders persists locally. Folder selection is explicit: do not automatically scan every repository for the recap. Today's work does not read Codex conversations, call an LLM, infer a narrative, fetch GitHub data, or contact a server. - No agent-status widgets are part of Perch. Working, blocked, done, and idle agents retain their existing appearance in the surrounding Herdr interface. ## Built from - Two personal mods: `mods/perch/` for the launcher/dock/picker/editor, and `mods/perch-today/` for the recap. Both use `mod.json` with `place: "none"`. Build them with native `gpui-kit`/`gpui-base` JavaScript, not HTML or a web view. - Perch's default copy renders the launcher and listens to `nextCommand()` for `toggle`/`add`. Its overlay copy receives `{dock: true, browse?: true}` via `props()`. Store pin and confirmation data through `shared()`/`setShared()`, using a Perch-specific namespace. Use `View.close()` to clear the open-overlay id so the launcher returns when the overlay is dismissed. - Use `openOverlay`, `closeOverlay`, `theme`, `home`, `appHome`, `spaces`, `panes`, `machines`, `focused`, `run`, and `exec`. Use a focus handle, `InputState` and `Input`, native flex layouts, overflow scrollbars, mouse/drop handlers, and an approximately 180 ms width transition. - Outline SVG assets are loaded from Herdr's shipped `mods/workspace-chrome/` icons: folder, server, terminal, file-text, layers, search, clock, pin, plus, x, chevron-down, chevron-right, check, square, and git-branch. No external artwork or fonts are required. Consult the installed `herdr.d.ts` and GPUI type definitions; they are the API source of truth. - The catalog is a small Python 3 helper invoked with argv, returning JSON. It reads directory metadata and SSH aliases; it does not connect to machines. The recap's separate Python helper invokes local `git` read-only with optional locks disabled. It returns per-project errors rather than one all-or-nothing result. - Launch commands include `pane.focus`, `space.select`, `space.new`, `terminal.open`, and `tab.new`. Local file/URL pins use `/usr/bin/open`. Path checks use `/bin/test`, never `/usr/bin/test` on macOS. No install-time command executes a pinned action. - Add one floating block to the person's current workspace container, preserving all existing nodes and floating blocks: ```json {"id":"perch-float","content":{"mod":"perch"},"edge":"bottom","align":"center"} ``` Clone the active layout first if it is shipped. Perch is a mod package, not a replacement layout. Keep existing search buttons, panels, themes, and bindings intact. Do not distribute a `layouts/` folder. - Merge the supplied `keys.json` snippet rather than replacing the person's file. If `cmd-shift-space` is occupied, retain the current binding and agree on an unused shortcut. ## Watch out - This version targets macOS. Python 3, Git, and zsh must be available; SSH/Node are needed only for the corresponding pins. It uses macOS paths such as `/bin/test` and `/usr/bin/open`. Linux/Windows behavior is not established. - Herdr's mod JavaScript has no DOM, Node APIs, or `setTimeout`. Do background work in `cx.spawn`; use that task's own `cx.notify()`. A successful initial `herdr-app check` does not exercise picker rows, async results, or launch behavior. - Herdr does not allow imports outside a mod's own folder. Keep both mods self-contained. Do not import Perch's model into the Today mod. - Hide the launcher with a zero-sized element while the overlay is open; returning null caused a render error. The overlay's transparent host is larger than the visible tray. Do not implement the dock as a normal layout row, which would shift terminals upward. - Use `panes().cwd` when reusing a project. A space's original folder and user-assigned name can refer to different projects now. - Generic new pins infer known projects/machines first, `user@host` as SSH, absolute script extensions as scripts, other absolute paths as projects, and other text as commands. Legacy file/URL/thread pin support exists, but the picker does not offer a thread catalog. Conversation search is a separate optional mod, not bundled here. - Six picker rows are visible in the fixed host, with scrolling for the rest; catalog rendering is capped at 120 matching rows. Pin names truncate to 60 px. Drag preview snaps between positions; it is not a spring animation. There is no hover-to-open behavior or drag source added to Herdr's shipped sidebar. - A command's terminal follows the current Herdr space/machine. For local commands use a local space. Custom SSH destination pins are intended to be launched from a local space. Registered machines use Herdr's explicit machine routing. - A Git recap is not all work performed today. Uncommitted work can predate today, commits without a selected local branch/HEAD are absent, configured identity may omit alternate emails, and no conversation-only activity is included. Last commit time is not last keyboard activity. - Refresh is explicit/on open; there is no continuous Git watcher. Error and empty states must be honest and readable. ## Done when 1. Both mod folders pass `herdr-app check`; inspect `herdr-app status` for hot-reload errors and actually try the UI. 2. Perch opens/closes by button and shortcut, leaves workspace geometry unchanged, and hides its launcher while open. Existing thread search and other layout controls remain present and working. 3. Pin a real project, a machine, and a command; duplicates do not multiply, order persists after a drag, right-click changes name/color, and Unpin removes only that pin. Test number shortcuts while compact and while typing into the picker. 4. A project pin reuses the matching live local pane or opens the correct local folder. A missing project stays open with a useful error. SSH is passed as argv. A command previews its exact working directory and command before execution. 5. Today's work starts empty, permits folder selection, refreshes, distinguishes commits from working changes, expands changed paths, opens projects, and opens a full recap tab. It reads no unselected project history. 6. Exercise Git fixtures for local midnight boundaries, alternate authors, commits on other local branches, future timestamps, renames, unusual filenames, an unborn repository, and a missing repository. Existing pin/model tests still pass. 7. Capture a real screenshot, check it for private content, and save `preview.png` beside this recipe. Publish only the source mods, key snippet, documentation, tests, and preview; never publish the person's Herdr state/configuration. Add the public repository topic `herdr-mod`.