Repository navigation
Description
Problem
When a script or the herdr CLI moves herdr's focus (for example herdr tab create --focus followed by herdr tab focus <tab_id>), the native herdr terminal switches to the new
tab. The web UI keeps showing whichever pane was selected before. The new tab appears in the sidebar, but I have to click it myself.
My use case is a small wrapper that opens a new tab in the current workspace and starts an agent in it:
out=$(herdr tab create --workspace "$HERDR_WORKSPACE_ID" --cwd "$PWD" --focus)
herdr pane run "$pane_id" "claude"
herdr tab focus "$tab_id"When I run it from a pane I'm using through the web UI, I'd expect the web UI to jump to the new tab the same way the terminal client does.
Current behaviour (from reading the source, v0.3.41):
server/collector.tsalready subscribes topane.focused, and per the comment there it also fires when a tab or workspace is brought to the front.- The
onFocushandler inserver/index.tsonly uses the event for completion state (done→idleviacompletions.seen). It never tells clients which pane is now focused. - The client keeps its own
selectedPaneId(src/App.tsx, also stored inlocalStorage). It changes only on user action, a notification tap, or?pane=at load time.
Environment: herdr 0.9.3 · herdr-web-ui 0.3.41 · macOS 26 (Darwin 25.5)
Proposal
- In
onFocus, also broadcast something like{ type: "pane-focused", pane_id }to connected clients. - In the client, when that message arrives and a new "Follow herdr focus" setting is enabled, call
selectPane(pane_id)(orselectTargetwith the current machine).
I'd keep it opt-in, off by default, or limit it to the client that issued the action if that can be identified. Otherwise a focus change at the desk would also switch the
view on a phone that is open on another pane.
Where
Sidebar and navigation
Workarounds and alternatives
No response
Activity
feat(navigation): follow herdr's focus on a device that asks to (devs…