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

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @eliya-oss/agent-diff
2
2
 
3
+ ## 0.1.0-alpha.116
4
+
5
+ ### Patch Changes
6
+
7
+ - `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.
8
+
9
+ 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.
10
+
11
+ 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.
12
+
3
13
  ## 0.1.0-alpha.115
4
14
 
5
15
  ### Patch Changes
package/dist/main.js CHANGED
@@ -10896,7 +10896,7 @@ var init_pane = __esmMin((() => {
10896
10896
  init_drafts();
10897
10897
  init_init();
10898
10898
  init_pane();
10899
- var version$1 = "0.1.0-alpha.115";
10899
+ var version$1 = "0.1.0-alpha.116";
10900
10900
  //#endregion
10901
10901
  //#region src/cli/upgrade.ts
10902
10902
  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 +12904,7 @@ var init_tree = __esmMin((() => {
12904
12904
  return node.children.reduce((total, child) => total + filesUnder(tree, child), 0);
12905
12905
  };
12906
12906
  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;
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, 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
12908
  var init_model = __esmMin((() => {
12909
12909
  init_dist();
12910
12910
  init_patch();
@@ -12999,12 +12999,13 @@ var init_model = __esmMin((() => {
12999
12999
  if (layer === void 0) return [];
13000
13000
  return layer.prose.filter((anchor) => anchor.path === path);
13001
13001
  };
13002
+ kept = (state, at) => !state.hideReviewed || at === state.patchIndex || !isReviewed(state, at);
13002
13003
  layerFiles = (state, layerIndex) => {
13003
13004
  const layer = state.layers[layerIndex];
13004
13005
  if (layer === void 0) return [];
13005
13006
  return layer.files.flatMap((path) => {
13006
13007
  const at = state.patches.findIndex((patch) => patch.path === path);
13007
- return at === -1 ? [] : [at];
13008
+ return at === -1 || !kept(state, at) ? [] : [at];
13008
13009
  });
13009
13010
  };
13010
13011
  layerHolding = (state, fileIndex) => {
@@ -13032,9 +13033,9 @@ var init_model = __esmMin((() => {
13032
13033
  TITLE_ROWS = 2;
13033
13034
  titleRows = (state, layerIndex, room) => {
13034
13035
  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) => ({
13036
+ const heldLines = lines.slice(0, TITLE_ROWS);
13037
+ const last = heldLines.at(-1) ?? "";
13038
+ return (lines.length > TITLE_ROWS ? [...heldLines.slice(0, -1), clip(`${last} …`, room)] : heldLines).map((text, at) => ({
13038
13039
  index: layerIndex,
13039
13040
  kind: "title",
13040
13041
  text,
@@ -13151,7 +13152,6 @@ var init_model = __esmMin((() => {
13151
13152
  selectedPatch = (state) => shownOf(state)?.patch;
13152
13153
  pullHere = (state) => state.pulls[selectedBranch(state)?.branch ?? ""] ?? "";
13153
13154
  knownToHaveNoPull = (state) => state.forge === "answered" && pullHere(state).length === 0;
13154
- kept = (state, at) => !state.hideReviewed || at === state.patchIndex || !isReviewed(state, at);
13155
13155
  treeOf = (state) => buildTree(state.patches.map((patch, at) => kept(state, at) ? patch.path : ""));
13156
13156
  reviewedCountIn = (state) => state.patches.filter((_, at) => isReviewed(state, at)).length;
13157
13157
  CROWDED = 8;
@@ -14361,7 +14361,7 @@ var init_match = __esmMin((() => {
14361
14361
  }));
14362
14362
  //#endregion
14363
14363
  //#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;
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, 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
14365
  var init_reduce = __esmMin((() => {
14366
14366
  init_dist();
14367
14367
  init_patch();
@@ -14538,6 +14538,37 @@ var init_reduce = __esmMin((() => {
14538
14538
  if (state.focus === "review") return movePanel(state, delta);
14539
14539
  return stepStop(state, delta);
14540
14540
  };
14541
+ stepsToEnd = (state, delta) => {
14542
+ const at = placeIn(state);
14543
+ const last = Math.max(0, readingOrder(state).length - 1);
14544
+ const here = at === -1 ? 0 : at;
14545
+ return delta < 0 ? -here : last - here;
14546
+ };
14547
+ toTop = (state) => ({
14548
+ ...atRow(state, landingOn(state, state.patchIndex)),
14549
+ top: 0,
14550
+ scroll: -1
14551
+ });
14552
+ farOff = (state, delta) => {
14553
+ if (state.focus === "tree") {
14554
+ const steps = stepsToEnd(state, delta);
14555
+ return steps === 0 ? state : inRail(state, steps);
14556
+ }
14557
+ if (state.focus === "review") return movePanel(state, delta * PANEL_FAR);
14558
+ return delta < 0 ? toTop(state) : atRow(state, lastRow(selectedPatch(state)));
14559
+ };
14560
+ byHalf = (state, delta) => {
14561
+ const step = Math.max(1, Math.floor(state.viewport / 2));
14562
+ if (state.focus === "diff") return moveCursor(state, delta * step);
14563
+ const wanted = delta * step;
14564
+ const bounded = state.focus === "tree" ? boundedStep(state, wanted) : wanted;
14565
+ return bounded === 0 ? state : layerDown(state, bounded);
14566
+ };
14567
+ boundedStep = (state, wanted) => {
14568
+ const most = stepsToEnd(state, wanted);
14569
+ return wanted < 0 ? Math.max(wanted, most) : Math.min(wanted, most);
14570
+ };
14571
+ PANEL_FAR = 1e4;
14541
14572
  PANES = [
14542
14573
  "tree",
14543
14574
  "diff",
@@ -14786,14 +14817,10 @@ var init_reduce = __esmMin((() => {
14786
14817
  "branch.open": (state) => state,
14787
14818
  "branch.pull": (state) => state,
14788
14819
  "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))),
14820
+ "cursor.top": (state) => farOff(state, -1),
14821
+ "cursor.bottom": (state) => farOff(state, 1),
14822
+ "cursor.pageDown": (state) => byHalf(state, 1),
14823
+ "cursor.pageUp": (state) => byHalf(state, -1),
14797
14824
  "context.more": (state) => state,
14798
14825
  "context.less": (state) => state,
14799
14826
  "context.whole": (state) => state,
@@ -14922,6 +14949,16 @@ var init_reduce = __esmMin((() => {
14922
14949
  ...state,
14923
14950
  full
14924
14951
  });
14952
+ allRevealed = (state) => {
14953
+ const path = selectedPatch(state)?.path;
14954
+ if (path === void 0) return state.revealed;
14955
+ const here = (shownOf(state)?.gaps ?? []).map((gap) => ({
14956
+ file: path,
14957
+ gap: gap.index,
14958
+ lines: gap.hidden
14959
+ }));
14960
+ return [...state.revealed.filter((entry) => entry.file !== path), ...here];
14961
+ };
14925
14962
  revealsAfter = (state, gap, lines) => {
14926
14963
  const path = state.patches[state.patchIndex]?.path ?? "";
14927
14964
  const others = state.revealed.filter((entry) => entry.file !== path || entry.gap !== gap);
@@ -18357,16 +18394,36 @@ var init_app = __esmMin((() => {
18357
18394
  this.commit(withNoticeHere(this.state, `${entry.comment.file} is not on this branch`));
18358
18395
  return;
18359
18396
  }
18360
- const shown = selectedPatch({
18397
+ const opened = {
18361
18398
  ...this.measured(),
18362
18399
  patchIndex: at
18363
- });
18400
+ };
18401
+ const shown = selectedPatch(opened);
18364
18402
  if (shown !== void 0 && rowShowing(shown, entry.comment.end) === void 0) {
18403
+ yield* this.jumpingPastGaps(opened, at, entry);
18404
+ return;
18405
+ }
18406
+ this.commit(openedAt(this.measured(), at, entry.comment.end));
18407
+ yield* this.turnedTo();
18408
+ yield* this.readAnswers(entry.comment.id);
18409
+ });
18410
+ }
18411
+ jumpingPastGaps(opened, at, entry) {
18412
+ return gen({ self: this }, function* () {
18413
+ const wide = {
18414
+ ...opened,
18415
+ revealed: allRevealed(opened)
18416
+ };
18417
+ const shown = selectedPatch(wide);
18418
+ if (shown === void 0 || rowShowing(shown, entry.comment.end) === void 0) {
18365
18419
  yield* this.readAnswers(entry.comment.id);
18366
18420
  this.commit(withNoticeHere(this.state, "that comment is outside this diff"));
18367
18421
  return;
18368
18422
  }
18369
- this.commit(openedAt(this.measured(), at, entry.comment.end));
18423
+ this.commit(openedAt({
18424
+ ...this.measured(),
18425
+ revealed: wide.revealed
18426
+ }, at, entry.comment.end));
18370
18427
  yield* this.turnedTo();
18371
18428
  yield* this.readAnswers(entry.comment.id);
18372
18429
  });
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.116",
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": {