MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / QuickOpenDialog

Function QuickOpenDialog

source code/components/QuickOpenDialog.tsx:30–227  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

28 * Fuzzy file finder with a syntax-highlighted preview of the focused file.
29 */
30export function QuickOpenDialog(t0) {
31 const $ = _c(35);
32 const {
33 onDone,
34 onInsert
35 } = t0;
36 useRegisterOverlay("quick-open");
37 const {
38 columns,
39 rows
40 } = useTerminalSize();
41 const visibleResults = Math.min(VISIBLE_RESULTS, Math.max(4, rows - 14));
42 let t1;
43 if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
44 t1 = [];
45 $[0] = t1;
46 } else {
47 t1 = $[0];
48 }
49 const [results, setResults] = useState(t1);
50 const [query, setQuery] = useState("");
51 const [focusedPath, setFocusedPath] = useState(undefined);
52 const [preview, setPreview] = useState(null);
53 const queryGenRef = useRef(0);
54 let t2;
55 let t3;
56 if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
57 t2 = () => () => {
58 queryGenRef.current = queryGenRef.current + 1;
59 return void queryGenRef.current;
60 };
61 t3 = [];
62 $[1] = t2;
63 $[2] = t3;
64 } else {
65 t2 = $[1];
66 t3 = $[2];
67 }
68 useEffect(t2, t3);
69 const previewOnRight = columns >= 120;
70 const effectivePreviewLines = previewOnRight ? VISIBLE_RESULTS - 1 : PREVIEW_LINES;
71 let t4;
72 if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
73 t4 = q => {
74 setQuery(q);
75 const gen = queryGenRef.current = queryGenRef.current + 1;
76 if (!q.trim()) {
77 setResults([]);
78 return;
79 }
80 generateFileSuggestions(q, true).then(items => {
81 if (gen !== queryGenRef.current) {
82 return;
83 }
84 const paths = items.filter(_temp).map(_temp2).filter(_temp3).map(_temp4);
85 setResults(paths);
86 });
87 };

Callers

nothing calls this directly

Calls 13

useRegisterOverlayFunction · 0.85
useTerminalSizeFunction · 0.85
generateFileSuggestionsFunction · 0.85
getCwdFunction · 0.85
readFileInRangeFunction · 0.85
openFileInExternalEditorFunction · 0.85
logEventFunction · 0.85
truncatePathMiddleFunction · 0.85
highlightMatchFunction · 0.85
truncateToWidthFunction · 0.85
maxMethod · 0.80
resolveMethod · 0.80

Tested by

no test coverage detected