@eliya-oss/agent-diff 0.1.0-alpha.96 → 0.1.0-alpha.97

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.97
4
+
5
+ ### Patch Changes
6
+
7
+ - Every release writes its changes into CHANGELOG.md and says them on the release page, rather than only in an install line.
8
+
9
+ - Clicking a line puts the cursor on it rather than selecting it, so the arrows afterwards move the cursor and the diff stays where it is.
10
+
11
+ - Settling or removing a thread from the review panel leaves the cursor where it was, rather than sending it back to the first thread.
12
+
3
13
  ## 0.1.0-alpha.96
4
14
 
5
15
  ### Patch Changes
package/dist/main.js CHANGED
@@ -9913,7 +9913,7 @@ var init_pane = __esmMin((() => {
9913
9913
  init_commands();
9914
9914
  init_init();
9915
9915
  init_pane();
9916
- var version$1 = "0.1.0-alpha.96";
9916
+ var version$1 = "0.1.0-alpha.97";
9917
9917
  //#endregion
9918
9918
  //#region src/cli/upgrade.ts
9919
9919
  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;
@@ -11749,7 +11749,7 @@ var init_tree = __esmMin((() => {
11749
11749
  return node.children.reduce((total, child) => total + filesUnder(tree, child), 0);
11750
11750
  };
11751
11751
  crowdedDirectories = (tree, limit) => tree.nodes.filter((node) => node.kind === "directory" && directFiles(tree, node.id) > limit).map((node) => node.path);
11752
- })), 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, 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, panelIndexOf, panelEntry, threadChosen, spokenSince, hunkStarts, openingRow, changeAround, nextUnreviewed, reviewedCount, fileOrder, filePlace, layerFile, selectionRange;
11752
+ })), 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, 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;
11753
11753
  var init_model = __esmMin((() => {
11754
11754
  init_dist();
11755
11755
  init_patch();
@@ -12247,11 +12247,6 @@ var init_model = __esmMin((() => {
12247
12247
  };
12248
12248
  return [...ordered("with"), ...ordered("answered")];
12249
12249
  };
12250
- panelIndexOf = (state, id) => {
12251
- if (id === void 0) return state.panelIndex;
12252
- const at = panelEntries(state).findIndex((entry) => entry.comment.id === id);
12253
- return at === -1 ? state.panelIndex : at;
12254
- };
12255
12250
  panelEntry = (state) => panelEntries(state)[state.panelIndex];
12256
12251
  threadChosen = (state) => {
12257
12252
  if (state.focus !== "review") return void 0;
@@ -13045,7 +13040,7 @@ var init_match = __esmMin((() => {
13045
13040
  }));
13046
13041
  //#endregion
13047
13042
  //#region src/tui/reduce.ts
13048
- var clamp, lastRow, rowsIn, withCursorVisible, moveCursor, stepStop, scrolled, 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, 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;
13043
+ 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, 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;
13049
13044
  var init_reduce = __esmMin((() => {
13050
13045
  init_dist();
13051
13046
  init_patch();
@@ -13106,6 +13101,14 @@ var init_reduce = __esmMin((() => {
13106
13101
  scroll: clamp(from + delta, 0, highest)
13107
13102
  };
13108
13103
  };
13104
+ restingOn = (state, row) => ({
13105
+ ...state,
13106
+ picked: void 0,
13107
+ selecting: false,
13108
+ stop: 0,
13109
+ anchorRow: clamp(row, 0, lastRow(selectedPatch(state))),
13110
+ cursor: clamp(row, 0, lastRow(selectedPatch(state)))
13111
+ });
13109
13112
  draggedTo = (state, from, to) => ({
13110
13113
  ...state,
13111
13114
  picked: void 0,
@@ -15997,7 +16000,7 @@ var init_upgrade = __esmMin((() => {
15997
16000
  return due ? `adiff ${latest} is out · adiff upgrade` : "";
15998
16001
  }).pipe(withSpan("Tui.upgradeHint"));
15999
16002
  upgradeHint = worded.pipe(orElseSucceed(() => ""));
16000
- })), KEY_HISTORY, DRAIN_PASSES, TRAIL_HISTORY, clockOf, momentOf, noticeOf, COPIERS, wayland, handOver, throughMultiplexer, copyToClipboard, lineUnder, asKey, openedPull, LISTENS, WRITES, OVER, overReview, writesInto, listens, laidOut, ARROWS, keyName, App, turnedOver, settledPath, chosenIn, settingsHeld, firstBranches, missing, openingOn, launch, told, untilDestroyed, runOn, runTui;
16003
+ })), KEY_HISTORY, DRAIN_PASSES, TRAIL_HISTORY, clockOf, momentOf, noticeOf, COPIERS, wayland, handOver, throughMultiplexer, copyToClipboard, lineUnder, asKey, openedPull, LISTENS, WRITES, OVER, overReview, writesInto, listens, laidOut, ARROWS, keyName, App, turnedOver, settledPath, restsWhereItLanded, chosenIn, settingsHeld, firstBranches, missing, openingOn, launch, told, untilDestroyed, runOn, runTui;
16001
16004
  var init_app = __esmMin((() => {
16002
16005
  init_dist();
16003
16006
  init_report();
@@ -16121,6 +16124,7 @@ var init_app = __esmMin((() => {
16121
16124
  sessionPath;
16122
16125
  remembered = "";
16123
16126
  chosen = {};
16127
+ selectingNow = false;
16124
16128
  grewWithShift = false;
16125
16129
  keys = [];
16126
16130
  trail = [];
@@ -16578,10 +16582,15 @@ var init_app = __esmMin((() => {
16578
16582
  });
16579
16583
  }
16580
16584
  dragged(from, to, done) {
16581
- const along = from.row === to.row && from.column !== to.column;
16582
16585
  const held = this.measured();
16586
+ if (restsWhereItLanded(from, to) && !this.selectingNow) {
16587
+ this.commit(restingOn(held, from.row));
16588
+ return;
16589
+ }
16590
+ const along = from.row === to.row;
16591
+ this.selectingNow = !done;
16583
16592
  this.commit(along ? pickedIn(held, from.row, from.column, to.column) : draggedTo(held, from.row, to.row));
16584
- if (done && (along || from.row !== to.row)) this.copySelection(true);
16593
+ if (done) this.copySelection(true);
16585
16594
  }
16586
16595
  copyDragged() {
16587
16596
  const taken = this.renderer.getSelection()?.getSelectedText() ?? "";
@@ -16729,13 +16738,14 @@ var init_app = __esmMin((() => {
16729
16738
  this.commit(withNotice(this.state, "no thread here"));
16730
16739
  return;
16731
16740
  }
16741
+ const was = this.state.panelIndex;
16732
16742
  yield* this.settling(branch.branch, id);
16733
16743
  const sent = yield* this.loadSent(branch.branch);
16734
16744
  const held = withSent({
16735
16745
  ...this.state,
16736
- opened: this.state.opened.filter((was) => was !== id)
16746
+ opened: this.state.opened.filter((one) => one !== id)
16737
16747
  }, sent);
16738
- this.commit(withNotice(this.staying(held, id), "settled"));
16748
+ this.commit(withNotice(this.staying(held, id, was), "settled"));
16739
16749
  });
16740
16750
  }
16741
16751
  replyHere() {
@@ -16753,12 +16763,13 @@ var init_app = __esmMin((() => {
16753
16763
  });
16754
16764
  });
16755
16765
  }
16756
- staying(state, id) {
16757
- const at = panelIndexOf(state, id);
16758
- const last = Math.max(0, panelEntries(state).length - 1);
16766
+ staying(state, id, was) {
16767
+ const entries = panelEntries(state);
16768
+ const last = Math.max(0, entries.length - 1);
16769
+ const at = entries.findIndex((entry) => entry.comment.id === id);
16759
16770
  return {
16760
16771
  ...state,
16761
- panelIndex: Math.min(at, last)
16772
+ panelIndex: Math.min(at === -1 ? was : at, last)
16762
16773
  };
16763
16774
  }
16764
16775
  removeHere() {
@@ -16769,13 +16780,14 @@ var init_app = __esmMin((() => {
16769
16780
  this.commit(withNotice(this.state, "no thread here"));
16770
16781
  return;
16771
16782
  }
16783
+ const was = this.state.panelIndex;
16772
16784
  yield* this.removing(branch.branch, id);
16773
16785
  const sent = yield* this.loadSent(branch.branch);
16774
16786
  const held = withSent({
16775
16787
  ...this.state,
16776
- opened: this.state.opened.filter((was) => was !== id)
16788
+ opened: this.state.opened.filter((one) => one !== id)
16777
16789
  }, sent);
16778
- this.commit(withNotice(held, "removed, restore it with comment restore"));
16790
+ this.commit(withNotice(this.staying(held, id, was), "removed, restore it with comment restore"));
16779
16791
  });
16780
16792
  }
16781
16793
  fillBranches() {
@@ -17094,6 +17106,7 @@ var init_app = __esmMin((() => {
17094
17106
  anchorRow: state.cursor
17095
17107
  });
17096
17108
  settledPath = (path) => promise(() => realpath(path).catch(() => resolve(path)));
17109
+ restsWhereItLanded = (from, to) => from.row === to.row && from.column === to.column;
17097
17110
  chosenIn = (state) => ({
17098
17111
  wrap: state.wrap,
17099
17112
  sticky: state.sticky,
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.96",
26
+ "version": "0.1.0-alpha.97",
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": {