Skip to content

feat(agent): a window list to pick from, and somewhere to step from on a cold start - #25

Merged
rbstp merged 7 commits into
masterfrom
feat/window-list
Sep 7, 2026
Merged

rbstp merged 7 commits into
masterfrom
feat/window-list

Conversation

@rbstp

@rbstp rbstp commented Sep 6, 2026 •

Copy link
Copy Markdown
Owner

Two things, one for the agent and one for the extension that drives it.

A focus shortcut that could not say where focus was did nothing at all. That is the ordinary case
for a URL rather than a keystroke: the launcher is in front and excluded from the ring, and on a
cold start there is no earlier app to remember either. moveFocus now resolves a source in order,
the system's live answer, then the app holding the front, then the window under the pointer, which
is the answer a focus-follows-mouse tool should have had all along. An app that was asked for its
windows and stayed silent still refuses, since neither the pointer nor the first entry may speak
for a window the ring never saw.

--windows prints the ring as JSON, built from the window server and Accessibility on the spot, so
a second copy of the binary answers whether or not the agent is running. heed://focus/id/<n> takes
a window back by the number the window server gives it. That pairing matters: a place in the ring is
only true of the ring it came from, and Heed rebuilds the ring on every command, so a window opening
or closing between the list and the pick would otherwise focus the wrong one. Ring numbers now also
run past the nine the digit keys reach.

The Raycast extension briefly grew a Search Windows command on top of the list and then lost it
again, in the last commit. Raycast ships a native Switch Windows that is already a searchable window
list which focuses the pick, and their guidelines name comparable native functionality as a
rejection reason. The extension keeps what nothing native does: focus by direction, and the
focus-follows-mouse switch. The list stays a scripting surface rather than a command.

Verified live throughout: cold start with Heed unloaded, Raycast in front and the pointer over one
window, heed://focus/up landing on the right neighbour; focusing a window by its id from the real
palette while that command still existed; and a stale id refused with a line in the log rather than
a wrong window. 240 unit tests, make check-package and ray lint are clean.

An adversarial review found seven defects in the first cut of this and every one is fixed in the
second commit, the id addressing above being the one that mattered.

…n a cold start

`--windows` prints the focus ring as JSON in the order the numbered shortcuts
count. It reads the window server and Accessibility for itself rather than
asking the running agent, so a second copy of the binary can answer it, and
window numbers now run past the nine the digit keys reach.

A shortcut that could not say where focus was did nothing. That is the ordinary
case for a URL: the launcher is frontmost and excluded, and on a cold start
there is no earlier app to remember either. Falling back to the window under the
pointer is the answer a focus-follows-mouse tool should have given all along.

The Raycast extension grows a Search Windows command on top of the list, which
is the thing it does that a Quicklink cannot.
A place in the ring is only true of the ring it came from. The list command
handed back a position, and the agent rebuilt the ring before indexing it, so a
window opening or closing in between focused the wrong one. Both ends now use
the window server's number, and an id that has gone says so.

Along with the rest of an adversarial review:

- An app that did not answer is not an app with no windows. The pointer fallback
  was standing in for one, which took focus off a window the ring never saw.
- The pointer is read before the ring is built rather than after, so movement
  during those cross-process calls cannot decide what the shortcut acts on.
- The listing gives each Accessibility message 200ms rather than 500ms: every
  window costs several, and whoever is waiting on the list has a timeout too.
- The flag saying which window was in front is called frontmost, because when
  the caller holds the front that is the window server's order, not focus.
- The list validates what it parses and survives a refused application lookup.
Raycast ships a native Switch Windows that is a searchable window list which
focuses the pick, and their guidelines name comparable native functionality as
a rejection reason. What the extension has that nothing native does is focus by
direction and the focus-follows-mouse switch, so that is what it should be.

`--windows` and `heed://focus/id/<n>` stay. They are a scripting surface next to
`--probe`, and asking for a window by the number the window server gives it is
the right answer for anything outside Heed that picks one.
A dropdown of "Window 1" to "Window 9" told you nothing: the numbers are Heed's
spatial order, which you cannot know without looking. Raycast's manifest
dropdowns are static, so showing names means the command has to be a view.

Focus Window now lists every visible window with its app icon, title, app name
and size, and focuses the one picked, by the window server's number so the list
going stale cannot focus the wrong one. Nine no-view commands and this one.
A bare dot needs a hover to mean anything, and a screenshot cannot hover.
The command list, the window list, and the directional commands. 2000x1250, one
background, no other apps. Raycast's own Window Capture has no Save to Metadata
in this build, so they were composited from window-only captures.
@rbstp
rbstp enabled auto-merge (squash) September 7, 2026 00:12
@rbstp
rbstp merged commit 3be6817 into master Sep 7, 2026
1 check passed
@rbstp
rbstp deleted the feat/window-list branch September 7, 2026 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant