@eliya-oss/agent-diff 0.1.0-alpha.60 → 0.1.0-alpha.62

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,17 @@
1
1
  # @eliya-oss/agent-diff
2
2
 
3
+ ## 0.1.0-alpha.62
4
+
5
+ ### Patch Changes
6
+
7
+ - Panning right reaches the end of a long line. The last few columns sat under the line numbers and the diff sign, and no amount of panning could bring them out, so a wide line always stopped short of wherever it really ended.
8
+
9
+ ## 0.1.0-alpha.61
10
+
11
+ ### Patch Changes
12
+
13
+ - Scrolling reaches the end of a file whose comments fill the screen. The wheel counted lines of code and a long answer is one line of code however tall it is drawn, so anything below it was out of reach. Opening a comment from the panel also leaves the panel where you left it.
14
+
3
15
  ## 0.1.0-alpha.60
4
16
 
5
17
  ### Patch Changes
package/dist/main.js CHANGED
@@ -9448,7 +9448,7 @@ var init_pane = __esmMin((() => {
9448
9448
  init_commands();
9449
9449
  init_init();
9450
9450
  init_pane();
9451
- var version$1 = "0.1.0-alpha.60";
9451
+ var version$1 = "0.1.0-alpha.62";
9452
9452
  //#endregion
9453
9453
  //#region src/cli/upgrade.ts
9454
9454
  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;
@@ -11235,7 +11235,9 @@ var init_model = __esmMin((() => {
11235
11235
  panelWas: true,
11236
11236
  panelIndex: 0,
11237
11237
  columns: 0,
11238
- reportFull: true
11238
+ reportFull: true,
11239
+ tallest: 0,
11240
+ scroll: -1
11239
11241
  };
11240
11242
  initialState = (branches) => ({
11241
11243
  ...nothingReviewed,
@@ -12412,6 +12414,7 @@ var init_reduce = __esmMin((() => {
12412
12414
  const top = state.cursor < state.top ? state.cursor : state.cursor >= state.top + height ? state.cursor - height + 1 : state.top;
12413
12415
  return {
12414
12416
  ...state,
12417
+ scroll: -1,
12415
12418
  top: clamp(top, 0, highest)
12416
12419
  };
12417
12420
  };
@@ -12443,10 +12446,12 @@ var init_reduce = __esmMin((() => {
12443
12446
  });
12444
12447
  };
12445
12448
  scrolled = (state, delta) => {
12446
- const highest = Math.max(0, rowsIn(state) - Math.max(1, state.viewport));
12449
+ const height = Math.max(1, state.viewport);
12450
+ const highest = Math.max(0, state.tallest - height);
12451
+ const from = state.scroll === -1 ? state.top : state.scroll;
12447
12452
  return {
12448
12453
  ...state,
12449
- top: clamp(state.top + delta, 0, highest)
12454
+ scroll: clamp(from + delta, 0, highest)
12450
12455
  };
12451
12456
  };
12452
12457
  draggedTo = (state, from, to) => ({
@@ -13486,9 +13491,12 @@ var init_diffview = __esmMin((() => {
13486
13491
  }
13487
13492
  return spans;
13488
13493
  }
13494
+ hidden() {
13495
+ return Math.max(0, this.code.x - this.numbers.x) + SIGN_WIDTH;
13496
+ }
13489
13497
  feed() {
13490
13498
  const spans = noteSpans(this.display, this.held);
13491
- this.code.content = textAt(this.display, this.held);
13499
+ this.code.content = textAt(this.display, this.held, this.hidden());
13492
13500
  this.code.onHighlight = (highlights) => {
13493
13501
  return [...(this.ownSpans() ?? highlights).filter((highlight) => !spans.some(([from, to]) => highlight[0] < to && highlight[1] > from)), ...spans];
13494
13502
  };
@@ -13581,8 +13589,16 @@ var init_diffview = __esmMin((() => {
13581
13589
  const line = this.lineOfRow(row);
13582
13590
  return line === void 0 ? void 0 : this.visualOf(line);
13583
13591
  }
13584
- scrollTo(row, cursor) {
13592
+ tallestRows() {
13593
+ return this.tallest();
13594
+ }
13595
+ scrollTo(row, cursor, held = -1) {
13585
13596
  const highest = Math.max(0, this.tallest() - this.rows());
13597
+ if (held >= 0) {
13598
+ const settled = Math.max(0, Math.min(highest, held));
13599
+ if (this.code.scrollY !== settled) this.code.scrollY = settled;
13600
+ return settled;
13601
+ }
13586
13602
  const wanted = this.visualOfRow(row) ?? row;
13587
13603
  const at = this.visualOfRow(cursor);
13588
13604
  const kept = at !== void 0 && at >= wanted ? Math.max(wanted, at - this.rows() + 1) : wanted;
@@ -13678,7 +13694,13 @@ var init_diffview = __esmMin((() => {
13678
13694
  ]);
13679
13695
  return held;
13680
13696
  };
13681
- textAt = (display, pan) => display.map((entry) => heldAt(entry, pan)).join("\n");
13697
+ textAt = (display, pan, covered = 0) => {
13698
+ const lines = display.map((entry) => heldAt(entry, pan));
13699
+ if (covered === 0) return lines.join("\n");
13700
+ const widest = lines.reduce((most, line) => Math.max(most, line.length), 0);
13701
+ const last = lines.length - 1;
13702
+ return lines.map((line, at) => at === last ? line.padEnd(widest + covered) : line).join("\n");
13703
+ };
13682
13704
  noteSpans = (display, pan) => {
13683
13705
  const spans = [];
13684
13706
  let at = 0;
@@ -14540,6 +14562,9 @@ var init_render = __esmMin((() => {
14540
14562
  noteRoom() {
14541
14563
  return this.view.room();
14542
14564
  }
14565
+ tallestRows() {
14566
+ return this.view.tallestRows();
14567
+ }
14543
14568
  diffRows() {
14544
14569
  const edges = this.diffPane.border === true ? PANE_EDGES : 0;
14545
14570
  const pane = this.diffPane.height - edges - this.view.pinRows();
@@ -14694,11 +14719,11 @@ var init_render = __esmMin((() => {
14694
14719
  this.view.setWrap(state.wrap);
14695
14720
  this.view.setPan(state.pan);
14696
14721
  this.view.show(patch, notesFor(state, patch.path), gapRowSet(shown), proseFor(state, patch.path));
14697
- this.paintSticky(state, state.top);
14698
14722
  this.view.fit(this.diffRows());
14699
14723
  const height = this.view.rows();
14700
- const top = this.view.scrollTo(state.top, state.cursor);
14724
+ const top = this.view.scrollTo(state.top, state.cursor, state.scroll);
14701
14725
  this.lastTop = top;
14726
+ this.paintSticky(state, this.view.rowAt(top));
14702
14727
  this.view.paint(this.linePaint(state), top, height);
14703
14728
  this.paintGutter(state, top, height);
14704
14729
  }
@@ -14997,6 +15022,7 @@ var init_display = __esmMin((() => {
14997
15022
  paint: paintWith(screen),
14998
15023
  rows: sync(() => screen.viewportRows()),
14999
15024
  room: sync(() => screen.noteRoom()),
15025
+ tallest: sync(() => screen.tallestRows()),
15000
15026
  columns: sync(() => screen.columns()),
15001
15027
  listen: listenWith(screen),
15002
15028
  light: (path, side, lines) => lightWith(screen, path, side, lines)
@@ -15339,6 +15365,14 @@ var init_app = __esmMin((() => {
15339
15365
  this.commit(withColumns(this.state, columns));
15340
15366
  return;
15341
15367
  }
15368
+ const tallest = runSync(this.display.tallest);
15369
+ if (tallest !== this.state.tallest) {
15370
+ this.commit({
15371
+ ...this.state,
15372
+ tallest
15373
+ });
15374
+ return;
15375
+ }
15342
15376
  const room = runSync(this.display.room);
15343
15377
  if (room === this.roomed) return;
15344
15378
  this.roomed = room;
@@ -15619,7 +15653,12 @@ var init_app = __esmMin((() => {
15619
15653
  const branch = selectedBranch(this.state);
15620
15654
  if (id === void 0 || branch === void 0) return;
15621
15655
  yield* markRead(this.repo, branch.branch, id);
15622
- this.commit(withSent(this.state, yield* this.loadSent(branch.branch)));
15656
+ const held = this.state.panelIndex;
15657
+ const sent = yield* this.loadSent(branch.branch);
15658
+ this.commit({
15659
+ ...withSent(this.state, sent),
15660
+ panelIndex: held
15661
+ });
15623
15662
  });
15624
15663
  }
15625
15664
  settleHere() {
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.60",
26
+ "version": "0.1.0-alpha.62",
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": {