@eliya-oss/agent-diff 0.1.0-alpha.135 → 0.1.0-alpha.136
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/release-notes/SKILL.md +125 -10
- package/CHANGELOG.md +38 -0
- package/dist/main.js +128 -25
- package/package.json +4 -2
|
@@ -32,7 +32,13 @@ If you are unsure, ask: would someone who upgraded notice? If no, no file.
|
|
|
32
32
|
|
|
33
33
|
## The shape of a change intent
|
|
34
34
|
|
|
35
|
-
`.changeset/<name>.md
|
|
35
|
+
`.changeset/<name>.md`. Name it the way you would name the test: the sentence, kebab-cased, no
|
|
36
|
+
gerund — `a-file-with-an-accent.md`, not `keeping-a-file-with-an-accent.md`. The bump is `patch`
|
|
37
|
+
until this reaches 1.0, whatever the kind says.
|
|
38
|
+
|
|
39
|
+
**Do not copy a neighbouring file as a model.** Most of `.changeset/` predates this format and is
|
|
40
|
+
free prose with a gerund name. The test only holds intents that have not shipped yet to the shape,
|
|
41
|
+
which is why the old ones still pass. Follow this page, not the file next to yours.
|
|
36
42
|
|
|
37
43
|
```markdown
|
|
38
44
|
---
|
|
@@ -137,22 +143,131 @@ tests, or how long it took you. Those belong in the PR.
|
|
|
137
143
|
|
|
138
144
|
## The PR description
|
|
139
145
|
|
|
140
|
-
|
|
146
|
+
### The template
|
|
147
|
+
|
|
148
|
+
```markdown
|
|
149
|
+
One paragraph. What this changes, and what prompted it. Two or three sentences.
|
|
150
|
+
|
|
151
|
+
## What changed
|
|
152
|
+
|
|
153
|
+
### Fixed
|
|
154
|
+
|
|
155
|
+
- **Layers rail** — the cursor stays on the rail when you collapse the layer you are reading.
|
|
156
|
+
- **Reading order** — a first layer naming no file in the diff opens at the first file, not the last.
|
|
157
|
+
|
|
158
|
+
### Added
|
|
159
|
+
|
|
160
|
+
- **Search** — typing narrows the matches as you type.
|
|
161
|
+
|
|
162
|
+
## The rail lost the cursor when you folded the layer you were in
|
|
163
|
+
|
|
164
|
+
The repro, as keys to press. Then what the fix was.
|
|
165
|
+
|
|
166
|
+
<table>
|
|
167
|
+
<tr><th>Before</th><th>After</th></tr>
|
|
168
|
+
<tr>
|
|
169
|
+
<td><img src="https://github.com/user-attachments/assets/…" alt="before"></td>
|
|
170
|
+
<td><img src="https://github.com/user-attachments/assets/…" alt="after"></td>
|
|
171
|
+
</tr>
|
|
172
|
+
</table>
|
|
173
|
+
|
|
174
|
+
## Reading order opened at the end
|
|
175
|
+
|
|
176
|
+
The repro. Then what the fix was.
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
- The **title** is the entry sentence without the `kind(area):` prefix, and follows the same
|
|
180
|
+
no-gerund rule.
|
|
181
|
+
- **`## What changed` is generated, never typed.** `node scripts/pr-summary.ts` prints it from the
|
|
182
|
+
change intents on this branch. The PR and the changelog then cannot drift apart. Commit the
|
|
183
|
+
intent first — the summary is read from the diff against `origin/main`, so an uncommitted file
|
|
184
|
+
is not on the branch yet and the script will say there is nothing to paste.
|
|
185
|
+
- **One `##` section per thing changed**, in the order the bullets list them, titled with the
|
|
186
|
+
symptom rather than the fix. That is what a reader searching their own bug will match on.
|
|
187
|
+
- A PR with **one entry and nothing to reproduce** is a title and a sentence. The template starts
|
|
188
|
+
earning its keep at two. This is about the `##` sections, not about the pictures: a single-entry
|
|
189
|
+
PR that changes a screen still owes a before and an after.
|
|
190
|
+
- A PR with **no change intent** — a refactor, a test, a doc — writes prose. `pnpm pr-summary`
|
|
191
|
+
will tell you there is nothing to paste, and that is the correct answer, not a problem to fix.
|
|
192
|
+
|
|
193
|
+
### What never goes in a PR body
|
|
194
|
+
|
|
195
|
+
- **Raw command output.** No `ls` listings, no shell transcripts, no stack traces pasted whole.
|
|
196
|
+
Quote the one line that matters.
|
|
197
|
+
- **Backticks around anything a shell would run.** Writing a body in a heredoc executes
|
|
198
|
+
`` `l` `` and pastes its output into your prose. Write the body to a file, then
|
|
199
|
+
`gh pr create --body-file`.
|
|
200
|
+
- **Test counts, timings, or self-assessment.** No "full suite green", no "740 tests", no
|
|
201
|
+
"verified twice". CI says whether the tests pass.
|
|
202
|
+
- **Anything from a private repository.** See below.
|
|
203
|
+
|
|
204
|
+
### Nothing private, ever
|
|
205
|
+
|
|
206
|
+
This repository is public, and so is every PR body, screenshot and recording attached to it. Before
|
|
207
|
+
you open or edit a PR, read what you wrote and confirm none of it carries:
|
|
208
|
+
|
|
209
|
+
- an employer's or a customer's name, or a private repository's name
|
|
210
|
+
- a ticket id, an internal URL, a dashboard link, or an internal hostname
|
|
211
|
+
- a real branch name, file path, or line of source from private work
|
|
212
|
+
- a colleague's name or address, or any credential, token or key
|
|
213
|
+
|
|
214
|
+
A screenshot leaks all of this faster than prose does, which is why **every capture runs against the
|
|
215
|
+
synthetic demo repository** — `scripts/simulate.ts` builds a repo of invented invitation code with
|
|
216
|
+
invented branch names. Never screenshot a review of real work. If you cannot reproduce a bug on the
|
|
217
|
+
synthetic repo, describe it instead, or seed what you need in `scripts/simulation/seed.ts`.
|
|
218
|
+
|
|
219
|
+
An attachment cannot be deleted once uploaded. There is no public deletion API for
|
|
220
|
+
user-attachments, so a leak is permanent.
|
|
221
|
+
|
|
222
|
+
### Showing a screen
|
|
223
|
+
|
|
224
|
+
adiff is a terminal, so a screenshot is a real PNG of a real terminal, captured with
|
|
225
|
+
[terminal-control](https://github.com/anomalyco/terminal-control) and uploaded to GitHub's
|
|
226
|
+
attachment store.
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
cargo install --locked terminal-control # once
|
|
230
|
+
gh extension install drogers0/gh-image # once, then `gh image check-token`
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
**Something new** gets one image:
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
pnpm shot --keys "enter text:l" --label "a layer opened"
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
**Something that changed** gets a before and an after, in a one-row table so the two sit side by
|
|
240
|
+
side rather than a screen apart:
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
pnpm shot --keys "enter text:l" --label "the layers rail" --against origin/main
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
`--against` builds a worktree at the merge base, captures the same keystrokes on the code as it was,
|
|
247
|
+
and prints the finished `<table>` with both images uploaded. Paste it under the section it belongs
|
|
248
|
+
to. If the two frames come out identical the script says so and stops — those keys do not reach the
|
|
249
|
+
screen you changed.
|
|
250
|
+
|
|
251
|
+
**Something about motion** — scroll feel, focus moving, a gap opening ten lines at a time — gets a
|
|
252
|
+
recording, because a still frame cannot show it:
|
|
253
|
+
|
|
254
|
+
```bash
|
|
255
|
+
pnpm shot --keys "enter text:l text:l text:l" --label "the gap opening" --video
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
That prints a bare URL. Leave it bare: GitHub wraps a player around a user-attachments URL on its
|
|
259
|
+
own line, and `` image markdown around a video renders nothing.
|
|
141
260
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
- Reproduction steps and the reasoning go in the body. That is what the body is for, and it is why
|
|
146
|
-
the changelog does not need them.
|
|
147
|
-
- Never paste raw command output, a directory listing, or a shell transcript into a PR body. Check
|
|
148
|
-
what you wrote actually renders before you open the PR.
|
|
149
|
-
- No test counts, no "full suite green", no self-assessment.
|
|
261
|
+
Keys are termctrl's: `enter`, `escape`, `tab`, `up`, `down`, `page-up`, `ctrl-a` through `ctrl-z`,
|
|
262
|
+
and `text:<value>` for anything typed, including single letters like `text:l`. Add `--keep` to leave
|
|
263
|
+
the files in `shots/` instead of deleting them after upload.
|
|
150
264
|
|
|
151
265
|
## Before you open the PR
|
|
152
266
|
|
|
153
267
|
```bash
|
|
154
268
|
node scripts/changelog.ts # rewrites CHANGELOG.md from every change intent
|
|
155
269
|
node scripts/changelog.ts 0.1.0-alpha.133 # prints one release's note, as the release page shows it
|
|
270
|
+
node scripts/pr-summary.ts # prints the `## What changed` block for this branch
|
|
156
271
|
```
|
|
157
272
|
|
|
158
273
|
`CHANGELOG.md` is regenerated by the release workflow, so it does not need to be committed with the
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# @eliya-oss/agent-diff
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.136
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fix(layers rail): the wheel keeps working after a flick, and moves one file per notch.
|
|
8
|
+
|
|
9
|
+
<details><summary>What was wrong</summary>
|
|
10
|
+
|
|
11
|
+
The guard that stopped a trackpad flick running on past the gesture was never cleared when a move failed, so after one bad load the rail stopped answering the wheel entirely. It is cleared whatever happens now, and a notch that arrives mid-load is remembered rather than thrown away, so movement keeps up with the gesture instead of dropping out of it.
|
|
12
|
+
|
|
13
|
+
The wheel was also registered twice over the file list — once on the pane and once on the text inside it — so a single notch moved two files.
|
|
14
|
+
|
|
15
|
+
</details>
|
|
16
|
+
|
|
17
|
+
perf(diff): the diff is not handed to the highlighter again when only the pane width changed.
|
|
18
|
+
|
|
19
|
+
<details><summary>What was wrong</summary>
|
|
20
|
+
|
|
21
|
+
Toggling the review panel reassigned the code pane's contents even though the text was identical, which starts a fresh parse and draws the file unhighlighted until it finishes.
|
|
22
|
+
|
|
23
|
+
</details>
|
|
24
|
+
|
|
25
|
+
- fix(key sheet): `?` fills the screen and lays the keys out in two columns under their section headings.
|
|
26
|
+
|
|
27
|
+
<details><summary>What was wrong</summary>
|
|
28
|
+
|
|
29
|
+
Fifty keys were drawn in one narrow column the same size and shape as the command palette, so it scrolled even on a tall terminal and the category was repeated on every row instead of heading a section. The two columns fit most of the sheet at once, the headings say what each group is, and the space the repeated category took goes to the descriptions, which were being cut mid-word.
|
|
30
|
+
|
|
31
|
+
</details>
|
|
32
|
+
|
|
33
|
+
- fix(review panel): opening the panel puts the keys on it, and closing gives them back to the pane you came from.
|
|
34
|
+
|
|
35
|
+
<details><summary>What was wrong</summary>
|
|
36
|
+
|
|
37
|
+
`a` opened the panel and left the keys wherever they were, so the comments you had just asked to see could not be moved through without a second press of `tab`. Closing it sent the keys to the diff whatever you had been reading before, so opening and closing the panel quietly moved you off the file list. The panel is left alone when there is nothing in it to read.
|
|
38
|
+
|
|
39
|
+
</details>
|
|
40
|
+
|
|
3
41
|
## 0.1.0-alpha.135
|
|
4
42
|
|
|
5
43
|
### Patch Changes
|
package/dist/main.js
CHANGED
|
@@ -11098,7 +11098,7 @@ var init_pane = __esmMin((() => {
|
|
|
11098
11098
|
init_drafts();
|
|
11099
11099
|
init_init();
|
|
11100
11100
|
init_pane();
|
|
11101
|
-
var version$1 = "0.1.0-alpha.
|
|
11101
|
+
var version$1 = "0.1.0-alpha.136";
|
|
11102
11102
|
//#endregion
|
|
11103
11103
|
//#region src/cli/upgrade.ts
|
|
11104
11104
|
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, ranChild, runUpgrade, statusOf$1, sayFound, sayDone, attempted, REFRESH_MS, refreshSkills, updatedIn, sayRefreshed, upgradeReport;
|
|
@@ -13154,7 +13154,8 @@ var init_model = __esmMin((() => {
|
|
|
13154
13154
|
scroll: -1,
|
|
13155
13155
|
railRows: 12,
|
|
13156
13156
|
railScroll: -1,
|
|
13157
|
-
now: 0
|
|
13157
|
+
now: 0,
|
|
13158
|
+
focusWas: "diff"
|
|
13158
13159
|
};
|
|
13159
13160
|
initialState = (branches) => ({
|
|
13160
13161
|
...nothingReviewed,
|
|
@@ -14646,7 +14647,7 @@ var init_command = __esmMin((() => {
|
|
|
14646
14647
|
}));
|
|
14647
14648
|
//#endregion
|
|
14648
14649
|
//#region src/tui/match.ts
|
|
14649
|
-
var subsequence, label, matches, closeness, searchCommands, searchGlossary;
|
|
14650
|
+
var subsequence, label, matches, closeness, searchCommands, byCategory, searchGlossary;
|
|
14650
14651
|
var init_match = __esmMin((() => {
|
|
14651
14652
|
init_command();
|
|
14652
14653
|
subsequence = (haystack, needle) => {
|
|
@@ -14669,7 +14670,16 @@ var init_match = __esmMin((() => {
|
|
|
14669
14670
|
return label(entry).includes(wanted) ? 3 : 4;
|
|
14670
14671
|
};
|
|
14671
14672
|
searchCommands = (screen, query) => listableFor(screen).filter((entry) => matches(entry, query)).toSorted((left, right) => closeness(left, query) - closeness(right, query));
|
|
14672
|
-
|
|
14673
|
+
byCategory = (screen) => {
|
|
14674
|
+
const seen = /* @__PURE__ */ new Map();
|
|
14675
|
+
for (const entry of glossaryFor(screen)) if (!seen.has(entry.category)) seen.set(entry.category, seen.size);
|
|
14676
|
+
return seen;
|
|
14677
|
+
};
|
|
14678
|
+
searchGlossary = (screen, query) => {
|
|
14679
|
+
const order = byCategory(screen);
|
|
14680
|
+
const placed = (entry) => order.get(entry.category) ?? order.size;
|
|
14681
|
+
return glossaryFor(screen).filter((entry) => matches(entry, query)).toSorted((left, right) => closeness(left, query) - closeness(right, query) || placed(left) - placed(right));
|
|
14682
|
+
};
|
|
14673
14683
|
}));
|
|
14674
14684
|
//#endregion
|
|
14675
14685
|
//#region src/tui/reduce.ts
|
|
@@ -14895,12 +14905,20 @@ var init_reduce = __esmMin((() => {
|
|
|
14895
14905
|
};
|
|
14896
14906
|
togglePanel = (state) => {
|
|
14897
14907
|
if (!panelFits(state)) return withNotice(state, "the terminal is too narrow for the review panel");
|
|
14898
|
-
|
|
14908
|
+
if (state.panelOpen) return {
|
|
14909
|
+
...state,
|
|
14910
|
+
panelOpen: false,
|
|
14911
|
+
panelWas: false,
|
|
14912
|
+
focus: state.focus === "review" ? state.focusWas : state.focus,
|
|
14913
|
+
panelIndex: 0
|
|
14914
|
+
};
|
|
14915
|
+
const worthReading = panelEntries(state).length > 0;
|
|
14899
14916
|
return {
|
|
14900
14917
|
...state,
|
|
14901
|
-
panelOpen,
|
|
14902
|
-
panelWas:
|
|
14903
|
-
focus:
|
|
14918
|
+
panelOpen: true,
|
|
14919
|
+
panelWas: true,
|
|
14920
|
+
focus: worthReading ? "review" : state.focus,
|
|
14921
|
+
focusWas: state.focus,
|
|
14904
14922
|
panelIndex: 0
|
|
14905
14923
|
};
|
|
14906
14924
|
};
|
|
@@ -15717,6 +15735,7 @@ var init_diffview = __esmMin((() => {
|
|
|
15717
15735
|
pinned;
|
|
15718
15736
|
pinBox;
|
|
15719
15737
|
pinnedText = "";
|
|
15738
|
+
fed = "";
|
|
15720
15739
|
newLit = [];
|
|
15721
15740
|
oldLit = [];
|
|
15722
15741
|
newFor = "";
|
|
@@ -15930,7 +15949,11 @@ var init_diffview = __esmMin((() => {
|
|
|
15930
15949
|
}
|
|
15931
15950
|
feed() {
|
|
15932
15951
|
const spans = [...noteSpans(this.display, this.held), ...this.pickedSpans()];
|
|
15933
|
-
|
|
15952
|
+
const text = textAt(this.display, this.held, this.hidden());
|
|
15953
|
+
if (text !== this.fed) {
|
|
15954
|
+
this.fed = text;
|
|
15955
|
+
this.code.content = text;
|
|
15956
|
+
}
|
|
15934
15957
|
this.code.onHighlight = (highlights) => {
|
|
15935
15958
|
return [...(this.ownSpans() ?? highlights).filter((highlight) => !spans.some(([from, to]) => highlight[0] < to && highlight[1] > from)), ...spans];
|
|
15936
15959
|
};
|
|
@@ -16330,7 +16353,7 @@ var init_diffview = __esmMin((() => {
|
|
|
16330
16353
|
}));
|
|
16331
16354
|
//#endregion
|
|
16332
16355
|
//#region src/tui/render.ts
|
|
16333
|
-
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_ASKING, STALE_LONG, STALE_MIDDLE, STALE_SHORT, staleSaid, staleBanner, litRow, leftOver, titlePaint, titleMark, titleLook, fileMark, fileLook, layerLook, layerGutter, layerText, PANEL_TITLES, PANEL_ORDER, PANEL_LEAD, PANEL_EMPTY, restingOrHere, FOUND_LEAST, nothingYet, foundTitle, CHANGED_MARK, fileRow, blockOf, aroundRow, windowedBlocks, panelWhere, panelBody, panelPair, panelSection, PULL_HINT, panelWindow, moreLine, panelText, Screen;
|
|
16356
|
+
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, SHEET_GAP, sheetRow, groupedBy, sheetBlock, splitInTwo, sheetPaint, sheetDeep, sheetText, 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_ASKING, STALE_LONG, STALE_MIDDLE, STALE_SHORT, staleSaid, staleBanner, litRow, leftOver, titlePaint, titleMark, titleLook, fileMark, fileLook, layerLook, layerGutter, layerText, PANEL_TITLES, PANEL_ORDER, PANEL_LEAD, PANEL_EMPTY, restingOrHere, FOUND_LEAST, nothingYet, foundTitle, CHANGED_MARK, fileRow, blockOf, aroundRow, windowedBlocks, panelWhere, panelBody, panelPair, panelSection, PULL_HINT, panelWindow, moreLine, panelText, Screen;
|
|
16334
16357
|
var init_render = __esmMin((() => {
|
|
16335
16358
|
init_dist();
|
|
16336
16359
|
init_command();
|
|
@@ -16357,10 +16380,9 @@ var init_render = __esmMin((() => {
|
|
|
16357
16380
|
PALETTE_GAP = 2;
|
|
16358
16381
|
PALETTE_CHROME = 4;
|
|
16359
16382
|
PENDING_CHROME = 4;
|
|
16360
|
-
keysTitle = (found,
|
|
16383
|
+
keysTitle = (found, whole) => {
|
|
16361
16384
|
if (found === 0) return "No key matches";
|
|
16362
|
-
|
|
16363
|
-
return `Keys here, ${found} of them — arrows for the rest`;
|
|
16385
|
+
return whole ? `Keys here, ${found} of them` : `Keys here, ${found} of them — arrows for the rest`;
|
|
16364
16386
|
};
|
|
16365
16387
|
PALETTE_WIDTH = 76;
|
|
16366
16388
|
PANEL_SHARE = .62;
|
|
@@ -16630,6 +16652,73 @@ var init_render = __esmMin((() => {
|
|
|
16630
16652
|
});
|
|
16631
16653
|
return new StyledText(drawn);
|
|
16632
16654
|
};
|
|
16655
|
+
SHEET_GAP = 3;
|
|
16656
|
+
sheetRow = (entry, room) => {
|
|
16657
|
+
return `${clip(keysOf(entry), 9).padEnd(PALETTE_KEY)}${clip(entry.title, Math.max(1, room - PALETTE_KEY))}`;
|
|
16658
|
+
};
|
|
16659
|
+
groupedBy = (rows) => {
|
|
16660
|
+
const groups = [];
|
|
16661
|
+
for (const [at, entry] of rows.entries()) {
|
|
16662
|
+
const last = groups.at(-1);
|
|
16663
|
+
if (last !== void 0 && rows[last[0] ?? 0]?.category === entry.category && last !== void 0) last.push(at);
|
|
16664
|
+
else groups.push([at]);
|
|
16665
|
+
}
|
|
16666
|
+
return groups;
|
|
16667
|
+
};
|
|
16668
|
+
sheetBlock = (rows, group, room) => [
|
|
16669
|
+
{
|
|
16670
|
+
text: rows[group[0] ?? 0]?.category ?? "",
|
|
16671
|
+
at: -1,
|
|
16672
|
+
heading: true
|
|
16673
|
+
},
|
|
16674
|
+
...group.map((at) => ({
|
|
16675
|
+
text: sheetRow(rows[at], room),
|
|
16676
|
+
at,
|
|
16677
|
+
heading: false
|
|
16678
|
+
})),
|
|
16679
|
+
{
|
|
16680
|
+
text: "",
|
|
16681
|
+
at: -1,
|
|
16682
|
+
heading: false
|
|
16683
|
+
}
|
|
16684
|
+
];
|
|
16685
|
+
splitInTwo = (blocks) => {
|
|
16686
|
+
const total = blocks.reduce((sum, block) => sum + block.length, 0);
|
|
16687
|
+
const left = [];
|
|
16688
|
+
const right = [];
|
|
16689
|
+
for (const block of blocks) if (left.length + block.length <= Math.ceil(total / 2) || left.length === 0) left.push(...block);
|
|
16690
|
+
else right.push(...block);
|
|
16691
|
+
return {
|
|
16692
|
+
left,
|
|
16693
|
+
right
|
|
16694
|
+
};
|
|
16695
|
+
};
|
|
16696
|
+
sheetPaint = (row, here, room) => {
|
|
16697
|
+
if (row === void 0) return fg(palette.ink)("".padEnd(room));
|
|
16698
|
+
const text = `${row.heading || row.at === -1 ? " " : here ? marks().cursor : " "} ${row.text}`.padEnd(room);
|
|
16699
|
+
if (row.heading) return fg(palette.accent)(text);
|
|
16700
|
+
return here ? bg(palette.selection)(fg(palette.ink)(text)) : fg(palette.ink)(text);
|
|
16701
|
+
};
|
|
16702
|
+
sheetDeep = (rows, room) => {
|
|
16703
|
+
const column = Math.max(12, Math.floor((room - SHEET_GAP) / 2));
|
|
16704
|
+
const { left, right } = splitInTwo(groupedBy(rows).map((group) => sheetBlock(rows, group, column - 2)));
|
|
16705
|
+
return Math.max(left.length, right.length);
|
|
16706
|
+
};
|
|
16707
|
+
sheetText = (rows, at, shown) => {
|
|
16708
|
+
const column = Math.max(12, Math.floor((shown.room - SHEET_GAP) / 2));
|
|
16709
|
+
const { left, right } = splitInTwo(groupedBy(rows).map((group) => sheetBlock(rows, group, column - 2)));
|
|
16710
|
+
const deep = Math.max(left.length, right.length);
|
|
16711
|
+
const where = left.findIndex((row) => row.at === at);
|
|
16712
|
+
const also = right.findIndex((row) => row.at === at);
|
|
16713
|
+
const on = where === -1 ? also : where;
|
|
16714
|
+
const top = Math.max(0, Math.min(deep - shown.height, on - Math.floor(shown.height / 2)));
|
|
16715
|
+
const drawn = [];
|
|
16716
|
+
for (let step = 0; step < Math.min(shown.height, deep); step += 1) {
|
|
16717
|
+
const row = top + step;
|
|
16718
|
+
drawn.push(sheetPaint(left[row], left[row]?.at === at, column), fg(palette.ink)(" ".repeat(SHEET_GAP)), sheetPaint(right[row], right[row]?.at === at, column), fg(palette.ink)("\n"));
|
|
16719
|
+
}
|
|
16720
|
+
return new StyledText(drawn);
|
|
16721
|
+
};
|
|
16633
16722
|
stack = (parent, children) => {
|
|
16634
16723
|
for (const child of children) parent.add(child);
|
|
16635
16724
|
};
|
|
@@ -17330,7 +17419,6 @@ var init_render = __esmMin((() => {
|
|
|
17330
17419
|
this.wheelOnSheet(this.keys);
|
|
17331
17420
|
this.wheelOnSheet(this.palette);
|
|
17332
17421
|
this.wheelOnRail(this.listPane);
|
|
17333
|
-
this.wheelOnRail(this.list);
|
|
17334
17422
|
this.view.listenTo({
|
|
17335
17423
|
scroll: (delta) => {
|
|
17336
17424
|
this.dragFrom = void 0;
|
|
@@ -17478,15 +17566,18 @@ var init_render = __esmMin((() => {
|
|
|
17478
17566
|
return;
|
|
17479
17567
|
}
|
|
17480
17568
|
const rows = keyMatches(state);
|
|
17481
|
-
const room =
|
|
17482
|
-
const keysRoom =
|
|
17569
|
+
const room = this.renderer.width;
|
|
17570
|
+
const keysRoom = this.renderer.height;
|
|
17483
17571
|
const shown = Math.max(1, keysRoom - PENDING_CHROME);
|
|
17484
|
-
this.keysTitle.content = keysTitle(rows.length, shown);
|
|
17485
|
-
this.keysChoices.content =
|
|
17572
|
+
this.keysTitle.content = keysTitle(rows.length, sheetDeep(rows, room - MODAL_ROOM) <= shown);
|
|
17573
|
+
this.keysChoices.content = sheetText(rows, Math.min(state.paletteIndex, Math.max(0, rows.length - 1)), {
|
|
17574
|
+
height: shown,
|
|
17575
|
+
room: room - MODAL_ROOM
|
|
17576
|
+
});
|
|
17486
17577
|
this.keys.height = keysRoom;
|
|
17487
17578
|
this.keys.width = room;
|
|
17488
|
-
this.keys.left =
|
|
17489
|
-
this.keys.top =
|
|
17579
|
+
this.keys.left = 0;
|
|
17580
|
+
this.keys.top = 0;
|
|
17490
17581
|
}
|
|
17491
17582
|
headerText(state) {
|
|
17492
17583
|
const branch = selectedBranch(state);
|
|
@@ -18179,6 +18270,7 @@ var init_app = __esmMin((() => {
|
|
|
18179
18270
|
leaving;
|
|
18180
18271
|
looking;
|
|
18181
18272
|
rolling = false;
|
|
18273
|
+
pendingRoll = 0;
|
|
18182
18274
|
ticking;
|
|
18183
18275
|
grewWithShift = false;
|
|
18184
18276
|
keys = [];
|
|
@@ -18986,13 +19078,18 @@ var init_app = __esmMin((() => {
|
|
|
18986
19078
|
const was = this.state.patchIndex;
|
|
18987
19079
|
this.commit(reduce(this.measured(), delta > 0 ? "comment.next" : "comment.prev"));
|
|
18988
19080
|
if (this.state.patchIndex !== was) yield* this.turnedTo();
|
|
18989
|
-
this.rolling = false;
|
|
18990
19081
|
});
|
|
18991
19082
|
}
|
|
18992
19083
|
rollFrom(delta) {
|
|
18993
|
-
|
|
18994
|
-
|
|
18995
|
-
|
|
19084
|
+
if (!onLayers(this.state)) {
|
|
19085
|
+
this.dispatchTask(this.rolled(delta));
|
|
19086
|
+
return;
|
|
19087
|
+
}
|
|
19088
|
+
if (this.rolling) {
|
|
19089
|
+
this.pendingRoll = delta;
|
|
19090
|
+
return;
|
|
19091
|
+
}
|
|
19092
|
+
this.rolling = true;
|
|
18996
19093
|
this.dispatchTask(this.rolled(delta));
|
|
18997
19094
|
}
|
|
18998
19095
|
stepped(delta) {
|
|
@@ -19040,7 +19137,13 @@ var init_app = __esmMin((() => {
|
|
|
19040
19137
|
const was = this.state.patchIndex;
|
|
19041
19138
|
this.commit(railScrolled(this.measured(), delta));
|
|
19042
19139
|
if (this.state.patchIndex !== was) yield* this.turnedTo();
|
|
19043
|
-
});
|
|
19140
|
+
}).pipe(ensuring(sync(() => this.rolledOn())));
|
|
19141
|
+
}
|
|
19142
|
+
rolledOn() {
|
|
19143
|
+
this.rolling = false;
|
|
19144
|
+
const held = this.pendingRoll;
|
|
19145
|
+
this.pendingRoll = 0;
|
|
19146
|
+
if (held !== 0) this.rollFrom(held > 0 ? 1 : -1);
|
|
19044
19147
|
}
|
|
19045
19148
|
moveFile(delta) {
|
|
19046
19149
|
return this.commitSynced(delta > 0 ? "file.next" : "file.prev");
|
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.136",
|
|
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": {
|
|
@@ -53,6 +53,8 @@
|
|
|
53
53
|
"sketch": "node --experimental-ffi --disable-warning=ExperimentalWarning scripts/sketch.ts",
|
|
54
54
|
"watch": "node --experimental-ffi --disable-warning=ExperimentalWarning scripts/watch.ts",
|
|
55
55
|
"serve": "node --experimental-ffi --disable-warning=ExperimentalWarning scripts/serve.ts",
|
|
56
|
-
"play": "node --watch --watch-path=src --watch-path=scripts --experimental-ffi --disable-warning=ExperimentalWarning scripts/play.ts"
|
|
56
|
+
"play": "node --watch --watch-path=src --watch-path=scripts --experimental-ffi --disable-warning=ExperimentalWarning scripts/play.ts",
|
|
57
|
+
"shot": "node --experimental-ffi --disable-warning=ExperimentalWarning scripts/shot.ts",
|
|
58
|
+
"pr-summary": "node scripts/pr-summary.ts"
|
|
57
59
|
}
|
|
58
60
|
}
|