@eliya-oss/agent-diff 0.1.0-alpha.165 → 0.1.0-alpha.166

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @eliya-oss/agent-diff
2
2
 
3
+ ## 0.1.0-alpha.166
4
+
5
+ ### Patch Changes
6
+
7
+ - feat(diff): A click moves the keys into the pane it landed in, opens the file or layer it landed on in the rail, and stands the cursor on the thread it landed on in the review panel.
8
+
9
+ - feat(review): `l` on a thread in the review panel reads it in full over the diff — the whole path, every message and the code it was written on, wrapped rather than cut — and a section counts the threads it holds whether its fold is open or shut.
10
+
3
11
  ## 0.1.0-alpha.165
4
12
 
5
13
  ### Patch Changes
package/dist/main.js CHANGED
@@ -11373,7 +11373,7 @@ var init_pane = __esmMin((() => {
11373
11373
  //#region package.json
11374
11374
  init_drafts();
11375
11375
  init_pane();
11376
- var version$1 = "0.1.0-alpha.165";
11376
+ var version$1 = "0.1.0-alpha.166";
11377
11377
  //#endregion
11378
11378
  //#region src/cli/upgrade.ts
11379
11379
  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$1, sayFound, sayDone, attempted, SAY_SKILL_TOO, upgradeReport;
@@ -15707,7 +15707,7 @@ var init_command = __esmMin((() => {
15707
15707
  "hide",
15708
15708
  "shrink"
15709
15709
  ],
15710
- title: "Close the folder, layer, gap, or settled thread",
15710
+ title: "Close the folder, layer, gap, or the thread in the panel",
15711
15711
  category: "Files",
15712
15712
  keys: ["h"],
15713
15713
  screens: ["review"]
@@ -15720,7 +15720,7 @@ var init_command = __esmMin((() => {
15720
15720
  "show more",
15721
15721
  "open"
15722
15722
  ],
15723
- title: "Open the folder, layer, gap, or settled thread",
15723
+ title: "Open the folder, layer, gap, or the thread in the panel",
15724
15724
  category: "Files",
15725
15725
  keys: ["l"],
15726
15726
  screens: ["review"]
@@ -15947,7 +15947,8 @@ var init_command = __esmMin((() => {
15947
15947
  "palette",
15948
15948
  "report",
15949
15949
  "search",
15950
- "keys"
15950
+ "keys",
15951
+ "thread"
15951
15952
  ],
15952
15953
  hint: "back",
15953
15954
  listed: false,
@@ -16057,7 +16058,7 @@ var init_match = __esmMin((() => {
16057
16058
  }));
16058
16059
  //#endregion
16059
16060
  //#region src/tui/reduce.ts
16060
- var clamp, lastRow, rowsIn, withCursorVisible, moveCursor, stepStop, scrolled, restingOn, draggedTo, pickedIn, atRow, noneLeft, layerHunk, nextFileWithComments, atComment, nothingOpen, layerComment, PAN_STEP, panned, moveLayer, inRail, railScrolled, movePanel, layerDown, stepsToEnd, toTop, farOff, byHalf, boundedStep, PANEL_FAR, PANES, paneShown, panesShown, focusStepped, togglePanel, toggleNav, packedAway, zoom, toggleRail, foldDirectory, foldLayer, foldThread, foldMoved, overFold, fold, moveBranch, landingOn, revealing, atTheEnd, moveFile, selectHunk, swapEnds, atBranch, grownBy, startSelection, draftMark, openCompose, outOfDiff, BACK_FROM, goBack, walkMatches, openPalette, openKeys, openSettings, moveSettings, flipSetting, moveRef, withChoices, withRefs, movePalette, paletteMatches, keyMatches, offered, paletteChoice, transitions, reduce, resumedAt, atFile, withContext, withFull, allRevealed, revealsAfter, gapShown, gapOpened, panBy, withRemarks, withSent, withArrived, withColumns, laidOver, onLayerHolding, withLayers, withPulls, withSilentForge, withBranches, withSource, withVouched, restoredTo, openedAt, withPatches, TAB_WIDTH, SPACE_CODE, ERASED_FROM, ERASED_TO, readable, legible, withDraft, paletteMoved, paletteClosed, withWaiting, withFinder, withMatches, withAround, withNoticeHere, withNotice;
16061
+ var clamp, lastRow, rowsIn, withCursorVisible, moveCursor, stepStop, scrolled, restingOn, draggedTo, pickedIn, atRow, noneLeft, layerHunk, nextFileWithComments, atComment, nothingOpen, layerComment, PAN_STEP, panned, atLayer, moveLayer, inRail, railScrolled, movePanel, layerDown, stepsToEnd, toTop, farOff, byHalf, boundedStep, PANEL_FAR, PANES, paneShown, panesShown, focusStepped, togglePanel, toggleNav, packedAway, zoom, toggleRail, foldDirectory, foldLayer, foldThread, foldMoved, overFold, readingThread, overThread, fold, moveBranch, landingOn, revealing, atTheEnd, moveFile, selectHunk, swapEnds, atBranch, grownBy, startSelection, draftMark, openCompose, outOfDiff, BACK_FROM, goBack, walkMatches, openPalette, openKeys, openSettings, moveSettings, flipSetting, moveRef, withChoices, withRefs, movePalette, paletteMatches, keyMatches, offered, paletteChoice, transitions, reduce, resumedAt, atFile, withContext, withFull, allRevealed, revealsAfter, gapShown, gapOpened, panBy, withRemarks, withSent, withArrived, withColumns, laidOver, onLayerHolding, withLayers, withPulls, withSilentForge, withBranches, withSource, withVouched, restoredTo, openedAt, withPatches, TAB_WIDTH, SPACE_CODE, ERASED_FROM, ERASED_TO, readable, legible, withDraft, paletteMoved, paletteClosed, withWaiting, withFinder, withMatches, withAround, withNoticeHere, withNotice;
16061
16062
  var init_reduce = __esmMin((() => {
16062
16063
  init_dist();
16063
16064
  init_patch();
@@ -16197,6 +16198,26 @@ var init_reduce = __esmMin((() => {
16197
16198
  pan: Math.max(0, state.pan + delta)
16198
16199
  };
16199
16200
  };
16201
+ atLayer = (state, layer) => {
16202
+ const landed = readingOrder(state).find((one) => one.layer === layer);
16203
+ if (landed === void 0) return {
16204
+ ...state,
16205
+ layerIndex: layer
16206
+ };
16207
+ return {
16208
+ ...state,
16209
+ layerIndex: layer,
16210
+ openLayers: state.openLayers.includes(layer) ? state.openLayers : [...state.openLayers, layer],
16211
+ patchIndex: landed.file,
16212
+ top: 0,
16213
+ cursor: landingOn({
16214
+ ...state,
16215
+ layerIndex: layer
16216
+ }, landed.file),
16217
+ anchorRow: 0,
16218
+ selecting: false
16219
+ };
16220
+ };
16200
16221
  moveLayer = (state, delta) => {
16201
16222
  const order = readingOrder(state);
16202
16223
  if (order.length === 0) return state;
@@ -16374,8 +16395,15 @@ var init_reduce = __esmMin((() => {
16374
16395
  panelIndex: state.panelIndex + 1
16375
16396
  };
16376
16397
  overFold = (state) => state.focus === "review" && panelEntry(state)?.kind === "fold";
16398
+ readingThread = (state) => ({
16399
+ ...state,
16400
+ screen: "thread",
16401
+ returnTo: state.screen
16402
+ });
16403
+ overThread = (state) => state.focus === "review" && panelEntry(state) !== void 0;
16377
16404
  fold = (state, shut) => {
16378
16405
  if (overFold(state)) return foldMoved(state, shut);
16406
+ if (!shut && overThread(state)) return readingThread(state);
16379
16407
  const thread = threadAtStop(state);
16380
16408
  if (thread?.id !== void 0 && thread.settled === true) return foldThread(state, shut, thread.id);
16381
16409
  return onLayers(state) ? foldLayer(state, shut) : foldDirectory(state, shut);
@@ -16521,6 +16549,10 @@ var init_reduce = __esmMin((() => {
16521
16549
  ...state,
16522
16550
  screen: state.returnTo
16523
16551
  }),
16552
+ thread: (state) => ({
16553
+ ...state,
16554
+ screen: state.returnTo
16555
+ }),
16524
16556
  compose: (state) => ({
16525
16557
  ...state,
16526
16558
  screen: "review",
@@ -17849,7 +17881,7 @@ var init_diffview = __esmMin((() => {
17849
17881
  }));
17850
17882
  //#endregion
17851
17883
  //#region src/tui/render.ts
17852
- 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, SETTING_LEAD, settingsText, stack, makeBody, makeHome, makeModals, makeBaseParts, 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, 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, panelText, Screen;
17884
+ 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, SETTING_LEAD, settingsText, stack, makeBody, makeHome, makeModals, makeBaseParts, 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;
17853
17885
  var init_render = __esmMin((() => {
17854
17886
  init_dist();
17855
17887
  init_command();
@@ -18266,6 +18298,7 @@ var init_render = __esmMin((() => {
18266
18298
  found: makeFoundParts(renderer),
18267
18299
  keys: makeKeysParts(renderer),
18268
18300
  settings: makeSettingsParts(renderer),
18301
+ reader: makeReaderParts(renderer),
18269
18302
  bases: makeBaseParts(renderer)
18270
18303
  });
18271
18304
  makeBaseParts = (renderer) => {
@@ -18284,6 +18317,19 @@ var init_render = __esmMin((() => {
18284
18317
  choices
18285
18318
  };
18286
18319
  };
18320
+ makeReaderParts = (renderer) => {
18321
+ const box = makePalette(renderer);
18322
+ const title = bar(renderer, "reader-title", palette.faint);
18323
+ const choices = makeChoices(renderer);
18324
+ box.id = "reader";
18325
+ box.add(title);
18326
+ box.add(choices);
18327
+ return {
18328
+ box,
18329
+ title,
18330
+ choices
18331
+ };
18332
+ };
18287
18333
  makeSettingsParts = (renderer) => {
18288
18334
  const box = makePalette(renderer);
18289
18335
  const title = bar(renderer, "settings-title", palette.faint);
@@ -18772,6 +18818,34 @@ var init_render = __esmMin((() => {
18772
18818
  onRemoved: threadHere(state)?.removed === true,
18773
18819
  onHeld: state.focus === "review" && panelEntry(state)?.section === "held"
18774
18820
  });
18821
+ readerTitle = (state, entry) => {
18822
+ if (entry.kind === "fold") return "The branch moved past these";
18823
+ const where = wherePart(state, entry).replace(" · ", "").trim();
18824
+ return where.length === 0 ? "This thread" : `This thread · ${where}`;
18825
+ };
18826
+ voicesOf = (entry) => {
18827
+ if (entry.kind === "fold") return [];
18828
+ if (entry.kind === "remark") return [`@${entry.remark.by} ${entry.remark.body}`, ...entry.remark.replies.map((reply) => `@${reply.by} ${reply.body}`)];
18829
+ const turns = entry.comment.turns;
18830
+ if (turns === void 0 || turns.length === 0) return [entry.comment.body];
18831
+ return turns.map((turn) => `${turn.voice === "agent" ? "↳" : "»"} ${turn.body}`);
18832
+ };
18833
+ readerText = (entry, room) => {
18834
+ const named = entry.kind === "fold" ? [] : [...wrapped(panelFile(entry), room), ""];
18835
+ const said = voicesOf(entry).flatMap((line) => wrapped(line, room));
18836
+ const code = lostCode(entry);
18837
+ const quoted = code.length === 0 ? [] : [
18838
+ "",
18839
+ "the code it was written on",
18840
+ ...code.map((line) => `│ ${line.trim()}`)
18841
+ ];
18842
+ const rows = [
18843
+ ...named,
18844
+ ...said,
18845
+ ...quoted
18846
+ ].flatMap((line) => wrapped(line, room));
18847
+ return new StyledText(rows.map((line) => fg(line.startsWith("│") ? palette.faint : palette.ink)(`${line.padEnd(room)}\n`)));
18848
+ };
18775
18849
  PANEL_TITLES = {
18776
18850
  remarks: "Remarks",
18777
18851
  dismissed: "Dismissed",
@@ -18963,7 +19037,8 @@ var init_render = __esmMin((() => {
18963
19037
  return [{
18964
19038
  text: clip(text, room),
18965
19039
  tone: palette.faint,
18966
- here
19040
+ here,
19041
+ at: placed.at
18967
19042
  }];
18968
19043
  };
18969
19044
  panelPair = (state, placed, room) => {
@@ -18975,12 +19050,14 @@ var init_render = __esmMin((() => {
18975
19050
  {
18976
19051
  text: `${lead}${panelWhere(state, entry, room - PANEL_LEAD)}`,
18977
19052
  tone: palette.ink,
18978
- here
19053
+ here,
19054
+ at: placed.at
18979
19055
  },
18980
19056
  {
18981
19057
  text: ` ${clip(panelBody(entry), Math.max(4, room - PANEL_LEAD))}`,
18982
19058
  tone: palette.muted,
18983
- here
19059
+ here,
19060
+ at: placed.at
18984
19061
  },
18985
19062
  ...writtenOn(state, placed, room)
18986
19063
  ];
@@ -18988,13 +19065,14 @@ var init_render = __esmMin((() => {
18988
19065
  panelSection = (state, placed, section, room) => {
18989
19066
  const here = placed.filter((one) => one.entry.section === section);
18990
19067
  if (here.length === 0) return [];
19068
+ const counted = panelHolds(state).filter((entry) => entry.section === section).length;
18991
19069
  return [
18992
19070
  {
18993
19071
  text: "",
18994
19072
  tone: palette.faint
18995
19073
  },
18996
19074
  {
18997
- text: `${PANEL_TITLES[section]} ${here.length}`,
19075
+ text: `${PANEL_TITLES[section]} ${counted}`,
18998
19076
  tone: palette.faint
18999
19077
  },
19000
19078
  ...here.flatMap((one) => panelPair(state, one, room))
@@ -19020,7 +19098,11 @@ var init_render = __esmMin((() => {
19020
19098
  text: clip(` ${mark} ${count} more`, room),
19021
19099
  tone: palette.faint
19022
19100
  }];
19023
- panelText = (state, room, rows) => {
19101
+ panelPicked = (banner, above, lines) => [...Array.from({ length: banner + (above > 0 ? 1 : 0) }, () => ({ pane: "review" })), ...lines.map((line) => ({
19102
+ pane: "review",
19103
+ entry: line.at
19104
+ }))];
19105
+ panelText = (state, room, rows, picked) => {
19024
19106
  const placed = panelEntries(state).map((entry, at) => ({
19025
19107
  entry,
19026
19108
  at
@@ -19046,6 +19128,7 @@ var init_render = __esmMin((() => {
19046
19128
  ...window.lines,
19047
19129
  ...moreLine(window.below, "▼", room)
19048
19130
  ];
19131
+ picked?.(panelPicked(banner.length, window.above, shown.slice(banner.length)));
19049
19132
  return new StyledText(shown.map((line) => {
19050
19133
  const drawn = fg(line.tone)(`${line.text.padEnd(room)}\n`);
19051
19134
  return line.here === true ? bg(restingOrHere(state.focus === "review"))(drawn) : drawn;
@@ -19090,15 +19173,14 @@ var init_render = __esmMin((() => {
19090
19173
  settingsTitle;
19091
19174
  settingsChoices;
19092
19175
  keysQuery;
19093
- foundQuery;
19094
19176
  keysChoices;
19095
19177
  keysLegend;
19096
- found;
19097
- foundTitle;
19098
- foundPeek;
19099
- foundChoices;
19178
+ reader;
19179
+ foundBox;
19100
19180
  renderer;
19101
19181
  mouse;
19182
+ listPicks = [];
19183
+ panelPicks = [];
19102
19184
  dragFrom;
19103
19185
  lastTop = 0;
19104
19186
  constructor(renderer, repo = "") {
@@ -19144,11 +19226,8 @@ var init_render = __esmMin((() => {
19144
19226
  this.keysChoices = modals.keys.choices;
19145
19227
  this.keysLegend = modals.keys.legend;
19146
19228
  this.baseBox = modals.bases;
19147
- this.found = modals.found.box;
19148
- this.foundTitle = modals.found.title;
19149
- this.foundQuery = modals.found.query;
19150
- this.foundPeek = modals.found.peek;
19151
- this.foundChoices = modals.found.choices;
19229
+ this.reader = modals.reader;
19230
+ this.foundBox = modals.found;
19152
19231
  this.assemble(renderer);
19153
19232
  }
19154
19233
  wheelOnRail(box) {
@@ -19165,8 +19244,16 @@ var init_render = __esmMin((() => {
19165
19244
  this.mouse?.onScroll(way === "down" ? 1 : -1);
19166
19245
  };
19167
19246
  }
19247
+ clickIn(box, picks, pane) {
19248
+ return (event) => {
19249
+ const found = picks()[Math.max(0, event.y - box.y)];
19250
+ this.mouse?.onClick(found ?? { pane });
19251
+ };
19252
+ }
19168
19253
  listen(mouse) {
19169
19254
  this.mouse = mouse;
19255
+ this.list.onMouseDown = this.clickIn(this.list, () => this.listPicks, "tree");
19256
+ this.panel.onMouseDown = this.clickIn(this.panel, () => this.panelPicks, "review");
19170
19257
  this.wheelOnSheet(this.keys);
19171
19258
  this.wheelOnSheet(this.palette);
19172
19259
  this.wheelOnRail(this.listPane);
@@ -19220,7 +19307,7 @@ var init_render = __esmMin((() => {
19220
19307
  asking(screen) {
19221
19308
  switch (screen) {
19222
19309
  case "palette": return this.paletteQuery;
19223
- case "search": return this.foundQuery;
19310
+ case "search": return this.foundBox.query;
19224
19311
  case "keys": return this.keysQuery;
19225
19312
  case "base":
19226
19313
  case "editor": return this.baseBox.query;
@@ -19267,6 +19354,7 @@ var init_render = __esmMin((() => {
19267
19354
  this.paintKeys(state);
19268
19355
  this.paintSettings(state);
19269
19356
  this.paintBases(state);
19357
+ this.paintReader(state);
19270
19358
  this.paintFound(state);
19271
19359
  this.paintReport(state);
19272
19360
  this.scrim.visible = state.screen !== "branches" && state.screen !== "review";
@@ -19333,6 +19421,22 @@ var init_render = __esmMin((() => {
19333
19421
  this.settings.left = Math.max(1, Math.floor((this.renderer.width - room) / 2));
19334
19422
  this.settings.top = panelTop(this.renderer.height, PANEL_QUARTER);
19335
19423
  }
19424
+ paintReader(state) {
19425
+ const entry = panelEntry(state);
19426
+ this.reader.box.visible = state.screen === "thread" && entry !== void 0;
19427
+ if (state.screen !== "thread" || entry === void 0) {
19428
+ this.reader.title.content = "";
19429
+ this.reader.choices.content = "";
19430
+ return;
19431
+ }
19432
+ const room = panelWidth(this.renderer.width);
19433
+ this.reader.title.content = clip(readerTitle(state, entry), room - MODAL_ROOM);
19434
+ this.reader.choices.content = readerText(entry, room - MODAL_ROOM);
19435
+ this.reader.box.height = Math.min(panelRows(this.renderer.height, PANEL_QUARTER), voicesOf(entry).length + lostCode(entry).length + PALETTE_CHROME + 8);
19436
+ this.reader.box.width = room;
19437
+ this.reader.box.left = Math.max(1, Math.floor((this.renderer.width - room) / 2));
19438
+ this.reader.box.top = panelTop(this.renderer.height, PANEL_QUARTER);
19439
+ }
19336
19440
  paintKeys(state) {
19337
19441
  this.keys.visible = state.screen === "keys";
19338
19442
  if (state.screen !== "keys") {
@@ -19406,7 +19510,7 @@ var init_render = __esmMin((() => {
19406
19510
  this.panelPane.paddingLeft = shown ? 1 : 0;
19407
19511
  this.panelPane.paddingTop = 0;
19408
19512
  const rows = Math.max(1, this.panelPane.height - PANE_EDGES);
19409
- this.panel.content = shown ? panelText(state, reviewWidth() - PANE_CHROME, rows) : "";
19513
+ this.panel.content = shown ? panelText(state, reviewWidth() - PANE_CHROME, rows, (found) => this.panelPicks = found) : "";
19410
19514
  }
19411
19515
  listText(state) {
19412
19516
  if (atHome(state)) return this.branchTable(state);
@@ -19415,6 +19519,10 @@ var init_render = __esmMin((() => {
19415
19519
  const pane = this.paneRoom();
19416
19520
  const whole = treeWindow(state, room);
19417
19521
  const window = whole.more === 0 ? whole : treeWindow(state, Math.max(1, room - 1));
19522
+ this.listPicks = window.rows.map((row) => ({
19523
+ pane: "tree",
19524
+ file: row.fileIndex
19525
+ }));
19418
19526
  const rows = window.rows.flatMap((row) => {
19419
19527
  const drawn = fg(row.kind === "file" ? palette.ink : palette.muted)(`${treeLine(state, row, pane)}\n`);
19420
19528
  return [row.fileIndex === state.patchIndex ? bg(restingOrHere(state.focus === "tree"))(drawn) : drawn];
@@ -19433,6 +19541,12 @@ var init_render = __esmMin((() => {
19433
19541
  const height = Math.max(1, this.listRoom() - banner);
19434
19542
  const all = layerFitted(state, room, height);
19435
19543
  const window = this.railFitted(state, all, height);
19544
+ const lead = said.length + (state.layersStale ? 1 : 0) + (window.above > 0 ? 1 : 0);
19545
+ this.listPicks = [...Array.from({ length: lead }, () => ({ pane: "tree" })), ...window.rows.map((row) => ({
19546
+ pane: "tree",
19547
+ file: row.fileIndex,
19548
+ layer: row.index
19549
+ }))];
19436
19550
  const rows = window.rows.flatMap((row) => this.layerLine(state, row, room));
19437
19551
  const above = window.above > 0 ? [fg(palette.faint)(` ▲ ${window.above} more\n`)] : [];
19438
19552
  const more = window.more > 0 ? [fg(palette.faint)(` ▼ ${window.more} more`)] : [];
@@ -19502,9 +19616,10 @@ var init_render = __esmMin((() => {
19502
19616
  this.scrim,
19503
19617
  this.compose,
19504
19618
  this.palette,
19505
- this.found,
19619
+ this.foundBox.box,
19506
19620
  this.keys,
19507
19621
  this.settings,
19622
+ this.reader.box,
19508
19623
  this.baseBox.box
19509
19624
  ]);
19510
19625
  }
@@ -19617,28 +19732,28 @@ var init_render = __esmMin((() => {
19617
19732
  this.listPane.justifyContent = place;
19618
19733
  }
19619
19734
  paintFound(state) {
19620
- this.found.visible = state.screen === "search";
19735
+ this.foundBox.box.visible = state.screen === "search";
19621
19736
  if (state.screen !== "search") {
19622
- this.foundTitle.content = "";
19623
- this.foundPeek.content = "";
19624
- this.foundChoices.content = "";
19737
+ this.foundBox.title.content = "";
19738
+ this.foundBox.peek.content = "";
19739
+ this.foundBox.choices.content = "";
19625
19740
  return;
19626
19741
  }
19627
19742
  const room = panelWidth(this.renderer.width);
19628
19743
  const wide = Math.max(1, room - MODAL_ROOM);
19629
- this.foundTitle.content = foundTitle(state, wide);
19744
+ this.foundBox.title.content = foundTitle(state, wide);
19630
19745
  const shown = shownMatches(state);
19631
19746
  const most = panelRows(this.renderer.height, PANEL_FIFTH);
19632
19747
  const { blocks, chosen } = foundBlocks(state, shown, wide);
19633
19748
  const tall = Math.max(FOUND_LEAST, most - PALETTE_CHROME);
19634
19749
  const window = windowedBlocks(blocks, chosen, tall);
19635
- this.foundChoices.content = blocks.length === 0 ? new StyledText([fg(palette.faint)(nothingYet(state, wide))]) : new StyledText([...window.chunks]);
19636
- this.foundPeek.content = "";
19637
- this.foundPeek.height = 0;
19638
- this.found.height = Math.min(most, Math.max(FOUND_LEAST, window.rows) + PALETTE_CHROME);
19639
- this.found.width = room;
19640
- this.found.left = Math.max(1, Math.floor((this.renderer.width - room) / 2));
19641
- this.found.top = panelTop(this.renderer.height, PANEL_FIFTH);
19750
+ this.foundBox.choices.content = blocks.length === 0 ? new StyledText([fg(palette.faint)(nothingYet(state, wide))]) : new StyledText([...window.chunks]);
19751
+ this.foundBox.peek.content = "";
19752
+ this.foundBox.peek.height = 0;
19753
+ this.foundBox.box.height = Math.min(most, Math.max(FOUND_LEAST, window.rows) + PALETTE_CHROME);
19754
+ this.foundBox.box.width = room;
19755
+ this.foundBox.box.left = Math.max(1, Math.floor((this.renderer.width - room) / 2));
19756
+ this.foundBox.box.top = panelTop(this.renderer.height, PANEL_FIFTH);
19642
19757
  }
19643
19758
  paintReport(state) {
19644
19759
  this.compose.visible = state.screen === "compose" || state.screen === "report";
@@ -20034,7 +20149,8 @@ var init_app = __esmMin((() => {
20034
20149
  "search",
20035
20150
  "settings",
20036
20151
  "base",
20037
- "editor"
20152
+ "editor",
20153
+ "thread"
20038
20154
  ]);
20039
20155
  overReview = (screen) => OVER.has(screen);
20040
20156
  writesInto = (screen) => WRITES.has(screen);
@@ -20132,6 +20248,7 @@ var init_app = __esmMin((() => {
20132
20248
  this.intents = options.intents;
20133
20249
  const { renderer } = options;
20134
20250
  runSync(this.display.listen({
20251
+ onClick: (what) => this.dispatchTask(this.clicked(what)),
20135
20252
  onScroll: (delta) => this.onWheel(delta),
20136
20253
  onPan: (delta) => this.onPanWheel(delta),
20137
20254
  onDrag: (from, to, done) => this.dragged(from, to, done),
@@ -20307,6 +20424,34 @@ var init_app = __esmMin((() => {
20307
20424
  const fiber = this.lighting;
20308
20425
  return fiber === void 0 ? void_ : asVoid(await_(fiber));
20309
20426
  }
20427
+ clicked(what) {
20428
+ return gen({ self: this }, function* () {
20429
+ const held = {
20430
+ ...this.measured(),
20431
+ focus: what.pane
20432
+ };
20433
+ if (what.entry !== void 0) {
20434
+ this.commit({
20435
+ ...held,
20436
+ panelIndex: what.entry
20437
+ });
20438
+ return;
20439
+ }
20440
+ if (what.layer !== void 0 && onLayers(held)) {
20441
+ const was = held.patchIndex;
20442
+ const moved = atLayer(held, what.layer);
20443
+ this.commit(what.file === void 0 ? moved : atFile(moved, what.file));
20444
+ if (this.state.patchIndex !== was) yield* this.turnedTo();
20445
+ return;
20446
+ }
20447
+ if (what.file === void 0 || what.file === held.patchIndex) {
20448
+ this.commit(held);
20449
+ return;
20450
+ }
20451
+ this.commit(atFile(held, what.file));
20452
+ yield* this.turnedTo();
20453
+ });
20454
+ }
20310
20455
  onWheel(delta) {
20311
20456
  this.wheel += delta;
20312
20457
  this.renderer.requestRender();
@@ -20716,7 +20861,10 @@ var init_app = __esmMin((() => {
20716
20861
  });
20717
20862
  }
20718
20863
  dragged(from, to, done) {
20719
- const held = this.measured();
20864
+ const held = {
20865
+ ...this.measured(),
20866
+ focus: "diff"
20867
+ };
20720
20868
  if (restsWhereItLanded(from, to) && !this.selectingNow) {
20721
20869
  this.commit(restingOn(held, from.row));
20722
20870
  return;
@@ -20916,7 +21064,12 @@ var init_app = __esmMin((() => {
20916
21064
  const shown = selectedPatch(wide);
20917
21065
  if (shown === void 0 || rowShowing(shown, entry.comment.end) === void 0) {
20918
21066
  yield* this.readAnswers(entry.comment.id);
20919
- this.commit(withNoticeHere(this.state, "the diff no longer has that line · the panel shows the code it was written on"));
21067
+ const said = withNoticeHere(this.state, "the diff no longer has that line");
21068
+ this.commit({
21069
+ ...said,
21070
+ screen: "thread",
21071
+ returnTo: said.screen
21072
+ });
20920
21073
  return;
20921
21074
  }
20922
21075
  this.commit(openedAt({
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.165",
26
+ "version": "0.1.0-alpha.166",
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": {