From f4a7346fd32f906ccc814364462c18afb3f10616 Mon Sep 17 00:00:00 2001 From: Igor Soarez Date: Thu, 22 Oct 2026 18:01:04 +0300 Subject: agent search: spotlight-style fuzzy finder on ctrl+opt+cmd+shift+u a centered, non-activating key panel that lists every agent and jumps to the chosen one through the same dingger focus path as a row click. - fzf-style matching: each word must match one of name, session, window, harness, status, or directory, letters in order; the best alignment wins (word starts and consecutive runs score higher), matched title letters are highlighted. - empty query keeps the menu's order, so enter jumps to the top waiting agent. - the selection follows the agent, not the position, as states change; the list scrolls to keep it visible. - keys: arrows, ctrl+n/p, ctrl+j/k, enter, esc, ctrl+u; the shortcut again or clicking elsewhere closes it. - search_hotkey setting; an unedited config file is upgraded. menu item "Search Agents...". rows carry the pane's directory. - --print-search and --snapshot-search debug flags; the panel's background and snapshot code are shared. selftest covers matching, ranking, highlighting, and selection; e2e step 15 checks queries through the real binary (fails when search only looks at titles). e2e resolves relative binary paths, which tmux hooks need. --- tests/e2e.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests') diff --git a/tests/e2e.sh b/tests/e2e.sh index 1a5cba0..983912c 100755 --- a/tests/e2e.sh +++ b/tests/e2e.sh @@ -18,6 +18,9 @@ set -u ROOT=$(cd "$(dirname "$0")/.." && pwd) DINGGER="${1:-$ROOT/target/release/dingger}" MENUBAR="${2:-$ROOT/target/dingger-menu}" +# tmux hooks run these from other directories: make them absolute. +case "$DINGGER" in /*) ;; *) DINGGER="$PWD/$DINGGER" ;; esac +case "$MENUBAR" in /*) ;; *) MENUBAR="$PWD/$MENUBAR" ;; esac SOCK=dingger-e2e DIR=$(mktemp -d /tmp/dingger-e2e.XXXXXX) HOOK="$DIR/agent.sock" @@ -327,6 +330,21 @@ expect "A2 done" "opt $A2 @agent_state" done launchd_env "$DINGGER" focus expect "dingger focus (jump shortcut) jumps, under launchd's PATH" "client_window" wa2 +# --- 15. agent search ---------------------------------------------------------- +echo "15. agent search" +if [ -x "$MENUBAR" ]; then + mb() { DINGGER_TMUX_SOCKET="$SOCK" DINGGER_BIN="$DINGGER" "$MENUBAR" "$@"; } + expect "empty query lists every agent" "mb --print-search '' | tail -1 | cut -d' ' -f1,2" "4 agents" + expect "fuzzy name match, selected" "mb --print-search 'rvw42' | head -1 | cut -f1,2" "› ○ idle Review PR 42" + expect "every word must match" "mb --print-search 'deploy 42' | head -1" "No agents match 'deploy 42'" + expect "finds an agent by its window" "mb --print-search wc1 | head -1 | cut -f3" "c · wc1 · pi" + expect "finds agents by directory" "mb --print-search \"$(basename "$DIR")\" | tail -1 | cut -d' ' -f1,2" "4 agents" + hook "$A2" working + expect "status word ranks first" "mb --print-search working | head -1 | cut -f1" "› ◐ working" +else + fail "menu bar binary not found at $MENUBAR" +fi + echo echo "$PASSES passed, $FAILS failed" [ "$FAILS" -eq 0 ] || { echo "--- daemon log tail"; tail -30 "$DIR/daemon.log"; exit 1; } -- cgit v1.2.3