Repository navigation
feat(agent): a window list to pick from, and somewhere to step from on a cold start - #25
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
moveFocusnow 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.
--windowsprints the ring as JSON, built from the window server and Accessibility on the spot, soa second copy of the binary answers whether or not the agent is running.
heed://focus/id/<n>takesa 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/uplanding on the right neighbour; focusing a window by its id from the realpalette 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-packageandray lintare 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.