@eliya-oss/agent-diff 0.1.0-alpha.102 → 0.1.0-alpha.104

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/main.js +119 -99
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @eliya-oss/agent-diff
2
2
 
3
+ ## 0.1.0-alpha.104
4
+
5
+ ### Patch Changes
6
+
7
+ - Looking for something shows the places as the words are typed, keeps a readable panel before there is anything to show, and never reads the clipboard.
8
+
9
+ ## 0.1.0-alpha.103
10
+
11
+ ### Minor Changes
12
+
13
+ - Looking for something opens a box to type in, filled from the clipboard or from what the mouse picked, rather than guessing a name from the selected line. Matches are grouped under the file they are in, and the one under the cursor shows the lines around it.
14
+
3
15
  ## 0.1.0-alpha.102
4
16
 
5
17
  ### Patch Changes
package/dist/main.js CHANGED
@@ -9926,7 +9926,7 @@ var init_pane = __esmMin((() => {
9926
9926
  init_commands();
9927
9927
  init_init();
9928
9928
  init_pane();
9929
- var version$1 = "0.1.0-alpha.102";
9929
+ var version$1 = "0.1.0-alpha.104";
9930
9930
  //#endregion
9931
9931
  //#region src/cli/upgrade.ts
9932
9932
  var PACKAGE, TAG, RELEASES, REGISTRY, ASK_MS, RUN_MS, CELLAR, COMPILED, INSTALLED, BUN_GLOBAL, routeOf, ROUTES, asRoute, checkoutOf, assetOf, commandFor, NOTES, RUNNABLE, NUMBERS, numbersIn, compare$1, partsOf, newer, tagIn, fetched, askLatest, here, findUpgrade, willUpgrade, runUpgrade, statusOf$1, sayFound, sayDone, attempted, REFRESH_MS, refreshSkills, updatedIn, sayRefreshed, upgradeReport;
@@ -11767,7 +11767,7 @@ var init_tree = __esmMin((() => {
11767
11767
  return node.children.reduce((total, child) => total + filesUnder(tree, child), 0);
11768
11768
  };
11769
11769
  crowdedDirectories = (tree, limit) => tree.nodes.filter((node) => node.kind === "directory" && directFiles(tree, node.id) > limit).map((node) => node.path);
11770
- })), nothingReviewed, initialState, TREE_MAX, TREE_ROOMY, TREE_MIN, TREE_SHARE, DIFF_MIN, DIFF_ROOMY, bodyRoom, treeWidth, reviewWidth, panelFits, panelShown, onLayers, selectedLayer, proseFor, layerFiles, layerHolding, layerOpen, chunked, packed, shortened, wordWrapped, wrapped, NO_NOTE, noteRows$1, proseRow, proseRows$1, titleRows, clipEnd, FILE_LEAD, fileRows, layerRows, railWindow, selectedBranch, selectedPatch, pullHere, knownToHaveNoPull, kept, treeOf, reviewedCountIn, treeRows, crowdedOf, foldersOfFile, isReviewed, treeStart, treeWindow, commentsOn, hiddenLines, markedRows, carriesLine, selectedRows, snippetOf, selectedLineCount, lineOf, brokenAt, laidLine, laidDraft, caretRow, caretColumn, caretOn, COMPOSE_BOX, COMPOSE_MARGIN, COMPOSE_PAD, COMPOSE_LEAST, composeBox, composeRoom$1, composeTarget, replyTarget, pickedText, selectedLines, KEYWORDS, NAME, longestName$1, searchTerm, shownMatches, matchHere, selectionReadout, WHOLE_FILE, CONTEXT_STEPS, wholeFileOff, contextToggled, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, rowShowing, lineOnSide, commentRowsIn, threadsAtRow, stopsAtRow, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, answersIn, newerOf, spokeLast, sectionOf, sentEntry, panelEntries, panelEntry, threadChosen, spokenSince, hunkStarts, openingRow, changeAround, nextUnreviewed, reviewedCount, fileOrder, filePlace, layerFile, selectionRange;
11770
+ })), nothingReviewed, initialState, TREE_MAX, TREE_ROOMY, TREE_MIN, TREE_SHARE, DIFF_MIN, DIFF_ROOMY, bodyRoom, treeWidth, reviewWidth, panelFits, panelShown, onLayers, selectedLayer, proseFor, layerFiles, layerHolding, layerOpen, chunked, packed, shortened, wordWrapped, wrapped, NO_NOTE, noteRows$1, proseRow, proseRows$1, titleRows, clipEnd, FILE_LEAD, fileRows, layerRows, railWindow, selectedBranch, selectedPatch, pullHere, knownToHaveNoPull, kept, treeOf, reviewedCountIn, treeRows, crowdedOf, foldersOfFile, isReviewed, treeStart, treeWindow, commentsOn, hiddenLines, markedRows, carriesLine, selectedRows, snippetOf, selectedLineCount, lineOf, brokenAt, laidLine, laidDraft, caretRow, caretColumn, caretOn, COMPOSE_BOX, COMPOSE_MARGIN, COMPOSE_PAD, COMPOSE_LEAST, composeBox, composeRoom$1, composeTarget, replyTarget, pickedText, selectedLines, shownMatches, matchHere, selectionReadout, WHOLE_FILE, CONTEXT_STEPS, wholeFileOff, contextToggled, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, rowShowing, lineOnSide, commentRowsIn, threadsAtRow, stopsAtRow, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, answersIn, newerOf, spokeLast, sectionOf, sentEntry, panelEntries, panelEntry, threadChosen, spokenSince, hunkStarts, openingRow, changeAround, nextUnreviewed, reviewedCount, fileOrder, filePlace, layerFile, selectionRange;
11771
11771
  var init_model = __esmMin((() => {
11772
11772
  init_dist();
11773
11773
  init_patch();
@@ -12108,63 +12108,6 @@ var init_model = __esmMin((() => {
12108
12108
  const [from, to] = selectionRange(state);
12109
12109
  return patch.rows.slice(from, to + 1).map((row) => row.text);
12110
12110
  };
12111
- KEYWORDS = /* @__PURE__ */ new Set([
12112
- "const",
12113
- "let",
12114
- "var",
12115
- "function",
12116
- "return",
12117
- "export",
12118
- "import",
12119
- "from",
12120
- "type",
12121
- "interface",
12122
- "class",
12123
- "extends",
12124
- "implements",
12125
- "async",
12126
- "await",
12127
- "new",
12128
- "this",
12129
- "if",
12130
- "else",
12131
- "for",
12132
- "while",
12133
- "switch",
12134
- "case",
12135
- "default",
12136
- "break",
12137
- "continue",
12138
- "throw",
12139
- "try",
12140
- "catch",
12141
- "finally",
12142
- "typeof",
12143
- "readonly",
12144
- "public",
12145
- "private",
12146
- "static",
12147
- "true",
12148
- "false",
12149
- "null",
12150
- "undefined",
12151
- "void",
12152
- "string",
12153
- "number",
12154
- "boolean",
12155
- "any",
12156
- "unknown",
12157
- "never"
12158
- ]);
12159
- NAME = /[A-Za-z_$][\w$]*/g;
12160
- longestName$1 = (line) => [...line.matchAll(NAME)].map((found) => found[0]).filter((name) => !KEYWORDS.has(name)).toSorted((left, right) => right.length - left.length)[0];
12161
- searchTerm = (state) => {
12162
- const taken = pickedText(state)?.trim();
12163
- if (taken !== void 0 && taken.length > 0) return taken;
12164
- const line = selectedLines(state).map((text) => text.trim()).find((text) => text.length > 0);
12165
- if (line === void 0) return "";
12166
- return longestName$1(line) ?? line;
12167
- };
12168
12111
  shownMatches = (state) => {
12169
12112
  const wanted = state.query.trim().toLowerCase();
12170
12113
  if (wanted.length === 0) return state.matches;
@@ -13066,7 +13009,7 @@ var init_match = __esmMin((() => {
13066
13009
  }));
13067
13010
  //#endregion
13068
13011
  //#region src/tui/reduce.ts
13069
- var clamp, lastRow, rowsIn, withCursorVisible, moveCursor, stepStop, scrolled, restingOn, draggedTo, pickedIn, atRow, noneLeft, layerHunk, nextFileWithComments, atComment, nothingOpen, layerComment, PAN_STEP, panned, moveLayer, inRail, railScrolled, movePanel, layerDown, PANES, panesShown, focusStepped, togglePanel, packedAway, zoom, toggleRail, foldDirectory, foldLayer, foldThread, fold, moveBranch, landingOn, revealing, moveFile, selectHunk, swapEnds, atBranch, grownBy, startSelection, openCompose, goBack, walkMatches, openPalette, openKeys, movePalette, paletteMatches, keyMatches, offered, paletteChoice, transitions, reduce, resumedAt, atFile, withContext, withFull, revealsAfter, gapShown, gapOpened, panBy, withSent, withArrived, withColumns, withLayers, withPulls, withSilentForge, withBranches, withSource, withVouched, restoredTo, openedAt, withPatches, TAB_WIDTH, SPACE_CODE, ERASED_FROM, ERASED_TO, readable, legible, withDraft, paletteMoved, paletteClosed, withWaiting, withMatches, withNoticeHere, withNotice;
13012
+ var clamp, lastRow, rowsIn, withCursorVisible, moveCursor, stepStop, scrolled, restingOn, draggedTo, pickedIn, atRow, noneLeft, layerHunk, nextFileWithComments, atComment, nothingOpen, layerComment, PAN_STEP, panned, moveLayer, inRail, railScrolled, movePanel, layerDown, PANES, panesShown, focusStepped, togglePanel, packedAway, zoom, toggleRail, foldDirectory, foldLayer, foldThread, fold, moveBranch, landingOn, revealing, moveFile, selectHunk, swapEnds, atBranch, grownBy, startSelection, openCompose, goBack, walkMatches, openPalette, openKeys, movePalette, paletteMatches, keyMatches, offered, paletteChoice, transitions, reduce, resumedAt, atFile, withContext, withFull, revealsAfter, gapShown, gapOpened, panBy, withSent, withArrived, withColumns, withLayers, withPulls, withSilentForge, withBranches, withSource, withVouched, restoredTo, openedAt, withPatches, TAB_WIDTH, SPACE_CODE, ERASED_FROM, ERASED_TO, readable, legible, withDraft, paletteMoved, paletteClosed, withWaiting, withFinder, withMatches, withNoticeHere, withNotice;
13070
13013
  var init_reduce = __esmMin((() => {
13071
13014
  init_dist();
13072
13015
  init_patch();
@@ -13780,13 +13723,21 @@ var init_reduce = __esmMin((() => {
13780
13723
  ...state,
13781
13724
  waiting
13782
13725
  });
13726
+ withFinder = (state, seed) => ({
13727
+ ...state,
13728
+ screen: "search",
13729
+ matches: [],
13730
+ matchIndex: 0,
13731
+ term: "",
13732
+ query: seed,
13733
+ selecting: false
13734
+ });
13783
13735
  withMatches = (state, matches, term) => ({
13784
13736
  ...state,
13785
13737
  screen: "search",
13786
13738
  matches,
13787
13739
  matchIndex: 0,
13788
13740
  term,
13789
- query: "",
13790
13741
  selecting: false
13791
13742
  });
13792
13743
  withNoticeHere = (state, notice) => ({
@@ -14608,7 +14559,7 @@ var init_diffview = __esmMin((() => {
14608
14559
  }));
14609
14560
  //#endregion
14610
14561
  //#region src/tui/render.ts
14611
- var ROW_HEIGHT, COMPOSE_WIDTH, GUTTER_X, CHIP_GAP, FRAME_PAD, MODAL_ROOM, COMPOSE_CHROME, COMPOSE_ACTION_ROWS, reportActions, actionsText, SNIPPET_LINES, PALETTE_KEY, PALETTE_TITLE, PALETTE_GAP, PALETTE_CHROME, PENDING_CHROME, PALETTE_WIDTH, PANEL_SHARE, PANEL_MAX, PANEL_FLOOR, PANEL_FOOT, PANEL_QUARTER, PANEL_FIFTH, PANE_CHROME, PANE_EDGES, PANE_INSET, BRANCH_WIDTH, BRANCH_NAME_MIN, BRANCH_FIXED, STATE_MIN, EMPTY_LIST, MODAL_MARGIN, shareOf, homeWidth, longestName, longestState, commandRow, modalWidth, panelWidth, panelTop, panelRows, composeRoom, laidOut$1, STICKY_MAX, pickPaint, SELECTION, CURSOR, ACCENT, GAP_PAINT, bar, makeList, makeDiffPane, makePanel, makeListParts, makeListText, makeGutter, makeScroller, makeScrim, makeScroll, makePalette, asking, makePaletteParts, makeChoices, LIST_LEAD, windowed, listText, stack, makeBody, makeHome, makeModals, makeKeysParts, makeFoundParts, FONTS, logoFont, makeLanding, makeLogo, MAC_KEYS, makeComposeParts, makeCompose, clip, clipHead, clipMiddle, clipPath, INDENT_MAX, treeLabel, waitingLabel, inRange, notesOf, notesFor, paired, keptWithin, CHIP_CHUNKS, shortPath, HOME_PATH_MIN, HOME_PATH_CHROME, elide, SUMMARY_LINES, summaryLines, contextLabel, nameRoom, stateRoom, columns, FORGE_SILENT, unaskedForge, branchHeading, atHome, layersCell, baseLabel, stateCell, branchCells, placeLabel, headerParts, HEADER_GAP, HEADER_PATH_MIN, headerRoom, headerFitted, fallbackScope, treeMarks, treeTail, treeLine, STEP_NUMBER, STEP_LEAD, NOTE_LEAD, STEP_GAP, STALE_ROOM, STALE_LONG, STALE_SHORT, staleBanner, layerRoom, layerFold, layerHead, layerText, layerPaint, PANEL_TITLES, PANEL_ORDER, PANEL_LEAD, PANEL_EMPTY, restingOrHere, foundTitle, MATCH_SHARE, matchRow, panelWhere, panelBody, panelPair, panelSection, PULL_HINT, panelText, Screen;
14562
+ var ROW_HEIGHT, COMPOSE_WIDTH, GUTTER_X, CHIP_GAP, FRAME_PAD, MODAL_ROOM, COMPOSE_CHROME, COMPOSE_ACTION_ROWS, reportActions, actionsText, SNIPPET_LINES, PALETTE_KEY, PALETTE_TITLE, PALETTE_GAP, PALETTE_CHROME, PENDING_CHROME, PALETTE_WIDTH, PANEL_SHARE, PANEL_MAX, PANEL_FLOOR, PANEL_FOOT, PANEL_QUARTER, PANEL_FIFTH, PANE_CHROME, PANE_EDGES, PANE_INSET, BRANCH_WIDTH, BRANCH_NAME_MIN, BRANCH_FIXED, STATE_MIN, EMPTY_LIST, MODAL_MARGIN, shareOf, homeWidth, longestName, longestState, commandRow, modalWidth, panelWidth, panelTop, panelRows, composeRoom, laidOut$1, STICKY_MAX, pickPaint, SELECTION, CURSOR, ACCENT, GAP_PAINT, bar, makeList, makeDiffPane, makePanel, makeListParts, makeListText, makeGutter, makeScroller, makeScrim, makeScroll, makePalette, asking, makePaletteParts, makeChoices, LIST_LEAD, windowed, listText, stack, makeBody, makeHome, makeModals, makeKeysParts, makeFoundParts, FONTS, logoFont, makeLanding, makeLogo, MAC_KEYS, makeComposeParts, makeCompose, clip, clipHead, clipMiddle, clipPath, INDENT_MAX, treeLabel, waitingLabel, inRange, notesOf, notesFor, paired, keptWithin, CHIP_CHUNKS, shortPath, HOME_PATH_MIN, HOME_PATH_CHROME, elide, SUMMARY_LINES, summaryLines, contextLabel, nameRoom, stateRoom, columns, FORGE_SILENT, unaskedForge, branchHeading, atHome, layersCell, baseLabel, stateCell, branchCells, placeLabel, headerParts, HEADER_GAP, HEADER_PATH_MIN, headerRoom, headerFitted, fallbackScope, treeMarks, treeTail, treeLine, STEP_NUMBER, STEP_LEAD, NOTE_LEAD, STEP_GAP, STALE_ROOM, STALE_LONG, STALE_SHORT, staleBanner, layerRoom, layerFold, layerHead, layerText, layerPaint, PANEL_TITLES, PANEL_ORDER, PANEL_LEAD, PANEL_EMPTY, restingOrHere, FOUND_LEAST, nothingYet, foundTitle, fileRow, blockOf, aroundRow, windowedBlocks, panelWhere, panelBody, panelPair, panelSection, PULL_HINT, panelText, Screen;
14612
14563
  var init_render = __esmMin((() => {
14613
14564
  init_command();
14614
14565
  init_patch();
@@ -14805,14 +14756,14 @@ var init_render = __esmMin((() => {
14805
14756
  box.width = PALETTE_WIDTH;
14806
14757
  return box;
14807
14758
  };
14808
- asking = (renderer, id) => new TextareaRenderable(renderer, {
14759
+ asking = (renderer, id, placeholder = "Type to filter…") => new TextareaRenderable(renderer, {
14809
14760
  id,
14810
14761
  height: ROW_HEIGHT,
14811
14762
  wrapMode: "none",
14812
14763
  flexShrink: 0,
14813
14764
  marginLeft: GUTTER_X,
14814
14765
  marginRight: GUTTER_X,
14815
- placeholder: "Type to filter…",
14766
+ placeholder,
14816
14767
  placeholderColor: palette.faint,
14817
14768
  backgroundColor: palette.panel,
14818
14769
  focusedBackgroundColor: palette.panel,
@@ -14893,7 +14844,7 @@ var init_render = __esmMin((() => {
14893
14844
  makeFoundParts = (renderer) => {
14894
14845
  const box = makePalette(renderer);
14895
14846
  const title = bar(renderer, "found-title", palette.faint);
14896
- const query = asking(renderer, "found-query");
14847
+ const query = asking(renderer, "found-query", "Type what to look for…");
14897
14848
  const peek = bar(renderer, "found-peek", palette.muted);
14898
14849
  const choices = makeChoices(renderer);
14899
14850
  box.id = "found";
@@ -15253,20 +15204,51 @@ var init_render = __esmMin((() => {
15253
15204
  PANEL_LEAD = 3;
15254
15205
  PANEL_EMPTY = "No comment on this branch yet.";
15255
15206
  restingOrHere = (focused) => focused ? palette.selection : palette.resting;
15207
+ FOUND_LEAST = 6;
15208
+ nothingYet = (state, room) => {
15209
+ const wanted = state.query.trim();
15210
+ if (wanted.length === 0 || state.term.length === 0) return "".padEnd(room);
15211
+ return clip(` nothing else uses ${wanted}`, room).padEnd(room);
15212
+ };
15256
15213
  foundTitle = (state) => {
15257
- const shown = shownMatches(state).length;
15258
15214
  const all = state.matches.length;
15259
- const said = shown === all ? `${all} elsewhere` : `${shown} of ${all} elsewhere`;
15260
- return `${state.term} · ${said}`;
15261
- };
15262
- MATCH_SHARE = .45;
15263
- matchRow = (match, room) => {
15264
- const lead = match.changed ? marks().comment : " ";
15265
- const where = `:${match.line}`;
15266
- const said = match.text.trim();
15267
- const forPath = Math.max(8, Math.floor(room * MATCH_SHARE) - where.length);
15268
- const left = `${lead} ${clipHead(match.path, forPath)}${where}`;
15269
- return `${left} ${clip(said, Math.max(1, room - left.length - 2))}`;
15215
+ if (state.term.length === 0) return "Look for something";
15216
+ return `${state.term} · ${all === 1 ? "1 place" : `${all} places`} elsewhere`;
15217
+ };
15218
+ fileRow = (match, room) => {
15219
+ const said = ` ${match.changed ? marks().comment : " "} ${clipHead(match.path, Math.max(8, room - 3))}`;
15220
+ return {
15221
+ rows: 1,
15222
+ chunks: [fg(palette.accent)(said.padEnd(room)), fg(palette.faint)("\n")]
15223
+ };
15224
+ };
15225
+ blockOf = (match, room, here) => {
15226
+ const lit = (here ? match.around.map((line) => aroundRow(line, match.line, room)) : [fg(palette.muted)(` ${String(match.line).padStart(5)} ${clip(match.text.trim(), Math.max(1, room - 11))}`.padEnd(room))]).map((chunk) => here ? bg(palette.selection)(chunk) : chunk);
15227
+ return {
15228
+ rows: lit.length,
15229
+ chunks: lit.flatMap((chunk) => [chunk, fg(palette.faint)("\n")])
15230
+ };
15231
+ };
15232
+ aroundRow = (line, at, room) => {
15233
+ const numbered = /^\s*(\d+) ?(.*)$/.exec(line);
15234
+ const number = Number(numbered?.[1] ?? 0);
15235
+ const text = numbered?.[2] ?? line;
15236
+ const said = ` ${number === at ? "▸" : " "} ${String(number).padStart(5)} ${text}`;
15237
+ return fg(number === at ? palette.ink : palette.faint)(clip(said, room).padEnd(room));
15238
+ };
15239
+ windowedBlocks = (blocks, at, room) => {
15240
+ const kept = [];
15241
+ let rows = 0;
15242
+ for (const [index, block] of blocks.entries()) {
15243
+ if (index < at && rows + block.rows > room) continue;
15244
+ if (rows + block.rows > room && index > at) break;
15245
+ kept.push(block);
15246
+ rows += block.rows;
15247
+ }
15248
+ return {
15249
+ rows,
15250
+ chunks: kept.flatMap((block) => block.chunks)
15251
+ };
15270
15252
  };
15271
15253
  panelWhere = (entry, room) => {
15272
15254
  const where = `:${entry.comment.end}`;
@@ -15822,17 +15804,23 @@ var init_render = __esmMin((() => {
15822
15804
  return;
15823
15805
  }
15824
15806
  const room = panelWidth(this.renderer.width);
15825
- const here = matchHere(state);
15826
- this.foundTitle.content = foundTitle(state);
15827
- const peekHigh = here?.around.length ?? 0;
15828
- const foundRoom = Math.min(panelRows(this.renderer.height, PANEL_FIFTH), shownMatches(state).length + peekHigh + PALETTE_CHROME);
15829
15807
  const wide = Math.max(1, room - MODAL_ROOM);
15808
+ this.foundTitle.content = foundTitle(state);
15830
15809
  const shown = shownMatches(state);
15831
- this.foundChoices.content = listText(shown.map((match) => matchRow(match, wide)), state.matchIndex, Math.max(1, foundRoom - peekHigh - PALETTE_CHROME));
15832
- this.foundPeek.content = (here?.around ?? []).map((line) => clip(line, Math.max(1, room - MODAL_ROOM))).join("\n");
15833
- const peekRows = here?.around.length ?? 0;
15834
- this.foundPeek.height = peekRows;
15835
- this.found.height = Math.min(panelRows(this.renderer.height, PANEL_FIFTH), shownMatches(state).length + peekRows + PALETTE_CHROME);
15810
+ const most = panelRows(this.renderer.height, PANEL_FIFTH);
15811
+ const blocks = [];
15812
+ let chosen = 0;
15813
+ for (const [at, match] of shown.entries()) {
15814
+ if (shown[at - 1]?.path !== match.path) blocks.push(fileRow(match, wide));
15815
+ if (at === state.matchIndex) chosen = blocks.length;
15816
+ blocks.push(blockOf(match, wide, at === state.matchIndex));
15817
+ }
15818
+ const tall = Math.max(FOUND_LEAST, most - PALETTE_CHROME);
15819
+ const window = windowedBlocks(blocks, chosen, tall);
15820
+ this.foundChoices.content = blocks.length === 0 ? new StyledText([fg(palette.faint)(nothingYet(state, wide))]) : new StyledText([...window.chunks]);
15821
+ this.foundPeek.content = "";
15822
+ this.foundPeek.height = 0;
15823
+ this.found.height = Math.min(most, Math.max(FOUND_LEAST, window.rows) + PALETTE_CHROME);
15836
15824
  this.found.width = room;
15837
15825
  this.found.left = Math.max(FRAME_PAD, Math.floor((this.renderer.width - room) / 2));
15838
15826
  this.found.top = panelTop(this.renderer.height, PANEL_FIFTH);
@@ -16057,7 +16045,7 @@ var init_upgrade = __esmMin((() => {
16057
16045
  return due ? `adiff ${latest} is out · adiff upgrade` : "";
16058
16046
  }).pipe(withSpan("Tui.upgradeHint"));
16059
16047
  upgradeHint = worded.pipe(orElseSucceed(() => ""));
16060
- })), LEAVING_SAID, NOTICE_MS, KEY_HISTORY, DRAIN_PASSES, TRAIL_HISTORY, clockOf, momentOf, noticeOf, COPIERS, wayland, handOver, throughMultiplexer, copyToClipboard, lineUnder, asKey, openedPull, LISTENS, WRITES, OVER, overReview, writesInto, listens, LETTER, laidOut, ARROWS, SHIFTED, keyName, App, turnedOver, settledPath, restsWhereItLanded, lonelyGaps, chosenIn, settingsHeld, firstBranches, missing, openingOn, launch, told, untilDestroyed, runOn, runTui;
16048
+ })), LOOK_MS, LEAVING_SAID, NOTICE_MS, KEY_HISTORY, DRAIN_PASSES, TRAIL_HISTORY, clockOf, momentOf, noticeOf, COPIERS, wayland, seedFor, handOver, throughMultiplexer, copyToClipboard, lineUnder, asKey, openedPull, LISTENS, WRITES, OVER, overReview, writesInto, listens, LETTER, laidOut, ARROWS, SHIFTED, keyName, App, turnedOver, settledPath, restsWhereItLanded, lonelyGaps, chosenIn, settingsHeld, firstBranches, missing, openingOn, launch, told, untilDestroyed, runOn, runTui;
16061
16049
  var init_app = __esmMin((() => {
16062
16050
  init_dist();
16063
16051
  init_report();
@@ -16075,6 +16063,7 @@ var init_app = __esmMin((() => {
16075
16063
  init_intent();
16076
16064
  init_session();
16077
16065
  init_upgrade();
16066
+ LOOK_MS = 220;
16078
16067
  LEAVING_SAID = "press ctrl+c again to leave";
16079
16068
  NOTICE_MS = 2200;
16080
16069
  KEY_HISTORY = 40;
@@ -16100,6 +16089,7 @@ var init_app = __esmMin((() => {
16100
16089
  win32: ["clip"]
16101
16090
  };
16102
16091
  wayland = () => process.env["WAYLAND_DISPLAY"] === void 0 ? void 0 : ["wl-copy"];
16092
+ seedFor = (picked) => picked?.trim() ?? "";
16103
16093
  handOver = (text) => {
16104
16094
  if (!process.stdout.isTTY) return;
16105
16095
  const named = wayland() ?? COPIERS[platform()];
@@ -16217,6 +16207,7 @@ var init_app = __esmMin((() => {
16217
16207
  chosen = {};
16218
16208
  selectingNow = false;
16219
16209
  leaving;
16210
+ looking;
16220
16211
  grewWithShift = false;
16221
16212
  keys = [];
16222
16213
  trail = [];
@@ -16254,6 +16245,7 @@ var init_app = __esmMin((() => {
16254
16245
  renderer.keyInput.on("keyrelease", (key) => this.letGo(key));
16255
16246
  renderer.on("destroy", () => this.stopWatching());
16256
16247
  renderer.on("destroy", () => this.stopFading());
16248
+ renderer.on("destroy", () => this.stopLooking());
16257
16249
  renderer.on("destroy", () => this.stopLighting());
16258
16250
  renderer.on("destroy", () => void getTreeSitterClient().destroy());
16259
16251
  renderer.on("destroy", () => this.stopPainting());
@@ -16546,7 +16538,7 @@ var init_app = __esmMin((() => {
16546
16538
  "thread.reply": () => this.replyHere(),
16547
16539
  "selection.copy": () => sync(() => this.copySelection(false)),
16548
16540
  "search.open": () => this.findSelection(),
16549
- "search.jump": () => this.openMatch(),
16541
+ "search.jump": () => this.runFinder(),
16550
16542
  "review.reload": () => this.state.screen === "branches" ? this.reloadList() : this.reloadBranch(),
16551
16543
  "report.open": () => sync(() => this.commit(reduce(this.measured(), "report.open"))),
16552
16544
  back: () => this.goBack(),
@@ -16627,6 +16619,7 @@ var init_app = __esmMin((() => {
16627
16619
  query: clean,
16628
16620
  paletteIndex: 0
16629
16621
  });
16622
+ if (this.state.screen === "search") this.lookSoon(clean);
16630
16623
  }
16631
16624
  readBack(text) {
16632
16625
  const clean = legible(stripAnsiSequences(text));
@@ -16717,19 +16710,47 @@ var init_app = __esmMin((() => {
16717
16710
  this.commit(said(this.state, many));
16718
16711
  }
16719
16712
  findSelection() {
16713
+ return sync(() => {
16714
+ const seed = seedFor(pickedText(this.state));
16715
+ this.commit(withFinder(this.state, seed));
16716
+ runSync(this.display.askWith(seed));
16717
+ });
16718
+ }
16719
+ lookSoon(wanted) {
16720
+ this.stopLooking();
16721
+ this.looking = setTimeout(() => {
16722
+ this.looking = void 0;
16723
+ const asked = wanted.trim();
16724
+ if (this.state.screen !== "search" || this.state.query.trim() !== asked) return;
16725
+ this.dispatchTask(asked.length === 0 ? this.forgetMatches() : this.lookFor(asked));
16726
+ }, LOOK_MS);
16727
+ }
16728
+ stopLooking() {
16729
+ if (this.looking === void 0) return;
16730
+ clearTimeout(this.looking);
16731
+ this.looking = void 0;
16732
+ }
16733
+ forgetMatches() {
16734
+ return sync(() => this.commit(withMatches(this.state, [], "")));
16735
+ }
16736
+ runFinder() {
16720
16737
  return gen({ self: this }, function* () {
16721
- const branch = selectedBranch(this.state);
16722
- const term = searchTerm(this.state);
16723
- if (branch === void 0 || term.length === 0) {
16724
- this.commit(withNoticeHere(this.state, "nothing selected"));
16725
- return;
16726
- }
16727
- const elsewhere = (yield* searchBranch(this.repo, branch.branch, term)).filter((match) => !this.isHere(match));
16728
- if (elsewhere.length === 0) {
16729
- this.commit(withNotice(this.state, `no other place uses ${term}`));
16738
+ const wanted = this.state.query.trim();
16739
+ if (wanted.length > 0 && wanted !== this.state.term) {
16740
+ this.stopLooking();
16741
+ yield* this.lookFor(wanted);
16730
16742
  return;
16731
16743
  }
16732
- this.commit(withMatches(this.state, elsewhere, term));
16744
+ yield* this.openMatch();
16745
+ });
16746
+ }
16747
+ lookFor(wanted) {
16748
+ return gen({ self: this }, function* () {
16749
+ const branch = selectedBranch(this.state);
16750
+ if (branch === void 0) return;
16751
+ const elsewhere = (yield* searchBranch(this.repo, branch.branch, wanted)).filter((match) => !this.isHere(match));
16752
+ this.commit(withMatches(this.state, elsewhere, wanted));
16753
+ if (elsewhere.length === 0) this.commit(withNoticeHere(this.state, `no other place uses ${wanted}`));
16733
16754
  });
16734
16755
  }
16735
16756
  isHere(match) {
@@ -17342,7 +17363,6 @@ var tui_exports = /* @__PURE__ */ __exportAll({
17342
17363
  runOn: () => runOn,
17343
17364
  runTui: () => runTui,
17344
17365
  searchCommands: () => searchCommands,
17345
- searchTerm: () => searchTerm,
17346
17366
  syntaxTheme: () => syntaxTheme,
17347
17367
  withPatches: () => withPatches
17348
17368
  });
package/package.json CHANGED
@@ -23,7 +23,7 @@
23
23
  "bin": {
24
24
  "adiff": "./bin/adiff.js"
25
25
  },
26
- "version": "0.1.0-alpha.102",
26
+ "version": "0.1.0-alpha.104",
27
27
  "description": "Review the work an agent left you without losing the thread: comments live on the lines, the agent answers them, and each point stays open until you settle it.",
28
28
  "license": "MIT",
29
29
  "repository": {