@eliya-oss/agent-diff 0.1.0-alpha.180 → 0.1.0-alpha.181
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 +0 -1
- package/CHANGELOG.md +34 -0
- package/dist/main.js +304 -202
- package/package.json +1 -1
|
@@ -28,7 +28,6 @@ another PR needs so it records only its own tests.
|
|
|
28
28
|
|
|
29
29
|
A recording narrates itself, so somebody who has never opened adiff can follow it:
|
|
30
30
|
|
|
31
|
-
- it opens on a title card carrying the test's `when` and `then`
|
|
32
31
|
- each step is held for a second, with a band naming it in plain words — `open the branch`,
|
|
33
32
|
`leave a comment saying "worth a second look"` — and a key cap in the corner showing the key as it
|
|
34
33
|
is pressed, so the caption, the key and what happens on screen line up
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# @eliya-oss/agent-diff
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.181
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- feat(command palette): every overlay is drawn the same way: a bold title with its count at the right edge, a `›` before the query, one empty row between title, query, list and keys, the keys that work inside the box, and no line at the left edge.
|
|
8
|
+
|
|
9
|
+
<details><summary>What was wrong</summary>
|
|
10
|
+
|
|
11
|
+
Each overlay had its own spacing, its own title colour and its own row lead. The title and the
|
|
12
|
+
placeholder shared one faint colour on adjacent rows, the settings indented their titles two columns
|
|
13
|
+
past the palette's, and the keys that worked sat in the footer under the scrim, dimmed by the very
|
|
14
|
+
box they described.
|
|
15
|
+
|
|
16
|
+
</details>
|
|
17
|
+
|
|
18
|
+
feat(preferences): the preferences are a sheet along the bottom of the terminal, one row per preference with `on` or `off` in a value column, and what the highlighted one does said once under the list.
|
|
19
|
+
|
|
20
|
+
<details><summary>What was wrong</summary>
|
|
21
|
+
|
|
22
|
+
The preferences opened as a box over the middle of the diff, two rows per preference, so toggling
|
|
23
|
+
one meant looking past the box to see the diff it changed.
|
|
24
|
+
|
|
25
|
+
</details>
|
|
26
|
+
|
|
27
|
+
feat(command palette): commands are grouped under their category's headline, and the cursor row is painted across the whole box.
|
|
28
|
+
|
|
29
|
+
feat(preferences): the editor a line opens in is the last row of the preferences sheet, and return on it offers the editors on the machine.
|
|
30
|
+
|
|
31
|
+
fix(command palette): return runs the command under the cursor; it used to run the first match, because the return key reached the filter box first and reset the cursor.
|
|
32
|
+
|
|
33
|
+
fix(preferences): escape closes the sheet after a visit to the editor picker; it used to bounce back to the sheet forever.
|
|
34
|
+
|
|
35
|
+
fix(search): an empty search is one faint row saying where the matches will list, instead of a nine-row void.
|
|
36
|
+
|
|
3
37
|
## 0.1.0-alpha.180
|
|
4
38
|
|
|
5
39
|
### Patch Changes
|
package/dist/main.js
CHANGED
|
@@ -6,7 +6,7 @@ import { fileURLToPath } from "node:url";
|
|
|
6
6
|
import { join, resolve } from "node:path";
|
|
7
7
|
import { promisify } from "node:util";
|
|
8
8
|
import { homedir, hostname, platform } from "node:os";
|
|
9
|
-
import { ASCIIFontRenderable, BoxRenderable, CodeRenderable, KeyEvent, LineNumberRenderable, RGBA, StyledText, SyntaxStyle, TextRenderable, TextareaRenderable, bg, createCliRenderer, defaultTextareaKeyBindings, fg, fonts, getTreeSitterClient, pathToFiletype, stripAnsiSequences, t } from "@opentui/core";
|
|
9
|
+
import { ASCIIFontRenderable, BoxRenderable, CodeRenderable, KeyEvent, LineNumberRenderable, RGBA, StyledText, SyntaxStyle, TextRenderable, TextareaRenderable, bg, bold, createCliRenderer, defaultTextareaKeyBindings, fg, fonts, getTreeSitterClient, pathToFiletype, stripAnsiSequences, t } from "@opentui/core";
|
|
10
10
|
import { existsSync, mkdirSync, watch } from "node:fs";
|
|
11
11
|
//#region \0rolldown/runtime.js
|
|
12
12
|
var __defProp = Object.defineProperty;
|
|
@@ -10042,7 +10042,7 @@ var init_config = __esmMin((() => {
|
|
|
10042
10042
|
//#region package.json
|
|
10043
10043
|
init_pane();
|
|
10044
10044
|
init_config();
|
|
10045
|
-
var version$1 = "0.1.0-alpha.
|
|
10045
|
+
var version$1 = "0.1.0-alpha.181";
|
|
10046
10046
|
//#endregion
|
|
10047
10047
|
//#region src/cli/error.ts
|
|
10048
10048
|
var UnknownCommand, MissingOption, UnknownField, UnknownOption, BadOption, RegistryUnanswered;
|
|
@@ -16053,7 +16053,9 @@ var init_command = __esmMin((() => {
|
|
|
16053
16053
|
category: "App",
|
|
16054
16054
|
keys: ["return", "space"],
|
|
16055
16055
|
screens: ["settings"],
|
|
16056
|
-
|
|
16056
|
+
hint: "toggle",
|
|
16057
|
+
listed: false,
|
|
16058
|
+
rank: 1
|
|
16057
16059
|
}),
|
|
16058
16060
|
command({
|
|
16059
16061
|
action: "back",
|
|
@@ -16065,7 +16067,9 @@ var init_command = __esmMin((() => {
|
|
|
16065
16067
|
","
|
|
16066
16068
|
],
|
|
16067
16069
|
screens: ["settings"],
|
|
16068
|
-
|
|
16070
|
+
hint: "back",
|
|
16071
|
+
listed: false,
|
|
16072
|
+
rank: 9
|
|
16069
16073
|
}),
|
|
16070
16074
|
command({
|
|
16071
16075
|
action: "keys.open",
|
|
@@ -16514,7 +16518,7 @@ var init_match = __esmMin((() => {
|
|
|
16514
16518
|
}));
|
|
16515
16519
|
//#endregion
|
|
16516
16520
|
//#region src/tui/state.ts
|
|
16517
|
-
var HOLDS$1, chosenNow, withChosen, preferenceRows, nothingReviewed, nothingFound, initialState, selectedBranch, selectedPatch, pullHere, authorHere, theirPull, heldWhere, noteEditing, hasNoPull, onLayers, selectedLayer;
|
|
16521
|
+
var HOLDS$1, chosenNow, withChosen, EDITOR_ROW, editorRow, preferenceRows, nothingReviewed, nothingFound, initialState, selectedBranch, selectedPatch, pullHere, authorHere, theirPull, heldWhere, noteEditing, hasNoPull, onLayers, selectedLayer;
|
|
16518
16522
|
var init_state = __esmMin((() => {
|
|
16519
16523
|
init_preferences$1();
|
|
16520
16524
|
init_gaps();
|
|
@@ -16536,15 +16540,28 @@ var init_state = __esmMin((() => {
|
|
|
16536
16540
|
[held]: value
|
|
16537
16541
|
};
|
|
16538
16542
|
};
|
|
16543
|
+
EDITOR_ROW = "editor";
|
|
16544
|
+
editorRow = (state) => ({
|
|
16545
|
+
name: EDITOR_ROW,
|
|
16546
|
+
title: "Open lines in",
|
|
16547
|
+
about: "The editor e opens a line in. Return offers the ones on your machine.",
|
|
16548
|
+
on: state.editorNow.length > 0,
|
|
16549
|
+
said: state.editorNow.length === 0 ? "none found" : state.editorNow,
|
|
16550
|
+
here: state.settingsIndex === preferences.length
|
|
16551
|
+
});
|
|
16539
16552
|
preferenceRows = (state) => {
|
|
16540
16553
|
const held = chosenNow(state);
|
|
16541
|
-
return preferences.map((one, at) =>
|
|
16542
|
-
name
|
|
16543
|
-
|
|
16544
|
-
|
|
16545
|
-
|
|
16546
|
-
|
|
16547
|
-
|
|
16554
|
+
return [...preferences.map((one, at) => {
|
|
16555
|
+
const on = held[one.name] ?? one.byDefault;
|
|
16556
|
+
return {
|
|
16557
|
+
name: one.name,
|
|
16558
|
+
title: one.title,
|
|
16559
|
+
about: one.about,
|
|
16560
|
+
on,
|
|
16561
|
+
said: on ? "on" : "off",
|
|
16562
|
+
here: at === state.settingsIndex
|
|
16563
|
+
};
|
|
16564
|
+
}), editorRow(state)];
|
|
16548
16565
|
};
|
|
16549
16566
|
nothingReviewed = {
|
|
16550
16567
|
theirs: {},
|
|
@@ -16570,6 +16587,7 @@ var init_state = __esmMin((() => {
|
|
|
16570
16587
|
railRows: 12,
|
|
16571
16588
|
railScroll: -1,
|
|
16572
16589
|
settingsIndex: 0,
|
|
16590
|
+
beneath: "review",
|
|
16573
16591
|
asking: void 0,
|
|
16574
16592
|
askIndex: 0,
|
|
16575
16593
|
now: 0,
|
|
@@ -17677,7 +17695,7 @@ var init_notes = __esmMin((() => {
|
|
|
17677
17695
|
}));
|
|
17678
17696
|
//#endregion
|
|
17679
17697
|
//#region src/tui/reduce.ts
|
|
17680
|
-
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, aroundTheEnd, CAME_AROUND, moveFile$1, selectHunk, swapEnds, atBranch, grownBy, startSelection, draftMark, openCompose, outOfDiff, BACK_FROM, movedInList$1, goBack$1, walkMatches$1, openPalette, openKeys, openSettings, moveSettings, flipSetting, moveAsk, 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;
|
|
17698
|
+
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, aroundTheEnd, CAME_AROUND, moveFile$1, selectHunk, swapEnds, atBranch, grownBy, startSelection, draftMark, openCompose, outOfDiff, BACK_FROM, movedInList$1, goBack$1, walkMatches$1, openPalette, openKeys, openSettings, moveSettings, onTheEditorRow, flipSetting, moveAsk, moveRef, withChoices, withRefs, movePalette, groupedByCategory, 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;
|
|
17681
17699
|
var init_reduce = __esmMin((() => {
|
|
17682
17700
|
init_dist();
|
|
17683
17701
|
init_patch();
|
|
@@ -18183,7 +18201,7 @@ var init_reduce = __esmMin((() => {
|
|
|
18183
18201
|
}),
|
|
18184
18202
|
settings: (state) => ({
|
|
18185
18203
|
...state,
|
|
18186
|
-
screen: state.
|
|
18204
|
+
screen: state.beneath
|
|
18187
18205
|
}),
|
|
18188
18206
|
thread: (state) => ({
|
|
18189
18207
|
...state,
|
|
@@ -18244,12 +18262,14 @@ var init_reduce = __esmMin((() => {
|
|
|
18244
18262
|
...state,
|
|
18245
18263
|
screen: "settings",
|
|
18246
18264
|
returnTo: state.screen,
|
|
18265
|
+
beneath: state.screen,
|
|
18247
18266
|
settingsIndex: 0
|
|
18248
18267
|
});
|
|
18249
18268
|
moveSettings = (state, delta) => ({
|
|
18250
18269
|
...state,
|
|
18251
|
-
settingsIndex: clamp(state.settingsIndex + delta, 0,
|
|
18270
|
+
settingsIndex: clamp(state.settingsIndex + delta, 0, preferences.length)
|
|
18252
18271
|
});
|
|
18272
|
+
onTheEditorRow = (state) => state.settingsIndex === preferences.length;
|
|
18253
18273
|
flipSetting = (state) => {
|
|
18254
18274
|
const wanted = preferences[state.settingsIndex];
|
|
18255
18275
|
if (wanted === void 0) return state;
|
|
@@ -18281,7 +18301,8 @@ var init_reduce = __esmMin((() => {
|
|
|
18281
18301
|
...state,
|
|
18282
18302
|
paletteIndex: clamp(state.paletteIndex + delta, 0, Math.max(0, offered(state).length - 1))
|
|
18283
18303
|
});
|
|
18284
|
-
|
|
18304
|
+
groupedByCategory = (rows) => [...new Set(rows.map((row) => row.category))].flatMap((category) => rows.filter((row) => row.category === category));
|
|
18305
|
+
paletteMatches = (state) => groupedByCategory(searchCommands(state.returnTo, state.query));
|
|
18285
18306
|
keyMatches = (state) => searchGlossary(state.returnTo, state.query);
|
|
18286
18307
|
offered = (state) => state.screen === "keys" ? keyMatches(state) : paletteMatches(state);
|
|
18287
18308
|
paletteChoice = (state) => offered(state)[state.paletteIndex]?.action;
|
|
@@ -19936,13 +19957,14 @@ var init_panelpane = __esmMin((() => {
|
|
|
19936
19957
|
return line.here === true ? bg(restingOrHere(state.focus === "review"))(drawn) : drawn;
|
|
19937
19958
|
}));
|
|
19938
19959
|
};
|
|
19939
|
-
})), PANEL_SHARE, CRAMPED, shareOf, modalWidth, panelWidth, panelTop, panelRows, notchOf, ASKING;
|
|
19960
|
+
})), PANEL_SHARE, CRAMPED, shareOf, modalWidth, panelWidth, boxWidth, panelTop, panelRows, notchOf, ASKING;
|
|
19940
19961
|
var init_chrome = __esmMin((() => {
|
|
19941
19962
|
PANEL_SHARE = .62;
|
|
19942
19963
|
CRAMPED = "adiff needs more room than this";
|
|
19943
19964
|
shareOf = (width, least) => Math.max(least, Math.min(120, Math.floor(width * PANEL_SHARE)));
|
|
19944
19965
|
modalWidth = (width, wanted) => Math.max(0, Math.min(wanted, width - 4));
|
|
19945
19966
|
panelWidth = (width) => modalWidth(width, shareOf(width, 76));
|
|
19967
|
+
boxWidth = (width) => Math.min(panelWidth(width), 80);
|
|
19946
19968
|
panelTop = (height, part) => Math.max(2, Math.floor(height / part));
|
|
19947
19969
|
panelRows = (height, part) => Math.max(6, height - panelTop(height, part) - 2);
|
|
19948
19970
|
notchOf = (event) => {
|
|
@@ -20229,16 +20251,17 @@ var init_footer = __esmMin((() => {
|
|
|
20229
20251
|
}));
|
|
20230
20252
|
//#endregion
|
|
20231
20253
|
//#region src/tui/found.ts
|
|
20232
|
-
var nothingYet, counting, foundBlocks, JOIN, foundTitle, CHANGED_MARK, DECLARED, fileRow, leftRow, placeRow, blockOf, aroundRow, windowedBlocks;
|
|
20254
|
+
var NOTHING_TYPED, nothingYet, counting, foundBlocks, JOIN, foundTitle, CHANGED_MARK, DECLARED, fileRow, leftRow, placeRow, blockOf, aroundRow, windowedBlocks;
|
|
20233
20255
|
var init_found = __esmMin((() => {
|
|
20234
20256
|
init_marks();
|
|
20235
20257
|
init_notespane();
|
|
20236
20258
|
init_theme();
|
|
20237
20259
|
init_words();
|
|
20260
|
+
NOTHING_TYPED = "Matches list here as you type, with the file each one sits in.";
|
|
20238
20261
|
nothingYet = (state, room) => {
|
|
20239
20262
|
const wanted = state.query.trim();
|
|
20240
|
-
if (wanted.length === 0 || state.term.length === 0) return
|
|
20241
|
-
return clip(`
|
|
20263
|
+
if (wanted.length === 0 || state.term.length === 0) return clip(` ${NOTHING_TYPED}`, room).padEnd(room);
|
|
20264
|
+
return clip(` nothing uses ${wanted}`, room).padEnd(room);
|
|
20242
20265
|
};
|
|
20243
20266
|
counting = (many) => many.toLocaleString("en-US");
|
|
20244
20267
|
foundBlocks = (state, shown, wide) => {
|
|
@@ -20257,7 +20280,7 @@ var init_found = __esmMin((() => {
|
|
|
20257
20280
|
};
|
|
20258
20281
|
JOIN = " · ";
|
|
20259
20282
|
foundTitle = (state, room) => {
|
|
20260
|
-
if (state.term.length === 0) return "
|
|
20283
|
+
if (state.term.length === 0) return "Search";
|
|
20261
20284
|
const counted = state.counted;
|
|
20262
20285
|
if (counted.worktree === 0) return state.term;
|
|
20263
20286
|
const here = `${counting(counted.file)} in this file`;
|
|
@@ -20377,7 +20400,7 @@ var init_paint = __esmMin((() => {
|
|
|
20377
20400
|
}));
|
|
20378
20401
|
//#endregion
|
|
20379
20402
|
//#region src/tui/parts.ts
|
|
20380
|
-
var COMPOSE_WIDTH, frameRoot, crampedBar, bar, makeList, makeDiffPane, makePanel, makeListParts, makeListText, makeGutter, makeScroller, makeScrim, makeScroll, makePalette, asking,
|
|
20403
|
+
var COMPOSE_WIDTH, frameRoot, crampedBar, bar, makeList, makeDiffPane, makePanel, makeListParts, makeListText, makeGutter, makeScroller, makeScrim, makeScroll, makePalette, asking, PROMPT, prompted, makeChoices, flush, headed, makeModal, makeAsking, makeKeysParts, makeFoundParts, makeModals, makeBody, makeHome, isFont, logoFont, makeLanding, makeLogo, MAC_KEYS, makeComposeParts, makeCompose;
|
|
20381
20404
|
var init_parts = __esmMin((() => {
|
|
20382
20405
|
init_home();
|
|
20383
20406
|
init_layout();
|
|
@@ -20505,170 +20528,156 @@ var init_parts = __esmMin((() => {
|
|
|
20505
20528
|
minWidth: 0,
|
|
20506
20529
|
overflow: "hidden"
|
|
20507
20530
|
});
|
|
20508
|
-
makePalette = (renderer) => {
|
|
20509
|
-
|
|
20510
|
-
|
|
20511
|
-
|
|
20512
|
-
|
|
20513
|
-
|
|
20514
|
-
|
|
20531
|
+
makePalette = (renderer) => new BoxRenderable(renderer, {
|
|
20532
|
+
id: "palette",
|
|
20533
|
+
position: "absolute",
|
|
20534
|
+
width: 76,
|
|
20535
|
+
height: 6,
|
|
20536
|
+
zIndex: 100,
|
|
20537
|
+
visible: false,
|
|
20538
|
+
backgroundColor: palette.overlay,
|
|
20539
|
+
paddingLeft: 3,
|
|
20540
|
+
paddingRight: 3,
|
|
20541
|
+
paddingTop: 1,
|
|
20542
|
+
paddingBottom: 1,
|
|
20543
|
+
flexDirection: "column"
|
|
20544
|
+
});
|
|
20515
20545
|
asking = (renderer, id, placeholder = "Type to filter…") => new TextareaRenderable(renderer, {
|
|
20516
20546
|
id,
|
|
20517
20547
|
height: 1,
|
|
20518
20548
|
wrapMode: "none",
|
|
20519
20549
|
flexShrink: 0,
|
|
20520
|
-
|
|
20521
|
-
marginRight: 2,
|
|
20550
|
+
flexGrow: 1,
|
|
20522
20551
|
placeholder,
|
|
20523
20552
|
placeholderColor: palette.faint,
|
|
20524
|
-
backgroundColor: palette.
|
|
20525
|
-
focusedBackgroundColor: palette.
|
|
20553
|
+
backgroundColor: palette.overlay,
|
|
20554
|
+
focusedBackgroundColor: palette.overlay,
|
|
20526
20555
|
textColor: palette.ink,
|
|
20527
20556
|
focusedTextColor: palette.ink,
|
|
20528
20557
|
cursorColor: palette.ink
|
|
20529
20558
|
});
|
|
20530
|
-
|
|
20531
|
-
|
|
20532
|
-
const
|
|
20533
|
-
|
|
20534
|
-
|
|
20535
|
-
|
|
20536
|
-
|
|
20537
|
-
|
|
20538
|
-
|
|
20539
|
-
|
|
20540
|
-
|
|
20541
|
-
|
|
20542
|
-
|
|
20543
|
-
|
|
20559
|
+
PROMPT = "› ";
|
|
20560
|
+
prompted = (renderer, id, query) => {
|
|
20561
|
+
const row = new BoxRenderable(renderer, {
|
|
20562
|
+
id: `${id}-prompt`,
|
|
20563
|
+
height: 1,
|
|
20564
|
+
flexDirection: "row",
|
|
20565
|
+
flexShrink: 0,
|
|
20566
|
+
marginTop: 1,
|
|
20567
|
+
marginBottom: 1
|
|
20568
|
+
});
|
|
20569
|
+
row.add(new TextRenderable(renderer, {
|
|
20570
|
+
id: `${id}-mark`,
|
|
20571
|
+
content: PROMPT,
|
|
20572
|
+
fg: palette.accent,
|
|
20573
|
+
width: 2,
|
|
20574
|
+
height: 1,
|
|
20575
|
+
flexShrink: 0
|
|
20576
|
+
}));
|
|
20577
|
+
row.add(query);
|
|
20578
|
+
return row;
|
|
20544
20579
|
};
|
|
20545
|
-
makeChoices = (renderer) => new TextRenderable(renderer, {
|
|
20546
|
-
id:
|
|
20580
|
+
makeChoices = (renderer, id) => new TextRenderable(renderer, {
|
|
20581
|
+
id: `${id}-choices`,
|
|
20547
20582
|
content: "",
|
|
20548
20583
|
flexGrow: 1,
|
|
20549
20584
|
fg: palette.ink,
|
|
20550
20585
|
selectable: true
|
|
20551
20586
|
});
|
|
20552
|
-
|
|
20553
|
-
id
|
|
20554
|
-
|
|
20555
|
-
|
|
20556
|
-
|
|
20557
|
-
minWidth: 0,
|
|
20558
|
-
overflow: "hidden"
|
|
20559
|
-
});
|
|
20560
|
-
makeHome = (renderer) => ({
|
|
20561
|
-
logo: makeLogo(renderer),
|
|
20562
|
-
path: makeLanding(renderer, "landing", palette.muted, 0),
|
|
20563
|
-
keys: makeLanding(renderer, "landing-keys", palette.faint, 2)
|
|
20564
|
-
});
|
|
20565
|
-
makeModals = (renderer) => ({
|
|
20566
|
-
palette: makePaletteParts(renderer),
|
|
20567
|
-
sending: makeSendingParts(renderer),
|
|
20568
|
-
found: makeFoundParts(renderer),
|
|
20569
|
-
keys: makeKeysParts(renderer),
|
|
20570
|
-
settings: makeSettingsParts(renderer),
|
|
20571
|
-
reader: makeReaderParts(renderer),
|
|
20572
|
-
bases: makeBaseParts(renderer),
|
|
20573
|
-
ask: makeAskParts(renderer)
|
|
20574
|
-
});
|
|
20575
|
-
makeBaseParts = (renderer) => {
|
|
20576
|
-
const box = makePalette(renderer);
|
|
20577
|
-
const title = bar(renderer, "base-title", palette.faint);
|
|
20578
|
-
const query = asking(renderer, "base-query", "Type a branch, a tag or a commit…");
|
|
20579
|
-
const choices = makeChoices(renderer);
|
|
20580
|
-
box.id = "base";
|
|
20581
|
-
box.add(title);
|
|
20582
|
-
box.add(query);
|
|
20583
|
-
box.add(choices);
|
|
20584
|
-
return {
|
|
20585
|
-
box,
|
|
20586
|
-
title,
|
|
20587
|
-
query,
|
|
20588
|
-
choices
|
|
20589
|
-
};
|
|
20590
|
-
};
|
|
20591
|
-
makeAskParts = (renderer) => {
|
|
20592
|
-
const box = makePalette(renderer);
|
|
20593
|
-
const title = bar(renderer, "ask-title", palette.faint);
|
|
20594
|
-
const choices = makeChoices(renderer);
|
|
20595
|
-
box.id = "ask";
|
|
20596
|
-
box.add(title);
|
|
20597
|
-
box.add(choices);
|
|
20598
|
-
return {
|
|
20599
|
-
box,
|
|
20600
|
-
title,
|
|
20601
|
-
choices
|
|
20602
|
-
};
|
|
20587
|
+
flush = (renderer, id, color) => {
|
|
20588
|
+
const made = bar(renderer, id, color);
|
|
20589
|
+
made.marginLeft = 0;
|
|
20590
|
+
made.marginRight = 0;
|
|
20591
|
+
return made;
|
|
20603
20592
|
};
|
|
20604
|
-
|
|
20593
|
+
headed = (renderer, id) => {
|
|
20605
20594
|
const box = makePalette(renderer);
|
|
20606
|
-
|
|
20607
|
-
const
|
|
20608
|
-
|
|
20595
|
+
box.id = id;
|
|
20596
|
+
const title = flush(renderer, `${id}-title`, palette.accent);
|
|
20597
|
+
const sub = flush(renderer, `${id}-sub`, palette.muted);
|
|
20598
|
+
sub.height = 0;
|
|
20599
|
+
const keys = flush(renderer, `${id}-keys`, palette.faint);
|
|
20600
|
+
keys.marginTop = 1;
|
|
20609
20601
|
box.add(title);
|
|
20610
|
-
box.add(
|
|
20602
|
+
box.add(sub);
|
|
20611
20603
|
return {
|
|
20612
20604
|
box,
|
|
20613
20605
|
title,
|
|
20614
|
-
|
|
20606
|
+
sub,
|
|
20607
|
+
keys
|
|
20615
20608
|
};
|
|
20616
20609
|
};
|
|
20617
|
-
|
|
20618
|
-
const
|
|
20619
|
-
const
|
|
20620
|
-
|
|
20621
|
-
box.
|
|
20622
|
-
box.add(
|
|
20623
|
-
box.add(choices);
|
|
20610
|
+
makeModal = (renderer, id) => {
|
|
20611
|
+
const head = headed(renderer, id);
|
|
20612
|
+
const choices = makeChoices(renderer, id);
|
|
20613
|
+
choices.marginTop = 1;
|
|
20614
|
+
head.box.add(choices);
|
|
20615
|
+
head.box.add(head.keys);
|
|
20624
20616
|
return {
|
|
20625
|
-
|
|
20626
|
-
title,
|
|
20617
|
+
...head,
|
|
20627
20618
|
choices
|
|
20628
20619
|
};
|
|
20629
20620
|
};
|
|
20630
|
-
|
|
20631
|
-
const
|
|
20632
|
-
const
|
|
20633
|
-
const choices = makeChoices(renderer);
|
|
20634
|
-
box.id
|
|
20635
|
-
box.add(
|
|
20636
|
-
box.add(
|
|
20621
|
+
makeAsking = (renderer, id, placeholder) => {
|
|
20622
|
+
const head = headed(renderer, id);
|
|
20623
|
+
const query = asking(renderer, `${id}-query`, placeholder);
|
|
20624
|
+
const choices = makeChoices(renderer, id);
|
|
20625
|
+
head.box.add(prompted(renderer, id, query));
|
|
20626
|
+
head.box.add(choices);
|
|
20627
|
+
head.box.add(head.keys);
|
|
20637
20628
|
return {
|
|
20638
|
-
|
|
20639
|
-
|
|
20629
|
+
...head,
|
|
20630
|
+
query,
|
|
20640
20631
|
choices
|
|
20641
20632
|
};
|
|
20642
20633
|
};
|
|
20643
20634
|
makeKeysParts = (renderer) => {
|
|
20644
|
-
const parts =
|
|
20645
|
-
|
|
20646
|
-
|
|
20635
|
+
const parts = makeAsking(renderer, "keys");
|
|
20636
|
+
const legend = flush(renderer, "keys-legend", palette.faint);
|
|
20637
|
+
legend.marginTop = 1;
|
|
20638
|
+
parts.box.remove(parts.keys);
|
|
20647
20639
|
parts.box.add(legend);
|
|
20640
|
+
parts.box.add(parts.keys);
|
|
20648
20641
|
return {
|
|
20649
20642
|
...parts,
|
|
20650
20643
|
legend
|
|
20651
20644
|
};
|
|
20652
20645
|
};
|
|
20653
20646
|
makeFoundParts = (renderer) => {
|
|
20654
|
-
const
|
|
20655
|
-
const
|
|
20656
|
-
|
|
20657
|
-
|
|
20658
|
-
|
|
20659
|
-
box.
|
|
20660
|
-
box.add(title);
|
|
20661
|
-
box.add(query);
|
|
20662
|
-
box.add(choices);
|
|
20663
|
-
box.add(peek);
|
|
20647
|
+
const parts = makeAsking(renderer, "found", "Type what to look for…");
|
|
20648
|
+
const peek = flush(renderer, "found-peek", palette.muted);
|
|
20649
|
+
peek.height = 0;
|
|
20650
|
+
parts.box.remove(parts.keys);
|
|
20651
|
+
parts.box.add(peek);
|
|
20652
|
+
parts.box.add(parts.keys);
|
|
20664
20653
|
return {
|
|
20665
|
-
|
|
20666
|
-
|
|
20667
|
-
query,
|
|
20668
|
-
peek,
|
|
20669
|
-
choices
|
|
20654
|
+
...parts,
|
|
20655
|
+
peek
|
|
20670
20656
|
};
|
|
20671
20657
|
};
|
|
20658
|
+
makeModals = (renderer) => ({
|
|
20659
|
+
palette: makeAsking(renderer, "palette"),
|
|
20660
|
+
found: makeFoundParts(renderer),
|
|
20661
|
+
keys: makeKeysParts(renderer),
|
|
20662
|
+
settings: makeModal(renderer, "settings"),
|
|
20663
|
+
sending: makeModal(renderer, "sending"),
|
|
20664
|
+
reader: makeModal(renderer, "reader"),
|
|
20665
|
+
bases: makeAsking(renderer, "base", "Type a branch, a tag or a commit…"),
|
|
20666
|
+
ask: makeModal(renderer, "ask")
|
|
20667
|
+
});
|
|
20668
|
+
makeBody = (renderer) => new BoxRenderable(renderer, {
|
|
20669
|
+
id: "body",
|
|
20670
|
+
flexGrow: 1,
|
|
20671
|
+
flexDirection: "row",
|
|
20672
|
+
minHeight: 0,
|
|
20673
|
+
minWidth: 0,
|
|
20674
|
+
overflow: "hidden"
|
|
20675
|
+
});
|
|
20676
|
+
makeHome = (renderer) => ({
|
|
20677
|
+
logo: makeLogo(renderer),
|
|
20678
|
+
path: makeLanding(renderer, "landing", palette.muted, 0),
|
|
20679
|
+
keys: makeLanding(renderer, "landing-keys", palette.faint, 2)
|
|
20680
|
+
});
|
|
20672
20681
|
isFont = (name) => name in fonts;
|
|
20673
20682
|
logoFont = () => {
|
|
20674
20683
|
const wanted = process.env["ADIFF_FONT"] ?? "";
|
|
@@ -20798,7 +20807,7 @@ var init_parts = __esmMin((() => {
|
|
|
20798
20807
|
}));
|
|
20799
20808
|
//#endregion
|
|
20800
20809
|
//#region src/tui/sheets.ts
|
|
20801
|
-
var PALETTE_KEY,
|
|
20810
|
+
var PALETTE_KEY, PALETTE_GAP, titleText, LEGEND, legendText, keysTitle, keysOf, windowed, listText, SHEET_GAP, sheetRow, groupedBy, sheetBlock, splitInTwo, sheetPaint, paletteBlocks, windowTop, paletteDeep, paletteText, sheetDeep, sheetText, REWRITTEN_TAIL, NOTHING_HELD, sendingTitle, noteBlock, sendingRows, sendingTop, TONES, notePaint, sendingText, askText, SETTING_TITLE, settingsText, offeredIn, onHeldEntry, readerTitle, voicesOf, readerText, pickingTitle, YOURS, YOUR_REF, pickedTail;
|
|
20802
20811
|
var init_sheets = __esmMin((() => {
|
|
20803
20812
|
init_command();
|
|
20804
20813
|
init_diffview();
|
|
@@ -20810,10 +20819,16 @@ var init_sheets = __esmMin((() => {
|
|
|
20810
20819
|
init_panelpane();
|
|
20811
20820
|
init_state();
|
|
20812
20821
|
init_theme();
|
|
20822
|
+
init_chrome();
|
|
20813
20823
|
init_words();
|
|
20814
20824
|
PALETTE_KEY = 11;
|
|
20815
|
-
PALETTE_TITLE = 60;
|
|
20816
20825
|
PALETTE_GAP = 2;
|
|
20826
|
+
titleText = (titled, room) => {
|
|
20827
|
+
const spent = titled.count.length === 0 ? 0 : titled.count.length + PALETTE_GAP;
|
|
20828
|
+
const shown = clip(titled.title, Math.max(1, room - spent));
|
|
20829
|
+
const gap = Math.max(0, room - shown.length - titled.count.length);
|
|
20830
|
+
return new StyledText([bold(fg(palette.accent)(shown)), fg(palette.muted)(`${" ".repeat(gap)}${titled.count}`)]);
|
|
20831
|
+
};
|
|
20817
20832
|
LEGEND = [
|
|
20818
20833
|
["filed", "written"],
|
|
20819
20834
|
["waiting", "picked up"],
|
|
@@ -20831,16 +20846,16 @@ var init_sheets = __esmMin((() => {
|
|
|
20831
20846
|
return clip([...said, ...voices].join(" "), room);
|
|
20832
20847
|
};
|
|
20833
20848
|
keysTitle = (found, whole) => {
|
|
20834
|
-
if (found === 0) return
|
|
20835
|
-
|
|
20849
|
+
if (found === 0) return {
|
|
20850
|
+
title: "No key matches",
|
|
20851
|
+
count: ""
|
|
20852
|
+
};
|
|
20853
|
+
return {
|
|
20854
|
+
title: "Keys",
|
|
20855
|
+
count: whole ? `${found}` : `${found}, arrows for the rest`
|
|
20856
|
+
};
|
|
20836
20857
|
};
|
|
20837
20858
|
keysOf = (entry) => entry.keys.map((one) => displayKey(one)).join(" ");
|
|
20838
|
-
commandRow = (entry, room) => {
|
|
20839
|
-
const key = clip(keysOf(entry), 9).padEnd(PALETTE_KEY);
|
|
20840
|
-
const left = Math.max(1, Math.min(PALETTE_TITLE, room - PALETTE_KEY - entry.category.length - PALETTE_GAP));
|
|
20841
|
-
return `${key}${clip(entry.title, left - PALETTE_GAP).padEnd(left)}${entry.category}`;
|
|
20842
|
-
};
|
|
20843
|
-
LIST_LEAD = 2;
|
|
20844
20859
|
windowed = (rows, at, height) => {
|
|
20845
20860
|
if (rows.length <= height) return {
|
|
20846
20861
|
rows,
|
|
@@ -20853,11 +20868,11 @@ var init_sheets = __esmMin((() => {
|
|
|
20853
20868
|
from
|
|
20854
20869
|
};
|
|
20855
20870
|
};
|
|
20856
|
-
listText = (rows, at, height) => {
|
|
20871
|
+
listText = (rows, at, height, wide) => {
|
|
20857
20872
|
const shown = windowed(rows, at, Math.max(1, height));
|
|
20858
20873
|
const drawn = shown.rows.map((row, index) => {
|
|
20859
20874
|
const here = shown.from + index === at;
|
|
20860
|
-
const text = `${here ? marks().cursor : " "} ${row}`.padEnd(
|
|
20875
|
+
const text = `${here ? marks().cursor : " "} ${row}`.padEnd(wide);
|
|
20861
20876
|
return here ? bg(palette.selection)(fg(palette.ink)(`${text}\n`)) : fg(palette.ink)(`${text}\n`);
|
|
20862
20877
|
});
|
|
20863
20878
|
return new StyledText(drawn);
|
|
@@ -20906,9 +20921,25 @@ var init_sheets = __esmMin((() => {
|
|
|
20906
20921
|
sheetPaint = (row, here, room) => {
|
|
20907
20922
|
if (row === void 0) return fg(palette.ink)("".padEnd(room));
|
|
20908
20923
|
const text = `${row.heading || row.at === -1 ? " " : here ? marks().cursor : " "} ${row.text}`.padEnd(room);
|
|
20909
|
-
if (row.heading) return fg(palette.
|
|
20924
|
+
if (row.heading) return bold(fg(palette.muted)(text));
|
|
20910
20925
|
return here ? bg(palette.selection)(fg(palette.ink)(text)) : fg(palette.ink)(text);
|
|
20911
20926
|
};
|
|
20927
|
+
paletteBlocks = (rows, room) => {
|
|
20928
|
+
return [...new Set(rows.map((entry) => entry.category))].map((category) => sheetBlock(rows, rows.flatMap((entry, at) => entry.category === category ? [at] : []), room)).flat().slice(0, -1);
|
|
20929
|
+
};
|
|
20930
|
+
windowTop = (listed, on, height) => {
|
|
20931
|
+
const centred = Math.max(0, Math.min(listed.length - height, on - Math.floor(height / 2)));
|
|
20932
|
+
const withHeading = centred > 0 && listed[centred - 1]?.heading === true ? centred - 1 : centred;
|
|
20933
|
+
return on < 0 || on >= withHeading && on < withHeading + height ? withHeading : centred;
|
|
20934
|
+
};
|
|
20935
|
+
paletteDeep = (rows, room) => paletteBlocks(rows, room - 2).length;
|
|
20936
|
+
paletteText = (rows, at, shown) => {
|
|
20937
|
+
const listed = paletteBlocks(rows, shown.room - 2);
|
|
20938
|
+
const on = listed.findIndex((row) => row.at === at);
|
|
20939
|
+
const top = windowTop(listed, on, shown.height);
|
|
20940
|
+
const drawn = listed.slice(top, top + shown.height).flatMap((row) => [sheetPaint(row, row.at === at, shown.room), fg(palette.ink)("\n")]);
|
|
20941
|
+
return new StyledText(drawn);
|
|
20942
|
+
};
|
|
20912
20943
|
sheetDeep = (rows, room) => {
|
|
20913
20944
|
const column = Math.max(12, Math.floor((room - SHEET_GAP) / 2));
|
|
20914
20945
|
const { left, right } = splitInTwo(groupedBy(rows).map((group) => sheetBlock(rows, group, column - 2)));
|
|
@@ -20980,7 +21011,7 @@ var init_sheets = __esmMin((() => {
|
|
|
20980
21011
|
return here ? bg(palette.selection)(fg(palette.ink)(`${text}\n`)) : fg(TONES[row.tone])(`${text}\n`);
|
|
20981
21012
|
};
|
|
20982
21013
|
sendingText = (state, shown) => {
|
|
20983
|
-
const rows = sendingRows(state, Math.max(1, shown.room -
|
|
21014
|
+
const rows = sendingRows(state, Math.max(1, shown.room - 2));
|
|
20984
21015
|
const top = sendingTop(rows, state.sendIndex, shown.height);
|
|
20985
21016
|
const drawn = rows.slice(top, top + shown.height).map((row) => notePaint(row, row.tone === "heading" && row.note === state.sendIndex, shown.room));
|
|
20986
21017
|
return new StyledText(drawn);
|
|
@@ -20993,16 +21024,17 @@ var init_sheets = __esmMin((() => {
|
|
|
20993
21024
|
});
|
|
20994
21025
|
return new StyledText([...listed, ...drawn]);
|
|
20995
21026
|
};
|
|
20996
|
-
|
|
21027
|
+
SETTING_TITLE = 36;
|
|
20997
21028
|
settingsText = (rows, room) => {
|
|
20998
21029
|
const drawn = rows.flatMap((row) => {
|
|
20999
|
-
const
|
|
21000
|
-
const
|
|
21001
|
-
|
|
21002
|
-
|
|
21003
|
-
return [row.here ? bg(palette.selection)(fg(palette.ink)(`${head.padEnd(room)}\n`)) : fg(tone)(`${head.padEnd(room)}\n`), fg(palette.faint)(`${said.padEnd(room)}\n`)];
|
|
21030
|
+
const head = `${row.here ? marks().cursor : " "} ${clip(row.title, 34).padEnd(SETTING_TITLE)}`;
|
|
21031
|
+
const state = clip(row.said, Math.max(1, room - head.length)).padEnd(Math.max(0, room - head.length));
|
|
21032
|
+
if (row.here) return [bg(palette.selection)(fg(palette.ink)(`${head}${state}\n`))];
|
|
21033
|
+
return [fg(palette.ink)(head), fg(row.on ? palette.added : palette.muted)(`${state}\n`)];
|
|
21004
21034
|
});
|
|
21005
|
-
|
|
21035
|
+
const here = rows.find((row) => row.here);
|
|
21036
|
+
const about = here === void 0 ? [] : [fg(palette.ink)("\n"), fg(palette.faint)(`${` ${clip(here.about, Math.max(8, room - 2))}`.padEnd(room)}\n`)];
|
|
21037
|
+
return new StyledText([...drawn, ...about]);
|
|
21006
21038
|
};
|
|
21007
21039
|
offeredIn = (state) => ({
|
|
21008
21040
|
comments: state.sent.length,
|
|
@@ -21055,10 +21087,16 @@ var init_sheets = __esmMin((() => {
|
|
|
21055
21087
|
return new StyledText(rows.map((line) => fg(line.startsWith("│") ? palette.faint : palette.ink)(`${line.padEnd(room)}\n`)));
|
|
21056
21088
|
};
|
|
21057
21089
|
pickingTitle = (state) => {
|
|
21058
|
-
if (state.screen === "editor") return
|
|
21090
|
+
if (state.screen === "editor") return {
|
|
21091
|
+
title: "Editor",
|
|
21092
|
+
sub: state.editorNow.length === 0 ? "none found" : `now ${state.editorNow}`
|
|
21093
|
+
};
|
|
21059
21094
|
const here = selectedBranch(state);
|
|
21060
21095
|
const on = here === void 0 ? "" : `${here.base}${here.basis === "set" ? "" : ", adiff's guess"}`;
|
|
21061
|
-
return
|
|
21096
|
+
return {
|
|
21097
|
+
title: "Base",
|
|
21098
|
+
sub: `for ${here?.branch ?? "this branch"}${on.length === 0 ? "" : ` · now ${on}`}`
|
|
21099
|
+
};
|
|
21062
21100
|
};
|
|
21063
21101
|
YOURS = " ← the command you typed";
|
|
21064
21102
|
YOUR_REF = " ← the ref you typed";
|
|
@@ -21069,7 +21107,7 @@ var init_sheets = __esmMin((() => {
|
|
|
21069
21107
|
}));
|
|
21070
21108
|
//#endregion
|
|
21071
21109
|
//#region src/tui/render.ts
|
|
21072
|
-
var stack, Screen;
|
|
21110
|
+
var ASK_REF, ASK_COMMAND, stack, Screen;
|
|
21073
21111
|
var init_render = __esmMin((() => {
|
|
21074
21112
|
init_patch();
|
|
21075
21113
|
init_command();
|
|
@@ -21096,6 +21134,8 @@ var init_render = __esmMin((() => {
|
|
|
21096
21134
|
init_words();
|
|
21097
21135
|
init_chrome();
|
|
21098
21136
|
init_theme();
|
|
21137
|
+
ASK_REF = "Type a branch, a tag or a commit…";
|
|
21138
|
+
ASK_COMMAND = "Type the command that opens a file, or pick one…";
|
|
21099
21139
|
stack = (parent, children) => {
|
|
21100
21140
|
for (const child of children) parent.add(child);
|
|
21101
21141
|
};
|
|
@@ -21134,6 +21174,7 @@ var init_render = __esmMin((() => {
|
|
|
21134
21174
|
keys;
|
|
21135
21175
|
keysTitle;
|
|
21136
21176
|
baseBox;
|
|
21177
|
+
modals;
|
|
21137
21178
|
settings;
|
|
21138
21179
|
settingsTitle;
|
|
21139
21180
|
settingsChoices;
|
|
@@ -21182,6 +21223,7 @@ var init_render = __esmMin((() => {
|
|
|
21182
21223
|
this.scrim = makeScrim(renderer);
|
|
21183
21224
|
this.gutter = makeGutter(renderer);
|
|
21184
21225
|
const modals = makeModals(renderer);
|
|
21226
|
+
this.modals = modals;
|
|
21185
21227
|
this.palette = modals.palette.box;
|
|
21186
21228
|
this.paletteTitle = modals.palette.title;
|
|
21187
21229
|
this.paletteQuery = modals.palette.query;
|
|
@@ -21358,7 +21400,8 @@ var init_render = __esmMin((() => {
|
|
|
21358
21400
|
this.paintAsk(state);
|
|
21359
21401
|
this.paintFound(state);
|
|
21360
21402
|
this.paintReport(state);
|
|
21361
|
-
this.
|
|
21403
|
+
this.paintModalKeys();
|
|
21404
|
+
this.scrim.visible = state.screen !== "branches" && state.screen !== "review" && state.screen !== "settings";
|
|
21362
21405
|
this.paintCramped();
|
|
21363
21406
|
}
|
|
21364
21407
|
paintCramped() {
|
|
@@ -21377,10 +21420,20 @@ var init_render = __esmMin((() => {
|
|
|
21377
21420
|
return;
|
|
21378
21421
|
}
|
|
21379
21422
|
const matches = paletteMatches(state);
|
|
21380
|
-
|
|
21381
|
-
|
|
21382
|
-
|
|
21383
|
-
|
|
21423
|
+
const room = boxWidth(this.renderer.width);
|
|
21424
|
+
this.paletteTitle.content = titleText(matches.length === 0 ? {
|
|
21425
|
+
title: "No command matches",
|
|
21426
|
+
count: ""
|
|
21427
|
+
} : {
|
|
21428
|
+
title: "Commands",
|
|
21429
|
+
count: `${matches.length}`
|
|
21430
|
+
}, room - 8);
|
|
21431
|
+
const inside = room - 6;
|
|
21432
|
+
const paletteRoom = Math.min(panelRows(this.renderer.height, 4), paletteDeep(matches, inside) + 8);
|
|
21433
|
+
this.paletteChoices.content = paletteText(matches, Math.min(state.paletteIndex, Math.max(0, matches.length - 1)), {
|
|
21434
|
+
height: Math.max(1, paletteRoom - 8),
|
|
21435
|
+
room: inside
|
|
21436
|
+
});
|
|
21384
21437
|
this.palette.height = paletteRoom;
|
|
21385
21438
|
this.palette.width = room;
|
|
21386
21439
|
this.palette.left = Math.max(1, Math.floor((this.renderer.width - room) / 2));
|
|
@@ -21390,16 +21443,24 @@ var init_render = __esmMin((() => {
|
|
|
21390
21443
|
this.baseBox.box.visible = isPicking(state);
|
|
21391
21444
|
if (!isPicking(state)) {
|
|
21392
21445
|
this.baseBox.title.content = "";
|
|
21446
|
+
this.baseBox.sub.content = "";
|
|
21393
21447
|
this.baseBox.choices.content = "";
|
|
21394
21448
|
return;
|
|
21395
21449
|
}
|
|
21396
21450
|
const shown = refsShown(state);
|
|
21397
|
-
const room =
|
|
21398
|
-
|
|
21451
|
+
const room = boxWidth(this.renderer.width);
|
|
21452
|
+
const picking = pickingTitle(state);
|
|
21453
|
+
this.baseBox.title.content = titleText({
|
|
21454
|
+
title: picking.title,
|
|
21455
|
+
count: ""
|
|
21456
|
+
}, room - 8);
|
|
21457
|
+
this.baseBox.sub.height = 1;
|
|
21458
|
+
this.baseBox.sub.content = clip(picking.sub, room - 8);
|
|
21399
21459
|
this.baseBox.query.visible = true;
|
|
21400
|
-
|
|
21460
|
+
this.baseBox.query.placeholder = state.screen === "editor" ? ASK_COMMAND : ASK_REF;
|
|
21461
|
+
const tall = Math.min(panelRows(this.renderer.height, 4), shown.length + 8 + 1);
|
|
21401
21462
|
const typed = state.query.trim();
|
|
21402
|
-
this.baseBox.choices.content = listText(shown.map((ref) => clip(
|
|
21463
|
+
this.baseBox.choices.content = listText(shown.map((ref) => clip(`${ref}${refNoteOf(state, ref).length === 0 ? "" : ` ${refNoteOf(state, ref)}`}${pickedTail(state, ref, typed)}`, room - 8)), Math.min(state.refIndex, Math.max(0, shown.length - 1)), Math.max(1, tall - 8 - 1), room - 6);
|
|
21403
21464
|
this.baseBox.box.height = tall;
|
|
21404
21465
|
this.baseBox.box.width = room;
|
|
21405
21466
|
this.baseBox.box.left = Math.max(1, Math.floor((this.renderer.width - room) / 2));
|
|
@@ -21413,14 +21474,19 @@ var init_render = __esmMin((() => {
|
|
|
21413
21474
|
return;
|
|
21414
21475
|
}
|
|
21415
21476
|
const rows = preferenceRows(state);
|
|
21416
|
-
const room =
|
|
21417
|
-
const tall = Math.min(
|
|
21418
|
-
this.settingsTitle.content =
|
|
21419
|
-
|
|
21477
|
+
const room = this.renderer.width;
|
|
21478
|
+
const tall = Math.min(this.renderer.height, rows.length + 6 + 2);
|
|
21479
|
+
this.settingsTitle.content = titleText({
|
|
21480
|
+
title: "Preferences",
|
|
21481
|
+
count: ""
|
|
21482
|
+
}, room - 8);
|
|
21483
|
+
this.settingsChoices.content = settingsText(rows, room - 6);
|
|
21484
|
+
this.settings.paddingTop = 1;
|
|
21485
|
+
this.settings.paddingBottom = 1;
|
|
21420
21486
|
this.settings.height = tall;
|
|
21421
21487
|
this.settings.width = room;
|
|
21422
|
-
this.settings.left =
|
|
21423
|
-
this.settings.top =
|
|
21488
|
+
this.settings.left = 0;
|
|
21489
|
+
this.settings.top = Math.max(0, this.renderer.height - tall);
|
|
21424
21490
|
}
|
|
21425
21491
|
paintAsk(state) {
|
|
21426
21492
|
this.ask.box.visible = state.screen === "settling";
|
|
@@ -21429,13 +21495,16 @@ var init_render = __esmMin((() => {
|
|
|
21429
21495
|
this.ask.choices.content = "";
|
|
21430
21496
|
return;
|
|
21431
21497
|
}
|
|
21432
|
-
const room =
|
|
21498
|
+
const room = boxWidth(this.renderer.width);
|
|
21433
21499
|
const asked = askingWords(state);
|
|
21434
21500
|
const forName = Math.max(8, room - 8 - asked.tail.length);
|
|
21435
21501
|
const name = asked.path ? clipPath(asked.name, forName) : clipMiddle(asked.name, forName);
|
|
21436
|
-
this.ask.title.content =
|
|
21437
|
-
|
|
21438
|
-
|
|
21502
|
+
this.ask.title.content = titleText({
|
|
21503
|
+
title: `${name}${asked.tail}`,
|
|
21504
|
+
count: ""
|
|
21505
|
+
}, room - 8);
|
|
21506
|
+
this.ask.choices.content = askText(state, room - 6);
|
|
21507
|
+
this.ask.box.height = askedThreads(state).length + askedRows(state).length + 6;
|
|
21439
21508
|
this.ask.box.width = room;
|
|
21440
21509
|
this.ask.box.left = Math.max(1, Math.floor((this.renderer.width - room) / 2));
|
|
21441
21510
|
this.ask.box.top = panelTop(this.renderer.height, 4);
|
|
@@ -21449,9 +21518,12 @@ var init_render = __esmMin((() => {
|
|
|
21449
21518
|
return;
|
|
21450
21519
|
}
|
|
21451
21520
|
const room = panelWidth(this.renderer.width);
|
|
21452
|
-
this.reader.title.content =
|
|
21521
|
+
this.reader.title.content = titleText({
|
|
21522
|
+
title: readerTitle(state, entry),
|
|
21523
|
+
count: ""
|
|
21524
|
+
}, room - 8);
|
|
21453
21525
|
this.reader.choices.content = readerText(entry, room - 8);
|
|
21454
|
-
this.reader.box.height = Math.min(panelRows(this.renderer.height, 4), voicesOf(entry).length + lostCode(entry).length +
|
|
21526
|
+
this.reader.box.height = Math.min(panelRows(this.renderer.height, 4), voicesOf(entry).length + lostCode(entry).length + 6 + 8);
|
|
21455
21527
|
this.reader.box.width = room;
|
|
21456
21528
|
this.reader.box.left = Math.max(1, Math.floor((this.renderer.width - room) / 2));
|
|
21457
21529
|
this.reader.box.top = panelTop(this.renderer.height, 4);
|
|
@@ -21464,11 +21536,14 @@ var init_render = __esmMin((() => {
|
|
|
21464
21536
|
return;
|
|
21465
21537
|
}
|
|
21466
21538
|
const room = this.renderer.width;
|
|
21467
|
-
const tall = Math.max(
|
|
21468
|
-
this.sending.title.content =
|
|
21539
|
+
const tall = Math.max(6, this.renderer.height - 1);
|
|
21540
|
+
this.sending.title.content = titleText({
|
|
21541
|
+
title: sendingTitle(state),
|
|
21542
|
+
count: ""
|
|
21543
|
+
}, room - 8);
|
|
21469
21544
|
this.sending.choices.content = sendingText(state, {
|
|
21470
|
-
height: Math.max(1, tall -
|
|
21471
|
-
room: room -
|
|
21545
|
+
height: Math.max(1, tall - 6),
|
|
21546
|
+
room: room - 6
|
|
21472
21547
|
});
|
|
21473
21548
|
this.sending.box.height = tall;
|
|
21474
21549
|
this.sending.box.width = room;
|
|
@@ -21486,11 +21561,11 @@ var init_render = __esmMin((() => {
|
|
|
21486
21561
|
const rows = keyMatches(state);
|
|
21487
21562
|
const room = this.renderer.width;
|
|
21488
21563
|
const keysRoom = this.renderer.height;
|
|
21489
|
-
const shown = Math.max(1, keysRoom -
|
|
21490
|
-
this.keysTitle.content = keysTitle(rows.length, sheetDeep(rows, room - 8) <= shown);
|
|
21564
|
+
const shown = Math.max(1, keysRoom - 8 - 1 - 1);
|
|
21565
|
+
this.keysTitle.content = titleText(keysTitle(rows.length, sheetDeep(rows, room - 8) <= shown), room - 8);
|
|
21491
21566
|
this.keysChoices.content = sheetText(rows, Math.min(state.paletteIndex, Math.max(0, rows.length - 1)), {
|
|
21492
21567
|
height: shown,
|
|
21493
|
-
room: room -
|
|
21568
|
+
room: room - 6
|
|
21494
21569
|
});
|
|
21495
21570
|
this.keysLegend.content = legendText(room - 8);
|
|
21496
21571
|
this.keys.height = keysRoom;
|
|
@@ -21731,6 +21806,9 @@ var init_render = __esmMin((() => {
|
|
|
21731
21806
|
homeRoom(state) {
|
|
21732
21807
|
return homeWidth(this.renderer.width, longestName(state), longestState(state));
|
|
21733
21808
|
}
|
|
21809
|
+
paintModalKeys() {
|
|
21810
|
+
for (const part of Object.values(this.modals)) part.keys.content = this.chipRow();
|
|
21811
|
+
}
|
|
21734
21812
|
chipRow() {
|
|
21735
21813
|
return new StyledText(this.chips.flatMap((chip, index) => {
|
|
21736
21814
|
const lit = index === this.hovered;
|
|
@@ -21792,16 +21870,20 @@ var init_render = __esmMin((() => {
|
|
|
21792
21870
|
}
|
|
21793
21871
|
const room = panelWidth(this.renderer.width);
|
|
21794
21872
|
const wide = Math.max(1, room - 8);
|
|
21795
|
-
this.foundBox.title.content =
|
|
21873
|
+
this.foundBox.title.content = titleText({
|
|
21874
|
+
title: foundTitle(state, wide),
|
|
21875
|
+
count: ""
|
|
21876
|
+
}, wide);
|
|
21796
21877
|
const shown = shownMatches(state);
|
|
21797
21878
|
const most = panelRows(this.renderer.height, 5);
|
|
21798
21879
|
const { blocks, chosen } = foundBlocks(state, shown, wide);
|
|
21799
|
-
const tall = Math.max(6, most -
|
|
21880
|
+
const tall = Math.max(6, most - 8);
|
|
21800
21881
|
const window = windowedBlocks(blocks, chosen, tall);
|
|
21801
21882
|
this.foundBox.choices.content = blocks.length === 0 ? new StyledText([fg(palette.faint)(nothingYet(state, wide))]) : new StyledText([...window.chunks]);
|
|
21802
21883
|
this.foundBox.peek.content = "";
|
|
21803
21884
|
this.foundBox.peek.height = 0;
|
|
21804
|
-
|
|
21885
|
+
const listed = blocks.length === 0 ? 1 : Math.max(6, window.rows);
|
|
21886
|
+
this.foundBox.box.height = Math.min(most, listed + 8);
|
|
21805
21887
|
this.foundBox.box.width = room;
|
|
21806
21888
|
this.foundBox.box.left = Math.max(1, Math.floor((this.renderer.width - room) / 2));
|
|
21807
21889
|
this.foundBox.box.top = panelTop(this.renderer.height, 5);
|
|
@@ -23035,7 +23117,7 @@ var init_editor$1 = __esmMin((() => {
|
|
|
23035
23117
|
}));
|
|
23036
23118
|
//#endregion
|
|
23037
23119
|
//#region src/tui/editor.ts
|
|
23038
|
-
var ranAside, onThePath, saveEditor, editorTold, chooseEditor, editorChosen, forgetEditor, openInEditor, whereTheLineIs;
|
|
23120
|
+
var ranAside, onThePath, saveEditor, editorTold, editorSaid, openPreferences, flipPreference, chooseEditor, editorChosen, forgetEditor, openInEditor, whereTheLineIs;
|
|
23039
23121
|
var init_editor = __esmMin((() => {
|
|
23040
23122
|
init_dist();
|
|
23041
23123
|
init_editor$1();
|
|
@@ -23078,6 +23160,14 @@ var init_editor = __esmMin((() => {
|
|
|
23078
23160
|
terminalEmulator: process.env["TERMINAL_EMULATOR"]
|
|
23079
23161
|
};
|
|
23080
23162
|
});
|
|
23163
|
+
editorSaid = map$1(editorTold, (told) => templateFor(told) ?? "");
|
|
23164
|
+
openPreferences = (app) => map$1(editorSaid, (now) => {
|
|
23165
|
+
app.commit({
|
|
23166
|
+
...reduce(app.measured(), "settings.open"),
|
|
23167
|
+
editorNow: now
|
|
23168
|
+
});
|
|
23169
|
+
});
|
|
23170
|
+
flipPreference = (app) => onTheEditorRow(app.state) ? chooseEditor(app) : sync(() => app.commit(reduce(app.measured(), "settings.flip")));
|
|
23081
23171
|
chooseEditor = (app) => {
|
|
23082
23172
|
return gen(function* () {
|
|
23083
23173
|
const around = editorsAround(onThePath);
|
|
@@ -23091,21 +23181,31 @@ var init_editor = __esmMin((() => {
|
|
|
23091
23181
|
const chosen = refHere(app.state);
|
|
23092
23182
|
if (chosen === void 0) return;
|
|
23093
23183
|
yield* saveEditor(chosen);
|
|
23094
|
-
|
|
23184
|
+
const back = {
|
|
23095
23185
|
...app.state,
|
|
23096
23186
|
screen: app.state.returnTo,
|
|
23097
23187
|
query: ""
|
|
23098
|
-
}
|
|
23188
|
+
};
|
|
23189
|
+
if (back.screen === "settings") {
|
|
23190
|
+
app.commit({
|
|
23191
|
+
...back,
|
|
23192
|
+
editorNow: chosen
|
|
23193
|
+
});
|
|
23194
|
+
return;
|
|
23195
|
+
}
|
|
23196
|
+
app.commit(back);
|
|
23099
23197
|
yield* openInEditor(app);
|
|
23100
23198
|
});
|
|
23101
23199
|
};
|
|
23102
23200
|
forgetEditor = (app) => {
|
|
23103
23201
|
return gen(function* () {
|
|
23104
23202
|
yield* saveEditor("");
|
|
23203
|
+
const now = yield* editorSaid;
|
|
23105
23204
|
const back = {
|
|
23106
23205
|
...app.state,
|
|
23107
23206
|
screen: app.state.returnTo,
|
|
23108
|
-
query: ""
|
|
23207
|
+
query: "",
|
|
23208
|
+
editorNow: now
|
|
23109
23209
|
};
|
|
23110
23210
|
app.commit(withNotice(back, "the editor is the environment's again"));
|
|
23111
23211
|
});
|
|
@@ -23976,6 +24076,8 @@ var init_app = __esmMin((() => {
|
|
|
23976
24076
|
"base.clear": (app) => app.state.screen === "editor" ? forgetEditor(app) : clearBaseHere(app),
|
|
23977
24077
|
"line.open": openInEditor,
|
|
23978
24078
|
"editor.open": chooseEditor,
|
|
24079
|
+
"settings.open": openPreferences,
|
|
24080
|
+
"settings.flip": flipPreference,
|
|
23979
24081
|
back: goBack,
|
|
23980
24082
|
"report.send": sendReport,
|
|
23981
24083
|
"context.more": (app) => expand(app, 1),
|
|
@@ -24231,7 +24333,7 @@ var init_app = __esmMin((() => {
|
|
|
24231
24333
|
this.screen.writeOn(now);
|
|
24232
24334
|
}
|
|
24233
24335
|
askedBack(text) {
|
|
24234
|
-
const clean = legible(text).replaceAll("\n", " ");
|
|
24336
|
+
const clean = text.includes("\n") ? legible(text).replaceAll("\n", " ").trim() : legible(text);
|
|
24235
24337
|
if (clean !== text) {
|
|
24236
24338
|
this.screen.askWith(clean);
|
|
24237
24339
|
return;
|
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.181",
|
|
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": {
|