feat(cli): implement logical component tracking for visual journey testing

- Enhance AppRig and matchers to support robust component discovery via node attributes and styles

- Update SuggestionsDisplay to support logical component tagging

- Fix act() warnings and stability issues in SuggestionsDisplay tests

- Refresh snapshots and rebase on origin/main
This commit is contained in:
Taylor Mullen
2026-03-31 16:46:46 -07:00
parent 800aea6cfb
commit 05bf04c852
11 changed files with 93 additions and 52 deletions
@@ -9,13 +9,14 @@ import { useCompletion } from './useCompletion.js';
import type { TextBuffer } from '../components/shared/text-buffer.js';
import type { Suggestion } from '../components/SuggestionsDisplay.js';
function useDebouncedValue<T>(value: T, delay = 200): T {
function useDebouncedValue<T>(value: T, delay = 200, enabled = true): T {
const [debounced, setDebounced] = useState(value);
useEffect(() => {
if (!enabled) return;
const handle = setTimeout(() => setDebounced(value), delay);
return () => clearTimeout(handle);
}, [value, delay]);
return debounced;
}, [value, delay, enabled]);
return enabled ? debounced : value;
}
export interface UseReverseSearchCompletionReturn {
@@ -48,7 +49,11 @@ export function useReverseSearchCompletion(
setVisibleStartIndex,
} = useCompletion();
const debouncedQuery = useDebouncedValue(buffer.text, 100);
const debouncedQuery = useDebouncedValue(
buffer.text,
100,
reverseSearchActive,
);
// incremental search
const prevQueryRef = useRef<string>('');