# Jump `Cmd+1…9` goes to a space and `Ctrl+1…9` to an agent, counted as the sidebar lists them. Right after a jump, every space and agent in the sidebar shows its number in a small pill for two seconds, so you learn the numbers without counting. ![Jump](preview.png) ## What you see - Nothing new until you jump: the Spaces and Agents lists look exactly like Herdr's own. - After `Cmd+N` or `Ctrl+N`, for 2 s, in **both** lists at once: - **Spaces**: each space's 18×18 colored letter avatar becomes a pill with its number: radius 5, `accent` background, 10.5 px bold digit in `accent_foreground`. A worktree row's branch glyph becomes the same pill. Rows don't move or change size. - **Agents**: each agent's 16×16 program icon becomes a 16×16 pill with its number, same colors. - Only 1–9 get a pill; rows past the ninth keep their avatar or icon. - The narrow sidebar rail (under 160 px) already shows numbers; it is unchanged. ## How it behaves - `Cmd+N` (`spaces-jump.N`) selects the Nth space **as listed**: worktree spaces nested under their repo's space, then other machines' groups in name order. Spaces in a folded machine group are skipped. - `Ctrl+N` (`agents-jump.N`) focuses the pane of the Nth agent **as listed**: pinned agents first, then the list in its current sort (grouped by space, or by priority). Sub-agents don't count. It's the same order `agent.next` follows. - A number with nothing behind it does nothing but still flashes the pills. - Each jump restarts the 2 s. The pills go by themselves, with no timer running while they're off. - Agent statuses (working, blocked, done, idle) look and behave exactly as in Herdr's agents list. ## Built from - `mods/spaces-jump/` and `mods/agents-jump/`: copies of Herdr 0.1.9's shipped `spaces` and `agents` mods (`herdr-app do mod.clone`), with only these additions (marked at the top of each `main.js`): - `nextCommand()` loop in `init`: a command `"1"`…`"9"` calls `jump(n)` and sets shared `"jump.flash"` to `Date.now() + 2000`. - Spaces: `grouped()` records the drawn order in `this.order`; `jump(n)` runs `space.select {id}`. Agents: `render` keeps the list in `this.list`; `jump(n)` runs `pane.focus {pane}`. - `flashing()` reads shared `"jump.flash"`, so both lists light up together; `cx.timer.after` schedules one redraw when it runs out. - `keys.json`: `cmd-1`…`cmd-9` → `spaces-jump.1`…`9`, `ctrl-1`…`9` → `agents-jump.1`…`9`. - A layout whose `spaces` and `agents` blocks use these mods. Herdr's shipped layouts are read-only, so: `herdr-app do layout.clone '{"name":"main","as":"my-layout"}'`, then in `layouts/my-layout.json` change `"mod": "spaces"` → `"spaces-jump"` and `"mod": "agents"` → `"agents-jump"`. - `herdr` functions: the shipped mods' own, plus `nextCommand`, `shared`/`setShared`, `run`. No programs, no network, no files beyond what the shipped mods already do. ## Watch out - In Herdr's default keys, `Cmd+1…9` selects **tabs** and `Ctrl+1…9` selects spaces. Installing this takes both; tabs keep `Cmd+Shift+[` / `]` and clicks. Ask before replacing a key the person uses. - Not `Cmd+Shift+N` for agents: on macOS `Cmd+Shift+3/4/5` are the system's screenshots and never reach the app. Not `Option+N` either: on many keyboards it types `@`, `#`, `|`. - `.` keys reach shown copies only: with the sidebar hidden (`Cmd+B`) the keys do nothing. - On Linux and Windows `cmd` is the Super key; pick other keys if the desktop takes them. - The pills can't appear on merely holding Cmd: a mod hears modifier keys only while it has the keyboard, and while you type the terminal has it. - These are copies of 0.1.9's sidebar: they won't get Herdr's later sidebar changes. To update, clone the new `spaces`/`agents` and reapply the additions above. ## Done when - `herdr-app check mods/spaces-jump` and `herdr-app check mods/agents-jump` pass. - With the layout switched to the one using them, `Cmd+2` selects the second space in the sidebar, worktrees counted where they're drawn. - `Ctrl+1` focuses the first agent in the Agents list, a pinned one if any is pinned. - Right after either, both lists show numbered pills for about 2 s, then their avatars and icons again. - `herdr-app do spaces-jump.1` does the same as `Cmd+1`.