@eliya-oss/agent-diff 0.1.0-alpha.132 → 0.1.0-alpha.134

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,19 @@
1
1
  # @eliya-oss/agent-diff
2
2
 
3
+ ## 0.1.0-alpha.134
4
+
5
+ ### Patch Changes
6
+
7
+ - A wheel over the layers rail still moves a file at a time, but stops when you do. Each tick was queued behind a file load, so a trackpad flick left a backlog that carried on walking the review long after the gesture ended. Ticks that arrive while a move is still loading are dropped rather than queued.
8
+
9
+ The rail's columns line up. A directory sat one column left of the layer title above it and two right of the file names below it — three ragged edges. The three levels now step in evenly, the way the file tree already did, and a directory too long for the rail is shortened rather than cut off at the pane edge.
10
+
11
+ ## 0.1.0-alpha.133
12
+
13
+ ### Patch Changes
14
+
15
+ - CHANGELOG.md reads newest first. Versions were ordered as words rather than as numbers, so alpha.9 sat between alpha.90 and alpha.89 and the newest release was nowhere near the top. The release pages were always right; only the generated file was wrong.
16
+
3
17
  ## 0.1.0-alpha.132
4
18
 
5
19
  ### Patch Changes
package/dist/main.js CHANGED
@@ -11046,7 +11046,7 @@ var init_pane = __esmMin((() => {
11046
11046
  init_drafts();
11047
11047
  init_init();
11048
11048
  init_pane();
11049
- var version$1 = "0.1.0-alpha.132";
11049
+ var version$1 = "0.1.0-alpha.134";
11050
11050
  //#endregion
11051
11051
  //#region src/cli/upgrade.ts
11052
11052
  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;
@@ -13079,7 +13079,7 @@ var init_tree = __esmMin((() => {
13079
13079
  return node.children.reduce((total, child) => total + filesUnder(tree, child), 0);
13080
13080
  };
13081
13081
  crowdedDirectories = (tree, limit) => tree.nodes.filter((node) => node.kind === "directory" && directFiles(tree, node.id) > limit).map((node) => node.path);
13082
- })), 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, layerHolds, layerFiles, layerHolding, layerOpen, chunked, packed, shortened, wordWrapped, wrapped, clip, TITLE_ROWS, titleRows, shortDir, fileRow$1, shownFiles, dirOf, fileRows, layerRead, layerDone, countRow, NOTHING_LEFT, textRows, emptyRows, layerBody, holdsCursor, layerCard, layerRows, nearFirst, layerFitted, railWindow, selectedBranch, selectedPatch, pullHere, knownToHaveNoPull, treeOf, reviewedCountIn, CROWDED, treeRows, crowdedOf, foldersOfFile, isReviewed, treeStart, treeWindow, threadStand, STAND_WEIGHT, louder, threadsOn, hiddenLines, rowsUnder, markedStands, carriesLine, selectedRows, snippetOf, selectedLineCount, lineOf, brokenAt, laidLine, laidDraft, COMPOSE_BOX, COMPOSE_MARGIN, COMPOSE_PAD, COMPOSE_LEAST, composeBox, composeRoom$1, composeTarget, replyTarget, threadReplying, VOICES, threadQuote, pickedText, takenRows, selectedLines, shownMatches, matchHere, selectionReadout, CONTEXT_STEPS, wholeFileOff, contextToggled, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, rowShowing, lineOnSide, commentRowsIn, threadsAtRow, stopsAtRow, threadHere, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, PANEL_SECTIONS, answersIn, newerOf, spokeLast, SECTION_OF, sectionOf, sentEntry, panelEntries, panelEntry, threadChosen, spokenSince, hunkStarts, openingRow, changeAround, nextUnreviewed, reviewedCount, fileOrder, filePlace, readingOrder, placeIn, layerFile, layerAfter, selectionRange;
13082
+ })), 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, layerHolds, layerFiles, layerHolding, layerOpen, chunked, packed, shortened, wordWrapped, wrapped, clip, TITLE_ROWS, titleRows, shortDir, fileRow$1, shownFiles, dirOf, fileRows, layerRead, layerDone, countRow, NOTHING_LEFT, textRows, emptyRows, layerBody, holdsCursor, layerCard, layerRows, nearFirst, layerFitted, restingAt, railTop, PANE_CHROME$1, layerRoomIn, railWindow, selectedBranch, selectedPatch, pullHere, knownToHaveNoPull, treeOf, reviewedCountIn, CROWDED, treeRows, crowdedOf, foldersOfFile, isReviewed, treeStart, treeWindow, threadStand, STAND_WEIGHT, louder, threadsOn, hiddenLines, rowsUnder, markedStands, carriesLine, selectedRows, snippetOf, selectedLineCount, lineOf, brokenAt, laidLine, laidDraft, COMPOSE_BOX, COMPOSE_MARGIN, COMPOSE_PAD, COMPOSE_LEAST, composeBox, composeRoom$1, composeTarget, replyTarget, threadReplying, VOICES, threadQuote, pickedText, takenRows, selectedLines, shownMatches, matchHere, selectionReadout, CONTEXT_STEPS, wholeFileOff, contextToggled, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, rowShowing, lineOnSide, commentRowsIn, threadsAtRow, stopsAtRow, threadHere, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, PANEL_SECTIONS, answersIn, newerOf, spokeLast, SECTION_OF, sectionOf, sentEntry, panelEntries, panelEntry, threadChosen, spokenSince, hunkStarts, openingRow, changeAround, nextUnreviewed, reviewedCount, fileOrder, filePlace, readingOrder, placeIn, layerFile, layerAfter, selectionRange;
13083
13083
  var init_model = __esmMin((() => {
13084
13084
  init_dist();
13085
13085
  init_patch();
@@ -13223,8 +13223,12 @@ var init_model = __esmMin((() => {
13223
13223
  const whole = `${dir}/`;
13224
13224
  if (whole.length <= room) return whole;
13225
13225
  const parts = dir.split("/");
13226
- if (parts.length < 3) return `${clip(dir, Math.max(1, room - 1))}/`;
13227
- return `${parts[0] ?? ""}/…/${parts.at(-1) ?? ""}/`;
13226
+ const last = parts.at(-1) ?? "";
13227
+ const shrunk = parts.length < 3 ? "" : `${parts[0] ?? ""}/…/${last}/`;
13228
+ if (shrunk.length > 0 && shrunk.length <= room) return shrunk;
13229
+ const tail = `…/${last}/`;
13230
+ if (tail.length <= room) return tail;
13231
+ return `${clip(last, Math.max(1, room - 1))}/`;
13228
13232
  };
13229
13233
  fileRow$1 = (state, layerIndex, at, room) => {
13230
13234
  const path = state.patches[at]?.path ?? "";
@@ -13327,16 +13331,31 @@ var init_model = __esmMin((() => {
13327
13331
  shown.add(state.layerIndex);
13328
13332
  return layerRows(state, room, shown);
13329
13333
  };
13330
- railWindow = (rows, height, layerIndex) => {
13334
+ restingAt = (rows, height, layerIndex) => {
13335
+ const first = Math.max(0, rows.findIndex((row) => row.index === layerIndex));
13336
+ const block = rows.findLastIndex((row) => row.index === layerIndex) - first + 1;
13337
+ return block >= height ? first : first - Math.floor((height - block) / 2);
13338
+ };
13339
+ railTop = (rows, height, layerIndex, scroll) => {
13340
+ const wanted = scroll >= 0 ? scroll : restingAt(rows, height, layerIndex);
13341
+ return Math.max(0, Math.min(Math.max(0, rows.length - height), wanted));
13342
+ };
13343
+ PANE_CHROME$1 = 3;
13344
+ layerRoomIn = (state) => {
13345
+ const whole = Math.max(8, treeWidth(state.columns) - PANE_CHROME$1);
13346
+ return {
13347
+ title: Math.max(4, whole - 4),
13348
+ dir: Math.max(4, whole - 6),
13349
+ file: Math.max(4, whole - 8)
13350
+ };
13351
+ };
13352
+ railWindow = (rows, height, layerIndex, scroll = -1) => {
13331
13353
  if (rows.length <= height) return {
13332
13354
  rows,
13333
13355
  more: 0,
13334
13356
  above: 0
13335
13357
  };
13336
- const first = Math.max(0, rows.findIndex((row) => row.index === layerIndex));
13337
- const block = rows.findLastIndex((row) => row.index === layerIndex) - first + 1;
13338
- const wanted = block >= height ? first : first - Math.floor((height - block) / 2);
13339
- const start = Math.max(0, Math.min(rows.length - height, wanted));
13358
+ const start = railTop(rows, height, layerIndex, scroll);
13340
13359
  const shown = rows.slice(start, start + height);
13341
13360
  const here = new Set(shown.map((row) => row.index));
13342
13361
  const seen = (from) => new Set(from.filter((row) => !here.has(row.index)).map((row) => row.index)).size;
@@ -14737,6 +14756,7 @@ var init_reduce = __esmMin((() => {
14737
14756
  layerIndex: landed.layer,
14738
14757
  openLayers: state.openLayers.includes(landed.layer) ? state.openLayers : [...state.openLayers, landed.layer],
14739
14758
  patchIndex: landed.file,
14759
+ railScroll: -1,
14740
14760
  top: 0,
14741
14761
  cursor: landingOn(state, landed.file),
14742
14762
  anchorRow: 0,
@@ -16235,7 +16255,7 @@ var init_diffview = __esmMin((() => {
16235
16255
  }));
16236
16256
  //#endregion
16237
16257
  //#region src/tui/render.ts
16238
- var ROW_HEIGHT, COMPOSE_WIDTH, GUTTER_X, CHIP_GAP, MODAL_ROOM, COMPOSE_CHROME, COMPOSE_ACTION_ROWS, reportActions, actionsText, SNIPPET_LINES, PALETTE_KEY, PALETTE_TITLE, PALETTE_GAP, PALETTE_CHROME, PENDING_CHROME, keysTitle, PALETTE_WIDTH, PANEL_SHARE, PANEL_MAX, PANEL_FLOOR, PANEL_FOOT, PANEL_QUARTER, PANEL_FIFTH, PANE_CHROME, PANE_EDGES, PANE_INSET, DIFF_FLOOR, COMPOSE_EDGE, CRAMPED, CRAMPED_ROWS, DIFF_CHROME_MOST, BRANCH_WIDTH, BRANCH_NAME_MIN, BRANCH_FIXED, STATE_MIN, EMPTY_LIST, MODAL_MARGIN, shareOf, homeWidth, longestName, longestState, keysOf, commandRow, modalWidth, panelWidth, panelTop, panelRows, composeRoom, laidOut$1, STICKY_MAX, pickPaint, PLAIN_PICKED, PICKED, PLAIN_CURSOR, UNDER_CURSOR, GAP_PAINT, frameRoot, crampedBar, 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, stillThere, quotedFor, clipHead, clipMiddle, clipPath, INDENT_MAX, treeLabel, waitingLabel, inRange, notesOf, notesFor, paired, chipWidth, WAYS_OUT, 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, panLabel, HEADER_GAP, HEADER_PATH_MIN, headerRoom, headerFitted, fallbackScope, treeMarks, treeTail, treeLine, GUTTER, DIR_LEAD, TITLE_LEAD, FILE_LEAD, STALE_ROOM, STALE_LONG, STALE_SHORT, staleBanner, layerRoom, litRow, leftOver, titlePaint, titleMark, titleLook, fileMark, fileLook, layerLook, layerGutter, layerText, PANEL_TITLES, PANEL_ORDER, PANEL_LEAD, PANEL_EMPTY, restingOrHere, FOUND_LEAST, nothingYet, foundTitle, CHANGED_MARK, fileRow, blockOf, aroundRow, windowedBlocks, panelWhere, panelBody, panelPair, panelSection, PULL_HINT, panelWindow, moreLine, panelText, Screen;
16258
+ var ROW_HEIGHT, COMPOSE_WIDTH, GUTTER_X, CHIP_GAP, MODAL_ROOM, COMPOSE_CHROME, COMPOSE_ACTION_ROWS, reportActions, actionsText, SNIPPET_LINES, PALETTE_KEY, PALETTE_TITLE, PALETTE_GAP, PALETTE_CHROME, PENDING_CHROME, keysTitle, PALETTE_WIDTH, PANEL_SHARE, PANEL_MAX, PANEL_FLOOR, PANEL_FOOT, PANEL_QUARTER, PANEL_FIFTH, PANE_CHROME, PANE_EDGES, PANE_INSET, DIFF_FLOOR, COMPOSE_EDGE, CRAMPED, CRAMPED_ROWS, DIFF_CHROME_MOST, BRANCH_WIDTH, BRANCH_NAME_MIN, BRANCH_FIXED, STATE_MIN, EMPTY_LIST, MODAL_MARGIN, shareOf, homeWidth, longestName, longestState, keysOf, commandRow, modalWidth, panelWidth, panelTop, panelRows, composeRoom, laidOut$1, STICKY_MAX, pickPaint, PLAIN_PICKED, PICKED, PLAIN_CURSOR, UNDER_CURSOR, GAP_PAINT, frameRoot, crampedBar, 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, stillThere, quotedFor, clipHead, clipMiddle, clipPath, INDENT_MAX, treeLabel, waitingLabel, inRange, notesOf, notesFor, paired, chipWidth, WAYS_OUT, 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, panLabel, HEADER_GAP, HEADER_PATH_MIN, headerRoom, headerFitted, fallbackScope, treeMarks, treeTail, treeLine, GUTTER, DIR_LEAD, TITLE_LEAD, FILE_LEAD, STALE_ROOM, STALE_ASKING, STALE_LONG, STALE_MIDDLE, STALE_SHORT, staleSaid, staleBanner, litRow, leftOver, titlePaint, titleMark, titleLook, fileMark, fileLook, layerLook, layerGutter, layerText, PANEL_TITLES, PANEL_ORDER, PANEL_LEAD, PANEL_EMPTY, restingOrHere, FOUND_LEAST, nothingYet, foundTitle, CHANGED_MARK, fileRow, blockOf, aroundRow, windowedBlocks, panelWhere, panelBody, panelPair, panelSection, PULL_HINT, panelWindow, moreLine, panelText, Screen;
16239
16259
  var init_render = __esmMin((() => {
16240
16260
  init_dist();
16241
16261
  init_command();
@@ -16902,21 +16922,19 @@ var init_render = __esmMin((() => {
16902
16922
  return `${treeMarks(state, row)}${clip(treeLabel(state, row, room), room).padEnd(room)}${tail}`;
16903
16923
  };
16904
16924
  GUTTER = 3;
16905
- DIR_LEAD = GUTTER;
16925
+ DIR_LEAD = 6;
16906
16926
  TITLE_LEAD = 4;
16907
- FILE_LEAD = 6;
16927
+ FILE_LEAD = 8;
16908
16928
  STALE_ROOM = 13;
16909
- STALE_LONG = "stale, the branch moved on";
16929
+ STALE_ASKING = 24;
16930
+ STALE_LONG = "stale, the branch moved on — press L to ask for a new one";
16931
+ STALE_MIDDLE = "stale, the branch moved on";
16910
16932
  STALE_SHORT = "stale";
16911
- staleBanner = (room) => wrapped(room >= STALE_ROOM ? STALE_LONG : STALE_SHORT, room).map((line) => ` ${line}`).join("\n");
16912
- layerRoom = (pane) => {
16913
- const whole = Math.max(8, pane - PANE_CHROME);
16914
- return {
16915
- title: Math.max(4, whole - TITLE_LEAD),
16916
- dir: Math.max(4, whole - DIR_LEAD),
16917
- file: Math.max(4, whole - FILE_LEAD)
16918
- };
16933
+ staleSaid = (room) => {
16934
+ if (room >= STALE_ASKING) return STALE_LONG;
16935
+ return room >= STALE_ROOM ? STALE_MIDDLE : STALE_SHORT;
16919
16936
  };
16937
+ staleBanner = (room) => wrapped(staleSaid(room), room).map((line) => ` ${line}`).join("\n");
16920
16938
  litRow = (row, state, drawn) => row.here === true ? bg(restingOrHere(state.focus === "tree"))(drawn) : drawn;
16921
16939
  leftOver = (state, layerIndex) => state.layers[layerIndex]?.title === REMAINDER_TITLE;
16922
16940
  titlePaint = (state, layerIndex) => {
@@ -16954,7 +16972,11 @@ var init_render = __esmMin((() => {
16954
16972
  mark: " ",
16955
16973
  paint: palette.faint
16956
16974
  };
16957
- case "count":
16975
+ case "count": return {
16976
+ lead: DIR_LEAD,
16977
+ mark: " ",
16978
+ paint: palette.faint
16979
+ };
16958
16980
  case "gap": return {
16959
16981
  lead: TITLE_LEAD,
16960
16982
  mark: " ",
@@ -16970,7 +16992,7 @@ var init_render = __esmMin((() => {
16970
16992
  }
16971
16993
  };
16972
16994
  layerGutter = (row, look) => {
16973
- return `${row.here === true ? marks().cursor : " "}${look.mark.padStart(2)}`;
16995
+ return `${row.here === true ? marks().cursor : " "}${look.mark.padStart(GUTTER - 1)}`;
16974
16996
  };
16975
16997
  layerText = (row, look, room) => row.kind === "gap" ? "" : `${layerGutter(row, look)}${" ".repeat(look.lead - GUTTER)}${row.text}`.padEnd(room.title + TITLE_LEAD);
16976
16998
  PANEL_TITLES = {
@@ -17453,7 +17475,7 @@ var init_render = __esmMin((() => {
17453
17475
  return Math.max(1, this.listPane.height - edges);
17454
17476
  }
17455
17477
  layerRail(state) {
17456
- const room = layerRoom(this.paneRoom());
17478
+ const room = layerRoomIn(state);
17457
17479
  const said = summaryLines(state.summary, room.title, this.listRoom());
17458
17480
  const banner = (state.layersStale ? 1 : 0) + said.length;
17459
17481
  const height = Math.max(1, this.listRoom() - banner);
@@ -17479,11 +17501,11 @@ var init_render = __esmMin((() => {
17479
17501
  return [fg(row.here === true ? palette.marker : palette.faint)(drawn.slice(0, 1)), litRow(row, state, body)];
17480
17502
  }
17481
17503
  railFitted(state, all, height) {
17482
- const whole = railWindow(all, height, state.layerIndex);
17504
+ const whole = railWindow(all, height, state.layerIndex, state.railScroll);
17483
17505
  if (whole.more === 0 && whole.above === 0) return whole;
17484
- const once = railWindow(all, Math.max(1, height - 1), state.layerIndex);
17506
+ const once = railWindow(all, Math.max(1, height - 1), state.layerIndex, state.railScroll);
17485
17507
  if (once.above === 0 || once.more === 0) return once;
17486
- return railWindow(all, Math.max(1, height - 2), state.layerIndex);
17508
+ return railWindow(all, Math.max(1, height - 2), state.layerIndex, state.railScroll);
17487
17509
  }
17488
17510
  paintDiff(state) {
17489
17511
  const shown = shownOf(state);
@@ -18071,6 +18093,7 @@ var init_app = __esmMin((() => {
18071
18093
  selectingNow = false;
18072
18094
  leaving;
18073
18095
  looking;
18096
+ rolling = false;
18074
18097
  grewWithShift = false;
18075
18098
  keys = [];
18076
18099
  trail = [];
@@ -18099,7 +18122,7 @@ var init_app = __esmMin((() => {
18099
18122
  onPan: (delta) => this.onPanWheel(delta),
18100
18123
  onDrag: (from, to, done) => this.dragged(from, to, done),
18101
18124
  onChip: (key) => this.dispatchTask(this.onKey(asKey(key))),
18102
- onRail: (delta) => this.dispatchTask(this.rolled(delta))
18125
+ onRail: (delta) => this.rollFrom(delta)
18103
18126
  }));
18104
18127
  renderer.on("selection", () => this.copyDragged());
18105
18128
  runSync(options.display.onWritten((text) => this.readBack(text)));
@@ -18857,8 +18880,15 @@ var init_app = __esmMin((() => {
18857
18880
  const was = this.state.patchIndex;
18858
18881
  this.commit(reduce(this.measured(), delta > 0 ? "comment.next" : "comment.prev"));
18859
18882
  if (this.state.patchIndex !== was) yield* this.turnedTo();
18883
+ this.rolling = false;
18860
18884
  });
18861
18885
  }
18886
+ rollFrom(delta) {
18887
+ const costly = onLayers(this.state);
18888
+ if (costly && this.rolling) return;
18889
+ this.rolling = costly;
18890
+ this.dispatchTask(this.rolled(delta));
18891
+ }
18862
18892
  stepped(delta) {
18863
18893
  return gen({ self: this }, function* () {
18864
18894
  if (this.paged(delta)) return;
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.132",
26
+ "version": "0.1.0-alpha.134",
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": {