@eliya-oss/agent-diff 0.1.0-alpha.68 → 0.1.0-alpha.69

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,13 @@
1
1
  # @eliya-oss/agent-diff
2
2
 
3
+ ## 0.1.0-alpha.69
4
+
5
+ ### Patch Changes
6
+
7
+ - A comment whose lines have left the diff can be read, settled and removed from the review panel. Settling or removing a thread marks its answers read, so nothing is left counted as unread once it is closed.
8
+
9
+ - The footer names the keys of the pane in focus, rather than one row for the whole screen. The sheet behind `?` filters as you type and groups keys narrowly. The wheel moves one row a notch, and an arrow after it moves the cursor into view instead of dragging the view back.
10
+
3
11
  ## 0.1.0-alpha.68
4
12
 
5
13
  ### Minor Changes
package/dist/main.js CHANGED
@@ -9650,7 +9650,7 @@ var init_pane = __esmMin((() => {
9650
9650
  init_commands();
9651
9651
  init_init();
9652
9652
  init_pane();
9653
- var version$1 = "0.1.0-alpha.68";
9653
+ var version$1 = "0.1.0-alpha.69";
9654
9654
  //#endregion
9655
9655
  //#region src/cli/upgrade.ts
9656
9656
  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;
@@ -10291,11 +10291,16 @@ var init_threads = __esmMin((() => {
10291
10291
  const worktree = yield* findBranch(repo, branch);
10292
10292
  if (!(yield* isKnown(worktree.path, id))) return yield* new UnknownComment({ id });
10293
10293
  const current = yield* store.state(worktree.path);
10294
+ const replies = (yield* store.answers(worktree.path)).filter((entry) => entry.comment === id);
10294
10295
  yield* store.saveState(worktree.path, {
10295
10296
  ...current,
10296
10297
  settled: {
10297
10298
  ...current.settled,
10298
10299
  [id]: at
10300
+ },
10301
+ read: {
10302
+ ...current.read,
10303
+ [id]: replies.length
10299
10304
  }
10300
10305
  });
10301
10306
  return { settled: id };
@@ -10305,11 +10310,16 @@ var init_threads = __esmMin((() => {
10305
10310
  const worktree = yield* findBranch(repo, branch);
10306
10311
  const current = yield* store.state(worktree.path);
10307
10312
  if (!(yield* isKnown(worktree.path, id))) return yield* new UnknownComment({ id });
10313
+ const replies = (yield* store.answers(worktree.path)).filter((entry) => entry.comment === id);
10308
10314
  yield* store.saveState(worktree.path, {
10309
10315
  ...current,
10310
10316
  removed: {
10311
10317
  ...current.removed,
10312
10318
  [id]: at
10319
+ },
10320
+ read: {
10321
+ ...current.read,
10322
+ [id]: replies.length
10313
10323
  }
10314
10324
  });
10315
10325
  return { removed: id };
@@ -11955,10 +11965,15 @@ var init_watch = __esmMin((() => {
11955
11965
  }));
11956
11966
  //#endregion
11957
11967
  //#region src/tui/command.ts
11958
- var command, commands, TEXT_SCREENS, PRINTABLE_KEY, takesText, commandsFor, listableFor, glossaryFor, actionFor, GLYPHS, displayKey, hintsFor;
11968
+ var EVERY_PANE, command, commands, TEXT_SCREENS, PRINTABLE_KEY, takesText, commandsFor, listableFor, glossaryFor, actionFor, GLYPHS, displayKey, hintsFor;
11959
11969
  var init_command = __esmMin((() => {
11970
+ EVERY_PANE = [
11971
+ "tree",
11972
+ "diff",
11973
+ "review"
11974
+ ];
11960
11975
  command = (input) => ({
11961
- category: "Review",
11976
+ category: "Reading",
11962
11977
  hint: "",
11963
11978
  listed: true,
11964
11979
  whenComments: false,
@@ -11968,6 +11983,7 @@ var init_command = __esmMin((() => {
11968
11983
  whenSelecting: false,
11969
11984
  whenReviewed: false,
11970
11985
  whenPull: false,
11986
+ panes: EVERY_PANE,
11971
11987
  rank: 0,
11972
11988
  ...input
11973
11989
  });
@@ -12010,7 +12026,7 @@ var init_command = __esmMin((() => {
12010
12026
  command({
12011
12027
  action: "branch.pull",
12012
12028
  title: "Open the pull request in a browser",
12013
- category: "Review",
12029
+ category: "Branches",
12014
12030
  keys: ["p"],
12015
12031
  screens: ["review"],
12016
12032
  hint: "pull request",
@@ -12019,60 +12035,70 @@ var init_command = __esmMin((() => {
12019
12035
  }),
12020
12036
  command({
12021
12037
  action: "cursor.next",
12038
+ category: "Moving",
12022
12039
  title: "Next line",
12023
12040
  keys: ["down", "j"],
12024
12041
  screens: ["review"]
12025
12042
  }),
12026
12043
  command({
12027
12044
  action: "cursor.prev",
12045
+ category: "Moving",
12028
12046
  title: "Previous line",
12029
12047
  keys: ["up", "k"],
12030
12048
  screens: ["review"]
12031
12049
  }),
12032
12050
  command({
12033
12051
  action: "cursor.top",
12052
+ category: "Moving",
12034
12053
  title: "Go to first line",
12035
12054
  keys: ["g"],
12036
12055
  screens: ["review"]
12037
12056
  }),
12038
12057
  command({
12039
12058
  action: "cursor.bottom",
12059
+ category: "Moving",
12040
12060
  title: "Go to last line",
12041
12061
  keys: ["G"],
12042
12062
  screens: ["review"]
12043
12063
  }),
12044
12064
  command({
12045
12065
  action: "cursor.pageDown",
12066
+ category: "Moving",
12046
12067
  title: "Half page down",
12047
12068
  keys: ["ctrl+d"],
12048
12069
  screens: ["review"]
12049
12070
  }),
12050
12071
  command({
12051
12072
  action: "cursor.pageUp",
12073
+ category: "Moving",
12052
12074
  title: "Half page up",
12053
12075
  keys: ["ctrl+u"],
12054
12076
  screens: ["review"]
12055
12077
  }),
12056
12078
  command({
12057
12079
  action: "context.more",
12080
+ category: "Reading",
12058
12081
  title: "Show more context",
12059
12082
  keys: ["+", "="],
12060
12083
  screens: ["review"]
12061
12084
  }),
12062
12085
  command({
12063
12086
  action: "context.less",
12087
+ category: "Reading",
12064
12088
  title: "Show less context",
12065
12089
  keys: ["-", "_"],
12066
12090
  screens: ["review"]
12067
12091
  }),
12068
12092
  command({
12069
12093
  action: "context.whole",
12094
+ category: "Reading",
12070
12095
  title: "Show the whole file, or go back to the diff",
12071
12096
  keys: ["F"],
12072
12097
  screens: ["review"]
12073
12098
  }),
12074
12099
  command({
12075
12100
  action: "comment.next",
12101
+ category: "Comments",
12076
12102
  title: "Next comment",
12077
12103
  keys: ["n"],
12078
12104
  screens: ["review"],
@@ -12080,24 +12106,28 @@ var init_command = __esmMin((() => {
12080
12106
  }),
12081
12107
  command({
12082
12108
  action: "comment.prev",
12109
+ category: "Comments",
12083
12110
  title: "Previous comment",
12084
12111
  keys: ["N"],
12085
12112
  screens: ["review"]
12086
12113
  }),
12087
12114
  command({
12088
12115
  action: "hunk.next",
12116
+ category: "Moving",
12089
12117
  title: "Next change",
12090
12118
  keys: ["}"],
12091
12119
  screens: ["review"]
12092
12120
  }),
12093
12121
  command({
12094
12122
  action: "hunk.prev",
12123
+ category: "Moving",
12095
12124
  title: "Previous change",
12096
12125
  keys: ["{"],
12097
12126
  screens: ["review"]
12098
12127
  }),
12099
12128
  command({
12100
12129
  action: "file.next",
12130
+ panes: ["tree", "diff"],
12101
12131
  title: "Next file",
12102
12132
  category: "Files",
12103
12133
  keys: ["]"],
@@ -12115,14 +12145,14 @@ var init_command = __esmMin((() => {
12115
12145
  command({
12116
12146
  action: "focus.toggle",
12117
12147
  title: "Switch pane",
12118
- category: "General",
12148
+ category: "Reading",
12119
12149
  keys: ["tab"],
12120
12150
  screens: ["review"]
12121
12151
  }),
12122
12152
  command({
12123
12153
  action: "focus.back",
12124
12154
  title: "Switch pane, the other way",
12125
- category: "General",
12155
+ category: "Reading",
12126
12156
  keys: ["shift+tab"],
12127
12157
  screens: ["review"],
12128
12158
  listed: false
@@ -12130,7 +12160,7 @@ var init_command = __esmMin((() => {
12130
12160
  command({
12131
12161
  action: "panel.toggle",
12132
12162
  title: "Show or hide the review panel",
12133
- category: "Review",
12163
+ category: "Comments",
12134
12164
  keys: ["a"],
12135
12165
  screens: ["review"],
12136
12166
  hint: "review"
@@ -12138,7 +12168,7 @@ var init_command = __esmMin((() => {
12138
12168
  command({
12139
12169
  action: "nav.zoom",
12140
12170
  title: "Hide the file list and the review panel",
12141
- category: "General",
12171
+ category: "Reading",
12142
12172
  keys: ["z", "\\"],
12143
12173
  screens: ["review"]
12144
12174
  }),
@@ -12158,12 +12188,15 @@ var init_command = __esmMin((() => {
12158
12188
  }),
12159
12189
  command({
12160
12190
  action: "select.hunk",
12191
+ category: "Selecting",
12161
12192
  title: "Select the change under the cursor",
12162
12193
  keys: ["V"],
12163
12194
  screens: ["review"]
12164
12195
  }),
12165
12196
  command({
12166
12197
  action: "selection.copy",
12198
+ panes: ["diff"],
12199
+ category: "Selecting",
12167
12200
  title: "Copy the selection, or the line the cursor is on",
12168
12201
  keys: ["y"],
12169
12202
  screens: ["review"],
@@ -12173,6 +12206,7 @@ var init_command = __esmMin((() => {
12173
12206
  }),
12174
12207
  command({
12175
12208
  action: "search.open",
12209
+ category: "Selecting",
12176
12210
  title: "Find the selection elsewhere",
12177
12211
  keys: ["/"],
12178
12212
  screens: ["review"]
@@ -12202,6 +12236,7 @@ var init_command = __esmMin((() => {
12202
12236
  }),
12203
12237
  command({
12204
12238
  action: "select.swap",
12239
+ category: "Selecting",
12205
12240
  title: "Grow the selection from its other end",
12206
12241
  keys: ["o"],
12207
12242
  screens: ["review"]
@@ -12209,18 +12244,20 @@ var init_command = __esmMin((() => {
12209
12244
  command({
12210
12245
  action: "wrap.toggle",
12211
12246
  title: "Wrap long lines",
12212
- category: "General",
12247
+ category: "Reading",
12213
12248
  keys: ["w"],
12214
12249
  screens: ["review"]
12215
12250
  }),
12216
12251
  command({
12217
12252
  action: "pan.right",
12253
+ category: "Reading",
12218
12254
  title: "Pan the diff right",
12219
12255
  keys: [">"],
12220
12256
  screens: ["review"]
12221
12257
  }),
12222
12258
  command({
12223
12259
  action: "pan.left",
12260
+ category: "Reading",
12224
12261
  title: "Pan the diff left",
12225
12262
  keys: ["<"],
12226
12263
  screens: ["review"]
@@ -12237,14 +12274,15 @@ var init_command = __esmMin((() => {
12237
12274
  command({
12238
12275
  action: "review.reload",
12239
12276
  title: "Read the branch again",
12240
- category: "Review",
12277
+ category: "Branches",
12241
12278
  keys: ["r"],
12242
12279
  screens: ["review"]
12243
12280
  }),
12244
12281
  command({
12245
12282
  action: "thread.settle",
12283
+ panes: ["diff", "review"],
12246
12284
  title: "Settle the thread here",
12247
- category: "Review",
12285
+ category: "Comments",
12248
12286
  keys: ["d"],
12249
12287
  screens: ["review"],
12250
12288
  hint: "settle",
@@ -12252,27 +12290,37 @@ var init_command = __esmMin((() => {
12252
12290
  }),
12253
12291
  command({
12254
12292
  action: "thread.settleRead",
12293
+ panes: ["review"],
12255
12294
  title: "Settle every answer already read",
12256
- category: "Review",
12295
+ category: "Comments",
12257
12296
  keys: ["D"],
12258
- screens: ["review"]
12297
+ screens: ["review"],
12298
+ hint: "settle read",
12299
+ rank: 1
12259
12300
  }),
12260
12301
  command({
12261
12302
  action: "thread.remove",
12303
+ panes: ["review"],
12304
+ hint: "remove",
12305
+ rank: 2,
12262
12306
  title: "Remove the comment here",
12263
- category: "Review",
12307
+ category: "Comments",
12264
12308
  keys: ["X"],
12265
12309
  screens: ["review"]
12266
12310
  }),
12267
12311
  command({
12268
12312
  action: "panel.flip",
12313
+ panes: ["review"],
12314
+ hint: "order",
12315
+ rank: 4,
12269
12316
  title: "Read the review oldest first, or newest first",
12270
- category: "Review",
12317
+ category: "Comments",
12271
12318
  keys: ["O"],
12272
12319
  screens: ["review"]
12273
12320
  }),
12274
12321
  command({
12275
12322
  action: "tree.winnow",
12323
+ panes: ["tree"],
12276
12324
  title: "Hide the files already reviewed",
12277
12325
  category: "Files",
12278
12326
  keys: ["f"],
@@ -12283,6 +12331,7 @@ var init_command = __esmMin((() => {
12283
12331
  }),
12284
12332
  command({
12285
12333
  action: "rail.toggle",
12334
+ panes: ["tree"],
12286
12335
  title: "Switch between layers and files",
12287
12336
  category: "Files",
12288
12337
  keys: ["s"],
@@ -12307,6 +12356,7 @@ var init_command = __esmMin((() => {
12307
12356
  }),
12308
12357
  command({
12309
12358
  action: "file.vouch",
12359
+ panes: ["tree", "diff"],
12310
12360
  title: "Mark reviewed",
12311
12361
  category: "Files",
12312
12362
  keys: ["m"],
@@ -12323,6 +12373,8 @@ var init_command = __esmMin((() => {
12323
12373
  }),
12324
12374
  command({
12325
12375
  action: "select.start",
12376
+ panes: ["diff"],
12377
+ category: "Selecting",
12326
12378
  title: "Start a selection",
12327
12379
  keys: ["v"],
12328
12380
  screens: ["review"],
@@ -12331,6 +12383,8 @@ var init_command = __esmMin((() => {
12331
12383
  }),
12332
12384
  command({
12333
12385
  action: "compose.open",
12386
+ panes: ["diff"],
12387
+ category: "Comments",
12334
12388
  title: "Comment on the selection",
12335
12389
  keys: ["c", "return"],
12336
12390
  screens: ["review"],
@@ -12340,20 +12394,21 @@ var init_command = __esmMin((() => {
12340
12394
  command({
12341
12395
  action: "report.open",
12342
12396
  title: "Report a bug",
12343
- category: "General",
12397
+ category: "App",
12344
12398
  keys: ["ctrl+b"],
12345
12399
  screens: ["branches", "review"]
12346
12400
  }),
12347
12401
  command({
12348
12402
  action: "report.mode",
12349
12403
  title: "Send a minimal report instead of a full one",
12350
- category: "General",
12404
+ category: "App",
12351
12405
  keys: ["ctrl+t"],
12352
12406
  screens: ["report"],
12353
12407
  listed: false
12354
12408
  }),
12355
12409
  command({
12356
12410
  action: "report.send",
12411
+ category: "App",
12357
12412
  title: "Send the report",
12358
12413
  keys: ["ctrl+s"],
12359
12414
  screens: ["report"],
@@ -12363,13 +12418,14 @@ var init_command = __esmMin((() => {
12363
12418
  command({
12364
12419
  action: "palette.open",
12365
12420
  title: "Find a command",
12366
- category: "General",
12421
+ category: "App",
12367
12422
  keys: ["ctrl+p"],
12368
12423
  screens: ["review"],
12369
12424
  listed: false
12370
12425
  }),
12371
12426
  command({
12372
12427
  action: "compose.submit",
12428
+ category: "Comments",
12373
12429
  title: "Send the comment",
12374
12430
  keys: ["ctrl+s"],
12375
12431
  screens: ["compose"],
@@ -12378,6 +12434,7 @@ var init_command = __esmMin((() => {
12378
12434
  }),
12379
12435
  command({
12380
12436
  action: "compose.newline",
12437
+ category: "Comments",
12381
12438
  title: "New line",
12382
12439
  keys: ["return"],
12383
12440
  screens: ["compose"],
@@ -12385,6 +12442,7 @@ var init_command = __esmMin((() => {
12385
12442
  }),
12386
12443
  command({
12387
12444
  action: "palette.run",
12445
+ category: "App",
12388
12446
  title: "Run the highlighted command",
12389
12447
  keys: ["return"],
12390
12448
  screens: ["palette", "keys"],
@@ -12394,7 +12452,7 @@ var init_command = __esmMin((() => {
12394
12452
  command({
12395
12453
  action: "keys.open",
12396
12454
  title: "List every key",
12397
- category: "General",
12455
+ category: "App",
12398
12456
  keys: ["?"],
12399
12457
  screens: [
12400
12458
  "branches",
@@ -12408,7 +12466,7 @@ var init_command = __esmMin((() => {
12408
12466
  command({
12409
12467
  action: "keys.next",
12410
12468
  title: "Next key",
12411
- category: "General",
12469
+ category: "App",
12412
12470
  keys: ["down", "j"],
12413
12471
  screens: ["keys"],
12414
12472
  listed: false
@@ -12416,7 +12474,7 @@ var init_command = __esmMin((() => {
12416
12474
  command({
12417
12475
  action: "keys.prev",
12418
12476
  title: "Previous key",
12419
- category: "General",
12477
+ category: "App",
12420
12478
  keys: ["up", "k"],
12421
12479
  screens: ["keys"],
12422
12480
  listed: false
@@ -12424,7 +12482,7 @@ var init_command = __esmMin((() => {
12424
12482
  command({
12425
12483
  action: "back",
12426
12484
  title: "Go back",
12427
- category: "General",
12485
+ category: "App",
12428
12486
  keys: ["escape", "q"],
12429
12487
  screens: [
12430
12488
  "review",
@@ -12441,7 +12499,7 @@ var init_command = __esmMin((() => {
12441
12499
  command({
12442
12500
  action: "quit",
12443
12501
  title: "Quit",
12444
- category: "General",
12502
+ category: "App",
12445
12503
  keys: ["q"],
12446
12504
  screens: ["branches"],
12447
12505
  hint: "quit",
@@ -12451,6 +12509,7 @@ var init_command = __esmMin((() => {
12451
12509
  ];
12452
12510
  TEXT_SCREENS = /* @__PURE__ */ new Set([
12453
12511
  "compose",
12512
+ "keys",
12454
12513
  "palette",
12455
12514
  "report"
12456
12515
  ]);
@@ -12477,7 +12536,7 @@ var init_command = __esmMin((() => {
12477
12536
  if (key.startsWith("ctrl+")) return `^${key.slice(5)}`;
12478
12537
  return GLYPHS[key] ?? key;
12479
12538
  };
12480
- hintsFor = (screen, offered) => commandsFor(screen).filter((entry) => entry.hint.length > 0).filter((entry) => !entry.whenComments || offered.comments > 0).filter((entry) => !entry.whenLayers || offered.layers > 0).filter((entry) => !entry.whenThread || offered.onThread).filter((entry) => !entry.whenSelecting || offered.selecting).filter((entry) => !entry.whenReviewed || offered.reviewed > 0).filter((entry) => !entry.whenPull || offered.pull).toSorted((left, right) => left.rank - right.rank).map((entry) => ({
12539
+ hintsFor = (screen, offered) => commandsFor(screen).filter((entry) => entry.hint.length > 0).filter((entry) => !entry.whenComments || offered.comments > 0).filter((entry) => !entry.whenLayers || offered.layers > 0).filter((entry) => !entry.whenThread || offered.onThread).filter((entry) => !entry.whenSelecting || offered.selecting).filter((entry) => !entry.whenReviewed || offered.reviewed > 0).filter((entry) => !entry.whenPull || offered.pull).filter((entry) => entry.panes.includes(offered.pane)).toSorted((left, right) => left.rank - right.rank).map((entry) => ({
12481
12540
  key: displayKey(entry.keys[0] ?? ""),
12482
12541
  hint: entry.counted ? `${entry.hint} ${offered.comments}` : entry.hint,
12483
12542
  press: entry.keys[0] ?? ""
@@ -12485,7 +12544,7 @@ var init_command = __esmMin((() => {
12485
12544
  }));
12486
12545
  //#endregion
12487
12546
  //#region src/tui/match.ts
12488
- var subsequence, label, matches, closeness, searchCommands;
12547
+ var subsequence, label, matches, closeness, searchCommands, searchGlossary;
12489
12548
  var init_match = __esmMin((() => {
12490
12549
  init_command();
12491
12550
  subsequence = (haystack, needle) => {
@@ -12507,10 +12566,11 @@ var init_match = __esmMin((() => {
12507
12566
  return label(entry).includes(wanted) ? 2 : 3;
12508
12567
  };
12509
12568
  searchCommands = (screen, query) => listableFor(screen).filter((entry) => matches(entry, query)).toSorted((left, right) => closeness(left, query) - closeness(right, query));
12569
+ searchGlossary = (screen, query) => glossaryFor(screen).filter((entry) => matches(entry, query));
12510
12570
  }));
12511
12571
  //#endregion
12512
12572
  //#region src/tui/reduce.ts
12513
- var clamp, lastRow, rowsIn, withCursorVisible, moveCursor, stepStop, scrolled, draggedTo, 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, moveFile, selectHunk, swapEnds, atBranch, startSelection, openCompose, goBack, walkMatches, openPalette, openKeys, movePalette, paletteMatches, offered, paletteChoice, transitions, reduce, atFile, withContext, withFull, revealsAfter, gapOpened, panBy, withSent, withArrived, withColumns, withLayers, withPulls, withSilentForge, withBranches, withSource, withVouched, restoredTo, openedAt, withPatches, inserted, typed, TAB_WIDTH, SPACE_CODE, ERASED_FROM, ERASED_TO, readable, legible, pasted, backspaced, cutBackTo, wordBackspaced, lineBackspaced, deleted, caretMoved, caretJumped, caretHomed, paletteMoved, paletteClosed, withWaiting, withMatches, withNoticeHere, withNotice;
12573
+ var clamp, lastRow, rowsIn, withCursorVisible, moveCursor, stepStop, scrolled, draggedTo, 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, moveFile, selectHunk, swapEnds, atBranch, startSelection, openCompose, goBack, walkMatches, openPalette, openKeys, movePalette, paletteMatches, keyMatches, offered, paletteChoice, transitions, reduce, atFile, withContext, withFull, revealsAfter, gapOpened, panBy, withSent, withArrived, withColumns, withLayers, withPulls, withSilentForge, withBranches, withSource, withVouched, restoredTo, openedAt, withPatches, inserted, asksAQuery, typed, TAB_WIDTH, SPACE_CODE, ERASED_FROM, ERASED_TO, readable, legible, pasted, backspaced, cutBackTo, wordBackspaced, lineBackspaced, deleted, caretMoved, caretJumped, caretHomed, paletteMoved, paletteClosed, withWaiting, withMatches, withNoticeHere, withNotice;
12514
12574
  var init_reduce = __esmMin((() => {
12515
12575
  init_dist();
12516
12576
  init_patch();
@@ -12806,7 +12866,8 @@ var init_reduce = __esmMin((() => {
12806
12866
  };
12807
12867
  if (state.screen === "keys") return {
12808
12868
  ...state,
12809
- screen: state.returnTo
12869
+ screen: state.returnTo,
12870
+ query: ""
12810
12871
  };
12811
12872
  if (state.screen === "compose") return {
12812
12873
  ...state,
@@ -12848,7 +12909,8 @@ var init_reduce = __esmMin((() => {
12848
12909
  paletteIndex: clamp(state.paletteIndex + delta, 0, Math.max(0, offered(state).length - 1))
12849
12910
  });
12850
12911
  paletteMatches = (state) => searchCommands(state.returnTo, state.query);
12851
- offered = (state) => state.screen === "keys" ? glossaryFor(state.returnTo) : paletteMatches(state);
12912
+ keyMatches = (state) => searchGlossary(state.returnTo, state.query);
12913
+ offered = (state) => state.screen === "keys" ? keyMatches(state) : paletteMatches(state);
12852
12914
  paletteChoice = (state) => offered(state)[state.paletteIndex]?.action;
12853
12915
  transitions = {
12854
12916
  "branch.first": (state) => atBranch(state, 0),
@@ -13105,7 +13167,8 @@ var init_reduce = __esmMin((() => {
13105
13167
  caret: at + text.length
13106
13168
  };
13107
13169
  };
13108
- typed = (state, character) => state.screen === "palette" ? {
13170
+ asksAQuery = (state) => state.screen === "palette" || state.screen === "keys";
13171
+ typed = (state, character) => asksAQuery(state) ? {
13109
13172
  ...state,
13110
13173
  query: `${state.query}${character}`,
13111
13174
  paletteIndex: 0
@@ -13123,10 +13186,10 @@ var init_reduce = __esmMin((() => {
13123
13186
  pasted = (state, text) => {
13124
13187
  const clean = legible(stripAnsiSequences(text));
13125
13188
  if (clean.length === 0) return state;
13126
- return typed(state, state.screen === "palette" ? clean.replace(/\n/g, " ") : clean);
13189
+ return typed(state, asksAQuery(state) ? clean.replace(/\n/g, " ") : clean);
13127
13190
  };
13128
13191
  backspaced = (state) => {
13129
- if (state.screen === "palette") return {
13192
+ if (asksAQuery(state)) return {
13130
13193
  ...state,
13131
13194
  query: state.query.slice(0, -1),
13132
13195
  paletteIndex: 0
@@ -13148,8 +13211,8 @@ var init_reduce = __esmMin((() => {
13148
13211
  caret: to
13149
13212
  };
13150
13213
  };
13151
- wordBackspaced = (state) => state.screen === "palette" ? backspaced(state) : cutBackTo(state, caretByWord(state, -1));
13152
- lineBackspaced = (state) => state.screen === "palette" ? backspaced(state) : cutBackTo(state, caretToEdge(state, "start"));
13214
+ wordBackspaced = (state) => asksAQuery(state) ? backspaced(state) : cutBackTo(state, caretByWord(state, -1));
13215
+ lineBackspaced = (state) => asksAQuery(state) ? backspaced(state) : cutBackTo(state, caretToEdge(state, "start"));
13153
13216
  deleted = (state) => {
13154
13217
  const at = caretAt(state);
13155
13218
  if (at >= state.draft.length) return state;
@@ -13378,7 +13441,7 @@ var init_diffview = __esmMin((() => {
13378
13441
  ANSWER_MARK = "↳";
13379
13442
  OVERSCAN = 2;
13380
13443
  SIGN_WIDTH = 2;
13381
- SCROLL_ROWS = 3;
13444
+ SCROLL_ROWS = 1;
13382
13445
  PAN_COLUMNS = 8;
13383
13446
  WAYS = {
13384
13447
  up: {
@@ -13710,6 +13773,9 @@ var init_diffview = __esmMin((() => {
13710
13773
  tallestRows() {
13711
13774
  return this.tallest();
13712
13775
  }
13776
+ screenRowOf(row) {
13777
+ return this.visualOfRow(row);
13778
+ }
13713
13779
  blockAt(row, stop) {
13714
13780
  const first = this.display.findIndex((entry) => entry.row === row && entry.stop === stop);
13715
13781
  if (first === -1) return {
@@ -14207,7 +14273,6 @@ var init_render = __esmMin((() => {
14207
14273
  makeKeysParts = (renderer) => {
14208
14274
  const parts = makePaletteParts(renderer);
14209
14275
  parts.box.id = "keys";
14210
- parts.query.height = 0;
14211
14276
  return parts;
14212
14277
  };
14213
14278
  makeFoundParts = (renderer) => {
@@ -14574,6 +14639,7 @@ var init_render = __esmMin((() => {
14574
14639
  paletteChoices;
14575
14640
  keys;
14576
14641
  keysTitle;
14642
+ keysQuery;
14577
14643
  keysChoices;
14578
14644
  found;
14579
14645
  foundTitle;
@@ -14621,6 +14687,7 @@ var init_render = __esmMin((() => {
14621
14687
  this.paletteChoices = modals.palette.choices;
14622
14688
  this.keys = modals.keys.box;
14623
14689
  this.keysTitle = modals.keys.title;
14690
+ this.keysQuery = modals.keys.query;
14624
14691
  this.keysChoices = modals.keys.choices;
14625
14692
  this.found = modals.found.box;
14626
14693
  this.foundTitle = modals.found.title;
@@ -14689,6 +14756,12 @@ var init_render = __esmMin((() => {
14689
14756
  scrolledAt() {
14690
14757
  return this.lastTop;
14691
14758
  }
14759
+ rowAtScreen(visual) {
14760
+ return this.view.rowAt(visual);
14761
+ }
14762
+ screenRowOf(row) {
14763
+ return this.view.screenRowOf(row);
14764
+ }
14692
14765
  blockAt(row, stop) {
14693
14766
  return this.view.blockAt(row, stop);
14694
14767
  }
@@ -14705,7 +14778,8 @@ var init_render = __esmMin((() => {
14705
14778
  onThread: state.stop > 0 || threadChosen(state) !== void 0,
14706
14779
  selecting: state.selecting,
14707
14780
  reviewed: reviewedCountIn(state),
14708
- pull: pullHere(state).length > 0
14781
+ pull: pullHere(state).length > 0,
14782
+ pane: state.screen === "review" ? state.focus : "diff"
14709
14783
  });
14710
14784
  this.header.content = this.headerText(state);
14711
14785
  this.footer.content = this.footerText(state);
@@ -14753,12 +14827,14 @@ var init_render = __esmMin((() => {
14753
14827
  this.keys.visible = state.screen === "keys";
14754
14828
  if (state.screen !== "keys") {
14755
14829
  this.keysTitle.content = "";
14830
+ this.keysQuery.content = "";
14756
14831
  this.keysChoices.options = [];
14757
14832
  return;
14758
14833
  }
14759
- const rows = glossaryFor(state.returnTo);
14834
+ const rows = keyMatches(state);
14760
14835
  const room = panelWidth(this.renderer.width);
14761
- this.keysTitle.content = `Every key here, ${rows.length} of them`;
14836
+ this.keysTitle.content = rows.length === 0 ? "No key matches" : `Keys here, ${rows.length} of them`;
14837
+ this.keysQuery.content = state.query.length === 0 ? "Type to filter…" : `${state.query}▏`;
14762
14838
  this.keysChoices.options = rows.map((entry) => ({
14763
14839
  name: commandRow(entry, room - MODAL_ROOM),
14764
14840
  description: "",
@@ -15131,6 +15207,8 @@ var init_display = __esmMin((() => {
15131
15207
  tallest: sync(() => screen.tallestRows()),
15132
15208
  rail: sync(() => screen.railRows()),
15133
15209
  at: sync(() => screen.scrolledAt()),
15210
+ rowAt: (visual) => sync(() => screen.rowAtScreen(visual)),
15211
+ screenRowOf: (row) => sync(() => screen.screenRowOf(row)),
15134
15212
  block: (row, stop) => sync(() => screen.blockAt(row, stop)),
15135
15213
  columns: sync(() => screen.columns()),
15136
15214
  listen: listenWith(screen),
@@ -15685,7 +15763,7 @@ var init_app = __esmMin((() => {
15685
15763
  if (PRINTABLE.test(key.sequence)) this.commit(typed(this.state, key.sequence));
15686
15764
  }
15687
15765
  onCaret(key) {
15688
- if (this.state.screen === "palette") return false;
15766
+ if (this.state.screen === "palette" || this.state.screen === "keys") return false;
15689
15767
  const moved = caretFor(this.state, key);
15690
15768
  if (moved === void 0) return false;
15691
15769
  this.commit(moved);
@@ -15808,6 +15886,7 @@ var init_app = __esmMin((() => {
15808
15886
  }
15809
15887
  const at = this.state.patches.findIndex((patch) => patch.path === entry.comment.file);
15810
15888
  if (this.state.patches[at] === void 0) {
15889
+ yield* this.readAnswers(entry.comment.id);
15811
15890
  this.commit(withNoticeHere(this.state, `${entry.comment.file} is not on this branch`));
15812
15891
  return;
15813
15892
  }
@@ -15816,6 +15895,7 @@ var init_app = __esmMin((() => {
15816
15895
  patchIndex: at
15817
15896
  });
15818
15897
  if (shown !== void 0 && rowShowing(shown, entry.comment.end) === void 0) {
15898
+ yield* this.readAnswers(entry.comment.id);
15819
15899
  this.commit(withNoticeHere(this.state, "that comment is outside this diff"));
15820
15900
  return;
15821
15901
  }
@@ -15930,9 +16010,25 @@ var init_app = __esmMin((() => {
15930
16010
  stepped(delta) {
15931
16011
  return gen({ self: this }, function* () {
15932
16012
  if (this.paged(delta)) return;
16013
+ this.catchUp();
15933
16014
  yield* this.commitSynced(delta > 0 ? "cursor.next" : "cursor.prev");
15934
16015
  });
15935
16016
  }
16017
+ catchUp() {
16018
+ const state = this.state;
16019
+ if (state.screen !== "review" || state.focus !== "diff" || state.scroll < 0) return;
16020
+ const last = state.scroll + Math.max(1, runSync(this.display.rows)) - 1;
16021
+ const at = runSync(this.display.screenRowOf(state.cursor)) ?? last;
16022
+ if (at >= state.scroll && at <= last) return;
16023
+ const wanted = at < state.scroll ? state.scroll : last;
16024
+ const top = runSync(this.display.rowAt(state.scroll));
16025
+ this.commit({
16026
+ ...state,
16027
+ cursor: runSync(this.display.rowAt(wanted)),
16028
+ stop: 0,
16029
+ top
16030
+ });
16031
+ }
15936
16032
  paged(delta) {
15937
16033
  if (this.state.screen !== "review" || this.state.focus !== "diff") return false;
15938
16034
  const state = this.standing();
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.68",
26
+ "version": "0.1.0-alpha.69",
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": {