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

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,19 @@
1
1
  # @eliya-oss/agent-diff
2
2
 
3
+ ## 0.1.0-alpha.114
4
+
5
+ ### Patch Changes
6
+
7
+ - A comment you withdrew can be brought back from the terminal. `X` used to be a one-key destructive action with no confirm, no undo and no trace — the thread vanished from the diff, from the review panel and from the file counts, and the only way back was a CLI command the message named but the terminal could not run. A withdrawn thread now sits under "Withdrawn" in the review, out of the diff, and `X` on it brings it back.
8
+
9
+ ## 0.1.0-alpha.113
10
+
11
+ ### Patch Changes
12
+
13
+ - The reply box shows the thread you are answering. It used to quote code from wherever the diff cursor happened to be — often a different file — and never showed your comment or the agent's answer, so you replied to a question you could not see. It now shows the conversation, and names the range rather than only its last line.
14
+
15
+ The header says when a line runs off the right of the pane. Code was cut with no marker of any kind, so two lines that differ only past the edge looked identical.
16
+
3
17
  ## 0.1.0-alpha.112
4
18
 
5
19
  ### Patch Changes
package/dist/main.js CHANGED
@@ -9764,7 +9764,7 @@ var init_commands = __esmMin((() => {
9764
9764
  asks: entry.asks
9765
9765
  }))].toSorted((one, other) => one.at < other.at ? -1 : one.at > other.at ? 1 : 0);
9766
9766
  sentOf = (comment, replies, reading) => {
9767
- const { spoken, settled, head, shown, read } = reading;
9767
+ const { spoken, settled, removed, head, shown, read } = reading;
9768
9768
  const ids = /* @__PURE__ */ new Set([comment.id, ...replies.map((reply) => reply.id)]);
9769
9769
  const said = spoken.filter((entry) => ids.has(entry.comment));
9770
9770
  const seen = [...ids].reduce((total, id) => total + (read[id] ?? 0), 0);
@@ -9778,6 +9778,7 @@ var init_commands = __esmMin((() => {
9778
9778
  end: comment.end,
9779
9779
  body: comment.body,
9780
9780
  settled: Object.hasOwn(settled, comment.id),
9781
+ removed: Object.hasOwn(removed, comment.id),
9781
9782
  stale: comment.head !== head,
9782
9783
  outside: !shown.has(comment.file),
9783
9784
  unread: Math.max(0, said.length - seen),
@@ -9795,11 +9796,12 @@ var init_commands = __esmMin((() => {
9795
9796
  const spoken = yield* store.answers(worktree.path);
9796
9797
  const current = yield* store.state(worktree.path);
9797
9798
  const shown = new Set(reading.patches.map((patch) => patch.path));
9798
- const held = flatten(yield* store.inbox(worktree.path)).filter((comment) => !Object.hasOwn(current.removed, comment.id));
9799
+ const held = flatten(yield* store.inbox(worktree.path));
9799
9800
  const replies = held.filter((comment) => comment.replyTo !== void 0);
9800
9801
  const conversation = {
9801
9802
  spoken,
9802
9803
  settled: current.settled,
9804
+ removed: current.removed,
9803
9805
  head: worktree.head,
9804
9806
  shown,
9805
9807
  read: current.read
@@ -10401,7 +10403,7 @@ var init_pane = __esmMin((() => {
10401
10403
  init_drafts();
10402
10404
  init_init();
10403
10405
  init_pane();
10404
- var version$1 = "0.1.0-alpha.112";
10406
+ var version$1 = "0.1.0-alpha.114";
10405
10407
  //#endregion
10406
10408
  //#region src/cli/upgrade.ts
10407
10409
  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;
@@ -11007,7 +11009,7 @@ var init_layers = __esmMin((() => {
11007
11009
  }));
11008
11010
  //#endregion
11009
11011
  //#region src/cli/threads.ts
11010
- var stateOf, spoken$1, turnsOf, threadOf, threadsIn, idsIn, isKnown, listThreads, answerComment, settleIn, settleThread, removeIn, removeComment, without, restoreComment, settleRead;
11012
+ var stateOf, spoken$1, turnsOf, threadOf, threadsIn, idsIn, isKnown, listThreads, answerComment, settleIn, settleThread, removeIn, removeComment, without, restoreIn, restoreComment, settleRead;
11011
11013
  var init_threads = __esmMin((() => {
11012
11014
  init_dist();
11013
11015
  init_store();
@@ -11139,6 +11141,15 @@ var init_threads = __esmMin((() => {
11139
11141
  return yield* removeIn(yield* findBranch(repo, branch), id, at);
11140
11142
  });
11141
11143
  without = (entries, id) => Object.fromEntries(Object.entries(entries).filter(([key]) => key !== id));
11144
+ restoreIn = fn("Cli.restoreIn")(function* (worktree, id) {
11145
+ const store = yield* Store;
11146
+ if (!(yield* isKnown(worktree.path, id))) return yield* new UnknownComment({ id });
11147
+ yield* store.changeState(worktree.path, (was) => ({
11148
+ ...was,
11149
+ removed: without(was.removed, id)
11150
+ }));
11151
+ return { restored: id };
11152
+ });
11142
11153
  restoreComment = fn("Cli.restoreComment")(function* (repo, branch, id) {
11143
11154
  const store = yield* Store;
11144
11155
  const worktree = yield* findBranch(repo, branch);
@@ -12401,7 +12412,7 @@ var init_tree = __esmMin((() => {
12401
12412
  return node.children.reduce((total, child) => total + filesUnder(tree, child), 0);
12402
12413
  };
12403
12414
  crowdedDirectories = (tree, limit) => tree.nodes.filter((node) => node.kind === "directory" && directFiles(tree, node.id) > limit).map((node) => node.path);
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;
12415
+ })), 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, threadReplying, VOICES, threadQuote, 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;
12405
12416
  var init_model = __esmMin((() => {
12406
12417
  init_dist();
12407
12418
  init_patch();
@@ -12691,7 +12702,7 @@ var init_model = __esmMin((() => {
12691
12702
  commentsOn = (state, fileIndex) => {
12692
12703
  const patch = state.patches[fileIndex];
12693
12704
  if (patch === void 0) return 0;
12694
- return state.sent.filter((entry) => entry.file === patch.path).length;
12705
+ return state.sent.filter((entry) => entry.file === patch.path && entry.removed !== true).length;
12695
12706
  };
12696
12707
  hiddenLines = (state) => shownOf(state)?.gaps.reduce((total, gap) => total + gap.hidden, 0) ?? 0;
12697
12708
  markedRows = (state) => {
@@ -12777,9 +12788,32 @@ var init_model = __esmMin((() => {
12777
12788
  return span === "" ? `Comment on ${patch.path}` : `Comment on ${patch.path}:${span}`;
12778
12789
  };
12779
12790
  replyTarget = (state) => {
12780
- const thread = state.sent.find((entry) => entry.id === state.replyTo);
12791
+ const thread = threadReplying(state);
12781
12792
  if (thread === void 0) return "Reply";
12782
- return `Reply on ${thread.file}:${thread.end}`;
12793
+ const span = thread.start === thread.end ? `${thread.end}` : `${thread.start}-${thread.end}`;
12794
+ return `Reply on ${thread.file}:${span}`;
12795
+ };
12796
+ threadReplying = (state) => state.replyTo === void 0 ? void 0 : state.sent.find((entry) => entry.id === state.replyTo);
12797
+ VOICES = {
12798
+ reviewer: "you",
12799
+ agent: "the agent"
12800
+ };
12801
+ threadQuote = (state, room) => {
12802
+ const thread = threadReplying(state);
12803
+ if (thread === void 0) return [];
12804
+ const spoken = (thread.answers ?? []).map((body) => ({
12805
+ voice: "agent",
12806
+ body
12807
+ }));
12808
+ const turns = thread.turns ?? [{
12809
+ voice: "reviewer",
12810
+ body: thread.body
12811
+ }, ...spoken];
12812
+ const saidBy = (turn) => {
12813
+ const lines = wrapped(turn.body, Math.max(8, room - 4)).map((line) => ` ${line}`);
12814
+ return [` ${VOICES[turn.voice]}`, ...lines];
12815
+ };
12816
+ return turns.flatMap(saidBy);
12783
12817
  };
12784
12818
  pickedText = (state) => {
12785
12819
  const picked = state.picked;
@@ -12856,7 +12890,7 @@ var init_model = __esmMin((() => {
12856
12890
  const patch = selectedPatch(state);
12857
12891
  const here = patch?.rows[row];
12858
12892
  if (patch === void 0 || here === void 0) return [];
12859
- return state.sent.filter((entry) => entry.file === patch.path && entry.id !== void 0 && lineOnSide(here, entry.side) === entry.end);
12893
+ return state.sent.filter((entry) => entry.file === patch.path && entry.id !== void 0 && entry.removed !== true && lineOnSide(here, entry.side) === entry.end);
12860
12894
  };
12861
12895
  stopsAtRow = (state, row) => 1 + threadsAtRow(state, row).length;
12862
12896
  threadAtStop = (state) => state.stop === 0 ? void 0 : threadsAtRow(state, state.cursor)[state.stop - 1];
@@ -12864,12 +12898,12 @@ var init_model = __esmMin((() => {
12864
12898
  const patch = selectedPatch(state);
12865
12899
  const here = patch?.rows[row];
12866
12900
  if (patch === void 0 || here === void 0) return void 0;
12867
- return state.sent.find((entry) => entry.file === patch.path && entry.id !== void 0 && lineOnSide(here, entry.side) === entry.end);
12901
+ return state.sent.find((entry) => entry.file === patch.path && entry.id !== void 0 && entry.removed !== true && lineOnSide(here, entry.side) === entry.end);
12868
12902
  };
12869
12903
  openCommentRows = (state) => {
12870
12904
  const patch = selectedPatch(state);
12871
12905
  if (patch === void 0) return [];
12872
- const open = state.sent.filter((entry) => entry.file === patch.path && entry.settled !== true);
12906
+ const open = state.sent.filter((entry) => entry.file === patch.path && entry.settled !== true && entry.removed !== true);
12873
12907
  return patch.rows.filter((row) => open.some((note) => lineOnSide(row, note.side) === note.end)).map((row) => row.index);
12874
12908
  };
12875
12909
  filesWithComments = (state) => state.patches.flatMap((patch, index) => state.sent.some((entry) => entry.file === patch.path) ? [index] : []);
@@ -12878,7 +12912,8 @@ var init_model = __esmMin((() => {
12878
12912
  "asked",
12879
12913
  "with",
12880
12914
  "answered",
12881
- "settled"
12915
+ "settled",
12916
+ "removed"
12882
12917
  ];
12883
12918
  answersIn = (comment) => comment.answers?.length ?? 0;
12884
12919
  newerOf = (state, comment) => {
@@ -12889,6 +12924,7 @@ var init_model = __esmMin((() => {
12889
12924
  };
12890
12925
  spokeLast = (comment) => comment.turns?.at(-1)?.voice;
12891
12926
  sectionOf = (comment) => {
12927
+ if (comment.removed === true) return "removed";
12892
12928
  if (comment.settled === true) return "settled";
12893
12929
  if (comment.asks === true) return "asked";
12894
12930
  if (spokeLast(comment) === "reviewer") return "with";
@@ -15392,7 +15428,7 @@ var init_diffview = __esmMin((() => {
15392
15428
  }));
15393
15429
  //#endregion
15394
15430
  //#region src/tui/render.ts
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;
15431
+ 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, stillThere, quotedFor, 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, panLabel, 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;
15396
15432
  var init_render = __esmMin((() => {
15397
15433
  init_command();
15398
15434
  init_layers$1();
@@ -15870,6 +15906,15 @@ var init_render = __esmMin((() => {
15870
15906
  paddingBottom: 1,
15871
15907
  flexDirection: "column"
15872
15908
  });
15909
+ stillThere = (sent) => sent.filter((one) => one.removed !== true);
15910
+ quotedFor = (state, shownLines, room) => {
15911
+ const said = threadQuote(state, room);
15912
+ if (said.length > 0) return said.slice(0, shownLines * 2).map((line) => clip(line, room));
15913
+ const snippet = snippetOf(state, shownLines);
15914
+ const more = selectedLineCount(state) - snippet.length;
15915
+ const tail = more > 0 ? [` … ${more} more lines`] : [];
15916
+ return [...snippet, ...tail].map((line) => clip(line, room));
15917
+ };
15873
15918
  clipHead = (label, room) => label.length > room ? `…${label.slice(label.length - Math.max(0, room - 1))}` : label;
15874
15919
  clipMiddle = (label, room) => {
15875
15920
  if (label.length <= room) return label;
@@ -15912,7 +15957,7 @@ var init_render = __esmMin((() => {
15912
15957
  answers: entry.answers ?? [],
15913
15958
  turns: entry.turns ?? []
15914
15959
  }));
15915
- notesFor = (state, path) => notesOf(state.sent, path, true, state.opened);
15960
+ notesFor = (state, path) => notesOf(stillThere(state.sent), path, true, state.opened);
15916
15961
  paired = (chunks) => {
15917
15962
  const chips = [];
15918
15963
  for (let at = 0; at < chunks.length; at += CHIP_CHUNKS) chips.push(chunks.slice(at, at + CHIP_CHUNKS));
@@ -16005,7 +16050,7 @@ var init_render = __esmMin((() => {
16005
16050
  const place = filePlace(state);
16006
16051
  return `file ${place.at} of ${place.of}`;
16007
16052
  };
16008
- headerParts = (state, branch, path, pan) => [
16053
+ headerParts = (state, branch, path, across) => [
16009
16054
  branch,
16010
16055
  path,
16011
16056
  state.patches.length === 0 ? "nothing to read" : placeLabel(state),
@@ -16014,8 +16059,13 @@ var init_render = __esmMin((() => {
16014
16059
  contextLabel(state.context),
16015
16060
  state.layersStale ? "layers stale" : "",
16016
16061
  hiddenLines(state) === 0 ? "" : `⋯ ${hiddenLines(state)} ${hiddenLines(state) === 1 ? "line" : "lines"} hidden`,
16017
- pan === 0 ? "" : `→ ${pan} columns`
16062
+ panLabel(state, across)
16018
16063
  ];
16064
+ panLabel = (state, across) => {
16065
+ if (across.pan > 0) return `→ ${across.pan} columns`;
16066
+ if (state.wrap || across.cutOff === 0) return "";
16067
+ return `→ ${across.cutOff} columns cut off`;
16068
+ };
16019
16069
  HEADER_GAP = 2;
16020
16070
  HEADER_PATH_MIN = 20;
16021
16071
  headerRoom = (width) => Math.max(0, width - 2 - 4);
@@ -16096,7 +16146,8 @@ var init_render = __esmMin((() => {
16096
16146
  asked: "Waiting on you",
16097
16147
  with: "With the agent",
16098
16148
  answered: "Answered, not settled",
16099
- settled: "Settled"
16149
+ settled: "Settled",
16150
+ removed: "Withdrawn"
16100
16151
  };
16101
16152
  PANEL_ORDER = PANEL_SECTIONS;
16102
16153
  PANEL_LEAD = 3;
@@ -16493,7 +16544,10 @@ var init_render = __esmMin((() => {
16493
16544
  const branch = selectedBranch(state);
16494
16545
  if (atHome(state)) return t`${fg(palette.faint)("")}`;
16495
16546
  const path = selectedPatch(state)?.path ?? "";
16496
- const parts = headerParts(state, branch?.branch ?? "", path, Math.min(state.pan, this.view.panLimit())).filter((part) => part.length > 0);
16547
+ const parts = headerParts(state, branch?.branch ?? "", path, {
16548
+ pan: Math.min(state.pan, this.view.panLimit()),
16549
+ cutOff: this.view.panLimit()
16550
+ }).filter((part) => part.length > 0);
16497
16551
  const [name = "", ...rest] = headerFitted(parts, path, headerRoom(this.renderer.width));
16498
16552
  return t`${fg(palette.ink)(name)} ${fg(palette.muted)(rest.join(" "))}`;
16499
16553
  }
@@ -16848,10 +16902,7 @@ var init_render = __esmMin((() => {
16848
16902
  if (state.screen !== "compose") return;
16849
16903
  const room = composeRoom(this.renderer.width);
16850
16904
  const shownLines = Math.max(1, Math.min(SNIPPET_LINES, Math.floor(this.renderer.height / 6)));
16851
- const snippet = snippetOf(state, shownLines);
16852
- const more = selectedLineCount(state) - snippet.length;
16853
- const tail = more > 0 ? [` … ${more} more lines`] : [];
16854
- const quoted = [...snippet, ...tail].map((line) => clip(line, room.text));
16905
+ const quoted = quotedFor(state, shownLines, room.text);
16855
16906
  this.composeTitle.content = clip(composeTarget(state), room.text);
16856
16907
  this.composeQuoted.content = [...quoted, ""].join("\n");
16857
16908
  this.composeQuoted.height = quoted.length + 1;
@@ -17010,7 +17061,7 @@ var init_upgrade = __esmMin((() => {
17010
17061
  }));
17011
17062
  //#endregion
17012
17063
  //#region src/tui/app.ts
17013
- var LEAVING_MS, LOOK_MS, LEAVING_SAID, NOTHING_WRITTEN, layersAsk, askedFor, alongFrom, NOTICE_MS, KEY_HISTORY, DRAIN_PASSES, TRAIL_HISTORY, clockOf, momentOf, noticeOf, COPIERS, wayland, seedFor, handOver, throughMultiplexer, copyToClipboard, lineUnder, asKey, openedPull, LISTENS, WRITES, OVER, overReview, writesInto, listens, LETTER, laidOut, ARROWS, SHIFTED, keyName, App, sentAway, turnedOver, settledPath, restsWhereItLanded, lonelyGaps, chosenIn, settingsHeld, firstBranches, missing, openingOn, launch, told, untilDestroyed, runOn, runTui;
17064
+ var LEAVING_MS, LOOK_MS, LEAVING_SAID, NOTHING_WRITTEN, layersAsk, askedFor, alongFrom, NOTICE_MS, KEY_HISTORY, DRAIN_PASSES, TRAIL_HISTORY, clockOf, momentOf, noticeOf, COPIERS, wayland, seedFor, handOver, throughMultiplexer, copyToClipboard, lineUnder, asKey, openedPull, LISTENS, WRITES, OVER, overReview, writesInto, listens, LETTER, laidOut, ARROWS, SHIFTED, keyName, App, threadHere, sentAway, turnedOver, settledPath, restsWhereItLanded, lonelyGaps, chosenIn, settingsHeld, firstBranches, missing, openingOn, launch, told, untilDestroyed, runOn, runTui;
17014
17065
  var init_app = __esmMin((() => {
17015
17066
  init_dist();
17016
17067
  init_report();
@@ -17870,19 +17921,26 @@ var init_app = __esmMin((() => {
17870
17921
  removeHere() {
17871
17922
  return gen({ self: this }, function* () {
17872
17923
  const branch = selectedBranch(this.state);
17873
- const id = (threadChosen(this.state) ?? threadAtStop(this.state) ?? threadAtRow(this.state, this.state.cursor))?.id;
17924
+ const thread = threadHere(this.state);
17925
+ const id = thread?.id;
17874
17926
  if (branch === void 0 || id === void 0) {
17875
17927
  this.commit(withNotice(this.state, "no thread here"));
17876
17928
  return;
17877
17929
  }
17930
+ yield* this.turningOver(branch.branch, id, thread?.removed === true);
17931
+ });
17932
+ }
17933
+ turningOver(branch, id, back) {
17934
+ return gen({ self: this }, function* () {
17878
17935
  const was = this.state.panelIndex;
17879
- yield* this.removing(branch.branch, id);
17880
- const sent = yield* this.loadSent(branch.branch);
17881
- const held = withSent({
17936
+ yield* back ? this.restoring(branch, id) : this.removing(branch, id);
17937
+ const sent = yield* this.loadSent(branch);
17938
+ const kept = {
17882
17939
  ...this.state,
17883
17940
  opened: this.state.opened.filter((one) => one !== id)
17884
- }, sent);
17885
- this.commit(withNotice(this.staying(held, id, was), "removed, restore it with comment restore"));
17941
+ };
17942
+ const said = back ? "brought back" : "withdrawn, it is under Withdrawn in the review";
17943
+ this.commit(withNotice(this.staying(withSent(kept, sent), id, was), said));
17886
17944
  });
17887
17945
  }
17888
17946
  fillBranches() {
@@ -18047,6 +18105,10 @@ var init_app = __esmMin((() => {
18047
18105
  const worktree = this.worktreeFor(branch);
18048
18106
  return worktree === void 0 ? settleThread(this.repo, branch, id, at) : settleIn(worktree, id, at);
18049
18107
  }
18108
+ restoring(branch, id) {
18109
+ const worktree = this.worktreeFor(branch);
18110
+ return worktree === void 0 ? restoreComment(this.repo, branch, id) : restoreIn(worktree, id);
18111
+ }
18050
18112
  removing(branch, id) {
18051
18113
  const at = (/* @__PURE__ */ new Date()).toISOString();
18052
18114
  const worktree = this.worktreeFor(branch);
@@ -18245,6 +18307,7 @@ var init_app = __esmMin((() => {
18245
18307
  });
18246
18308
  }
18247
18309
  };
18310
+ threadHere = (state) => threadChosen(state) ?? threadAtStop(state) ?? threadAtRow(state, state.cursor);
18248
18311
  sentAway = (state) => ({
18249
18312
  ...state,
18250
18313
  screen: "review",
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.112",
26
+ "version": "0.1.0-alpha.114",
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": {