@eliya-oss/agent-diff 0.1.0-alpha.115 → 0.1.0-alpha.117

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 +16 -0
  2. package/dist/main.js +114 -41
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @eliya-oss/agent-diff
2
2
 
3
+ ## 0.1.0-alpha.117
4
+
5
+ ### Patch Changes
6
+
7
+ - A binary file says it is binary instead of drawing an empty pane. git reports it as changed and adiff listed it in the file tree, but opening it showed a pane with nothing in it — indistinguishable from a rendering failure.
8
+
9
+ ## 0.1.0-alpha.116
10
+
11
+ ### Patch Changes
12
+
13
+ - `g`, `G` and the page keys move whatever pane has focus. With the file list or the review panel focused they moved the diff cursor instead — invisibly, since you were not looking at the diff — so the only way through a long list was one row at a time. Sixty presses to get from the bottom of a forty-layer rail to the top.
14
+
15
+ Hiding reviewed files now works while reading layers. `f` was honoured by the file tree and ignored by the layers rail, so the same key did something in one rail and nothing in the other, and the header count disagreed with what you could see.
16
+
17
+ A comment on a line that is hidden inside a collapsed gap can be reached from the review panel. It used to say the comment was outside the diff while the file it belongs to was open on screen; it now opens the gaps and goes there.
18
+
3
19
  ## 0.1.0-alpha.115
4
20
 
5
21
  ### Patch Changes
package/dist/main.js CHANGED
@@ -9552,11 +9552,13 @@ var init_anchor = __esmMin((() => {
9552
9552
  }));
9553
9553
  //#endregion
9554
9554
  //#region src/domain/patch/parse.ts
9555
- var FILE_MARKER, HUNK_MARKER, BLOB_MARKER, OLD_PATH_MARKER, NEW_PATH_MARKER, HUNK_HEADER, FILE_HEADER, SIGNS$1, draftFrom, openHunk, appendRow, readBody, readHeader, parsePatches;
9555
+ var FILE_MARKER, HUNK_MARKER, BINARY_MARKER, BINARY_SAID, BLOB_MARKER, OLD_PATH_MARKER, NEW_PATH_MARKER, HUNK_HEADER, FILE_HEADER, SIGNS$1, draftFrom, openHunk, appendRow, readBody, readBinary, readHeader, parsePatches;
9556
9556
  var init_parse$1 = __esmMin((() => {
9557
9557
  init_dist();
9558
9558
  FILE_MARKER = "diff --git ";
9559
9559
  HUNK_MARKER = "@@";
9560
+ BINARY_MARKER = "Binary files ";
9561
+ BINARY_SAID = "binary file, adiff cannot show what changed in it";
9560
9562
  BLOB_MARKER = "index ";
9561
9563
  OLD_PATH_MARKER = "--- ";
9562
9564
  NEW_PATH_MARKER = "+++ ";
@@ -9615,6 +9617,19 @@ var init_parse$1 = __esmMin((() => {
9615
9617
  const kind = SIGNS$1[line.slice(0, 1)];
9616
9618
  if (kind !== void 0) appendRow(draft, kind, line.slice(1));
9617
9619
  };
9620
+ readBinary = (draft, line) => {
9621
+ if (!line.startsWith(BINARY_MARKER)) return false;
9622
+ draft.hunks.push({
9623
+ marker: "",
9624
+ scope: "",
9625
+ startRow: 0,
9626
+ newStart: 1,
9627
+ rows: [],
9628
+ skipped: 0
9629
+ });
9630
+ appendRow(draft, "context", BINARY_SAID);
9631
+ return true;
9632
+ };
9618
9633
  readHeader = (draft, line) => {
9619
9634
  if (line.startsWith(BLOB_MARKER)) {
9620
9635
  draft.blob = line.slice(6).split("..")[1]?.split(" ")[0] ?? "";
@@ -9637,6 +9652,7 @@ var init_parse$1 = __esmMin((() => {
9637
9652
  const draft = drafts.at(-1);
9638
9653
  if (draft === void 0) continue;
9639
9654
  if (readHeader(draft, line)) continue;
9655
+ if (readBinary(draft, line)) continue;
9640
9656
  if (line.startsWith(HUNK_MARKER)) openHunk(draft, line);
9641
9657
  else readBody(draft, line);
9642
9658
  }
@@ -10896,7 +10912,7 @@ var init_pane = __esmMin((() => {
10896
10912
  init_drafts();
10897
10913
  init_init();
10898
10914
  init_pane();
10899
- var version$1 = "0.1.0-alpha.115";
10915
+ var version$1 = "0.1.0-alpha.117";
10900
10916
  //#endregion
10901
10917
  //#region src/cli/upgrade.ts
10902
10918
  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, ranChild, runUpgrade, statusOf$1, sayFound, sayDone, attempted, REFRESH_MS, refreshSkills, updatedIn, sayRefreshed, upgradeReport;
@@ -12904,7 +12920,7 @@ var init_tree = __esmMin((() => {
12904
12920
  return node.children.reduce((total, child) => total + filesUnder(tree, child), 0);
12905
12921
  };
12906
12922
  crowdedDirectories = (tree, limit) => tree.nodes.filter((node) => node.kind === "directory" && directFiles(tree, node.id) > limit).map((node) => node.path);
12907
- })), nothingReviewed, initialState, TREE_MAX, TREE_ROOMY, TREE_WIDE, TREE_MIN, TREE_SHARE, DIFF_MIN, DIFF_ROOMY, bodyRoom, treeWidth, tooSmall, reviewWidth, panelFits, panelShown, onLayers, selectedLayer, proseFor, layerFiles, layerHolding, layerOpen, chunked, packed, shortened, wordWrapped, wrapped, clip, TITLE_ROWS, titleRows, shortDir, fileRow$1, shownFiles, dirOf, fileRows, layerRead, layerDone, countRow, layerBody, layerRows, nearFirst, layerFitted, railWindow, selectedBranch, selectedPatch, pullHere, knownToHaveNoPull, kept, treeOf, reviewedCountIn, CROWDED, 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, threadReplying, VOICES, threadQuote, pickedText, selectedLines, shownMatches, matchHere, selectionReadout, CONTEXT_STEPS, wholeFileOff, contextToggled, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, rowShowing, lineOnSide, commentRowsIn, threadsAtRow, stopsAtRow, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, PANEL_SECTIONS, answersIn, newerOf, spokeLast, sectionOf, sentEntry, panelEntries, panelEntry, threadChosen, spokenSince, hunkStarts, openingRow, changeAround, nextUnreviewed, reviewedCount, fileOrder, filePlace, readingOrder, placeIn, layerFile, layerAfter, selectionRange;
12923
+ })), nothingReviewed, initialState, TREE_MAX, TREE_ROOMY, TREE_WIDE, TREE_MIN, TREE_SHARE, DIFF_MIN, DIFF_ROOMY, bodyRoom, treeWidth, tooSmall, reviewWidth, panelFits, panelShown, onLayers, selectedLayer, proseFor, kept, layerFiles, layerHolding, layerOpen, chunked, packed, shortened, wordWrapped, wrapped, clip, TITLE_ROWS, titleRows, shortDir, fileRow$1, shownFiles, dirOf, fileRows, layerRead, layerDone, countRow, layerBody, layerRows, nearFirst, layerFitted, railWindow, selectedBranch, selectedPatch, pullHere, knownToHaveNoPull, treeOf, reviewedCountIn, CROWDED, 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, threadReplying, VOICES, threadQuote, pickedText, selectedLines, shownMatches, matchHere, selectionReadout, CONTEXT_STEPS, wholeFileOff, contextToggled, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, rowShowing, lineOnSide, commentRowsIn, threadsAtRow, stopsAtRow, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, PANEL_SECTIONS, answersIn, newerOf, spokeLast, sectionOf, sentEntry, panelEntries, panelEntry, threadChosen, spokenSince, hunkStarts, openingRow, changeAround, nextUnreviewed, reviewedCount, fileOrder, filePlace, readingOrder, placeIn, layerFile, layerAfter, selectionRange;
12908
12924
  var init_model = __esmMin((() => {
12909
12925
  init_dist();
12910
12926
  init_patch();
@@ -12999,12 +13015,13 @@ var init_model = __esmMin((() => {
12999
13015
  if (layer === void 0) return [];
13000
13016
  return layer.prose.filter((anchor) => anchor.path === path);
13001
13017
  };
13018
+ kept = (state, at) => !state.hideReviewed || at === state.patchIndex || !isReviewed(state, at);
13002
13019
  layerFiles = (state, layerIndex) => {
13003
13020
  const layer = state.layers[layerIndex];
13004
13021
  if (layer === void 0) return [];
13005
13022
  return layer.files.flatMap((path) => {
13006
13023
  const at = state.patches.findIndex((patch) => patch.path === path);
13007
- return at === -1 ? [] : [at];
13024
+ return at === -1 || !kept(state, at) ? [] : [at];
13008
13025
  });
13009
13026
  };
13010
13027
  layerHolding = (state, fileIndex) => {
@@ -13032,9 +13049,9 @@ var init_model = __esmMin((() => {
13032
13049
  TITLE_ROWS = 2;
13033
13050
  titleRows = (state, layerIndex, room) => {
13034
13051
  const lines = wordWrapped(state.layers[layerIndex]?.title ?? "", room);
13035
- const kept = lines.slice(0, TITLE_ROWS);
13036
- const last = kept.at(-1) ?? "";
13037
- return (lines.length > TITLE_ROWS ? [...kept.slice(0, -1), clip(`${last} …`, room)] : kept).map((text, at) => ({
13052
+ const heldLines = lines.slice(0, TITLE_ROWS);
13053
+ const last = heldLines.at(-1) ?? "";
13054
+ return (lines.length > TITLE_ROWS ? [...heldLines.slice(0, -1), clip(`${last} …`, room)] : heldLines).map((text, at) => ({
13038
13055
  index: layerIndex,
13039
13056
  kind: "title",
13040
13057
  text,
@@ -13151,7 +13168,6 @@ var init_model = __esmMin((() => {
13151
13168
  selectedPatch = (state) => shownOf(state)?.patch;
13152
13169
  pullHere = (state) => state.pulls[selectedBranch(state)?.branch ?? ""] ?? "";
13153
13170
  knownToHaveNoPull = (state) => state.forge === "answered" && pullHere(state).length === 0;
13154
- kept = (state, at) => !state.hideReviewed || at === state.patchIndex || !isReviewed(state, at);
13155
13171
  treeOf = (state) => buildTree(state.patches.map((patch, at) => kept(state, at) ? patch.path : ""));
13156
13172
  reviewedCountIn = (state) => state.patches.filter((_, at) => isReviewed(state, at)).length;
13157
13173
  CROWDED = 8;
@@ -13897,8 +13913,8 @@ var init_command = __esmMin((() => {
13897
13913
  "look for",
13898
13914
  "where is"
13899
13915
  ],
13900
- category: "Selecting",
13901
- title: "Find the selection elsewhere",
13916
+ category: "Reading",
13917
+ title: "Search this branch",
13902
13918
  keys: ["/"],
13903
13919
  screens: ["review"]
13904
13920
  }),
@@ -13985,6 +14001,7 @@ var init_command = __esmMin((() => {
13985
14001
  command({
13986
14002
  action: "thread.settle",
13987
14003
  also: [
14004
+ "settle",
13988
14005
  "resolve",
13989
14006
  "close",
13990
14007
  "done",
@@ -14011,6 +14028,7 @@ var init_command = __esmMin((() => {
14011
14028
  command({
14012
14029
  action: "thread.reply",
14013
14030
  also: [
14031
+ "reply",
14014
14032
  "respond",
14015
14033
  "answer",
14016
14034
  "write back"
@@ -14027,6 +14045,7 @@ var init_command = __esmMin((() => {
14027
14045
  command({
14028
14046
  action: "thread.remove",
14029
14047
  also: [
14048
+ "remove",
14030
14049
  "delete",
14031
14050
  "withdraw",
14032
14051
  "retract",
@@ -14350,18 +14369,19 @@ var init_match = __esmMin((() => {
14350
14369
  matches = (entry, query) => query.toLowerCase().split(/\s+/).filter((word) => word.length > 0).every((word) => subsequence(label(entry), word));
14351
14370
  closeness = (entry, query) => {
14352
14371
  const wanted = query.trim().toLowerCase();
14353
- if (wanted.length === 0) return 2;
14372
+ if (wanted.length === 0) return 3;
14354
14373
  const title = entry.title.toLowerCase();
14355
14374
  if (title.startsWith(wanted)) return 0;
14356
- if (title.includes(wanted)) return 1;
14357
- return label(entry).includes(wanted) ? 2 : 3;
14375
+ if (entry.also.some((one) => one.toLowerCase() === wanted)) return 1;
14376
+ if (title.includes(wanted)) return 2;
14377
+ return label(entry).includes(wanted) ? 3 : 4;
14358
14378
  };
14359
14379
  searchCommands = (screen, query) => listableFor(screen).filter((entry) => matches(entry, query)).toSorted((left, right) => closeness(left, query) - closeness(right, query));
14360
- searchGlossary = (screen, query) => glossaryFor(screen).filter((entry) => matches(entry, query));
14380
+ searchGlossary = (screen, query) => glossaryFor(screen).filter((entry) => matches(entry, query)).toSorted((left, right) => closeness(left, query) - closeness(right, query));
14361
14381
  }));
14362
14382
  //#endregion
14363
14383
  //#region src/tui/reduce.ts
14364
- 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, atTheEnd, moveFile, selectHunk, swapEnds, atBranch, grownBy, startSelection, draftMark, openCompose, outOfDiff, goBack, walkMatches, openPalette, openKeys, movePalette, paletteMatches, keyMatches, offered, paletteChoice, transitions, reduce, resumedAt, atFile, withContext, withFull, revealsAfter, gapShown, gapOpened, panBy, withSent, withArrived, withColumns, laidOver, 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;
14384
+ 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, stepsToEnd, toTop, farOff, byHalf, boundedStep, PANEL_FAR, PANES, panesShown, focusStepped, togglePanel, packedAway, zoom, toggleRail, foldDirectory, foldLayer, foldThread, fold, moveBranch, landingOn, revealing, atTheEnd, moveFile, selectHunk, swapEnds, atBranch, grownBy, startSelection, draftMark, openCompose, outOfDiff, goBack, walkMatches, openPalette, openKeys, movePalette, paletteMatches, keyMatches, offered, paletteChoice, transitions, reduce, resumedAt, atFile, withContext, withFull, allRevealed, revealsAfter, gapShown, gapOpened, panBy, withSent, withArrived, withColumns, laidOver, 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;
14365
14385
  var init_reduce = __esmMin((() => {
14366
14386
  init_dist();
14367
14387
  init_patch();
@@ -14538,6 +14558,37 @@ var init_reduce = __esmMin((() => {
14538
14558
  if (state.focus === "review") return movePanel(state, delta);
14539
14559
  return stepStop(state, delta);
14540
14560
  };
14561
+ stepsToEnd = (state, delta) => {
14562
+ const at = placeIn(state);
14563
+ const last = Math.max(0, readingOrder(state).length - 1);
14564
+ const here = at === -1 ? 0 : at;
14565
+ return delta < 0 ? -here : last - here;
14566
+ };
14567
+ toTop = (state) => ({
14568
+ ...atRow(state, landingOn(state, state.patchIndex)),
14569
+ top: 0,
14570
+ scroll: -1
14571
+ });
14572
+ farOff = (state, delta) => {
14573
+ if (state.focus === "tree") {
14574
+ const steps = stepsToEnd(state, delta);
14575
+ return steps === 0 ? state : inRail(state, steps);
14576
+ }
14577
+ if (state.focus === "review") return movePanel(state, delta * PANEL_FAR);
14578
+ return delta < 0 ? toTop(state) : atRow(state, lastRow(selectedPatch(state)));
14579
+ };
14580
+ byHalf = (state, delta) => {
14581
+ const step = Math.max(1, Math.floor(state.viewport / 2));
14582
+ if (state.focus === "diff") return moveCursor(state, delta * step);
14583
+ const wanted = delta * step;
14584
+ const bounded = state.focus === "tree" ? boundedStep(state, wanted) : wanted;
14585
+ return bounded === 0 ? state : layerDown(state, bounded);
14586
+ };
14587
+ boundedStep = (state, wanted) => {
14588
+ const most = stepsToEnd(state, wanted);
14589
+ return wanted < 0 ? Math.max(wanted, most) : Math.min(wanted, most);
14590
+ };
14591
+ PANEL_FAR = 1e4;
14541
14592
  PANES = [
14542
14593
  "tree",
14543
14594
  "diff",
@@ -14786,14 +14837,10 @@ var init_reduce = __esmMin((() => {
14786
14837
  "branch.open": (state) => state,
14787
14838
  "branch.pull": (state) => state,
14788
14839
  "cursor.next": (state) => layerDown(state, 1),
14789
- "cursor.top": (state) => ({
14790
- ...atRow(state, landingOn(state, state.patchIndex)),
14791
- top: 0,
14792
- scroll: -1
14793
- }),
14794
- "cursor.bottom": (state) => atRow(state, lastRow(selectedPatch(state))),
14795
- "cursor.pageDown": (state) => moveCursor(state, Math.max(1, Math.floor(state.viewport / 2))),
14796
- "cursor.pageUp": (state) => moveCursor(state, -Math.max(1, Math.floor(state.viewport / 2))),
14840
+ "cursor.top": (state) => farOff(state, -1),
14841
+ "cursor.bottom": (state) => farOff(state, 1),
14842
+ "cursor.pageDown": (state) => byHalf(state, 1),
14843
+ "cursor.pageUp": (state) => byHalf(state, -1),
14797
14844
  "context.more": (state) => state,
14798
14845
  "context.less": (state) => state,
14799
14846
  "context.whole": (state) => state,
@@ -14922,6 +14969,16 @@ var init_reduce = __esmMin((() => {
14922
14969
  ...state,
14923
14970
  full
14924
14971
  });
14972
+ allRevealed = (state) => {
14973
+ const path = selectedPatch(state)?.path;
14974
+ if (path === void 0) return state.revealed;
14975
+ const here = (shownOf(state)?.gaps ?? []).map((gap) => ({
14976
+ file: path,
14977
+ gap: gap.index,
14978
+ lines: gap.hidden
14979
+ }));
14980
+ return [...state.revealed.filter((entry) => entry.file !== path), ...here];
14981
+ };
14925
14982
  revealsAfter = (state, gap, lines) => {
14926
14983
  const path = state.patches[state.patchIndex]?.path ?? "";
14927
14984
  const others = state.revealed.filter((entry) => entry.file !== path || entry.gap !== gap);
@@ -16516,8 +16573,8 @@ var init_render = __esmMin((() => {
16516
16573
  nameRoom = (pane, longest = pane) => Math.max(BRANCH_NAME_MIN, Math.min(longest, pane - BRANCH_FIXED - STATE_MIN));
16517
16574
  stateRoom = (pane, name) => Math.max(0, pane - name - BRANCH_FIXED);
16518
16575
  columns = (cells, room) => `${clip(cells.name, room).padEnd(room)}${cells.files.padStart(5)}${cells.added.padStart(8)}${cells.gone.padStart(8)} ${cells.layers.padStart(8)} ${cells.state}`;
16519
- FORGE_SILENT = " could not find out which of these have a pull request";
16520
- unaskedForge = (state) => state.forge === "silent" ? [fg(palette.faint)(`\n${FORGE_SILENT}`)] : [];
16576
+ FORGE_SILENT = " could not reach the forge, so no pull request is shown";
16577
+ unaskedForge = (state) => state.forge === "silent" ? [fg(palette.attention)(`\n${FORGE_SILENT}`)] : [];
16521
16578
  branchHeading = (room) => ` ${columns({
16522
16579
  name: "WORKTREE",
16523
16580
  files: "FILES",
@@ -17005,7 +17062,7 @@ var init_render = __esmMin((() => {
17005
17062
  const pane = this.homeRoom(state);
17006
17063
  const room = Math.max(HOME_PATH_MIN, pane - many.length - HOME_PATH_CHROME);
17007
17064
  this.landing.content = `${elide(shortPath(this.repo), room)} · ${many}`;
17008
- this.landingKeys.content = this.homeKeys(state);
17065
+ this.landingKeys.visible = false;
17009
17066
  this.diffPane.visible = state.screen !== "branches" && !atHome(state);
17010
17067
  this.paintPanel(state);
17011
17068
  this.paintPane(state);
@@ -17263,21 +17320,11 @@ var init_render = __esmMin((() => {
17263
17320
  });
17264
17321
  if (found === this.hovered) return;
17265
17322
  this.hovered = found;
17266
- this.landingKeys.content = this.chipRow();
17267
17323
  if (this.shown !== void 0) this.footer.content = this.footerText(this.shown);
17268
17324
  }
17269
17325
  homeRoom(state) {
17270
17326
  return homeWidth(this.renderer.width, longestName(state), longestState(state));
17271
17327
  }
17272
- homeKeys(state) {
17273
- const said = state.notice.length === 0 ? state.waiting : state.notice;
17274
- const tail = said.length === 0 ? "" : ` ${said}`;
17275
- const room = Math.max(0, this.homeRoom(state) - tail.length);
17276
- const chips = keptWithin(this.chipRow().chunks, room);
17277
- if (tail.length === 0) return new StyledText([...chips]);
17278
- const colour = state.notice.length === 0 ? palette.accent : palette.attention;
17279
- return new StyledText([...chips, fg(colour)(tail)]);
17280
- }
17281
17328
  chipRow() {
17282
17329
  return new StyledText(this.chips.flatMap((chip, index) => {
17283
17330
  const lit = index === this.hovered;
@@ -18328,9 +18375,15 @@ var init_app = __esmMin((() => {
18328
18375
  matches: [],
18329
18376
  term: ""
18330
18377
  }, at);
18331
- this.commit({
18378
+ const shown = selectedPatch(landed);
18379
+ const opened = shown !== void 0 && rowShowing(shown, match.line) !== void 0 ? landed : {
18332
18380
  ...landed,
18333
- cursor: rowAtSourceLine(patch, match.line)
18381
+ revealed: allRevealed(landed)
18382
+ };
18383
+ const found = selectedPatch(opened) ?? patch;
18384
+ this.commit({
18385
+ ...opened,
18386
+ cursor: rowAtSourceLine(found, match.line)
18334
18387
  });
18335
18388
  yield* this.loadSource();
18336
18389
  });
@@ -18357,16 +18410,36 @@ var init_app = __esmMin((() => {
18357
18410
  this.commit(withNoticeHere(this.state, `${entry.comment.file} is not on this branch`));
18358
18411
  return;
18359
18412
  }
18360
- const shown = selectedPatch({
18413
+ const opened = {
18361
18414
  ...this.measured(),
18362
18415
  patchIndex: at
18363
- });
18416
+ };
18417
+ const shown = selectedPatch(opened);
18364
18418
  if (shown !== void 0 && rowShowing(shown, entry.comment.end) === void 0) {
18419
+ yield* this.jumpingPastGaps(opened, at, entry);
18420
+ return;
18421
+ }
18422
+ this.commit(openedAt(this.measured(), at, entry.comment.end));
18423
+ yield* this.turnedTo();
18424
+ yield* this.readAnswers(entry.comment.id);
18425
+ });
18426
+ }
18427
+ jumpingPastGaps(opened, at, entry) {
18428
+ return gen({ self: this }, function* () {
18429
+ const wide = {
18430
+ ...opened,
18431
+ revealed: allRevealed(opened)
18432
+ };
18433
+ const shown = selectedPatch(wide);
18434
+ if (shown === void 0 || rowShowing(shown, entry.comment.end) === void 0) {
18365
18435
  yield* this.readAnswers(entry.comment.id);
18366
18436
  this.commit(withNoticeHere(this.state, "that comment is outside this diff"));
18367
18437
  return;
18368
18438
  }
18369
- this.commit(openedAt(this.measured(), at, entry.comment.end));
18439
+ this.commit(openedAt({
18440
+ ...this.measured(),
18441
+ revealed: wide.revealed
18442
+ }, at, entry.comment.end));
18370
18443
  yield* this.turnedTo();
18371
18444
  yield* this.readAnswers(entry.comment.id);
18372
18445
  });
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.115",
26
+ "version": "0.1.0-alpha.117",
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": {