@eliya-oss/agent-diff 0.1.0-alpha.171 → 0.1.0-alpha.173

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 +33 -0
  2. package/dist/main.js +266 -25
  3. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # @eliya-oss/agent-diff
2
2
 
3
+ ## 0.1.0-alpha.173
4
+
5
+ ### Patch Changes
6
+
7
+ - feat(review panel): `d` takes a settled thread back, so a point settled too early can be reopened.
8
+
9
+ <details><summary>What it does</summary>
10
+
11
+ Pressing `d` on a settled thread unsettles it: the thread opens where it stands, the footer names
12
+ the key as "unsettle" while the cursor is on one, its answers are marked unread again, and the agent
13
+ is owed an answer again if it never gave one. The panel cursor stays on a thread that has been
14
+ taken back, while settling still brings the next thread to it.
15
+ `adiff comment reopen --repo . --branch <branch> --id <id>` does the same from the command line, and
16
+ is refused on a thread that is not settled.
17
+
18
+ </details>
19
+
20
+ ## 0.1.0-alpha.172
21
+
22
+ ### Patch Changes
23
+
24
+ - feat(diff): a comment is written in the diff, under the line it is about, instead of in a box over it.
25
+
26
+ <details><summary>What moved</summary>
27
+
28
+ The draft opens under the last line of the selection and the code below it moves down, the way a
29
+ thread already sits under its line; a reply opens under the thread it answers. The quoted snippet is
30
+ gone, because the code is on the screen above. `ctrl+s` sends and `escape` cancels, as before. On a
31
+ pane too short to hold the draft, and where the diff cannot show the line, the draft opens over the
32
+ diff as it did before.
33
+
34
+ </details>
35
+
3
36
  ## 0.1.0-alpha.171
4
37
 
5
38
  ### Patch Changes
package/dist/main.js CHANGED
@@ -10723,7 +10723,7 @@ var init_model$3 = __esmMin((() => {
10723
10723
  //#region src/domain/preferences/index.ts
10724
10724
  var init_preferences = __esmMin((() => {
10725
10725
  init_model$3();
10726
- })), UnknownBranch, UnknownBase, UnknownFile, UnknownComment, UnknownRemark, NothingSaid, RemarkTaken, UnknownPreference, UnknownPreferenceValue, UnselectableRange, UnknownCommand, MissingOption, UnknownWorktree, MalformedLayers, UnknownField, UnknownOption, BadOption, UnknownDraft, NothingDrafted, PartlySent, PullMoved, NoLayers;
10726
+ })), UnknownBranch, UnknownBase, UnknownFile, UnknownComment, UnknownRemark, NothingSaid, ThreadOpen, RemarkTaken, UnknownPreference, UnknownPreferenceValue, UnselectableRange, UnknownCommand, MissingOption, UnknownWorktree, MalformedLayers, UnknownField, UnknownOption, BadOption, UnknownDraft, NothingDrafted, PartlySent, PullMoved, NoLayers;
10727
10727
  var init_error = __esmMin((() => {
10728
10728
  init_dist();
10729
10729
  UnknownBranch = class extends TaggedError("UnknownBranch") {};
@@ -10732,6 +10732,7 @@ var init_error = __esmMin((() => {
10732
10732
  UnknownComment = class extends TaggedError("UnknownComment") {};
10733
10733
  UnknownRemark = class extends TaggedError("UnknownRemark") {};
10734
10734
  NothingSaid = class extends TaggedError("NothingSaid") {};
10735
+ ThreadOpen = class extends TaggedError("ThreadOpen") {};
10735
10736
  RemarkTaken = class extends TaggedError("RemarkTaken") {};
10736
10737
  UnknownPreference = class extends TaggedError("UnknownPreference") {};
10737
10738
  UnknownPreferenceValue = class extends TaggedError("UnknownPreferenceValue") {};
@@ -11601,7 +11602,7 @@ var init_pane = __esmMin((() => {
11601
11602
  //#region package.json
11602
11603
  init_drafts();
11603
11604
  init_pane();
11604
- var version$1 = "0.1.0-alpha.171";
11605
+ var version$1 = "0.1.0-alpha.173";
11605
11606
  //#endregion
11606
11607
  //#region src/cli/upgrade.ts
11607
11608
  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$1, newer, tagIn, fetched, askLatest, here, findUpgrade, willUpgrade, ranChild, runUpgrade, statusOf, sayFound, sayDone, attempted, SAY_SKILL_TOO, upgradeReport;
@@ -12238,7 +12239,7 @@ var init_layers = __esmMin((() => {
12238
12239
  }));
12239
12240
  //#endregion
12240
12241
  //#region src/cli/threads.ts
12241
- var stateOf$1, whereItSitsNow, spoken$1, turnsOf, threadOf, threadsIn, idsIn, isKnown, listThreads, answerComment, settleIn, settleThread, removeIn, removeComment, without$1, restoreIn, restoreComment, settleRead;
12242
+ var stateOf$1, whereItSitsNow, spoken$1, turnsOf, threadOf, threadsIn, idsIn, isKnown, listThreads, answerComment, settleIn, unsettleIn, unsettleThread, settleThread, removeIn, removeComment, without$1, restoreIn, restoreComment, settleRead;
12242
12243
  var init_threads = __esmMin((() => {
12243
12244
  init_dist();
12244
12245
  init_patch();
@@ -12372,6 +12373,21 @@ var init_threads = __esmMin((() => {
12372
12373
  }));
12373
12374
  return { settled: id };
12374
12375
  });
12376
+ unsettleIn = fn("Cli.unsettleIn")(function* (worktree, id) {
12377
+ const store = yield* Store;
12378
+ if (!(yield* isKnown(worktree.path, id))) return yield* new UnknownComment({ id });
12379
+ const held = yield* store.state(worktree.path);
12380
+ if (!Object.hasOwn(held.settled, id)) return yield* new ThreadOpen({ id });
12381
+ yield* store.changeState(worktree.path, (was) => ({
12382
+ ...was,
12383
+ settled: without$1(was.settled, id),
12384
+ read: without$1(was.read, id)
12385
+ }));
12386
+ return { unsettled: id };
12387
+ });
12388
+ unsettleThread = fn("Cli.unsettleThread")(function* (repo, branch, id) {
12389
+ return yield* unsettleIn(yield* findBranch(repo, branch), id);
12390
+ });
12375
12391
  settleThread = fn("Cli.settleThread")(function* (repo, branch, id, at) {
12376
12392
  return yield* settleIn(yield* findBranch(repo, branch), id, at);
12377
12393
  });
@@ -12933,6 +12949,21 @@ var init_catalog = __esmMin((() => {
12933
12949
  dataKey: "restored",
12934
12950
  example: "adiff comment restore --repo . --branch add-invitations --id c1"
12935
12951
  },
12952
+ {
12953
+ name: "comment reopen",
12954
+ about: "Take a settled comment back into the review, so the agent is owed an answer again",
12955
+ group: FOLLOW_UP,
12956
+ addresses: "review",
12957
+ safety: "write",
12958
+ options: [...addressing, {
12959
+ name: "id",
12960
+ required: true,
12961
+ value: "id",
12962
+ about: "The comment to reopen"
12963
+ }],
12964
+ dataKey: "reopened",
12965
+ example: "adiff comment reopen --repo . --branch add-invitations --id c1"
12966
+ },
12936
12967
  {
12937
12968
  name: "config list",
12938
12969
  about: "Every preference adiff keeps, with its value and what it does",
@@ -13241,6 +13272,11 @@ var init_report$1 = __esmMin((() => {
13241
13272
  suggestion: "Nothing was written. Pass `--body` with what you mean to say.",
13242
13273
  retriable: false
13243
13274
  },
13275
+ ThreadOpen: {
13276
+ exit: 3,
13277
+ suggestion: "That thread is not settled, so there is nothing to reopen. `adiff comment list` reports which threads are.",
13278
+ retriable: false
13279
+ },
13244
13280
  RemarkTaken: {
13245
13281
  exit: 3,
13246
13282
  suggestion: "That remark is already a comment on this review. `adiff comment list` reports it, and removing that comment frees the remark.",
@@ -14105,7 +14141,7 @@ var init_tree = __esmMin((() => {
14105
14141
  return node.children.reduce((total, child) => total + filesUnder(tree, child), 0);
14106
14142
  };
14107
14143
  crowdedDirectories = (tree, limit) => tree.nodes.filter((node) => node.kind === "directory" && directFiles(tree, node.id) > limit).map((node) => node.path);
14108
- })), HOLDS, chosenNow, withChosen, preferenceRows, nothingReviewed, nothingFound, 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, partHere, layersHolding, readIn, treeStart, treeWindow, MINUTE, HOUR, DAY, sinceThen, threadStand, STAND_WEIGHT, louder, threadsOn, coveredBy, lastLayerOf, threadsInLayer, threadsOpenOn, askedRows, withAsking, asksAbout, hiddenLines, rowsUnder, markedStands, carriesLine, selectedRows, snippetOf, selectedLineCount, lineOf, brokenAt, laidLine, laidDraft, COMPOSE_BOX, COMPOSE_MARGIN, COMPOSE_PAD, COMPOSE_LEAST, composeBox, composeRoom$1, composeTarget, remarkAnswering, answerTarget, replyTarget, threadReplying, VOICES, remarkQuote, threadQuote, pickedText, takenRows, selectedLines, shownMatches, refSaidOf, refsShown, picking, refHere, matchHere, selectionReadout, CONTEXT_STEPS, wholeFileOff, contextToggled, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, rowShowing, lineOnSide, needingRowsIn, commentRowsIn, threadsAtRow, remarkShown, remarksAtRow, remarkRowsIn, stopsIn, stopsAtRow, remarkAtStop, remarkAtRow, remarkInPanel, remarkInDiff, remarkUnderCursor, remarkToTakeOn, remarkHere, threadHere, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, PANEL_SECTIONS, answersIn, newerOf, spokeLast, SECTION_OF, movedPast, sectionOf, sentEntry, remarkRows, panelHolds, panelEntries, panelEntry, threadChosen, spokenSince, hunkStarts, openingRow, changeAround, nextUnreviewed, reviewedCount, fileOrder, filePlace, readingOrder, placeIn, layerFile, layerAfter, selectionRange;
14144
+ })), HOLDS, chosenNow, withChosen, preferenceRows, nothingReviewed, nothingFound, 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, partHere, layersHolding, readIn, treeStart, treeWindow, MINUTE, HOUR, DAY, sinceThen, threadStand, STAND_WEIGHT, louder, threadsOn, coveredBy, lastLayerOf, threadsInLayer, threadsOpenOn, askedRows, withAsking, asksAbout, hiddenLines, rowsUnder, markedStands, carriesLine, selectedRows, snippetOf, selectedLineCount, lineOf, brokenAt, laidLine, laidDraft, COMPOSE_BOX, COMPOSE_MARGIN, COMPOSE_PAD, COMPOSE_LEAST, composeBox, composeRoom$1, composeTarget, remarkAnswering, answerTarget, replyTarget, threadReplying, VOICES, remarkQuote, threadQuote, pickedText, takenRows, selectedLines, shownMatches, refSaidOf, refsShown, picking, refHere, matchHere, selectionReadout, CONTEXT_STEPS, wholeFileOff, contextToggled, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, rowShowing, lineOnSide, needingRowsIn, commentRowsIn, draftPlace, notesShown, threadsAtRow, remarkShown, remarksAtRow, remarkRowsIn, stopsIn, stopsAtRow, remarkAtStop, remarkAtRow, remarkInPanel, remarkInDiff, remarkUnderCursor, remarkToTakeOn, remarkHere, standingOnThread, threadHere, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, PANEL_SECTIONS, answersIn, newerOf, spokeLast, SECTION_OF, movedPast, sectionOf, sentEntry, remarkRows, panelHolds, panelEntries, panelEntry, threadChosen, spokenSince, hunkStarts, openingRow, changeAround, nextUnreviewed, reviewedCount, fileOrder, filePlace, readingOrder, placeIn, layerFile, layerAfter, selectionRange;
14109
14145
  var init_model$1 = __esmMin((() => {
14110
14146
  init_dist();
14111
14147
  init_patch();
@@ -14790,6 +14826,34 @@ var init_model$1 = __esmMin((() => {
14790
14826
  const notes = state.sent.filter((entry) => entry.file === patch.path && entry.outside !== true);
14791
14827
  return patch.rows.filter((row) => notes.some((note) => lineOnSide(row, note.side) === note.end)).map((row) => row.index).toSorted((left, right) => left - right);
14792
14828
  };
14829
+ draftPlace = (state) => {
14830
+ const patch = selectedPatch(state);
14831
+ if (patch === void 0) return void 0;
14832
+ const to = state.replyTo ?? state.answerTo;
14833
+ if (to === void 0) return {
14834
+ row: selectionRange(state)[1],
14835
+ stop: void 0
14836
+ };
14837
+ const drawn = notesShown(state, patch.path);
14838
+ const at = drawn.findIndex((note) => note.id === to);
14839
+ const note = drawn[at];
14840
+ if (note === void 0) return void 0;
14841
+ const row = patch.rows.find((one) => lineOnSide(one, note.side) === note.end)?.index;
14842
+ if (row === void 0) return void 0;
14843
+ return {
14844
+ row,
14845
+ stop: drawn.filter((one) => one.side === note.side && one.end === note.end && drawn.indexOf(one) <= at).length
14846
+ };
14847
+ };
14848
+ notesShown = (state, path) => [...state.sent.filter((one) => one.file === path && one.removed !== true && one.outside !== true).map((one) => ({
14849
+ id: one.id,
14850
+ side: one.side,
14851
+ end: one.end
14852
+ })), ...state.remarks.filter((one) => one.file === path && remarkShown(one)).map((one) => ({
14853
+ id: one.id,
14854
+ side: one.side,
14855
+ end: one.end
14856
+ }))];
14793
14857
  threadsAtRow = (state, row) => {
14794
14858
  const patch = selectedPatch(state);
14795
14859
  const here = patch?.rows[row];
@@ -14850,6 +14914,7 @@ var init_model$1 = __esmMin((() => {
14850
14914
  };
14851
14915
  remarkToTakeOn = (state) => remarkInPanel(state)?.remark ?? remarkInDiff(state, false);
14852
14916
  remarkHere = (state) => remarkToTakeOn(state);
14917
+ standingOnThread = (state) => state.stop > 0 && threadAtStop(state) !== void 0 || threadChosen(state) !== void 0;
14853
14918
  threadHere = (state) => {
14854
14919
  if (state.focus === "review") {
14855
14920
  const entry = panelEntry(state);
@@ -15737,10 +15802,12 @@ var init_command = __esmMin((() => {
15737
15802
  "resolve",
15738
15803
  "close",
15739
15804
  "done",
15740
- "accept"
15805
+ "accept",
15806
+ "unsettle",
15807
+ "reopen"
15741
15808
  ],
15742
15809
  panes: ["diff", "review"],
15743
- title: "Settle the thread here",
15810
+ title: "Settle the thread here, or take a settled one back",
15744
15811
  category: "Comments",
15745
15812
  keys: ["d"],
15746
15813
  screens: ["review"],
@@ -16190,6 +16257,7 @@ var init_command = __esmMin((() => {
16190
16257
  "tree.winnow": (offered) => offered.hidingRead ? "show read" : "hide read",
16191
16258
  "panel.winnow": (offered) => offered.hidingSettled ? "show settled" : "hide settled",
16192
16259
  "thread.remove": (offered) => heldOrRemoved(offered),
16260
+ "thread.settle": (offered) => offered.onSettled ? "unsettle" : "settle",
16193
16261
  "held.send": (offered) => `send ${offered.held}`
16194
16262
  };
16195
16263
  hintOf = (entry, offered) => {
@@ -17364,7 +17432,7 @@ var init_theme = __esmMin((() => {
17364
17432
  "note.label": { fg: "#7aa2f7" },
17365
17433
  default: { fg: ink }
17366
17434
  };
17367
- })), WASH, NOTE_MIN, OVERSCAN, SIGN_WIDTH, SCROLL_ROWS, PAN_COLUMNS, WAYS, notchesIn, takenOver, wheelTo, SIGNS, numberFor, DiffView, startsOf, numbered, bareOf, noteKey, keyOf, groupOf, isChrome, alike, heldAt, sameLine, NO_SPANS, lineStarts, overLine, shifted, acrossLines, firstOfEach, spansByLine, textAt, noteSpans, NOTE_PAINT, wrap, REMARK_MARK$1, remarkHead, commentHead, headOf, spokenLines, heardFrom, answerLines, REMARK_LINES, capped, bodyLines, saidLines, noteLines, REMARK_RULE, noteRows, proseRows, freshLines, proseAt, apart, notesAt, TRAILING, shownText, codeRow, rowsFor, replacedBy, layout, lineNumbers, BARE_SIGN, signFor, lineSigns, sideLineOf;
17435
+ })), WASH, NOTE_MIN, OVERSCAN, SIGN_WIDTH, SCROLL_ROWS, PAN_COLUMNS, WAYS, notchesIn, takenOver, wheelTo, SIGNS, numberFor, DiffView, startsOf, numbered, bareOf, noteKey, keyOf, groupOf, isChrome, alike, heldAt, sameLine, NO_SPANS, lineStarts, overLine, shifted, acrossLines, firstOfEach, spansByLine, textAt, noteSpans, NOTE_PAINT, wrap, SAID_INDENT, REMARK_MARK$1, remarkHead, commentHead, headOf, spokenLines, heardFrom, answerLines, REMARK_LINES, capped, bodyLines, saidLines, noteLines, REMARK_RULE, noteRows, proseRows, freshLines, proseAt, apart, notesAt, TRAILING, shownText, codeRow, DRAFT_STOP, draftText, draftRows, rowsFor, replacedBy, layout, lineNumbers, BARE_SIGN, signFor, lineSigns, sideLineOf;
17368
17436
  var init_diffview = __esmMin((() => {
17369
17437
  init_dist();
17370
17438
  init_patch();
@@ -17453,6 +17521,7 @@ var init_diffview = __esmMin((() => {
17453
17521
  wrapped = false;
17454
17522
  held = 0;
17455
17523
  picked;
17524
+ draftLine;
17456
17525
  constructor(renderer) {
17457
17526
  this.code = new CodeRenderable(renderer, {
17458
17527
  id: "diff-code",
@@ -17507,6 +17576,15 @@ var init_diffview = __esmMin((() => {
17507
17576
  room() {
17508
17577
  return this.noteRoom();
17509
17578
  }
17579
+ noteLeft() {
17580
+ return this.numbers.x + this.gutterWidth();
17581
+ }
17582
+ saidLeft() {
17583
+ return this.noteLeft() + SAID_INDENT;
17584
+ }
17585
+ noteWidth() {
17586
+ return Math.max(NOTE_MIN, this.code.width - this.gutterWidth());
17587
+ }
17510
17588
  paneWidth() {
17511
17589
  return this.numbers.width;
17512
17590
  }
@@ -17550,6 +17628,19 @@ var init_diffview = __esmMin((() => {
17550
17628
  screenTop() {
17551
17629
  return this.code.y;
17552
17630
  }
17631
+ screenLeft() {
17632
+ return this.numbers.x;
17633
+ }
17634
+ showDraft(top, rows) {
17635
+ const at = this.draftTop();
17636
+ if (at === void 0) return top;
17637
+ const highest = Math.max(0, this.tallest() - this.rows());
17638
+ const below = at + rows - this.rows();
17639
+ const above = Math.max(0, at - 1);
17640
+ const settled = Math.max(0, Math.min(highest, above < top ? above : below > top ? below : top));
17641
+ if (this.code.scrollY !== settled) this.code.scrollY = settled;
17642
+ return settled;
17643
+ }
17553
17644
  fit(height) {
17554
17645
  const rows = Math.max(1, height);
17555
17646
  if (rows !== this.fitted) {
@@ -17563,9 +17654,13 @@ var init_diffview = __esmMin((() => {
17563
17654
  rows() {
17564
17655
  return this.fitted;
17565
17656
  }
17566
- show(patch, notes, gaps, prose = []) {
17657
+ show(patch, notes, gaps, under = {
17658
+ prose: [],
17659
+ draft: void 0
17660
+ }) {
17661
+ const { prose, draft } = under;
17567
17662
  const room = notes.length === 0 && prose.length === 0 ? NOTE_MIN : this.noteRoom();
17568
- const key = keyOf(room, notes, prose);
17663
+ const key = keyOf(room, notes, prose, draft);
17569
17664
  if (patch === this.shown && key === this.noted) return;
17570
17665
  this.unpin();
17571
17666
  this.shown = patch;
@@ -17576,8 +17671,11 @@ var init_diffview = __esmMin((() => {
17576
17671
  room,
17577
17672
  gaps,
17578
17673
  prose,
17579
- fresh: freshLines(patch)
17674
+ fresh: freshLines(patch),
17675
+ draft
17580
17676
  });
17677
+ const at = this.display.findIndex((entry) => entry.draft === true);
17678
+ this.draftLine = at === -1 ? void 0 : at;
17581
17679
  this.starts = startsOf(this.display);
17582
17680
  this.code.filetype = pathToFiletype(patch.path) ?? "text";
17583
17681
  this.feed();
@@ -17728,7 +17826,7 @@ var init_diffview = __esmMin((() => {
17728
17826
  carries(visual) {
17729
17827
  const entry = this.display[this.lineAt(visual)];
17730
17828
  if (entry === void 0) return false;
17731
- if (entry.prose) return false;
17829
+ if (entry.prose || entry.draft === true) return false;
17732
17830
  return true;
17733
17831
  }
17734
17832
  isComment(visual) {
@@ -17758,6 +17856,9 @@ var init_diffview = __esmMin((() => {
17758
17856
  screenRowOf(row) {
17759
17857
  return this.visualOfRow(row);
17760
17858
  }
17859
+ draftTop() {
17860
+ return this.draftLine === void 0 ? void 0 : this.visualOf(this.draftLine);
17861
+ }
17761
17862
  pick(picked) {
17762
17863
  if (alike(this.picked, picked)) return;
17763
17864
  this.picked = picked;
@@ -17828,8 +17929,9 @@ var init_diffview = __esmMin((() => {
17828
17929
  note.settled ? "settled" : note.asks ? "asked" : "open",
17829
17930
  ...note.turns.length > 0 ? note.turns.map((turn) => `${turn.voice[0] ?? ""}:${turn.body}`) : note.answers.map((body) => `a:${body}`)
17830
17931
  ].join("");
17831
- keyOf = (room, notes, prose) => [
17932
+ keyOf = (room, notes, prose, draft) => [
17832
17933
  room,
17934
+ draft === void 0 ? "d-" : `d${draft.row}:${draft.stop ?? 0}:${draft.rows}:${draft.head}`,
17833
17935
  ...notes.map(noteKey),
17834
17936
  ...prose.map((entry) => `p${entry.line}${entry.after ? ">" : "<"}:${entry.markdown}`)
17835
17937
  ].join("\0");
@@ -17944,6 +18046,7 @@ var init_diffview = __esmMin((() => {
17944
18046
  }
17945
18047
  return lines;
17946
18048
  };
18049
+ SAID_INDENT = 2;
17947
18050
  REMARK_MARK$1 = "◇";
17948
18051
  remarkHead = (note, from) => `${REMARK_MARK$1} @${from}${note.stale ? " · outdated" : ""}`;
17949
18052
  commentHead = (note) => {
@@ -18015,7 +18118,10 @@ var init_diffview = __esmMin((() => {
18015
18118
  gap: false,
18016
18119
  prose: false
18017
18120
  });
18018
- notesAt = (plan, row) => plan.notes.filter((note) => sideLineOf(row, note.side) === note.line).flatMap((note, at) => at === 0 ? noteRows(note, row.index, plan.room, at + 1) : [apart(row.index, at + 1)].concat(noteRows(note, row.index, plan.room, at + 1)));
18121
+ notesAt = (plan, row) => plan.notes.filter((note) => sideLineOf(row, note.side) === note.line).flatMap((note, at) => {
18122
+ const drawn = at === 0 ? noteRows(note, row.index, plan.room, at + 1) : [apart(row.index, at + 1)].concat(noteRows(note, row.index, plan.room, at + 1));
18123
+ return plan.draft?.stop === at + 1 ? drawn.concat(draftRows(plan, row)) : drawn;
18124
+ });
18019
18125
  TRAILING = /[ \t]+$/;
18020
18126
  shownText = (row) => {
18021
18127
  if (row.kind === "context") return row.text;
@@ -18034,11 +18140,29 @@ var init_diffview = __esmMin((() => {
18034
18140
  gap: plan.gaps.has(row.index),
18035
18141
  prose: false
18036
18142
  });
18143
+ DRAFT_STOP = -1;
18144
+ draftText = (draft, at) => {
18145
+ if (at === 0) return `${marks().rule} ${draft.head}`;
18146
+ if (at === 1) return `${marks().rule} » `;
18147
+ return marks().rule;
18148
+ };
18149
+ draftRows = (plan, row) => plan.draft === void 0 || plan.draft.row !== row.index ? [] : Array.from({ length: plan.draft.rows }, (_, at) => ({
18150
+ text: draftText(plan.draft, at),
18151
+ row: row.index,
18152
+ stop: DRAFT_STOP,
18153
+ draft: true,
18154
+ comment: true,
18155
+ sent: false,
18156
+ label: false,
18157
+ gap: false,
18158
+ prose: false
18159
+ }));
18037
18160
  rowsFor = (plan, row, around) => [
18038
18161
  ...around.lead.flatMap((entry) => proseRows(entry, row.index, plan.room)),
18039
18162
  ...(around.own ? proseAt(plan, row, false) : []).flatMap((entry) => proseRows(entry, row.index, plan.room)),
18040
18163
  codeRow(plan, row),
18041
18164
  ...notesAt(plan, row),
18165
+ ...plan.draft?.stop === void 0 ? draftRows(plan, row) : [],
18042
18166
  ...proseAt(plan, row, true).flatMap((entry) => proseRows(entry, row.index, plan.room))
18043
18167
  ];
18044
18168
  replacedBy = (rows, at) => {
@@ -18089,7 +18213,7 @@ var init_diffview = __esmMin((() => {
18089
18213
  }));
18090
18214
  //#endregion
18091
18215
  //#region src/tui/render.ts
18092
- var ROW_HEIGHT, COMPOSE_WIDTH, GUTTER_X, CHIP_GAP, MODAL_ROOM, COMPOSE_CHROME, COMPOSE_ACTION_ROWS, reportActions, SENDS, REPLIES, actionsText, SNIPPET_LINES, PALETTE_KEY, PALETTE_TITLE, PALETTE_GAP, PALETTE_CHROME, PENDING_CHROME, LEGEND_ROWS, LEGEND, legendText, 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, SHEET_GAP, sheetRow, groupedBy, sheetBlock, splitInTwo, sheetPaint, sheetDeep, sheetText, askText, SETTING_LEAD, settingsText, stack, makeBody, makeHome, makeModals, makeBaseParts, makeAskParts, makeReaderParts, makeSettingsParts, makeKeysParts, makeFoundParts, FONTS, logoFont, makeLanding, makeLogo, MAC_KEYS, makeComposeParts, makeCompose, stillThere, quotedFor, clipHead, clipMiddle, clipPath, INDENT_MAX, treeLabel, waitingLabel, inRange, notesOf, remarksOf, 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, standingOnThread, standingOnRemark, standingOnDismissed, offeredIn, readerTitle, voicesOf, readerText, PANEL_TITLES, PANEL_ORDER, PANEL_LEAD, PANEL_EMPTY, restingOrHere, FOUND_LEAST, nothingYet, counting, foundBlocks, JOIN, foundTitle, CHANGED_MARK, DECLARED, fileRow, leftRow, placeRow, blockOf, aroundRow, windowedBlocks, pickingTitle, YOURS, YOUR_REF, pickedTail, REMARK_MARK, remarkWhere, wherePart, panelFile, panelWhere, panelBody, panelMark, lostCode, lostEntry, writtenOn, foldLine, panelPair, panelSection, PULL_HINT, panelWindow, moreLine, panelPicked, panelText, Screen;
18216
+ var ROW_HEIGHT, COMPOSE_WIDTH, GUTTER_X, CHIP_GAP, MODAL_ROOM, COMPOSE_CHROME, DRAFT_PAD, NOTE_ROOM_MIN, DRAFT_ROOM, DRAFT_HEAD, COMPOSE_ACTION_ROWS, reportActions, SENDS, REPLIES, actionsText, SNIPPET_LINES, PALETTE_KEY, PALETTE_TITLE, PALETTE_GAP, PALETTE_CHROME, PENDING_CHROME, LEGEND_ROWS, LEGEND, legendText, 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, SHEET_GAP, sheetRow, groupedBy, sheetBlock, splitInTwo, sheetPaint, sheetDeep, sheetText, askText, SETTING_LEAD, settingsText, stack, makeBody, makeHome, makeModals, makeBaseParts, makeAskParts, makeReaderParts, makeSettingsParts, makeKeysParts, makeFoundParts, FONTS, logoFont, makeLanding, makeLogo, MAC_KEYS, makeComposeParts, makeCompose, stillThere, quotedFor, clipHead, clipMiddle, clipPath, INDENT_MAX, treeLabel, waitingLabel, inRange, notesOf, remarksOf, 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, standingOnRemark, standingOnDismissed, offeredIn, readerTitle, voicesOf, readerText, PANEL_TITLES, PANEL_ORDER, PANEL_LEAD, PANEL_EMPTY, restingOrHere, FOUND_LEAST, nothingYet, counting, foundBlocks, JOIN, foundTitle, CHANGED_MARK, DECLARED, fileRow, leftRow, placeRow, blockOf, aroundRow, windowedBlocks, pickingTitle, YOURS, YOUR_REF, pickedTail, REMARK_MARK, remarkWhere, wherePart, panelFile, panelWhere, panelBody, panelMark, lostCode, lostEntry, writtenOn, foldLine, panelPair, panelSection, PULL_HINT, panelWindow, moreLine, panelPicked, panelText, Screen;
18093
18217
  var init_render = __esmMin((() => {
18094
18218
  init_dist();
18095
18219
  init_command();
@@ -18107,6 +18231,10 @@ var init_render = __esmMin((() => {
18107
18231
  CHIP_GAP = 4;
18108
18232
  MODAL_ROOM = 8;
18109
18233
  COMPOSE_CHROME = 3;
18234
+ DRAFT_PAD = 2;
18235
+ NOTE_ROOM_MIN = 24;
18236
+ DRAFT_ROOM = 6;
18237
+ DRAFT_HEAD = 1;
18110
18238
  COMPOSE_ACTION_ROWS = 2;
18111
18239
  reportActions = (full) => t`${fg(palette.accent)("esc")} ${fg(palette.muted)("cancel")} ${fg(palette.accent)("^t")} ${fg(palette.muted)(full ? "sending everything" : "sending the least")} ${fg(palette.accent)("^s")} ${fg(palette.muted)("copy and save")}`;
18112
18240
  SENDS = "send it";
@@ -18741,6 +18869,7 @@ var init_render = __esmMin((() => {
18741
18869
  if (answering.length > 0) return answering.slice(0, shownLines * 2).map((line) => clip(line, room));
18742
18870
  const said = threadQuote(state, room);
18743
18871
  if (said.length > 0) return said.slice(0, shownLines * 2).map((line) => clip(line, room));
18872
+ if (state.replyTo !== void 0) return [];
18744
18873
  const snippet = snippetOf(state, shownLines);
18745
18874
  const more = selectedLineCount(state) - snippet.length;
18746
18875
  const tail = more > 0 ? [` … ${more} more lines`] : [];
@@ -19026,7 +19155,6 @@ var init_render = __esmMin((() => {
19026
19155
  return `${row.here === true ? marks().cursor : " "}${look.mark.padStart(GUTTER - 1)}`;
19027
19156
  };
19028
19157
  layerText = (row, look, room) => row.kind === "gap" ? "" : `${layerGutter(row, look)}${" ".repeat(look.lead - GUTTER)}${row.text}`.padEnd(room.title + TITLE_LEAD);
19029
- standingOnThread = (state) => state.stop > 0 && threadAtStop(state) !== void 0 || threadChosen(state) !== void 0;
19030
19158
  standingOnRemark = (state) => remarkToTakeOn(state) !== void 0;
19031
19159
  standingOnDismissed = (state) => remarkUnderCursor(state)?.dismissed === true;
19032
19160
  offeredIn = (state) => ({
@@ -19045,6 +19173,7 @@ var init_render = __esmMin((() => {
19045
19173
  hidingRead: state.hideReviewed,
19046
19174
  hidingSettled: state.hideSettled,
19047
19175
  onRemoved: threadHere(state)?.removed === true,
19176
+ onSettled: threadHere(state)?.settled === true,
19048
19177
  onHeld: state.focus === "review" && panelEntry(state)?.section === "held"
19049
19178
  });
19050
19179
  readerTitle = (state, entry) => {
@@ -19413,6 +19542,8 @@ var init_render = __esmMin((() => {
19413
19542
  panelPicks = [];
19414
19543
  dragFrom;
19415
19544
  lastTop = 0;
19545
+ drafted;
19546
+ drafting;
19416
19547
  constructor(renderer, repo = "") {
19417
19548
  this.renderer = renderer;
19418
19549
  this.repo = repo;
@@ -19829,14 +19960,25 @@ var init_render = __esmMin((() => {
19829
19960
  const patch = shown.patch;
19830
19961
  this.view.setWrap(state.wrap, this.diffRoom());
19831
19962
  this.view.setPan(state.pan);
19832
- this.view.show(patch, notesFor(state, patch.path), gapRowSet(shown), proseFor(state, patch.path));
19963
+ const draft = this.draftFor(state);
19964
+ this.drafted = draft;
19965
+ this.view.show(patch, notesFor(state, patch.path), gapRowSet(shown), {
19966
+ prose: proseFor(state, patch.path),
19967
+ draft
19968
+ });
19833
19969
  this.view.pick(state.picked);
19834
19970
  if (!takesText(state.screen)) {
19835
19971
  this.view.fit(this.diffRows());
19836
19972
  this.lastTop = this.view.scrollTo(state.top, state.cursor, state.scroll);
19837
19973
  if (state.sticky) this.paintSticky(state, this.view.rowAt(this.lastTop));
19838
19974
  else this.view.pin([]);
19975
+ } else if (draft !== void 0) {
19976
+ this.view.fit(this.diffRows());
19977
+ const held = state.scroll >= 0 && this.drafting === draft.row ? state.scroll : this.lastTop;
19978
+ this.lastTop = this.view.showDraft(held, draft.rows);
19979
+ this.drafting = draft.row;
19839
19980
  }
19981
+ if (draft === void 0) this.drafting = void 0;
19840
19982
  const top = this.lastTop;
19841
19983
  this.view.paint(this.linePaint(state), top, this.view.rows());
19842
19984
  this.paintGutter(state, top, this.view.rows());
@@ -20009,6 +20151,7 @@ var init_render = __esmMin((() => {
20009
20151
  paintReport(state) {
20010
20152
  this.compose.visible = state.screen === "compose" || state.screen === "report";
20011
20153
  if (state.screen !== "report") return;
20154
+ this.asBox();
20012
20155
  const room = composeRoom(this.renderer.width);
20013
20156
  const asked = state.reportFull ? "What went wrong? Everything on screen is attached for you." : "What went wrong? Only what you type is sent.";
20014
20157
  const lead = laidOut$1([asked], room.text);
@@ -20060,6 +20203,66 @@ var init_render = __esmMin((() => {
20060
20203
  });
20061
20204
  };
20062
20205
  }
20206
+ draftFor(state) {
20207
+ if (state.screen !== "compose") return void 0;
20208
+ if (this.diffRows() < DRAFT_ROOM) return void 0;
20209
+ const place = draftPlace(state);
20210
+ if (place === void 0 || this.view.screenRowOf(place.row) === void 0) return void 0;
20211
+ const body = this.draftBody(state);
20212
+ return {
20213
+ row: place.row,
20214
+ stop: place.stop,
20215
+ rows: DRAFT_HEAD + body + COMPOSE_ACTION_ROWS,
20216
+ head: clip(composeTarget(state), this.draftRoom())
20217
+ };
20218
+ }
20219
+ draftRoom() {
20220
+ return Math.max(NOTE_ROOM_MIN, this.view.noteWidth() - DRAFT_PAD);
20221
+ }
20222
+ draftBody(state) {
20223
+ const most = Math.max(1, this.diffRows() - DRAFT_HEAD - COMPOSE_ACTION_ROWS - 1);
20224
+ return Math.max(1, Math.min(most, laidDraft(state.draft, this.draftRoom()).length));
20225
+ }
20226
+ paintInline(state, draft) {
20227
+ const at = this.view.draftTop();
20228
+ if (at === void 0) return;
20229
+ this.asNote();
20230
+ this.composeTitle.content = "";
20231
+ this.composeTitle.height = 0;
20232
+ this.composeQuoted.content = "";
20233
+ this.composeQuoted.height = 0;
20234
+ this.fitBody(state, this.draftRoom(), draft.rows - DRAFT_HEAD - COMPOSE_ACTION_ROWS);
20235
+ this.composeActions.content = actionsText(state.answerTo === void 0 ? SENDS : REPLIES);
20236
+ this.compose.height = draft.rows - DRAFT_HEAD;
20237
+ this.compose.width = this.draftRoom();
20238
+ this.compose.left = this.view.saidLeft();
20239
+ const top = this.view.screenTop();
20240
+ const lowest = top + Math.max(0, this.view.rows() - draft.rows + DRAFT_HEAD);
20241
+ this.compose.top = Math.max(top, Math.min(lowest, top + at + DRAFT_HEAD - this.lastTop));
20242
+ }
20243
+ asNote() {
20244
+ if (this.compose.border !== false) {
20245
+ this.compose.border = false;
20246
+ this.compose.paddingLeft = 0;
20247
+ this.compose.paddingRight = 0;
20248
+ this.compose.paddingTop = 0;
20249
+ this.compose.backgroundColor = "transparent";
20250
+ this.composeBody.backgroundColor = "transparent";
20251
+ this.composeBody.focusedBackgroundColor = "transparent";
20252
+ }
20253
+ }
20254
+ asBox() {
20255
+ if (this.compose.border === false) {
20256
+ this.compose.border = ["left"];
20257
+ this.compose.paddingLeft = GUTTER_X;
20258
+ this.compose.paddingRight = GUTTER_X;
20259
+ this.compose.paddingTop = 1;
20260
+ this.compose.backgroundColor = palette.panel;
20261
+ this.composeBody.backgroundColor = palette.panel;
20262
+ this.composeBody.focusedBackgroundColor = palette.panel;
20263
+ this.composeTitle.height = 1;
20264
+ }
20265
+ }
20063
20266
  fitBody(state, room, most) {
20064
20267
  if (this.composeBody.width !== room) this.composeBody.width = room;
20065
20268
  const wanted = Math.max(1, laidDraft(state.draft, room).length);
@@ -20070,6 +20273,12 @@ var init_render = __esmMin((() => {
20070
20273
  paintCompose(state) {
20071
20274
  this.compose.visible = state.screen === "compose";
20072
20275
  if (state.screen !== "compose") return;
20276
+ const inline = this.drafted;
20277
+ if (inline !== void 0) {
20278
+ this.paintInline(state, inline);
20279
+ return;
20280
+ }
20281
+ this.asBox();
20073
20282
  const room = composeRoom(this.renderer.width);
20074
20283
  const shownLines = Math.max(1, Math.min(SNIPPET_LINES, Math.floor(this.renderer.height / 6)));
20075
20284
  const quoted = quotedFor(state, shownLines, room.text);
@@ -20791,7 +21000,8 @@ var init_app = __esmMin((() => {
20791
21000
  return Date.now() - this.began;
20792
21001
  }
20793
21002
  commit(given) {
20794
- const next = given.patchIndex === this.state.patchIndex ? given : turnedOver(given);
21003
+ const kept = this.keptScroll(given);
21004
+ const next = kept.patchIndex === this.state.patchIndex ? kept : turnedOver(kept);
20795
21005
  this.turnWriting(next);
20796
21006
  const appeared = next.notice.length > 0 && next.notice !== this.state.notice;
20797
21007
  if (appeared) this.recordNotice(next.notice);
@@ -20800,6 +21010,14 @@ var init_app = __esmMin((() => {
20800
21010
  this.write(next);
20801
21011
  if (appeared) this.fade();
20802
21012
  }
21013
+ keptScroll(given) {
21014
+ if (this.state.screen !== "compose" || given.screen === "compose") return given;
21015
+ if (given.patchIndex !== this.state.patchIndex) return given;
21016
+ return {
21017
+ ...given,
21018
+ scroll: runSync(this.display.at)
21019
+ };
21020
+ }
20803
21021
  recordNotice(notice) {
20804
21022
  this.trail.push(noticeOf(notice, this.since()));
20805
21023
  if (this.trail.length > TRAIL_HISTORY) this.trail.shift();
@@ -21367,21 +21585,27 @@ var init_app = __esmMin((() => {
21367
21585
  });
21368
21586
  }
21369
21587
  settleHere() {
21588
+ const thread = threadHere(this.state);
21589
+ const id = thread?.id;
21590
+ if (selectedBranch(this.state) === void 0 || id === void 0) return sync(() => this.commit(withNotice(this.state, "no thread here")));
21591
+ if (thread?.settled !== true) return this.settleThread(id, false);
21592
+ if (!standingOnThread(this.state)) return sync(() => this.commit(withNotice(this.state, "stand on the thread to take it back")));
21593
+ return this.settleThread(id, true);
21594
+ }
21595
+ settleThread(id, back) {
21370
21596
  return gen({ self: this }, function* () {
21371
21597
  const branch = selectedBranch(this.state);
21372
- const id = threadHere(this.state)?.id;
21373
- if (branch === void 0 || id === void 0) {
21374
- this.commit(withNotice(this.state, "no thread here"));
21375
- return;
21376
- }
21598
+ if (branch === void 0) return;
21377
21599
  const was = this.state.panelIndex;
21378
- yield* this.settling(branch.branch, id);
21600
+ yield* back ? this.unsettling(branch.branch, id) : this.settling(branch.branch, id);
21379
21601
  const sent = yield* this.loadSent(branch.branch);
21602
+ const opened = this.state.opened.filter((one) => one !== id);
21380
21603
  const held = withSent({
21381
21604
  ...this.state,
21382
- opened: this.state.opened.filter((one) => one !== id)
21605
+ opened
21383
21606
  }, sent);
21384
- this.commit(withNotice(this.staying(held, was), "settled"));
21607
+ const where = back ? this.following(held, id, was) : this.staying(held, was);
21608
+ this.commit(withNotice(where, back ? "unsettled" : "settled"));
21385
21609
  });
21386
21610
  }
21387
21611
  replyHere() {
@@ -21451,6 +21675,14 @@ var init_app = __esmMin((() => {
21451
21675
  panelIndex: Math.min(was, last)
21452
21676
  };
21453
21677
  }
21678
+ following(state, id, was) {
21679
+ if (state.focus !== "review") return this.staying(state, was);
21680
+ const at = panelEntries(state).findIndex((entry) => entry.kind === "comment" && entry.comment.id === id);
21681
+ return at === -1 ? this.staying(state, was) : {
21682
+ ...state,
21683
+ panelIndex: at
21684
+ };
21685
+ }
21454
21686
  heldUnderCursor() {
21455
21687
  if (this.state.focus !== "review") return -1;
21456
21688
  const entry = panelEntry(this.state);
@@ -21793,6 +22025,10 @@ var init_app = __esmMin((() => {
21793
22025
  const worktree = this.worktreeFor(branch);
21794
22026
  return worktree === void 0 ? settleThread(this.repo, branch, id, at) : settleIn(worktree, id, at);
21795
22027
  }
22028
+ unsettling(branch, id) {
22029
+ const worktree = this.worktreeFor(branch);
22030
+ return worktree === void 0 ? unsettleThread(this.repo, branch, id) : unsettleIn(worktree, id);
22031
+ }
21796
22032
  restoring(branch, id) {
21797
22033
  const worktree = this.worktreeFor(branch);
21798
22034
  return worktree === void 0 ? restoreComment(this.repo, branch, id) : restoreIn(worktree, id);
@@ -22442,6 +22678,10 @@ const commentRestore = fn("Main.commentRestore")(function* (options) {
22442
22678
  const report = yield* restoreComment(yield* required(options, "repo"), yield* required(options, "branch"), yield* required(options, "id"));
22443
22679
  yield* answer(options, { restored: report.restored });
22444
22680
  });
22681
+ const commentReopen = fn("Main.commentReopen")(function* (options) {
22682
+ const report = yield* unsettleThread(yield* required(options, "repo"), yield* required(options, "branch"), yield* required(options, "id"));
22683
+ yield* answer(options, { reopened: report.unsettled });
22684
+ });
22445
22685
  const fileReview = fn("Main.fileReview")(function* (options) {
22446
22686
  const report = yield* toggleVouch({
22447
22687
  repo: yield* required(options, "repo"),
@@ -22526,6 +22766,7 @@ const routes = {
22526
22766
  "comment resolve": commentResolve,
22527
22767
  "comment remove": commentRemove,
22528
22768
  "comment restore": commentRestore,
22769
+ "comment reopen": commentReopen,
22529
22770
  "config list": configList,
22530
22771
  "config get": configGet,
22531
22772
  "config set": configSet,
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.171",
26
+ "version": "0.1.0-alpha.173",
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": {