MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / keyboard

Function keyboard

graph-ui/src/impact/ChangeAnalysisWorkspace.tsx:52–60  ·  view source on GitHub ↗
(event: KeyboardEvent<HTMLElement>)

Source from the content-addressed store, hash-verified

50 return () => { if (previous?.isConnected) previous.focus(); };
51 }, []);
52 const keyboard = (event: KeyboardEvent<HTMLElement>) => {
53 if (event.key === 'Escape' && onClose) { event.preventDefault(); event.stopPropagation(); onClose(); return; }
54 if (event.key !== 'Tab' || !workspace.current) return;
55 const controls = [...workspace.current.querySelectorAll<HTMLElement>('button:not(:disabled), input, select, summary, [tabindex="0"]')]
56 .filter(element => element.getClientRects().length > 0 && !element.closest('[hidden]'));
57 const first = controls[0], last = controls.at(-1);
58 if (event.shiftKey && document.activeElement === first && last) { event.preventDefault(); last.focus(); }
59 else if (!event.shiftKey && document.activeElement === last && first) { event.preventDefault(); first.focus(); }
60 };
61
62 useEffect(() => {
63 setChosen(selectedTarget?.filePath ? { owner: selectionIdentity, target: selectedTarget } : undefined);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected