@eliya-oss/agent-diff 0.1.0-alpha.172 → 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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
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
+
3
20
  ## 0.1.0-alpha.172
4
21
 
5
22
  ### 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.172";
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, draftPlace, notesShown, 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();
@@ -14878,6 +14914,7 @@ var init_model$1 = __esmMin((() => {
14878
14914
  };
14879
14915
  remarkToTakeOn = (state) => remarkInPanel(state)?.remark ?? remarkInDiff(state, false);
14880
14916
  remarkHere = (state) => remarkToTakeOn(state);
14917
+ standingOnThread = (state) => state.stop > 0 && threadAtStop(state) !== void 0 || threadChosen(state) !== void 0;
14881
14918
  threadHere = (state) => {
14882
14919
  if (state.focus === "review") {
14883
14920
  const entry = panelEntry(state);
@@ -15765,10 +15802,12 @@ var init_command = __esmMin((() => {
15765
15802
  "resolve",
15766
15803
  "close",
15767
15804
  "done",
15768
- "accept"
15805
+ "accept",
15806
+ "unsettle",
15807
+ "reopen"
15769
15808
  ],
15770
15809
  panes: ["diff", "review"],
15771
- title: "Settle the thread here",
15810
+ title: "Settle the thread here, or take a settled one back",
15772
15811
  category: "Comments",
15773
15812
  keys: ["d"],
15774
15813
  screens: ["review"],
@@ -16218,6 +16257,7 @@ var init_command = __esmMin((() => {
16218
16257
  "tree.winnow": (offered) => offered.hidingRead ? "show read" : "hide read",
16219
16258
  "panel.winnow": (offered) => offered.hidingSettled ? "show settled" : "hide settled",
16220
16259
  "thread.remove": (offered) => heldOrRemoved(offered),
16260
+ "thread.settle": (offered) => offered.onSettled ? "unsettle" : "settle",
16221
16261
  "held.send": (offered) => `send ${offered.held}`
16222
16262
  };
16223
16263
  hintOf = (entry, offered) => {
@@ -18173,7 +18213,7 @@ var init_diffview = __esmMin((() => {
18173
18213
  }));
18174
18214
  //#endregion
18175
18215
  //#region src/tui/render.ts
18176
- 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, 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;
18177
18217
  var init_render = __esmMin((() => {
18178
18218
  init_dist();
18179
18219
  init_command();
@@ -19115,7 +19155,6 @@ var init_render = __esmMin((() => {
19115
19155
  return `${row.here === true ? marks().cursor : " "}${look.mark.padStart(GUTTER - 1)}`;
19116
19156
  };
19117
19157
  layerText = (row, look, room) => row.kind === "gap" ? "" : `${layerGutter(row, look)}${" ".repeat(look.lead - GUTTER)}${row.text}`.padEnd(room.title + TITLE_LEAD);
19118
- standingOnThread = (state) => state.stop > 0 && threadAtStop(state) !== void 0 || threadChosen(state) !== void 0;
19119
19158
  standingOnRemark = (state) => remarkToTakeOn(state) !== void 0;
19120
19159
  standingOnDismissed = (state) => remarkUnderCursor(state)?.dismissed === true;
19121
19160
  offeredIn = (state) => ({
@@ -19134,6 +19173,7 @@ var init_render = __esmMin((() => {
19134
19173
  hidingRead: state.hideReviewed,
19135
19174
  hidingSettled: state.hideSettled,
19136
19175
  onRemoved: threadHere(state)?.removed === true,
19176
+ onSettled: threadHere(state)?.settled === true,
19137
19177
  onHeld: state.focus === "review" && panelEntry(state)?.section === "held"
19138
19178
  });
19139
19179
  readerTitle = (state, entry) => {
@@ -21545,21 +21585,27 @@ var init_app = __esmMin((() => {
21545
21585
  });
21546
21586
  }
21547
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) {
21548
21596
  return gen({ self: this }, function* () {
21549
21597
  const branch = selectedBranch(this.state);
21550
- const id = threadHere(this.state)?.id;
21551
- if (branch === void 0 || id === void 0) {
21552
- this.commit(withNotice(this.state, "no thread here"));
21553
- return;
21554
- }
21598
+ if (branch === void 0) return;
21555
21599
  const was = this.state.panelIndex;
21556
- yield* this.settling(branch.branch, id);
21600
+ yield* back ? this.unsettling(branch.branch, id) : this.settling(branch.branch, id);
21557
21601
  const sent = yield* this.loadSent(branch.branch);
21602
+ const opened = this.state.opened.filter((one) => one !== id);
21558
21603
  const held = withSent({
21559
21604
  ...this.state,
21560
- opened: this.state.opened.filter((one) => one !== id)
21605
+ opened
21561
21606
  }, sent);
21562
- 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"));
21563
21609
  });
21564
21610
  }
21565
21611
  replyHere() {
@@ -21629,6 +21675,14 @@ var init_app = __esmMin((() => {
21629
21675
  panelIndex: Math.min(was, last)
21630
21676
  };
21631
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
+ }
21632
21686
  heldUnderCursor() {
21633
21687
  if (this.state.focus !== "review") return -1;
21634
21688
  const entry = panelEntry(this.state);
@@ -21971,6 +22025,10 @@ var init_app = __esmMin((() => {
21971
22025
  const worktree = this.worktreeFor(branch);
21972
22026
  return worktree === void 0 ? settleThread(this.repo, branch, id, at) : settleIn(worktree, id, at);
21973
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
+ }
21974
22032
  restoring(branch, id) {
21975
22033
  const worktree = this.worktreeFor(branch);
21976
22034
  return worktree === void 0 ? restoreComment(this.repo, branch, id) : restoreIn(worktree, id);
@@ -22620,6 +22678,10 @@ const commentRestore = fn("Main.commentRestore")(function* (options) {
22620
22678
  const report = yield* restoreComment(yield* required(options, "repo"), yield* required(options, "branch"), yield* required(options, "id"));
22621
22679
  yield* answer(options, { restored: report.restored });
22622
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
+ });
22623
22685
  const fileReview = fn("Main.fileReview")(function* (options) {
22624
22686
  const report = yield* toggleVouch({
22625
22687
  repo: yield* required(options, "repo"),
@@ -22704,6 +22766,7 @@ const routes = {
22704
22766
  "comment resolve": commentResolve,
22705
22767
  "comment remove": commentRemove,
22706
22768
  "comment restore": commentRestore,
22769
+ "comment reopen": commentReopen,
22707
22770
  "config list": configList,
22708
22771
  "config get": configGet,
22709
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.172",
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": {