@eliya-oss/agent-diff 0.1.0-alpha.111 → 0.1.0-alpha.112

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/main.js +161 -25
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @eliya-oss/agent-diff
2
2
 
3
+ ## 0.1.0-alpha.112
4
+
5
+ ### Patch Changes
6
+
7
+ - The review panel says what state a thread is in. A question the agent asked back — the one thing that stops the review until you answer — was filed under "Answered" with the same mark as an ordinary answer. It now has a section of its own at the top, and settled threads have one at the bottom instead of sitting in place with one glyph missing. When there are more threads than fit, the panel says how many are above and below rather than ending mid-list.
8
+
9
+ The box a comment is written in stays on screen. Past about seven hundred characters at 80x24 it grew through the pane border, the send hint and the footer, and you carried on typing with the caret off the bottom of the terminal.
10
+
11
+ `a` says the terminal is too narrow for the review panel every time, not only the first — it used to toggle an invisible flag and look dead. A path that is not a git repository says so, instead of "nothing to review". The key sheet no longer says "4 of them" while drawing three. And the key sheet and the command palette answer to the words a reviewer would actually type: `resolve` finds settle, `search` finds find, `shortcuts` finds the key sheet.
12
+
3
13
  ## 0.1.0-alpha.111
4
14
 
5
15
  ### Patch Changes
package/dist/main.js CHANGED
@@ -9213,11 +9213,14 @@ var init_patch = __esmMin((() => {
9213
9213
  init_parse$1();
9214
9214
  init_sticky();
9215
9215
  init_model$3();
9216
- })), GitCommandFailed, FileUnreadable;
9216
+ }));
9217
+ //#endregion
9218
+ //#region src/service/git/error.ts
9219
+ var GitCommandFailed, NotARepository, FileUnreadable;
9217
9220
  var init_error$1 = __esmMin((() => {
9218
9221
  init_dist();
9219
9222
  GitCommandFailed = class extends TaggedError("GitCommandFailed") {};
9220
- TaggedError("NotARepository");
9223
+ NotARepository = class extends TaggedError("NotARepository") {};
9221
9224
  FileUnreadable = class extends TaggedError("FileUnreadable") {};
9222
9225
  }));
9223
9226
  //#endregion
@@ -9378,6 +9381,7 @@ var init_service = __esmMin((() => {
9378
9381
  "list",
9379
9382
  "--porcelain"
9380
9383
  ]);
9384
+ if (porcelain.trim().length === 0) return yield* new NotARepository({ path: repo });
9381
9385
  const base = yield* defaultBranch(repo);
9382
9386
  const entries = readEntries(porcelain);
9383
9387
  const opened = yield* settled(repo);
@@ -10397,7 +10401,7 @@ var init_pane = __esmMin((() => {
10397
10401
  init_drafts();
10398
10402
  init_init();
10399
10403
  init_pane();
10400
- var version$1 = "0.1.0-alpha.111";
10404
+ var version$1 = "0.1.0-alpha.112";
10401
10405
  //#endregion
10402
10406
  //#region src/cli/upgrade.ts
10403
10407
  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;
@@ -11902,7 +11906,7 @@ var init_report$1 = __esmMin((() => {
11902
11906
  },
11903
11907
  NotARepository: {
11904
11908
  exit: 3,
11905
- suggestion: "That path is not a git repository. Point --repo at one.",
11909
+ suggestion: "That path is not a git repository. Point --repo or --worktree at one, or run `adiff branch list` from inside the repository you mean.",
11906
11910
  retriable: false
11907
11911
  },
11908
11912
  GitCommandFailed: {
@@ -12397,7 +12401,7 @@ var init_tree = __esmMin((() => {
12397
12401
  return node.children.reduce((total, child) => total + filesUnder(tree, child), 0);
12398
12402
  };
12399
12403
  crowdedDirectories = (tree, limit) => tree.nodes.filter((node) => node.kind === "directory" && directFiles(tree, node.id) > limit).map((node) => node.path);
12400
- })), 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, pickedText, selectedLines, shownMatches, matchHere, selectionReadout, 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, readingOrder, placeIn, layerFile, layerAfter, selectionRange;
12404
+ })), 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, 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;
12401
12405
  var init_model = __esmMin((() => {
12402
12406
  init_dist();
12403
12407
  init_patch();
@@ -12870,6 +12874,12 @@ var init_model = __esmMin((() => {
12870
12874
  };
12871
12875
  filesWithComments = (state) => state.patches.flatMap((patch, index) => state.sent.some((entry) => entry.file === patch.path) ? [index] : []);
12872
12876
  answerCount = (comments) => comments.reduce((total, entry) => total + (entry.answers?.length ?? 0), 0);
12877
+ PANEL_SECTIONS = [
12878
+ "asked",
12879
+ "with",
12880
+ "answered",
12881
+ "settled"
12882
+ ];
12873
12883
  answersIn = (comment) => comment.answers?.length ?? 0;
12874
12884
  newerOf = (state, comment) => {
12875
12885
  if (comment.id === void 0) return comment;
@@ -12879,8 +12889,10 @@ var init_model = __esmMin((() => {
12879
12889
  };
12880
12890
  spokeLast = (comment) => comment.turns?.at(-1)?.voice;
12881
12891
  sectionOf = (comment) => {
12882
- if (spokeLast(comment) === "reviewer" && comment.settled !== true) return "with";
12883
- return answersIn(comment) > 0 || comment.settled === true ? "answered" : "with";
12892
+ if (comment.settled === true) return "settled";
12893
+ if (comment.asks === true) return "asked";
12894
+ if (spokeLast(comment) === "reviewer") return "with";
12895
+ return answersIn(comment) > 0 ? "answered" : "with";
12884
12896
  };
12885
12897
  sentEntry = (state, comment) => {
12886
12898
  const newer = newerOf(state, comment);
@@ -12897,7 +12909,7 @@ var init_model = __esmMin((() => {
12897
12909
  const found = delivered.filter((entry) => entry.section === section);
12898
12910
  return state.newestFirst ? found.toReversed() : found;
12899
12911
  };
12900
- return [...ordered("with"), ...ordered("answered")];
12912
+ return PANEL_SECTIONS.flatMap((section) => ordered(section));
12901
12913
  };
12902
12914
  panelEntry = (state) => panelEntries(state)[state.panelIndex];
12903
12915
  threadChosen = (state) => {
@@ -13075,6 +13087,7 @@ var init_command = __esmMin((() => {
13075
13087
  command = (input) => ({
13076
13088
  category: "Reading",
13077
13089
  hint: "",
13090
+ also: [],
13078
13091
  listed: true,
13079
13092
  whenComments: false,
13080
13093
  counted: false,
@@ -13266,6 +13279,11 @@ var init_command = __esmMin((() => {
13266
13279
  }),
13267
13280
  command({
13268
13281
  action: "panel.toggle",
13282
+ also: [
13283
+ "comments",
13284
+ "threads",
13285
+ "conversation"
13286
+ ],
13269
13287
  title: "Show or hide the review panel",
13270
13288
  category: "Comments",
13271
13289
  keys: ["a"],
@@ -13274,6 +13292,11 @@ var init_command = __esmMin((() => {
13274
13292
  }),
13275
13293
  command({
13276
13294
  action: "nav.zoom",
13295
+ also: [
13296
+ "fullscreen",
13297
+ "maximise",
13298
+ "wide"
13299
+ ],
13277
13300
  title: "Hide the file list and the review panel",
13278
13301
  category: "Reading",
13279
13302
  keys: ["z", "\\"],
@@ -13331,6 +13354,13 @@ var init_command = __esmMin((() => {
13331
13354
  }),
13332
13355
  command({
13333
13356
  action: "search.open",
13357
+ also: [
13358
+ "search",
13359
+ "find",
13360
+ "grep",
13361
+ "look for",
13362
+ "where is"
13363
+ ],
13334
13364
  category: "Selecting",
13335
13365
  title: "Find the selection elsewhere",
13336
13366
  keys: ["/"],
@@ -13376,6 +13406,11 @@ var init_command = __esmMin((() => {
13376
13406
  }),
13377
13407
  command({
13378
13408
  action: "wrap.toggle",
13409
+ also: [
13410
+ "wrap",
13411
+ "soft wrap",
13412
+ "long lines"
13413
+ ],
13379
13414
  title: "Wrap long lines",
13380
13415
  category: "Reading",
13381
13416
  keys: ["w"],
@@ -13413,6 +13448,12 @@ var init_command = __esmMin((() => {
13413
13448
  }),
13414
13449
  command({
13415
13450
  action: "thread.settle",
13451
+ also: [
13452
+ "resolve",
13453
+ "close",
13454
+ "done",
13455
+ "accept"
13456
+ ],
13416
13457
  panes: ["diff", "review"],
13417
13458
  title: "Settle the thread here",
13418
13459
  category: "Comments",
@@ -13433,6 +13474,11 @@ var init_command = __esmMin((() => {
13433
13474
  }),
13434
13475
  command({
13435
13476
  action: "thread.reply",
13477
+ also: [
13478
+ "respond",
13479
+ "answer",
13480
+ "write back"
13481
+ ],
13436
13482
  panes: ["review", "diff"],
13437
13483
  hint: "reply",
13438
13484
  rank: 1,
@@ -13444,6 +13490,12 @@ var init_command = __esmMin((() => {
13444
13490
  }),
13445
13491
  command({
13446
13492
  action: "thread.remove",
13493
+ also: [
13494
+ "delete",
13495
+ "withdraw",
13496
+ "retract",
13497
+ "undo"
13498
+ ],
13447
13499
  panes: ["review"],
13448
13500
  hint: "remove",
13449
13501
  rank: 2,
@@ -13485,6 +13537,11 @@ var init_command = __esmMin((() => {
13485
13537
  }),
13486
13538
  command({
13487
13539
  action: "layers.ask",
13540
+ also: [
13541
+ "reading order",
13542
+ "plan",
13543
+ "walkthrough"
13544
+ ],
13488
13545
  title: "Ask the agent for a reading order",
13489
13546
  category: "Files",
13490
13547
  keys: ["L"],
@@ -13492,6 +13549,11 @@ var init_command = __esmMin((() => {
13492
13549
  }),
13493
13550
  command({
13494
13551
  action: "rail.toggle",
13552
+ also: [
13553
+ "sidebar",
13554
+ "outline",
13555
+ "toc"
13556
+ ],
13495
13557
  panes: ["tree", "diff"],
13496
13558
  title: "Switch between layers and files",
13497
13559
  category: "Files",
@@ -13503,6 +13565,11 @@ var init_command = __esmMin((() => {
13503
13565
  }),
13504
13566
  command({
13505
13567
  action: "tree.collapse",
13568
+ also: [
13569
+ "fold",
13570
+ "hide",
13571
+ "shrink"
13572
+ ],
13506
13573
  title: "Close the folder, layer, gap, or settled thread",
13507
13574
  category: "Files",
13508
13575
  keys: ["h"],
@@ -13510,6 +13577,12 @@ var init_command = __esmMin((() => {
13510
13577
  }),
13511
13578
  command({
13512
13579
  action: "tree.expand",
13580
+ also: [
13581
+ "expand",
13582
+ "unfold",
13583
+ "show more",
13584
+ "open"
13585
+ ],
13513
13586
  title: "Open the folder, layer, gap, or settled thread",
13514
13587
  category: "Files",
13515
13588
  keys: ["l"],
@@ -13517,6 +13590,12 @@ var init_command = __esmMin((() => {
13517
13590
  }),
13518
13591
  command({
13519
13592
  action: "file.vouch",
13593
+ also: [
13594
+ "done",
13595
+ "approve",
13596
+ "tick",
13597
+ "check off"
13598
+ ],
13520
13599
  panes: ["tree", "diff"],
13521
13600
  title: "Mark reviewed",
13522
13601
  category: "Files",
@@ -13544,6 +13623,12 @@ var init_command = __esmMin((() => {
13544
13623
  }),
13545
13624
  command({
13546
13625
  action: "compose.open",
13626
+ also: [
13627
+ "write",
13628
+ "note",
13629
+ "feedback",
13630
+ "say"
13631
+ ],
13547
13632
  panes: ["diff"],
13548
13633
  category: "Comments",
13549
13634
  title: "Comment on the selection",
@@ -13578,6 +13663,11 @@ var init_command = __esmMin((() => {
13578
13663
  }),
13579
13664
  command({
13580
13665
  action: "palette.open",
13666
+ also: [
13667
+ "commands",
13668
+ "actions",
13669
+ "what can i do"
13670
+ ],
13581
13671
  title: "Find a command",
13582
13672
  category: "App",
13583
13673
  keys: ["ctrl+p"],
@@ -13604,6 +13694,12 @@ var init_command = __esmMin((() => {
13604
13694
  }),
13605
13695
  command({
13606
13696
  action: "keys.open",
13697
+ also: [
13698
+ "help",
13699
+ "shortcuts",
13700
+ "bindings",
13701
+ "keys"
13702
+ ],
13607
13703
  title: "List every key",
13608
13704
  category: "App",
13609
13705
  keys: ["?"],
@@ -13714,7 +13810,7 @@ var init_match = __esmMin((() => {
13714
13810
  }
13715
13811
  return needle.length === 0;
13716
13812
  };
13717
- label = (entry) => `${entry.category} ${entry.title} ${entry.keys.join(" ")}`.toLowerCase();
13813
+ label = (entry) => `${entry.category} ${entry.title} ${entry.keys.join(" ")} ${entry.also.join(" ")}`.toLowerCase();
13718
13814
  matches = (entry, query) => query.toLowerCase().split(/\s+/).filter((word) => word.length > 0).every((word) => subsequence(label(entry), word));
13719
13815
  closeness = (entry, query) => {
13720
13816
  const wanted = query.trim().toLowerCase();
@@ -13918,7 +14014,7 @@ var init_reduce = __esmMin((() => {
13918
14014
  return shown[((at === -1 ? 0 : at) + delta + shown.length) % shown.length] ?? state.focus;
13919
14015
  };
13920
14016
  togglePanel = (state) => {
13921
- if (!state.panelOpen && !panelFits(state)) return withNotice(state, "the terminal is too narrow for the review panel");
14017
+ if (!panelFits(state)) return withNotice(state, "the terminal is too narrow for the review panel");
13922
14018
  const panelOpen = !state.panelOpen;
13923
14019
  return {
13924
14020
  ...state,
@@ -14586,7 +14682,7 @@ var init_theme = __esmMin((() => {
14586
14682
  panel: "#0e1117",
14587
14683
  overlay: "#181c26",
14588
14684
  scrim: "#000000a0",
14589
- rule: "#262b37",
14685
+ rule: "#3b4354",
14590
14686
  note: "#9aa7c7",
14591
14687
  cursor: "#232936",
14592
14688
  selection: "#2b3854",
@@ -15296,7 +15392,7 @@ var init_diffview = __esmMin((() => {
15296
15392
  }));
15297
15393
  //#endregion
15298
15394
  //#region src/tui/render.ts
15299
- 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, PALETTE_WIDTH, PANEL_SHARE, PANEL_MAX, PANEL_FLOOR, PANEL_FOOT, PANEL_QUARTER, PANEL_FIFTH, PANE_CHROME, PANE_EDGES, PANE_INSET, DIFF_FLOOR, 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, 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, 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, layerMark, layerLead, layerGutter, layerText, litRow, leftOver, titlePaint, layerPaint, PANEL_TITLES, PANEL_ORDER, PANEL_LEAD, PANEL_EMPTY, restingOrHere, FOUND_LEAST, nothingYet, foundTitle, fileRow, blockOf, aroundRow, windowedBlocks, panelWhere, panelBody, panelPair, panelSection, PULL_HINT, panelText, Screen;
15395
+ 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, 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, 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, layerMark, layerLead, layerGutter, layerText, litRow, leftOver, titlePaint, layerPaint, PANEL_TITLES, PANEL_ORDER, PANEL_LEAD, PANEL_EMPTY, restingOrHere, FOUND_LEAST, nothingYet, foundTitle, fileRow, blockOf, aroundRow, windowedBlocks, panelWhere, panelBody, panelPair, panelSection, PULL_HINT, panelWindow, moreLine, panelText, Screen;
15300
15396
  var init_render = __esmMin((() => {
15301
15397
  init_command();
15302
15398
  init_layers$1();
@@ -15321,7 +15417,12 @@ var init_render = __esmMin((() => {
15321
15417
  PALETTE_TITLE = 60;
15322
15418
  PALETTE_GAP = 2;
15323
15419
  PALETTE_CHROME = 4;
15324
- PENDING_CHROME = 3;
15420
+ PENDING_CHROME = 4;
15421
+ keysTitle = (found, shown) => {
15422
+ if (found === 0) return "No key matches";
15423
+ if (found <= shown) return `Keys here, ${found} of them`;
15424
+ return `Keys here, ${found} of them — arrows for the rest`;
15425
+ };
15325
15426
  PALETTE_WIDTH = 76;
15326
15427
  PANEL_SHARE = .62;
15327
15428
  PANEL_MAX = 120;
@@ -15333,6 +15434,7 @@ var init_render = __esmMin((() => {
15333
15434
  PANE_EDGES = 2;
15334
15435
  PANE_INSET = 1;
15335
15436
  DIFF_FLOOR = 24;
15437
+ COMPOSE_EDGE = 4;
15336
15438
  CRAMPED = "adiff needs more room than this";
15337
15439
  CRAMPED_ROWS = 4;
15338
15440
  DIFF_CHROME_MOST = 16;
@@ -15991,10 +16093,12 @@ var init_render = __esmMin((() => {
15991
16093
  return titlePaint(state, row.index);
15992
16094
  };
15993
16095
  PANEL_TITLES = {
16096
+ asked: "Waiting on you",
15994
16097
  with: "With the agent",
15995
- answered: "Answered"
16098
+ answered: "Answered, not settled",
16099
+ settled: "Settled"
15996
16100
  };
15997
- PANEL_ORDER = ["with", "answered"];
16101
+ PANEL_ORDER = PANEL_SECTIONS;
15998
16102
  PANEL_LEAD = 3;
15999
16103
  PANEL_EMPTY = "No comment on this branch yet.";
16000
16104
  restingOrHere = (focused) => focused ? palette.selection : palette.resting;
@@ -16079,7 +16183,26 @@ var init_render = __esmMin((() => {
16079
16183
  ];
16080
16184
  };
16081
16185
  PULL_HINT = "answered, press r to pull";
16082
- panelText = (state, room) => {
16186
+ panelWindow = (lines, rows) => {
16187
+ if (lines.length <= rows) return {
16188
+ lines,
16189
+ above: 0,
16190
+ below: 0
16191
+ };
16192
+ const room = Math.max(1, rows - 2);
16193
+ const at = Math.max(0, lines.findIndex((line) => line.here === true));
16194
+ const start = Math.max(0, Math.min(lines.length - room, at - Math.floor(room / 2)));
16195
+ return {
16196
+ lines: lines.slice(start, start + room),
16197
+ above: start,
16198
+ below: lines.length - (start + room)
16199
+ };
16200
+ };
16201
+ moreLine = (count, mark, room) => count === 0 ? [] : [{
16202
+ text: clip(` ${mark} ${count} more`, room),
16203
+ tone: palette.faint
16204
+ }];
16205
+ panelText = (state, room, rows) => {
16083
16206
  const placed = panelEntries(state).map((entry, at) => ({
16084
16207
  entry,
16085
16208
  at
@@ -16097,7 +16220,14 @@ var init_render = __esmMin((() => {
16097
16220
  text: PANEL_EMPTY,
16098
16221
  tone: palette.muted
16099
16222
  }] : body;
16100
- return new StyledText([...banner, ...lines].map((line) => {
16223
+ const window = panelWindow(lines, Math.max(1, rows - banner.length));
16224
+ const shown = [
16225
+ ...banner,
16226
+ ...moreLine(window.above, "▲", room),
16227
+ ...window.lines,
16228
+ ...moreLine(window.below, "▼", room)
16229
+ ];
16230
+ return new StyledText(shown.map((line) => {
16101
16231
  const drawn = fg(line.tone)(`${line.text.padEnd(room)}\n`);
16102
16232
  return line.here === true ? bg(restingOrHere(state.focus === "review"))(drawn) : drawn;
16103
16233
  }));
@@ -16350,9 +16480,10 @@ var init_render = __esmMin((() => {
16350
16480
  }
16351
16481
  const rows = keyMatches(state);
16352
16482
  const room = panelWidth(this.renderer.width);
16353
- this.keysTitle.content = rows.length === 0 ? "No key matches" : `Keys here, ${rows.length} of them`;
16354
16483
  const keysRoom = Math.min(panelRows(this.renderer.height, PANEL_QUARTER), rows.length + PENDING_CHROME);
16355
- this.keysChoices.content = listText(rows.map((entry) => commandRow(entry, room - MODAL_ROOM)), Math.min(state.paletteIndex, Math.max(0, rows.length - 1)), keysRoom - PENDING_CHROME);
16484
+ const shown = Math.max(1, keysRoom - PENDING_CHROME);
16485
+ this.keysTitle.content = keysTitle(rows.length, shown);
16486
+ this.keysChoices.content = listText(rows.map((entry) => commandRow(entry, room - MODAL_ROOM)), Math.min(state.paletteIndex, Math.max(0, rows.length - 1)), shown);
16356
16487
  this.keys.height = keysRoom;
16357
16488
  this.keys.width = room;
16358
16489
  this.keys.left = Math.max(1, Math.floor((this.renderer.width - room) / 2));
@@ -16404,7 +16535,8 @@ var init_render = __esmMin((() => {
16404
16535
  this.panelPane.width = shown ? reviewWidth() : 0;
16405
16536
  this.panelPane.paddingLeft = shown ? 1 : 0;
16406
16537
  this.panelPane.paddingTop = 0;
16407
- this.panel.content = shown ? panelText(state, reviewWidth() - PANE_CHROME) : "";
16538
+ const rows = Math.max(1, this.panelPane.height - PANE_EDGES);
16539
+ this.panel.content = shown ? panelText(state, reviewWidth() - PANE_CHROME, rows) : "";
16408
16540
  }
16409
16541
  listText(state) {
16410
16542
  if (atHome(state)) return this.branchTable(state);
@@ -16660,7 +16792,8 @@ var init_render = __esmMin((() => {
16660
16792
  this.composeTitle.content = "Report a bug";
16661
16793
  this.composeQuoted.content = lead.join("\n");
16662
16794
  this.composeQuoted.height = lead.length;
16663
- const written = this.fitBody(state, room.text);
16795
+ const spare = this.renderer.height - lead.length - COMPOSE_ACTION_ROWS - COMPOSE_CHROME - COMPOSE_EDGE;
16796
+ const written = this.fitBody(state, room.text, Math.max(1, spare));
16664
16797
  this.composeActions.content = reportActions(state.reportFull);
16665
16798
  this.compose.height = lead.length + written + COMPOSE_ACTION_ROWS + COMPOSE_CHROME;
16666
16799
  this.compose.width = room.box;
@@ -16703,9 +16836,10 @@ var init_render = __esmMin((() => {
16703
16836
  });
16704
16837
  };
16705
16838
  }
16706
- fitBody(state, room) {
16839
+ fitBody(state, room, most) {
16707
16840
  if (this.composeBody.width !== room) this.composeBody.width = room;
16708
- const rows = Math.max(1, laidDraft(state.draft, room).length);
16841
+ const wanted = Math.max(1, laidDraft(state.draft, room).length);
16842
+ const rows = Math.max(1, Math.min(most, wanted));
16709
16843
  if (this.composeBody.height !== rows) this.composeBody.height = rows;
16710
16844
  return rows;
16711
16845
  }
@@ -16713,14 +16847,16 @@ var init_render = __esmMin((() => {
16713
16847
  this.compose.visible = state.screen === "compose";
16714
16848
  if (state.screen !== "compose") return;
16715
16849
  const room = composeRoom(this.renderer.width);
16716
- const snippet = snippetOf(state, SNIPPET_LINES);
16850
+ const shownLines = Math.max(1, Math.min(SNIPPET_LINES, Math.floor(this.renderer.height / 6)));
16851
+ const snippet = snippetOf(state, shownLines);
16717
16852
  const more = selectedLineCount(state) - snippet.length;
16718
16853
  const tail = more > 0 ? [` … ${more} more lines`] : [];
16719
16854
  const quoted = [...snippet, ...tail].map((line) => clip(line, room.text));
16720
16855
  this.composeTitle.content = clip(composeTarget(state), room.text);
16721
16856
  this.composeQuoted.content = [...quoted, ""].join("\n");
16722
16857
  this.composeQuoted.height = quoted.length + 1;
16723
- const written = this.fitBody(state, room.text);
16858
+ const spare = this.renderer.height - quoted.length - 1 - COMPOSE_ACTION_ROWS - COMPOSE_CHROME - COMPOSE_EDGE;
16859
+ const written = this.fitBody(state, room.text, Math.max(1, spare));
16724
16860
  this.composeActions.content = actionsText();
16725
16861
  const height = quoted.length + 1 + written + COMPOSE_ACTION_ROWS + COMPOSE_CHROME;
16726
16862
  this.compose.height = height;
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.111",
26
+ "version": "0.1.0-alpha.112",
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": {