@eliya-oss/agent-diff 0.1.0-alpha.164 → 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/.claude/skills/create-pr/SKILL.md +15 -0
- package/.claude/skills/release-notes/SKILL.md +14 -0
- package/CHANGELOG.md +14 -0
- package/dist/main.js +287 -48
- package/package.json +1 -1
|
@@ -118,6 +118,21 @@ duration, no dimensions, no file size.
|
|
|
118
118
|
After the prose and after `## What changed`, before anything else. A reviewer reads what changed,
|
|
119
119
|
then watches it.
|
|
120
120
|
|
|
121
|
+
## The whole template
|
|
122
|
+
|
|
123
|
+
```markdown
|
|
124
|
+
### What changed
|
|
125
|
+
|
|
126
|
+
<one paragraph, 200-300 characters, high level, technical>
|
|
127
|
+
|
|
128
|
+
### Recorded tests
|
|
129
|
+
|
|
130
|
+
<the pnpm record section, when the branch adds tests that press keys>
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Two headings, in that order, and nothing else: no prose above `### What changed`, no "why", no
|
|
134
|
+
investigation, no test counts. A branch with no recordings carries the first heading alone.
|
|
135
|
+
|
|
121
136
|
## Check the body before it is posted
|
|
122
137
|
|
|
123
138
|
```bash
|
|
@@ -209,6 +209,20 @@ The repro. Then what the fix was.
|
|
|
209
209
|
"verified twice". CI says whether the tests pass.
|
|
210
210
|
- **Anything from a private repository.** See below.
|
|
211
211
|
|
|
212
|
+
### The template
|
|
213
|
+
|
|
214
|
+
A body is two headings and nothing else:
|
|
215
|
+
|
|
216
|
+
```markdown
|
|
217
|
+
### What changed
|
|
218
|
+
|
|
219
|
+
<one paragraph, 200-300 characters, high level, technical>
|
|
220
|
+
|
|
221
|
+
### Recorded tests
|
|
222
|
+
|
|
223
|
+
<what pnpm record printed>
|
|
224
|
+
```
|
|
225
|
+
|
|
212
226
|
### The body says what changed, and nothing about who asked
|
|
213
227
|
|
|
214
228
|
A body is the change, not its history. Two rules, and a command that enforces both:
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
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
|
+
|
|
11
|
+
## 0.1.0-alpha.165
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- fix(review): A comment is called lost only when its line is gone from the whole file, not merely from the shown hunks, and the ones the branch really moved past are folded into a section of their own that says how many there are and opens with `l`.
|
|
16
|
+
|
|
3
17
|
## 0.1.0-alpha.164
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/main.js
CHANGED
|
@@ -10577,7 +10577,7 @@ var init_error = __esmMin((() => {
|
|
|
10577
10577
|
}));
|
|
10578
10578
|
//#endregion
|
|
10579
10579
|
//#region src/cli/commands.ts
|
|
10580
|
-
var realOf, CONTEXT, POLL, AUTO, askedFor$1, basedOn, worktreeNamed, findBranch, baseFor, patchesOf, findPatch, waitingOn, summaryOf, summaryFor, listBranches, readParts, blobOf, vouchIn, toggleVouch, readingOf, progressIn, reviewProgress, bodyOf, saidTo, spunOf, sentOf, whereItSitsNow$1, sentIn, listSent, anchorIn, commentsIn, commentIn, submitComment, submitComments, without$2, submitReply, listPatches, patchIn, flatten, threadBefore, takeComments, repoOf$1, worktreeOf$1, branchAt, awaitComments, saveReport, fileSource, fileBefore, readPreferences, readPreference, ON, OFF, preferenceValue, savePreference, listRefs, setBase, clearBase, markRead;
|
|
10580
|
+
var realOf, CONTEXT, POLL, AUTO, askedFor$1, basedOn, worktreeNamed, findBranch, baseFor, patchesOf, findPatch, waitingOn, summaryOf, summaryFor, listBranches, readParts, blobOf, vouchIn, toggleVouch, readingOf, progressIn, reviewProgress, bodyOf, saidTo, spunOf, sentOf, whereItSitsNow$1, linesIn, lastLineOf, nearestLine, stillInFile, foundOutsideTheHunks, sentIn, listSent, anchorIn, commentsIn, commentIn, submitComment, submitComments, without$2, submitReply, listPatches, patchIn, flatten, threadBefore, takeComments, repoOf$1, worktreeOf$1, branchAt, awaitComments, saveReport, fileSource, fileBefore, readPreferences, readPreference, ON, OFF, preferenceValue, savePreference, listRefs, setBase, clearBase, markRead;
|
|
10581
10581
|
var init_commands = __esmMin((() => {
|
|
10582
10582
|
init_dist();
|
|
10583
10583
|
init_patch();
|
|
@@ -10844,13 +10844,43 @@ var init_commands = __esmMin((() => {
|
|
|
10844
10844
|
})
|
|
10845
10845
|
});
|
|
10846
10846
|
};
|
|
10847
|
+
linesIn = (found) => getOrElse$1(found, () => []);
|
|
10848
|
+
lastLineOf = (snippet) => snippet.split("\n").map((line) => line.trim()).findLast((line) => line.length > 0) ?? "";
|
|
10849
|
+
nearestLine = (source, wanted, was) => {
|
|
10850
|
+
const found = source.flatMap((line, at) => line.trim() === wanted ? [at + 1] : []);
|
|
10851
|
+
if (found.length === 0) return void 0;
|
|
10852
|
+
return found.reduce((best, line) => Math.abs(line - was) < Math.abs(best - was) ? line : best);
|
|
10853
|
+
};
|
|
10854
|
+
stillInFile = (comment, source) => {
|
|
10855
|
+
const line = nearestLine(source, lastLineOf(comment.snippet), comment.end);
|
|
10856
|
+
if (line === void 0) return comment;
|
|
10857
|
+
const span = Math.max(0, comment.end - comment.start);
|
|
10858
|
+
return {
|
|
10859
|
+
...comment,
|
|
10860
|
+
start: line - span,
|
|
10861
|
+
end: line,
|
|
10862
|
+
placed: true
|
|
10863
|
+
};
|
|
10864
|
+
};
|
|
10865
|
+
foundOutsideTheHunks = fn("Cli.foundOutsideTheHunks")(function* (worktree, held, shown) {
|
|
10866
|
+
const wanted = held.filter((comment) => comment.placed === false && shown.has(comment.file) && comment.start !== 1e5 && comment.snippet.trim().length > 0);
|
|
10867
|
+
if (wanted.length === 0) return held;
|
|
10868
|
+
const git = yield* Git;
|
|
10869
|
+
const paths = [...new Set(wanted.map((comment) => comment.file))];
|
|
10870
|
+
const readOne = (path) => map(git.source(worktree, path), (found) => [path, linesIn(found)]);
|
|
10871
|
+
const read = yield* forEach(paths, readOne);
|
|
10872
|
+
const sources = new Map(read);
|
|
10873
|
+
const asked = new Set(wanted.map((comment) => comment.id));
|
|
10874
|
+
return held.map((comment) => asked.has(comment.id) ? stillInFile(comment, sources.get(comment.file) ?? []) : comment);
|
|
10875
|
+
});
|
|
10847
10876
|
sentIn = fn("Cli.sentIn")(function* (reading) {
|
|
10848
10877
|
const store = yield* Store;
|
|
10849
10878
|
const worktree = reading.worktree;
|
|
10850
10879
|
const spoken = yield* store.answers(worktree.path);
|
|
10851
10880
|
const current = yield* store.state(worktree.path);
|
|
10852
10881
|
const shown = new Set(reading.patches.map((patch) => patch.path));
|
|
10853
|
-
const
|
|
10882
|
+
const placed = flatten(yield* store.inbox(worktree.path)).map((comment) => whereItSitsNow$1(reading.patches, comment));
|
|
10883
|
+
const held = yield* foundOutsideTheHunks(worktree, placed, shown);
|
|
10854
10884
|
const replies = held.filter((comment) => comment.replyTo !== void 0);
|
|
10855
10885
|
const conversation = {
|
|
10856
10886
|
spoken,
|
|
@@ -11343,7 +11373,7 @@ var init_pane = __esmMin((() => {
|
|
|
11343
11373
|
//#region package.json
|
|
11344
11374
|
init_drafts();
|
|
11345
11375
|
init_pane();
|
|
11346
|
-
var version$1 = "0.1.0-alpha.
|
|
11376
|
+
var version$1 = "0.1.0-alpha.166";
|
|
11347
11377
|
//#endregion
|
|
11348
11378
|
//#region src/cli/upgrade.ts
|
|
11349
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;
|
|
@@ -13987,7 +14017,7 @@ var init_tree = __esmMin((() => {
|
|
|
13987
14017
|
return node.children.reduce((total, child) => total + filesUnder(tree, child), 0);
|
|
13988
14018
|
};
|
|
13989
14019
|
crowdedDirectories = (tree, limit) => tree.nodes.filter((node) => node.kind === "directory" && directFiles(tree, node.id) > limit).map((node) => node.path);
|
|
13990
|
-
})), 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, 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, 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, sectionOf, sentEntry, remarkRows, panelEntries, panelEntry, threadChosen, spokenSince, hunkStarts, openingRow, changeAround, nextUnreviewed, reviewedCount, fileOrder, filePlace, readingOrder, placeIn, layerFile, layerAfter, selectionRange;
|
|
14020
|
+
})), 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, 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, 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;
|
|
13991
14021
|
var init_model$1 = __esmMin((() => {
|
|
13992
14022
|
init_dist();
|
|
13993
14023
|
init_patch();
|
|
@@ -14075,6 +14105,7 @@ var init_model$1 = __esmMin((() => {
|
|
|
14075
14105
|
closed: [],
|
|
14076
14106
|
vouched: [],
|
|
14077
14107
|
partsRead: [],
|
|
14108
|
+
openMoved: false,
|
|
14078
14109
|
sent: [],
|
|
14079
14110
|
remarks: [],
|
|
14080
14111
|
viewport: 20,
|
|
@@ -14712,6 +14743,7 @@ var init_model$1 = __esmMin((() => {
|
|
|
14712
14743
|
"filed",
|
|
14713
14744
|
"with",
|
|
14714
14745
|
"answered",
|
|
14746
|
+
"movedOn",
|
|
14715
14747
|
"settled",
|
|
14716
14748
|
"removed",
|
|
14717
14749
|
"dismissed"
|
|
@@ -14732,7 +14764,8 @@ var init_model$1 = __esmMin((() => {
|
|
|
14732
14764
|
answered: "answered",
|
|
14733
14765
|
waiting: "with"
|
|
14734
14766
|
};
|
|
14735
|
-
|
|
14767
|
+
movedPast = (comment) => comment.outside === true && comment.settled !== true && comment.removed !== true;
|
|
14768
|
+
sectionOf = (comment) => movedPast(comment) ? "movedOn" : SECTION_OF[threadStand(comment)];
|
|
14736
14769
|
sentEntry = (state, comment) => {
|
|
14737
14770
|
const newer = newerOf(state, comment);
|
|
14738
14771
|
return {
|
|
@@ -14748,6 +14781,10 @@ var init_model$1 = __esmMin((() => {
|
|
|
14748
14781
|
section,
|
|
14749
14782
|
remark
|
|
14750
14783
|
}));
|
|
14784
|
+
panelHolds = (state) => panelEntries({
|
|
14785
|
+
...state,
|
|
14786
|
+
openMoved: true
|
|
14787
|
+
}).filter((entry) => entry.kind !== "fold");
|
|
14751
14788
|
panelEntries = (state) => {
|
|
14752
14789
|
const shown = state.hideSettled ? state.sent.filter((comment) => comment.settled !== true) : state.sent;
|
|
14753
14790
|
const waiting = state.held.map((comment) => ({
|
|
@@ -14765,7 +14802,15 @@ var init_model$1 = __esmMin((() => {
|
|
|
14765
14802
|
];
|
|
14766
14803
|
const ordered = (section) => {
|
|
14767
14804
|
const found = delivered.filter((entry) => entry.section === section);
|
|
14768
|
-
|
|
14805
|
+
const held = state.newestFirst ? found.toReversed() : found;
|
|
14806
|
+
if (section !== "movedOn" || held.length === 0) return held;
|
|
14807
|
+
const fold = {
|
|
14808
|
+
kind: "fold",
|
|
14809
|
+
section,
|
|
14810
|
+
held: held.length,
|
|
14811
|
+
open: state.openMoved
|
|
14812
|
+
};
|
|
14813
|
+
return state.openMoved ? [fold, ...held] : [fold];
|
|
14769
14814
|
};
|
|
14770
14815
|
return PANEL_SECTIONS.flatMap((section) => ordered(section));
|
|
14771
14816
|
};
|
|
@@ -15662,7 +15707,7 @@ var init_command = __esmMin((() => {
|
|
|
15662
15707
|
"hide",
|
|
15663
15708
|
"shrink"
|
|
15664
15709
|
],
|
|
15665
|
-
title: "Close the folder, layer, gap, or
|
|
15710
|
+
title: "Close the folder, layer, gap, or the thread in the panel",
|
|
15666
15711
|
category: "Files",
|
|
15667
15712
|
keys: ["h"],
|
|
15668
15713
|
screens: ["review"]
|
|
@@ -15675,7 +15720,7 @@ var init_command = __esmMin((() => {
|
|
|
15675
15720
|
"show more",
|
|
15676
15721
|
"open"
|
|
15677
15722
|
],
|
|
15678
|
-
title: "Open the folder, layer, gap, or
|
|
15723
|
+
title: "Open the folder, layer, gap, or the thread in the panel",
|
|
15679
15724
|
category: "Files",
|
|
15680
15725
|
keys: ["l"],
|
|
15681
15726
|
screens: ["review"]
|
|
@@ -15902,7 +15947,8 @@ var init_command = __esmMin((() => {
|
|
|
15902
15947
|
"palette",
|
|
15903
15948
|
"report",
|
|
15904
15949
|
"search",
|
|
15905
|
-
"keys"
|
|
15950
|
+
"keys",
|
|
15951
|
+
"thread"
|
|
15906
15952
|
],
|
|
15907
15953
|
hint: "back",
|
|
15908
15954
|
listed: false,
|
|
@@ -16012,7 +16058,7 @@ var init_match = __esmMin((() => {
|
|
|
16012
16058
|
}));
|
|
16013
16059
|
//#endregion
|
|
16014
16060
|
//#region src/tui/reduce.ts
|
|
16015
|
-
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, 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;
|
|
16016
16062
|
var init_reduce = __esmMin((() => {
|
|
16017
16063
|
init_dist();
|
|
16018
16064
|
init_patch();
|
|
@@ -16152,6 +16198,26 @@ var init_reduce = __esmMin((() => {
|
|
|
16152
16198
|
pan: Math.max(0, state.pan + delta)
|
|
16153
16199
|
};
|
|
16154
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
|
+
};
|
|
16155
16221
|
moveLayer = (state, delta) => {
|
|
16156
16222
|
const order = readingOrder(state);
|
|
16157
16223
|
if (order.length === 0) return state;
|
|
@@ -16320,7 +16386,24 @@ var init_reduce = __esmMin((() => {
|
|
|
16320
16386
|
opened: shut ? rest : [...rest, id]
|
|
16321
16387
|
};
|
|
16322
16388
|
};
|
|
16389
|
+
foldMoved = (state, shut) => shut ? {
|
|
16390
|
+
...state,
|
|
16391
|
+
openMoved: false
|
|
16392
|
+
} : {
|
|
16393
|
+
...state,
|
|
16394
|
+
openMoved: true,
|
|
16395
|
+
panelIndex: state.panelIndex + 1
|
|
16396
|
+
};
|
|
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;
|
|
16323
16404
|
fold = (state, shut) => {
|
|
16405
|
+
if (overFold(state)) return foldMoved(state, shut);
|
|
16406
|
+
if (!shut && overThread(state)) return readingThread(state);
|
|
16324
16407
|
const thread = threadAtStop(state);
|
|
16325
16408
|
if (thread?.id !== void 0 && thread.settled === true) return foldThread(state, shut, thread.id);
|
|
16326
16409
|
return onLayers(state) ? foldLayer(state, shut) : foldDirectory(state, shut);
|
|
@@ -16466,6 +16549,10 @@ var init_reduce = __esmMin((() => {
|
|
|
16466
16549
|
...state,
|
|
16467
16550
|
screen: state.returnTo
|
|
16468
16551
|
}),
|
|
16552
|
+
thread: (state) => ({
|
|
16553
|
+
...state,
|
|
16554
|
+
screen: state.returnTo
|
|
16555
|
+
}),
|
|
16469
16556
|
compose: (state) => ({
|
|
16470
16557
|
...state,
|
|
16471
16558
|
screen: "review",
|
|
@@ -17794,7 +17881,7 @@ var init_diffview = __esmMin((() => {
|
|
|
17794
17881
|
}));
|
|
17795
17882
|
//#endregion
|
|
17796
17883
|
//#region src/tui/render.ts
|
|
17797
|
-
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, 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;
|
|
17798
17885
|
var init_render = __esmMin((() => {
|
|
17799
17886
|
init_dist();
|
|
17800
17887
|
init_command();
|
|
@@ -18211,6 +18298,7 @@ var init_render = __esmMin((() => {
|
|
|
18211
18298
|
found: makeFoundParts(renderer),
|
|
18212
18299
|
keys: makeKeysParts(renderer),
|
|
18213
18300
|
settings: makeSettingsParts(renderer),
|
|
18301
|
+
reader: makeReaderParts(renderer),
|
|
18214
18302
|
bases: makeBaseParts(renderer)
|
|
18215
18303
|
});
|
|
18216
18304
|
makeBaseParts = (renderer) => {
|
|
@@ -18229,6 +18317,19 @@ var init_render = __esmMin((() => {
|
|
|
18229
18317
|
choices
|
|
18230
18318
|
};
|
|
18231
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
|
+
};
|
|
18232
18333
|
makeSettingsParts = (renderer) => {
|
|
18233
18334
|
const box = makePalette(renderer);
|
|
18234
18335
|
const title = bar(renderer, "settings-title", palette.faint);
|
|
@@ -18717,6 +18818,34 @@ var init_render = __esmMin((() => {
|
|
|
18717
18818
|
onRemoved: threadHere(state)?.removed === true,
|
|
18718
18819
|
onHeld: state.focus === "review" && panelEntry(state)?.section === "held"
|
|
18719
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
|
+
};
|
|
18720
18849
|
PANEL_TITLES = {
|
|
18721
18850
|
remarks: "Remarks",
|
|
18722
18851
|
dismissed: "Dismissed",
|
|
@@ -18725,6 +18854,7 @@ var init_render = __esmMin((() => {
|
|
|
18725
18854
|
filed: "Not picked up",
|
|
18726
18855
|
with: "Picked up, no answer",
|
|
18727
18856
|
answered: "Answered, not settled",
|
|
18857
|
+
movedOn: "The branch moved past these",
|
|
18728
18858
|
settled: "Settled",
|
|
18729
18859
|
removed: "Removed"
|
|
18730
18860
|
};
|
|
@@ -18846,25 +18976,34 @@ var init_render = __esmMin((() => {
|
|
|
18846
18976
|
return known ? " · outside this diff" : " · not in the diff";
|
|
18847
18977
|
};
|
|
18848
18978
|
wherePart = (state, entry) => {
|
|
18979
|
+
if (entry.kind === "fold") return "";
|
|
18849
18980
|
if (entry.kind === "remark") {
|
|
18850
18981
|
const known = state.patches.some((patch) => patch.path === entry.remark.file);
|
|
18851
18982
|
return remarkWhere(entry.remark, known);
|
|
18852
18983
|
}
|
|
18853
18984
|
return entry.comment.outside === true ? " · not in the diff" : `:${entry.comment.end}`;
|
|
18854
18985
|
};
|
|
18855
|
-
panelFile = (entry) =>
|
|
18986
|
+
panelFile = (entry) => {
|
|
18987
|
+
if (entry.kind === "fold") return "";
|
|
18988
|
+
return entry.kind === "remark" ? entry.remark.file : entry.comment.file;
|
|
18989
|
+
};
|
|
18856
18990
|
panelWhere = (state, entry, room) => {
|
|
18857
18991
|
const where = wherePart(state, entry);
|
|
18858
18992
|
return `${clipPath(panelFile(entry), Math.max(4, room - where.length))}${where}`;
|
|
18859
18993
|
};
|
|
18860
18994
|
panelBody = (entry) => {
|
|
18995
|
+
if (entry.kind === "fold") return "";
|
|
18861
18996
|
return (entry.kind === "remark" ? `@${entry.remark.by} ${entry.remark.body}` : entry.comment.body).split("\n").find((line) => line.trim().length > 0) ?? "";
|
|
18862
18997
|
};
|
|
18863
|
-
panelMark = (entry) =>
|
|
18998
|
+
panelMark = (entry) => {
|
|
18999
|
+
if (entry.kind === "fold") return entry.open ? marks().open : marks().shut;
|
|
19000
|
+
return entry.kind === "remark" ? REMARK_MARK : standMark(threadStand(entry.comment));
|
|
19001
|
+
};
|
|
18864
19002
|
lostCode = (entry) => {
|
|
19003
|
+
if (entry.kind === "fold") return [];
|
|
18865
19004
|
return (entry.kind === "remark" ? entry.remark.code : (entry.comment.snippet ?? "").split("\n")).filter((line) => line.trim().length > 0);
|
|
18866
19005
|
};
|
|
18867
|
-
lostEntry = (state, entry) => entry.kind === "remark" ? !entry.remark.placed && state.patches.some((patch) => patch.path === entry.remark.file) : entry.comment.outside === true;
|
|
19006
|
+
lostEntry = (state, entry) => entry.kind === "fold" ? false : entry.kind === "remark" ? !entry.remark.placed && state.patches.some((patch) => patch.path === entry.remark.file) : entry.comment.outside === true;
|
|
18868
19007
|
writtenOn = (state, placed, room) => {
|
|
18869
19008
|
const { entry } = placed;
|
|
18870
19009
|
if (placed.at !== state.panelIndex || !lostEntry(state, entry)) return [];
|
|
@@ -18889,20 +19028,36 @@ var init_render = __esmMin((() => {
|
|
|
18889
19028
|
...rows
|
|
18890
19029
|
];
|
|
18891
19030
|
};
|
|
19031
|
+
foldLine = (state, placed, room) => {
|
|
19032
|
+
const { entry } = placed;
|
|
19033
|
+
if (entry.kind !== "fold") return [];
|
|
19034
|
+
const here = placed.at === state.panelIndex;
|
|
19035
|
+
const said = entry.open ? "h folds them away" : "l opens them";
|
|
19036
|
+
const text = ` ${panelMark(entry)} ${entry.held} ${entry.held === 1 ? "comment" : "comments"} · ${said}`;
|
|
19037
|
+
return [{
|
|
19038
|
+
text: clip(text, room),
|
|
19039
|
+
tone: palette.faint,
|
|
19040
|
+
here,
|
|
19041
|
+
at: placed.at
|
|
19042
|
+
}];
|
|
19043
|
+
};
|
|
18892
19044
|
panelPair = (state, placed, room) => {
|
|
18893
19045
|
const { entry } = placed;
|
|
19046
|
+
if (entry.kind === "fold") return foldLine(state, placed, room);
|
|
18894
19047
|
const lead = ` ${panelMark(entry)} `;
|
|
18895
19048
|
const here = placed.at === state.panelIndex;
|
|
18896
19049
|
return [
|
|
18897
19050
|
{
|
|
18898
19051
|
text: `${lead}${panelWhere(state, entry, room - PANEL_LEAD)}`,
|
|
18899
19052
|
tone: palette.ink,
|
|
18900
|
-
here
|
|
19053
|
+
here,
|
|
19054
|
+
at: placed.at
|
|
18901
19055
|
},
|
|
18902
19056
|
{
|
|
18903
19057
|
text: ` ${clip(panelBody(entry), Math.max(4, room - PANEL_LEAD))}`,
|
|
18904
19058
|
tone: palette.muted,
|
|
18905
|
-
here
|
|
19059
|
+
here,
|
|
19060
|
+
at: placed.at
|
|
18906
19061
|
},
|
|
18907
19062
|
...writtenOn(state, placed, room)
|
|
18908
19063
|
];
|
|
@@ -18910,13 +19065,14 @@ var init_render = __esmMin((() => {
|
|
|
18910
19065
|
panelSection = (state, placed, section, room) => {
|
|
18911
19066
|
const here = placed.filter((one) => one.entry.section === section);
|
|
18912
19067
|
if (here.length === 0) return [];
|
|
19068
|
+
const counted = panelHolds(state).filter((entry) => entry.section === section).length;
|
|
18913
19069
|
return [
|
|
18914
19070
|
{
|
|
18915
19071
|
text: "",
|
|
18916
19072
|
tone: palette.faint
|
|
18917
19073
|
},
|
|
18918
19074
|
{
|
|
18919
|
-
text: `${PANEL_TITLES[section]} ${
|
|
19075
|
+
text: `${PANEL_TITLES[section]} ${counted}`,
|
|
18920
19076
|
tone: palette.faint
|
|
18921
19077
|
},
|
|
18922
19078
|
...here.flatMap((one) => panelPair(state, one, room))
|
|
@@ -18942,13 +19098,18 @@ var init_render = __esmMin((() => {
|
|
|
18942
19098
|
text: clip(` ${mark} ${count} more`, room),
|
|
18943
19099
|
tone: palette.faint
|
|
18944
19100
|
}];
|
|
18945
|
-
|
|
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) => {
|
|
18946
19106
|
const placed = panelEntries(state).map((entry, at) => ({
|
|
18947
19107
|
entry,
|
|
18948
19108
|
at
|
|
18949
19109
|
}));
|
|
18950
|
-
const
|
|
18951
|
-
const
|
|
19110
|
+
const holds = panelHolds(state);
|
|
19111
|
+
const fresh = holds.filter((entry) => entry.kind === "comment" && entry.fresh).length;
|
|
19112
|
+
const unread = holds.filter((entry) => entry.kind === "comment" && entry.unread > 0).length;
|
|
18952
19113
|
const said = fresh > 0 ? `${fresh} ${PULL_HINT}` : unread > 0 ? `${unread} unread` : "";
|
|
18953
19114
|
const banner = said.length === 0 ? [] : [{
|
|
18954
19115
|
text: clip(said, room),
|
|
@@ -18967,6 +19128,7 @@ var init_render = __esmMin((() => {
|
|
|
18967
19128
|
...window.lines,
|
|
18968
19129
|
...moreLine(window.below, "▼", room)
|
|
18969
19130
|
];
|
|
19131
|
+
picked?.(panelPicked(banner.length, window.above, shown.slice(banner.length)));
|
|
18970
19132
|
return new StyledText(shown.map((line) => {
|
|
18971
19133
|
const drawn = fg(line.tone)(`${line.text.padEnd(room)}\n`);
|
|
18972
19134
|
return line.here === true ? bg(restingOrHere(state.focus === "review"))(drawn) : drawn;
|
|
@@ -19011,15 +19173,14 @@ var init_render = __esmMin((() => {
|
|
|
19011
19173
|
settingsTitle;
|
|
19012
19174
|
settingsChoices;
|
|
19013
19175
|
keysQuery;
|
|
19014
|
-
foundQuery;
|
|
19015
19176
|
keysChoices;
|
|
19016
19177
|
keysLegend;
|
|
19017
|
-
|
|
19018
|
-
|
|
19019
|
-
foundPeek;
|
|
19020
|
-
foundChoices;
|
|
19178
|
+
reader;
|
|
19179
|
+
foundBox;
|
|
19021
19180
|
renderer;
|
|
19022
19181
|
mouse;
|
|
19182
|
+
listPicks = [];
|
|
19183
|
+
panelPicks = [];
|
|
19023
19184
|
dragFrom;
|
|
19024
19185
|
lastTop = 0;
|
|
19025
19186
|
constructor(renderer, repo = "") {
|
|
@@ -19065,11 +19226,8 @@ var init_render = __esmMin((() => {
|
|
|
19065
19226
|
this.keysChoices = modals.keys.choices;
|
|
19066
19227
|
this.keysLegend = modals.keys.legend;
|
|
19067
19228
|
this.baseBox = modals.bases;
|
|
19068
|
-
this.
|
|
19069
|
-
this.
|
|
19070
|
-
this.foundQuery = modals.found.query;
|
|
19071
|
-
this.foundPeek = modals.found.peek;
|
|
19072
|
-
this.foundChoices = modals.found.choices;
|
|
19229
|
+
this.reader = modals.reader;
|
|
19230
|
+
this.foundBox = modals.found;
|
|
19073
19231
|
this.assemble(renderer);
|
|
19074
19232
|
}
|
|
19075
19233
|
wheelOnRail(box) {
|
|
@@ -19086,8 +19244,16 @@ var init_render = __esmMin((() => {
|
|
|
19086
19244
|
this.mouse?.onScroll(way === "down" ? 1 : -1);
|
|
19087
19245
|
};
|
|
19088
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
|
+
}
|
|
19089
19253
|
listen(mouse) {
|
|
19090
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");
|
|
19091
19257
|
this.wheelOnSheet(this.keys);
|
|
19092
19258
|
this.wheelOnSheet(this.palette);
|
|
19093
19259
|
this.wheelOnRail(this.listPane);
|
|
@@ -19141,7 +19307,7 @@ var init_render = __esmMin((() => {
|
|
|
19141
19307
|
asking(screen) {
|
|
19142
19308
|
switch (screen) {
|
|
19143
19309
|
case "palette": return this.paletteQuery;
|
|
19144
|
-
case "search": return this.
|
|
19310
|
+
case "search": return this.foundBox.query;
|
|
19145
19311
|
case "keys": return this.keysQuery;
|
|
19146
19312
|
case "base":
|
|
19147
19313
|
case "editor": return this.baseBox.query;
|
|
@@ -19188,6 +19354,7 @@ var init_render = __esmMin((() => {
|
|
|
19188
19354
|
this.paintKeys(state);
|
|
19189
19355
|
this.paintSettings(state);
|
|
19190
19356
|
this.paintBases(state);
|
|
19357
|
+
this.paintReader(state);
|
|
19191
19358
|
this.paintFound(state);
|
|
19192
19359
|
this.paintReport(state);
|
|
19193
19360
|
this.scrim.visible = state.screen !== "branches" && state.screen !== "review";
|
|
@@ -19254,6 +19421,22 @@ var init_render = __esmMin((() => {
|
|
|
19254
19421
|
this.settings.left = Math.max(1, Math.floor((this.renderer.width - room) / 2));
|
|
19255
19422
|
this.settings.top = panelTop(this.renderer.height, PANEL_QUARTER);
|
|
19256
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
|
+
}
|
|
19257
19440
|
paintKeys(state) {
|
|
19258
19441
|
this.keys.visible = state.screen === "keys";
|
|
19259
19442
|
if (state.screen !== "keys") {
|
|
@@ -19327,7 +19510,7 @@ var init_render = __esmMin((() => {
|
|
|
19327
19510
|
this.panelPane.paddingLeft = shown ? 1 : 0;
|
|
19328
19511
|
this.panelPane.paddingTop = 0;
|
|
19329
19512
|
const rows = Math.max(1, this.panelPane.height - PANE_EDGES);
|
|
19330
|
-
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) : "";
|
|
19331
19514
|
}
|
|
19332
19515
|
listText(state) {
|
|
19333
19516
|
if (atHome(state)) return this.branchTable(state);
|
|
@@ -19336,6 +19519,10 @@ var init_render = __esmMin((() => {
|
|
|
19336
19519
|
const pane = this.paneRoom();
|
|
19337
19520
|
const whole = treeWindow(state, room);
|
|
19338
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
|
+
}));
|
|
19339
19526
|
const rows = window.rows.flatMap((row) => {
|
|
19340
19527
|
const drawn = fg(row.kind === "file" ? palette.ink : palette.muted)(`${treeLine(state, row, pane)}\n`);
|
|
19341
19528
|
return [row.fileIndex === state.patchIndex ? bg(restingOrHere(state.focus === "tree"))(drawn) : drawn];
|
|
@@ -19354,6 +19541,12 @@ var init_render = __esmMin((() => {
|
|
|
19354
19541
|
const height = Math.max(1, this.listRoom() - banner);
|
|
19355
19542
|
const all = layerFitted(state, room, height);
|
|
19356
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
|
+
}))];
|
|
19357
19550
|
const rows = window.rows.flatMap((row) => this.layerLine(state, row, room));
|
|
19358
19551
|
const above = window.above > 0 ? [fg(palette.faint)(` ▲ ${window.above} more\n`)] : [];
|
|
19359
19552
|
const more = window.more > 0 ? [fg(palette.faint)(` ▼ ${window.more} more`)] : [];
|
|
@@ -19423,9 +19616,10 @@ var init_render = __esmMin((() => {
|
|
|
19423
19616
|
this.scrim,
|
|
19424
19617
|
this.compose,
|
|
19425
19618
|
this.palette,
|
|
19426
|
-
this.
|
|
19619
|
+
this.foundBox.box,
|
|
19427
19620
|
this.keys,
|
|
19428
19621
|
this.settings,
|
|
19622
|
+
this.reader.box,
|
|
19429
19623
|
this.baseBox.box
|
|
19430
19624
|
]);
|
|
19431
19625
|
}
|
|
@@ -19538,28 +19732,28 @@ var init_render = __esmMin((() => {
|
|
|
19538
19732
|
this.listPane.justifyContent = place;
|
|
19539
19733
|
}
|
|
19540
19734
|
paintFound(state) {
|
|
19541
|
-
this.
|
|
19735
|
+
this.foundBox.box.visible = state.screen === "search";
|
|
19542
19736
|
if (state.screen !== "search") {
|
|
19543
|
-
this.
|
|
19544
|
-
this.
|
|
19545
|
-
this.
|
|
19737
|
+
this.foundBox.title.content = "";
|
|
19738
|
+
this.foundBox.peek.content = "";
|
|
19739
|
+
this.foundBox.choices.content = "";
|
|
19546
19740
|
return;
|
|
19547
19741
|
}
|
|
19548
19742
|
const room = panelWidth(this.renderer.width);
|
|
19549
19743
|
const wide = Math.max(1, room - MODAL_ROOM);
|
|
19550
|
-
this.
|
|
19744
|
+
this.foundBox.title.content = foundTitle(state, wide);
|
|
19551
19745
|
const shown = shownMatches(state);
|
|
19552
19746
|
const most = panelRows(this.renderer.height, PANEL_FIFTH);
|
|
19553
19747
|
const { blocks, chosen } = foundBlocks(state, shown, wide);
|
|
19554
19748
|
const tall = Math.max(FOUND_LEAST, most - PALETTE_CHROME);
|
|
19555
19749
|
const window = windowedBlocks(blocks, chosen, tall);
|
|
19556
|
-
this.
|
|
19557
|
-
this.
|
|
19558
|
-
this.
|
|
19559
|
-
this.
|
|
19560
|
-
this.
|
|
19561
|
-
this.
|
|
19562
|
-
this.
|
|
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);
|
|
19563
19757
|
}
|
|
19564
19758
|
paintReport(state) {
|
|
19565
19759
|
this.compose.visible = state.screen === "compose" || state.screen === "report";
|
|
@@ -19955,7 +20149,8 @@ var init_app = __esmMin((() => {
|
|
|
19955
20149
|
"search",
|
|
19956
20150
|
"settings",
|
|
19957
20151
|
"base",
|
|
19958
|
-
"editor"
|
|
20152
|
+
"editor",
|
|
20153
|
+
"thread"
|
|
19959
20154
|
]);
|
|
19960
20155
|
overReview = (screen) => OVER.has(screen);
|
|
19961
20156
|
writesInto = (screen) => WRITES.has(screen);
|
|
@@ -20053,6 +20248,7 @@ var init_app = __esmMin((() => {
|
|
|
20053
20248
|
this.intents = options.intents;
|
|
20054
20249
|
const { renderer } = options;
|
|
20055
20250
|
runSync(this.display.listen({
|
|
20251
|
+
onClick: (what) => this.dispatchTask(this.clicked(what)),
|
|
20056
20252
|
onScroll: (delta) => this.onWheel(delta),
|
|
20057
20253
|
onPan: (delta) => this.onPanWheel(delta),
|
|
20058
20254
|
onDrag: (from, to, done) => this.dragged(from, to, done),
|
|
@@ -20228,6 +20424,34 @@ var init_app = __esmMin((() => {
|
|
|
20228
20424
|
const fiber = this.lighting;
|
|
20229
20425
|
return fiber === void 0 ? void_ : asVoid(await_(fiber));
|
|
20230
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
|
+
}
|
|
20231
20455
|
onWheel(delta) {
|
|
20232
20456
|
this.wheel += delta;
|
|
20233
20457
|
this.renderer.requestRender();
|
|
@@ -20637,7 +20861,10 @@ var init_app = __esmMin((() => {
|
|
|
20637
20861
|
});
|
|
20638
20862
|
}
|
|
20639
20863
|
dragged(from, to, done) {
|
|
20640
|
-
const held =
|
|
20864
|
+
const held = {
|
|
20865
|
+
...this.measured(),
|
|
20866
|
+
focus: "diff"
|
|
20867
|
+
};
|
|
20641
20868
|
if (restsWhereItLanded(from, to) && !this.selectingNow) {
|
|
20642
20869
|
this.commit(restingOn(held, from.row));
|
|
20643
20870
|
return;
|
|
@@ -20797,6 +21024,13 @@ var init_app = __esmMin((() => {
|
|
|
20797
21024
|
this.commit(withNoticeHere(this.state, "nothing in the review yet"));
|
|
20798
21025
|
return;
|
|
20799
21026
|
}
|
|
21027
|
+
if (entry.kind === "fold") {
|
|
21028
|
+
this.commit({
|
|
21029
|
+
...this.state,
|
|
21030
|
+
openMoved: !entry.open
|
|
21031
|
+
});
|
|
21032
|
+
return;
|
|
21033
|
+
}
|
|
20800
21034
|
if (entry.kind === "remark") {
|
|
20801
21035
|
yield* this.openRemark(entry.remark);
|
|
20802
21036
|
return;
|
|
@@ -20830,7 +21064,12 @@ var init_app = __esmMin((() => {
|
|
|
20830
21064
|
const shown = selectedPatch(wide);
|
|
20831
21065
|
if (shown === void 0 || rowShowing(shown, entry.comment.end) === void 0) {
|
|
20832
21066
|
yield* this.readAnswers(entry.comment.id);
|
|
20833
|
-
|
|
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
|
+
});
|
|
20834
21073
|
return;
|
|
20835
21074
|
}
|
|
20836
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.
|
|
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": {
|