@eliya-oss/agent-diff 0.1.0-alpha.36 → 0.1.0-alpha.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/main.js +155 -46
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/main.js
CHANGED
|
@@ -10750,7 +10750,7 @@ var init_watch = __esmMin((() => {
|
|
|
10750
10750
|
}));
|
|
10751
10751
|
//#endregion
|
|
10752
10752
|
//#region src/tui/command.ts
|
|
10753
|
-
var command, commands, TEXT_SCREENS, PRINTABLE_KEY, takesText, commandsFor, listableFor, actionFor, GLYPHS, displayKey, hintsFor;
|
|
10753
|
+
var command, commands, TEXT_SCREENS, PRINTABLE_KEY, takesText, commandsFor, listableFor, glossaryFor, actionFor, GLYPHS, displayKey, hintsFor;
|
|
10754
10754
|
var init_command = __esmMin((() => {
|
|
10755
10755
|
command = (input) => ({
|
|
10756
10756
|
category: "Review",
|
|
@@ -10760,6 +10760,7 @@ var init_command = __esmMin((() => {
|
|
|
10760
10760
|
counted: false,
|
|
10761
10761
|
whenLayers: false,
|
|
10762
10762
|
whenThread: false,
|
|
10763
|
+
rank: 0,
|
|
10763
10764
|
...input
|
|
10764
10765
|
});
|
|
10765
10766
|
commands = [
|
|
@@ -10769,7 +10770,8 @@ var init_command = __esmMin((() => {
|
|
|
10769
10770
|
category: "Branches",
|
|
10770
10771
|
keys: ["down", "j"],
|
|
10771
10772
|
screens: ["branches"],
|
|
10772
|
-
hint: "move"
|
|
10773
|
+
hint: "move",
|
|
10774
|
+
rank: 1
|
|
10773
10775
|
}),
|
|
10774
10776
|
command({
|
|
10775
10777
|
action: "branch.prev",
|
|
@@ -10784,7 +10786,8 @@ var init_command = __esmMin((() => {
|
|
|
10784
10786
|
category: "Branches",
|
|
10785
10787
|
keys: ["return"],
|
|
10786
10788
|
screens: ["branches"],
|
|
10787
|
-
hint: "review"
|
|
10789
|
+
hint: "review",
|
|
10790
|
+
rank: 2
|
|
10788
10791
|
}),
|
|
10789
10792
|
command({
|
|
10790
10793
|
action: "branch.pull",
|
|
@@ -10798,8 +10801,7 @@ var init_command = __esmMin((() => {
|
|
|
10798
10801
|
action: "cursor.next",
|
|
10799
10802
|
title: "Next line",
|
|
10800
10803
|
keys: ["down", "j"],
|
|
10801
|
-
screens: ["review"]
|
|
10802
|
-
hint: "line"
|
|
10804
|
+
screens: ["review"]
|
|
10803
10805
|
}),
|
|
10804
10806
|
command({
|
|
10805
10807
|
action: "cursor.prev",
|
|
@@ -10848,7 +10850,6 @@ var init_command = __esmMin((() => {
|
|
|
10848
10850
|
title: "Next comment",
|
|
10849
10851
|
keys: ["n"],
|
|
10850
10852
|
screens: ["review"],
|
|
10851
|
-
hint: "next comment",
|
|
10852
10853
|
whenStaged: true
|
|
10853
10854
|
}),
|
|
10854
10855
|
command({
|
|
@@ -10875,7 +10876,8 @@ var init_command = __esmMin((() => {
|
|
|
10875
10876
|
category: "Files",
|
|
10876
10877
|
keys: ["]"],
|
|
10877
10878
|
screens: ["review"],
|
|
10878
|
-
hint: "file"
|
|
10879
|
+
hint: "file",
|
|
10880
|
+
rank: 1
|
|
10879
10881
|
}),
|
|
10880
10882
|
command({
|
|
10881
10883
|
action: "file.prev",
|
|
@@ -10896,8 +10898,7 @@ var init_command = __esmMin((() => {
|
|
|
10896
10898
|
title: "Hide the file list",
|
|
10897
10899
|
category: "General",
|
|
10898
10900
|
keys: ["z", "\\"],
|
|
10899
|
-
screens: ["review"]
|
|
10900
|
-
hint: "zoom"
|
|
10901
|
+
screens: ["review"]
|
|
10901
10902
|
}),
|
|
10902
10903
|
command({
|
|
10903
10904
|
action: "branch.first",
|
|
@@ -10923,23 +10924,20 @@ var init_command = __esmMin((() => {
|
|
|
10923
10924
|
action: "selection.copy",
|
|
10924
10925
|
title: "Copy the selection",
|
|
10925
10926
|
keys: ["y"],
|
|
10926
|
-
screens: ["review"]
|
|
10927
|
-
hint: "copy"
|
|
10927
|
+
screens: ["review"]
|
|
10928
10928
|
}),
|
|
10929
10929
|
command({
|
|
10930
10930
|
action: "search.open",
|
|
10931
10931
|
title: "Find the selection elsewhere",
|
|
10932
10932
|
keys: ["/"],
|
|
10933
|
-
screens: ["review"]
|
|
10934
|
-
hint: "find"
|
|
10933
|
+
screens: ["review"]
|
|
10935
10934
|
}),
|
|
10936
10935
|
command({
|
|
10937
10936
|
action: "match.next",
|
|
10938
10937
|
title: "Next match",
|
|
10939
10938
|
category: "Search",
|
|
10940
10939
|
keys: ["j", "down"],
|
|
10941
|
-
screens: ["search"]
|
|
10942
|
-
hint: "move"
|
|
10940
|
+
screens: ["search"]
|
|
10943
10941
|
}),
|
|
10944
10942
|
command({
|
|
10945
10943
|
action: "match.prev",
|
|
@@ -10954,7 +10952,8 @@ var init_command = __esmMin((() => {
|
|
|
10954
10952
|
category: "Search",
|
|
10955
10953
|
keys: ["return"],
|
|
10956
10954
|
screens: ["search"],
|
|
10957
|
-
hint: "open"
|
|
10955
|
+
hint: "open",
|
|
10956
|
+
rank: 2
|
|
10958
10957
|
}),
|
|
10959
10958
|
command({
|
|
10960
10959
|
action: "select.swap",
|
|
@@ -10967,8 +10966,7 @@ var init_command = __esmMin((() => {
|
|
|
10967
10966
|
title: "Wrap long lines",
|
|
10968
10967
|
category: "General",
|
|
10969
10968
|
keys: ["w"],
|
|
10970
|
-
screens: ["review"]
|
|
10971
|
-
hint: "wrap"
|
|
10969
|
+
screens: ["review"]
|
|
10972
10970
|
}),
|
|
10973
10971
|
command({
|
|
10974
10972
|
action: "pan.right",
|
|
@@ -10982,13 +10980,21 @@ var init_command = __esmMin((() => {
|
|
|
10982
10980
|
keys: ["<"],
|
|
10983
10981
|
screens: ["review"]
|
|
10984
10982
|
}),
|
|
10983
|
+
command({
|
|
10984
|
+
action: "review.reload",
|
|
10985
|
+
title: "Read the worktrees again",
|
|
10986
|
+
category: "Branches",
|
|
10987
|
+
keys: ["r"],
|
|
10988
|
+
screens: ["branches"],
|
|
10989
|
+
hint: "reload",
|
|
10990
|
+
rank: 3
|
|
10991
|
+
}),
|
|
10985
10992
|
command({
|
|
10986
10993
|
action: "review.reload",
|
|
10987
10994
|
title: "Read the branch again",
|
|
10988
10995
|
category: "Review",
|
|
10989
10996
|
keys: ["r"],
|
|
10990
|
-
screens: ["
|
|
10991
|
-
hint: "reload"
|
|
10997
|
+
screens: ["review"]
|
|
10992
10998
|
}),
|
|
10993
10999
|
command({
|
|
10994
11000
|
action: "thread.settle",
|
|
@@ -11013,6 +11019,7 @@ var init_command = __esmMin((() => {
|
|
|
11013
11019
|
keys: ["s"],
|
|
11014
11020
|
screens: ["review"],
|
|
11015
11021
|
hint: "layers",
|
|
11022
|
+
rank: 2,
|
|
11016
11023
|
whenLayers: true
|
|
11017
11024
|
}),
|
|
11018
11025
|
command({
|
|
@@ -11035,7 +11042,8 @@ var init_command = __esmMin((() => {
|
|
|
11035
11042
|
category: "Files",
|
|
11036
11043
|
keys: ["m"],
|
|
11037
11044
|
screens: ["review"],
|
|
11038
|
-
hint: "reviewed"
|
|
11045
|
+
hint: "reviewed",
|
|
11046
|
+
rank: 2
|
|
11039
11047
|
}),
|
|
11040
11048
|
command({
|
|
11041
11049
|
action: "file.vouch.next",
|
|
@@ -11049,14 +11057,16 @@ var init_command = __esmMin((() => {
|
|
|
11049
11057
|
title: "Start a selection",
|
|
11050
11058
|
keys: ["v"],
|
|
11051
11059
|
screens: ["review"],
|
|
11052
|
-
hint: "select"
|
|
11060
|
+
hint: "select",
|
|
11061
|
+
rank: 3
|
|
11053
11062
|
}),
|
|
11054
11063
|
command({
|
|
11055
11064
|
action: "compose.open",
|
|
11056
11065
|
title: "Comment on the selection",
|
|
11057
11066
|
keys: ["c", "return"],
|
|
11058
11067
|
screens: ["review"],
|
|
11059
|
-
hint: "comment"
|
|
11068
|
+
hint: "comment",
|
|
11069
|
+
rank: 4
|
|
11060
11070
|
}),
|
|
11061
11071
|
command({
|
|
11062
11072
|
action: "report.open",
|
|
@@ -11079,7 +11089,6 @@ var init_command = __esmMin((() => {
|
|
|
11079
11089
|
category: "General",
|
|
11080
11090
|
keys: ["ctrl+p"],
|
|
11081
11091
|
screens: ["review", "pending"],
|
|
11082
|
-
hint: "commands",
|
|
11083
11092
|
listed: false
|
|
11084
11093
|
}),
|
|
11085
11094
|
command({
|
|
@@ -11097,7 +11106,8 @@ var init_command = __esmMin((() => {
|
|
|
11097
11106
|
screens: ["review"],
|
|
11098
11107
|
hint: "send",
|
|
11099
11108
|
whenStaged: true,
|
|
11100
|
-
counted: true
|
|
11109
|
+
counted: true,
|
|
11110
|
+
rank: 6
|
|
11101
11111
|
}),
|
|
11102
11112
|
command({
|
|
11103
11113
|
action: "pending.submit",
|
|
@@ -11105,7 +11115,8 @@ var init_command = __esmMin((() => {
|
|
|
11105
11115
|
keys: ["ctrl+s"],
|
|
11106
11116
|
screens: ["pending"],
|
|
11107
11117
|
hint: "send",
|
|
11108
|
-
listed: false
|
|
11118
|
+
listed: false,
|
|
11119
|
+
rank: 2
|
|
11109
11120
|
}),
|
|
11110
11121
|
command({
|
|
11111
11122
|
action: "pending.edit",
|
|
@@ -11113,7 +11124,8 @@ var init_command = __esmMin((() => {
|
|
|
11113
11124
|
category: "Review",
|
|
11114
11125
|
keys: ["e"],
|
|
11115
11126
|
screens: ["pending"],
|
|
11116
|
-
hint: "reword"
|
|
11127
|
+
hint: "reword",
|
|
11128
|
+
rank: 3
|
|
11117
11129
|
}),
|
|
11118
11130
|
command({
|
|
11119
11131
|
action: "pending.drop",
|
|
@@ -11121,7 +11133,8 @@ var init_command = __esmMin((() => {
|
|
|
11121
11133
|
category: "Review",
|
|
11122
11134
|
keys: ["X"],
|
|
11123
11135
|
screens: ["pending"],
|
|
11124
|
-
hint: "withdraw"
|
|
11136
|
+
hint: "withdraw",
|
|
11137
|
+
rank: 4
|
|
11125
11138
|
}),
|
|
11126
11139
|
command({
|
|
11127
11140
|
action: "pending.next",
|
|
@@ -11156,10 +11169,41 @@ var init_command = __esmMin((() => {
|
|
|
11156
11169
|
action: "palette.run",
|
|
11157
11170
|
title: "Run the highlighted command",
|
|
11158
11171
|
keys: ["return"],
|
|
11159
|
-
screens: ["palette"],
|
|
11172
|
+
screens: ["palette", "keys"],
|
|
11160
11173
|
hint: "run",
|
|
11161
11174
|
listed: false
|
|
11162
11175
|
}),
|
|
11176
|
+
command({
|
|
11177
|
+
action: "keys.open",
|
|
11178
|
+
title: "List every key",
|
|
11179
|
+
category: "General",
|
|
11180
|
+
keys: ["?"],
|
|
11181
|
+
screens: [
|
|
11182
|
+
"branches",
|
|
11183
|
+
"review",
|
|
11184
|
+
"pending",
|
|
11185
|
+
"search"
|
|
11186
|
+
],
|
|
11187
|
+
hint: "keys",
|
|
11188
|
+
rank: 5,
|
|
11189
|
+
listed: false
|
|
11190
|
+
}),
|
|
11191
|
+
command({
|
|
11192
|
+
action: "keys.next",
|
|
11193
|
+
title: "Next key",
|
|
11194
|
+
category: "General",
|
|
11195
|
+
keys: ["down", "j"],
|
|
11196
|
+
screens: ["keys"],
|
|
11197
|
+
listed: false
|
|
11198
|
+
}),
|
|
11199
|
+
command({
|
|
11200
|
+
action: "keys.prev",
|
|
11201
|
+
title: "Previous key",
|
|
11202
|
+
category: "General",
|
|
11203
|
+
keys: ["up", "k"],
|
|
11204
|
+
screens: ["keys"],
|
|
11205
|
+
listed: false
|
|
11206
|
+
}),
|
|
11163
11207
|
command({
|
|
11164
11208
|
action: "back",
|
|
11165
11209
|
title: "Go back",
|
|
@@ -11171,10 +11215,12 @@ var init_command = __esmMin((() => {
|
|
|
11171
11215
|
"palette",
|
|
11172
11216
|
"pending",
|
|
11173
11217
|
"report",
|
|
11174
|
-
"search"
|
|
11218
|
+
"search",
|
|
11219
|
+
"keys"
|
|
11175
11220
|
],
|
|
11176
11221
|
hint: "back",
|
|
11177
|
-
listed: false
|
|
11222
|
+
listed: false,
|
|
11223
|
+
rank: 9
|
|
11178
11224
|
}),
|
|
11179
11225
|
command({
|
|
11180
11226
|
action: "quit",
|
|
@@ -11183,7 +11229,8 @@ var init_command = __esmMin((() => {
|
|
|
11183
11229
|
keys: ["q"],
|
|
11184
11230
|
screens: ["branches"],
|
|
11185
11231
|
hint: "quit",
|
|
11186
|
-
listed: false
|
|
11232
|
+
listed: false,
|
|
11233
|
+
rank: 9
|
|
11187
11234
|
})
|
|
11188
11235
|
];
|
|
11189
11236
|
TEXT_SCREENS = /* @__PURE__ */ new Set([
|
|
@@ -11195,6 +11242,7 @@ var init_command = __esmMin((() => {
|
|
|
11195
11242
|
takesText = (screen) => TEXT_SCREENS.has(screen);
|
|
11196
11243
|
commandsFor = (screen) => commands.filter((entry) => entry.screens.includes(screen));
|
|
11197
11244
|
listableFor = (screen) => commandsFor(screen).filter((entry) => entry.listed);
|
|
11245
|
+
glossaryFor = (screen) => commandsFor(screen).toSorted((left, right) => left.category.localeCompare(right.category) || left.title.localeCompare(right.title));
|
|
11198
11246
|
actionFor = (screen, key) => {
|
|
11199
11247
|
if (takesText(screen) && PRINTABLE_KEY.test(key)) return void 0;
|
|
11200
11248
|
return commandsFor(screen).find((entry) => entry.keys.includes(key))?.action;
|
|
@@ -11213,7 +11261,7 @@ var init_command = __esmMin((() => {
|
|
|
11213
11261
|
if (key.startsWith("ctrl+")) return `^${key.slice(5)}`;
|
|
11214
11262
|
return GLYPHS[key] ?? key;
|
|
11215
11263
|
};
|
|
11216
|
-
hintsFor = (screen, staged, layers = 0, onThread = false) => commandsFor(screen).filter((entry) => entry.hint.length > 0).filter((entry) => !entry.whenStaged || staged > 0).filter((entry) => !entry.whenLayers || layers > 0).filter((entry) => !entry.whenThread || onThread).map((entry) => ({
|
|
11264
|
+
hintsFor = (screen, staged, layers = 0, onThread = false) => commandsFor(screen).filter((entry) => entry.hint.length > 0).filter((entry) => !entry.whenStaged || staged > 0).filter((entry) => !entry.whenLayers || layers > 0).filter((entry) => !entry.whenThread || onThread).toSorted((left, right) => left.rank - right.rank).map((entry) => ({
|
|
11217
11265
|
key: displayKey(entry.keys[0] ?? ""),
|
|
11218
11266
|
hint: entry.counted ? `${entry.hint} ${staged}` : entry.hint,
|
|
11219
11267
|
press: entry.keys[0] ?? ""
|
|
@@ -11246,10 +11294,11 @@ var init_match = __esmMin((() => {
|
|
|
11246
11294
|
}));
|
|
11247
11295
|
//#endregion
|
|
11248
11296
|
//#region src/tui/reduce.ts
|
|
11249
|
-
var clamp, lastRow, rowsIn, withCursorVisible, moveCursor, stepStop, scrolled, draggedTo, atRow, layerHunk, nextFileWithComments, atComment, nothingOpen, layerComment, PAN_STEP, panned, movePending, moveLayer, inRail, layerDown, toggleRail, foldDirectory, foldLayer, foldThread, fold, moveBranch, moveFile, selectHunk, swapEnds, atBranch, startSelection, openCompose, goBack, walkMatches, openPalette, movePalette, paletteMatches, paletteChoice, transitions, reduce, atFile, withContext, withFull, revealsAfter, gapOpened, withPending, panBy, withSent, withLayers, withPulls, withBranches, withSource, withVouched, restoredTo, withPatches, typed, backspaced, paletteMoved, paletteClosed, withWaiting, withMatches, withNoticeHere, withNotice;
|
|
11297
|
+
var clamp, lastRow, rowsIn, withCursorVisible, moveCursor, stepStop, scrolled, draggedTo, atRow, layerHunk, nextFileWithComments, atComment, nothingOpen, layerComment, PAN_STEP, panned, movePending, moveLayer, inRail, layerDown, toggleRail, foldDirectory, foldLayer, foldThread, fold, moveBranch, moveFile, selectHunk, swapEnds, atBranch, startSelection, openCompose, goBack, walkMatches, openPalette, openKeys, movePalette, paletteMatches, offered, paletteChoice, transitions, reduce, atFile, withContext, withFull, revealsAfter, gapOpened, withPending, panBy, withSent, withLayers, withPulls, withBranches, withSource, withVouched, restoredTo, withPatches, typed, backspaced, paletteMoved, paletteClosed, withWaiting, withMatches, withNoticeHere, withNotice;
|
|
11250
11298
|
var init_reduce = __esmMin((() => {
|
|
11251
11299
|
init_dist();
|
|
11252
11300
|
init_patch();
|
|
11301
|
+
init_command();
|
|
11253
11302
|
init_gaps();
|
|
11254
11303
|
init_match();
|
|
11255
11304
|
init_model();
|
|
@@ -11483,6 +11532,10 @@ var init_reduce = __esmMin((() => {
|
|
|
11483
11532
|
screen: state.returnTo,
|
|
11484
11533
|
query: ""
|
|
11485
11534
|
};
|
|
11535
|
+
if (state.screen === "keys") return {
|
|
11536
|
+
...state,
|
|
11537
|
+
screen: state.returnTo
|
|
11538
|
+
};
|
|
11486
11539
|
if (state.screen === "compose") return {
|
|
11487
11540
|
...state,
|
|
11488
11541
|
screen: "review",
|
|
@@ -11510,12 +11563,20 @@ var init_reduce = __esmMin((() => {
|
|
|
11510
11563
|
query: "",
|
|
11511
11564
|
paletteIndex: 0
|
|
11512
11565
|
});
|
|
11566
|
+
openKeys = (state) => ({
|
|
11567
|
+
...state,
|
|
11568
|
+
screen: "keys",
|
|
11569
|
+
returnTo: state.screen,
|
|
11570
|
+
query: "",
|
|
11571
|
+
paletteIndex: 0
|
|
11572
|
+
});
|
|
11513
11573
|
movePalette = (state, delta) => ({
|
|
11514
11574
|
...state,
|
|
11515
|
-
paletteIndex: clamp(state.paletteIndex + delta, 0, Math.max(0,
|
|
11575
|
+
paletteIndex: clamp(state.paletteIndex + delta, 0, Math.max(0, offered(state).length - 1))
|
|
11516
11576
|
});
|
|
11517
11577
|
paletteMatches = (state) => searchCommands(state.returnTo, state.query);
|
|
11518
|
-
|
|
11578
|
+
offered = (state) => state.screen === "keys" ? glossaryFor(state.returnTo) : paletteMatches(state);
|
|
11579
|
+
paletteChoice = (state) => offered(state)[state.paletteIndex]?.action;
|
|
11519
11580
|
transitions = {
|
|
11520
11581
|
"branch.first": (state) => atBranch(state, 0),
|
|
11521
11582
|
"branch.last": (state) => atBranch(state, state.branches.length - 1),
|
|
@@ -11586,6 +11647,9 @@ var init_reduce = __esmMin((() => {
|
|
|
11586
11647
|
}),
|
|
11587
11648
|
"report.send": (state) => state,
|
|
11588
11649
|
"palette.open": openPalette,
|
|
11650
|
+
"keys.open": openKeys,
|
|
11651
|
+
"keys.next": (state) => movePalette(state, 1),
|
|
11652
|
+
"keys.prev": (state) => movePalette(state, -1),
|
|
11589
11653
|
"palette.run": (state) => state,
|
|
11590
11654
|
"search.open": (state) => state,
|
|
11591
11655
|
"search.jump": (state) => state,
|
|
@@ -12367,7 +12431,7 @@ var init_diffview = __esmMin((() => {
|
|
|
12367
12431
|
}));
|
|
12368
12432
|
//#endregion
|
|
12369
12433
|
//#region src/tui/render.ts
|
|
12370
|
-
var ROW_HEIGHT, COMPOSE_WIDTH, GUTTER_X, CHIP_GAP, FRAME_PAD, MODAL_ROOM, COMPOSE_CHROME, COMPOSE_ACTION_ROWS, COMPOSE_PAD, COMPOSE_MIN_TEXT, reportActions, actionsText, SNIPPET_LINES, PALETTE_TITLE, PALETTE_MAX, PALETTE_CHROME, PENDING_CHROME, PALETTE_WIDTH, TREE_MAX, TREE_MIN, TREE_SHARE, DIFF_MIN, BODY_BORDER, PANE_CHROME, BRANCH_WIDTH, BRANCH_NAME, BRANCH_NAME_MIN, BRANCH_TAIL, EMPTY_LIST, MODAL_MARGIN, bodyRoom, treeWidth, homeWidth, modalWidth, composeRoom, laidOut, STICKY_MAX, pickPaint, SELECTION, CURSOR, ACCENT, GAP_PAINT, bar, makeList, makeDiffPane, makeListParts, makeListText, makeGutter, makeScroller, makeScrim, makeScroll, makePalette, makePaletteParts, makePendingParts, makeChoices, stack, makeBody, makeHome, makeModals, makeFoundParts, FONTS, logoFont, makeLanding, makeLogo, makeComposeParts, makeCompose, clip, clipHead, clipPath, treeLabel, waitingLabel, inRange, notesOf, notesFor, paired, keptWithin, CHIP_CHUNKS, shortPath, HOME_PATH_MIN, HOME_PATH_CHROME, elide, contextLabel, nameRoom, columns, branchHeading, atHome, layersCell, stateCell, branchCells, headerParts, fallbackScope, treeMarks, treeTail, treeLine, STEP_NUMBER, STEP_LEAD, NOTE_LEAD, STEP_GAP, STALE_ROOM, STALE_LONG, STALE_SHORT, staleBanner, layerRoom, layerFold, layerHead, layerText, layerPaint, Screen;
|
|
12434
|
+
var ROW_HEIGHT, COMPOSE_WIDTH, GUTTER_X, CHIP_GAP, FRAME_PAD, MODAL_ROOM, COMPOSE_CHROME, COMPOSE_ACTION_ROWS, COMPOSE_PAD, COMPOSE_MIN_TEXT, reportActions, actionsText, SNIPPET_LINES, PALETTE_KEY, PALETTE_TITLE, PALETTE_GAP, PALETTE_MAX, PALETTE_CHROME, PENDING_CHROME, PALETTE_WIDTH, TREE_MAX, TREE_MIN, TREE_SHARE, DIFF_MIN, BODY_BORDER, PANE_CHROME, BRANCH_WIDTH, BRANCH_NAME, BRANCH_NAME_MIN, BRANCH_TAIL, EMPTY_LIST, MODAL_MARGIN, bodyRoom, treeWidth, homeWidth, commandRow, modalWidth, composeRoom, laidOut, STICKY_MAX, pickPaint, SELECTION, CURSOR, ACCENT, GAP_PAINT, bar, makeList, makeDiffPane, makeListParts, makeListText, makeGutter, makeScroller, makeScrim, makeScroll, makePalette, makePaletteParts, makePendingParts, makeChoices, stack, makeBody, makeHome, makeModals, makeKeysParts, makeFoundParts, FONTS, logoFont, makeLanding, makeLogo, makeComposeParts, makeCompose, clip, clipHead, clipPath, treeLabel, waitingLabel, inRange, notesOf, notesFor, paired, keptWithin, CHIP_CHUNKS, shortPath, HOME_PATH_MIN, HOME_PATH_CHROME, elide, contextLabel, nameRoom, columns, branchHeading, atHome, layersCell, stateCell, branchCells, headerParts, fallbackScope, treeMarks, treeTail, treeLine, STEP_NUMBER, STEP_LEAD, NOTE_LEAD, STEP_GAP, STALE_ROOM, STALE_LONG, STALE_SHORT, staleBanner, layerRoom, layerFold, layerHead, layerText, layerPaint, Screen;
|
|
12371
12435
|
var init_render = __esmMin((() => {
|
|
12372
12436
|
init_command();
|
|
12373
12437
|
init_patch();
|
|
@@ -12390,7 +12454,9 @@ var init_render = __esmMin((() => {
|
|
|
12390
12454
|
reportActions = () => t`${fg(palette.accent)("esc")} ${fg(palette.muted)("cancel")} ${fg(palette.accent)("^s")} ${fg(palette.muted)("copy and save")}`;
|
|
12391
12455
|
actionsText = () => t`${fg(palette.accent)("esc")} ${fg(palette.muted)("cancel")} ${fg(palette.accent)("^a")} ${fg(palette.muted)("add to review")} ${fg(palette.accent)("^s")} ${fg(palette.muted)("comment now")}`;
|
|
12392
12456
|
SNIPPET_LINES = 4;
|
|
12457
|
+
PALETTE_KEY = 7;
|
|
12393
12458
|
PALETTE_TITLE = 34;
|
|
12459
|
+
PALETTE_GAP = 2;
|
|
12394
12460
|
PALETTE_MAX = 18;
|
|
12395
12461
|
PALETTE_CHROME = 4;
|
|
12396
12462
|
PENDING_CHROME = 3;
|
|
@@ -12414,6 +12480,11 @@ var init_render = __esmMin((() => {
|
|
|
12414
12480
|
return Math.max(0, Math.min(wanted, room - DIFF_MIN));
|
|
12415
12481
|
};
|
|
12416
12482
|
homeWidth = (width) => Math.max(0, Math.min(BRANCH_WIDTH, width - 2));
|
|
12483
|
+
commandRow = (entry, room) => {
|
|
12484
|
+
const key = clip(displayKey(entry.keys[0] ?? ""), 5).padEnd(PALETTE_KEY);
|
|
12485
|
+
const left = Math.max(1, Math.min(PALETTE_TITLE, room - PALETTE_KEY - entry.category.length - PALETTE_GAP));
|
|
12486
|
+
return `${key}${clip(entry.title, left - PALETTE_GAP).padEnd(left)}${entry.category}`;
|
|
12487
|
+
};
|
|
12417
12488
|
modalWidth = (width, wanted) => Math.max(0, Math.min(wanted, width - MODAL_MARGIN));
|
|
12418
12489
|
composeRoom = (width) => {
|
|
12419
12490
|
const box = modalWidth(width, COMPOSE_WIDTH);
|
|
@@ -12592,8 +12663,15 @@ var init_render = __esmMin((() => {
|
|
|
12592
12663
|
makeModals = (renderer) => ({
|
|
12593
12664
|
palette: makePaletteParts(renderer),
|
|
12594
12665
|
staged: makePendingParts(renderer),
|
|
12595
|
-
found: makeFoundParts(renderer)
|
|
12666
|
+
found: makeFoundParts(renderer),
|
|
12667
|
+
keys: makeKeysParts(renderer)
|
|
12596
12668
|
});
|
|
12669
|
+
makeKeysParts = (renderer) => {
|
|
12670
|
+
const parts = makePaletteParts(renderer);
|
|
12671
|
+
parts.box.id = "keys";
|
|
12672
|
+
parts.query.height = 0;
|
|
12673
|
+
return parts;
|
|
12674
|
+
};
|
|
12597
12675
|
makeFoundParts = (renderer) => {
|
|
12598
12676
|
const box = makePalette(renderer);
|
|
12599
12677
|
const title = bar(renderer, "found-title", palette.faint);
|
|
@@ -12763,7 +12841,7 @@ var init_render = __esmMin((() => {
|
|
|
12763
12841
|
layers: "LAYERS",
|
|
12764
12842
|
state: "STATE"
|
|
12765
12843
|
}, room)}`;
|
|
12766
|
-
atHome = (state) => state.screen === "branches" || state.screen === "palette" && state.returnTo === "branches";
|
|
12844
|
+
atHome = (state) => state.screen === "branches" || (state.screen === "palette" || state.screen === "keys") && state.returnTo === "branches";
|
|
12767
12845
|
layersCell = (branch) => {
|
|
12768
12846
|
if (branch.layers === 0) return "";
|
|
12769
12847
|
return branch.stale ? `${branch.layers} stale` : `${branch.layers} layers`;
|
|
@@ -12872,6 +12950,9 @@ var init_render = __esmMin((() => {
|
|
|
12872
12950
|
paletteQuery;
|
|
12873
12951
|
paletteChoices;
|
|
12874
12952
|
pending;
|
|
12953
|
+
keys;
|
|
12954
|
+
keysTitle;
|
|
12955
|
+
keysChoices;
|
|
12875
12956
|
pendingTitle;
|
|
12876
12957
|
pendingChoices;
|
|
12877
12958
|
found;
|
|
@@ -12915,6 +12996,9 @@ var init_render = __esmMin((() => {
|
|
|
12915
12996
|
this.paletteTitle = modals.palette.title;
|
|
12916
12997
|
this.paletteQuery = modals.palette.query;
|
|
12917
12998
|
this.paletteChoices = modals.palette.choices;
|
|
12999
|
+
this.keys = modals.keys.box;
|
|
13000
|
+
this.keysTitle = modals.keys.title;
|
|
13001
|
+
this.keysChoices = modals.keys.choices;
|
|
12918
13002
|
this.pending = modals.staged.box;
|
|
12919
13003
|
this.pendingTitle = modals.staged.title;
|
|
12920
13004
|
this.pendingChoices = modals.staged.choices;
|
|
@@ -12967,11 +13051,12 @@ var init_render = __esmMin((() => {
|
|
|
12967
13051
|
const room = Math.max(HOME_PATH_MIN, pane - many.length - HOME_PATH_CHROME);
|
|
12968
13052
|
this.landing.content = `${elide(shortPath(this.repo), room)} · ${many}`;
|
|
12969
13053
|
this.landingKeys.content = this.homeKeys(state);
|
|
12970
|
-
this.diffPane.visible = state.screen !== "branches" && !(state
|
|
13054
|
+
this.diffPane.visible = state.screen !== "branches" && !atHome(state);
|
|
12971
13055
|
if (this.diffPane.visible) this.paintDiff(state);
|
|
12972
13056
|
this.paintPane(state);
|
|
12973
13057
|
this.paintCompose(state);
|
|
12974
13058
|
this.paintPalette(state);
|
|
13059
|
+
this.paintKeys(state);
|
|
12975
13060
|
this.paintPending(state);
|
|
12976
13061
|
this.paintFound(state);
|
|
12977
13062
|
this.paintReport(state);
|
|
@@ -12988,18 +13073,39 @@ var init_render = __esmMin((() => {
|
|
|
12988
13073
|
const matches = paletteMatches(state);
|
|
12989
13074
|
this.paletteTitle.content = matches.length === 0 ? "No command matches" : "Commands";
|
|
12990
13075
|
this.paletteQuery.content = state.query.length === 0 ? "Type to filter…" : `${state.query}▏`;
|
|
13076
|
+
const room = modalWidth(this.renderer.width, PALETTE_WIDTH);
|
|
12991
13077
|
this.paletteChoices.options = matches.map((entry) => ({
|
|
12992
|
-
name:
|
|
13078
|
+
name: commandRow(entry, room - MODAL_ROOM),
|
|
12993
13079
|
description: "",
|
|
12994
13080
|
value: entry.action
|
|
12995
13081
|
}));
|
|
12996
|
-
const room = modalWidth(this.renderer.width, PALETTE_WIDTH);
|
|
12997
13082
|
this.paletteChoices.selectedIndex = Math.min(state.paletteIndex, Math.max(0, matches.length - 1));
|
|
12998
13083
|
this.palette.height = Math.min(PALETTE_MAX, matches.length + PALETTE_CHROME);
|
|
12999
13084
|
this.palette.width = room;
|
|
13000
13085
|
this.palette.left = Math.max(FRAME_PAD, Math.floor((this.renderer.width - room) / 2));
|
|
13001
13086
|
this.palette.top = Math.max(2, Math.floor(this.renderer.height / 4));
|
|
13002
13087
|
}
|
|
13088
|
+
paintKeys(state) {
|
|
13089
|
+
this.keys.visible = state.screen === "keys";
|
|
13090
|
+
if (state.screen !== "keys") {
|
|
13091
|
+
this.keysTitle.content = "";
|
|
13092
|
+
this.keysChoices.options = [];
|
|
13093
|
+
return;
|
|
13094
|
+
}
|
|
13095
|
+
const rows = glossaryFor(state.returnTo);
|
|
13096
|
+
const room = modalWidth(this.renderer.width, PALETTE_WIDTH);
|
|
13097
|
+
this.keysTitle.content = `Every key here, ${rows.length} of them`;
|
|
13098
|
+
this.keysChoices.options = rows.map((entry) => ({
|
|
13099
|
+
name: commandRow(entry, room - MODAL_ROOM),
|
|
13100
|
+
description: "",
|
|
13101
|
+
value: entry.action
|
|
13102
|
+
}));
|
|
13103
|
+
this.keysChoices.selectedIndex = Math.min(state.paletteIndex, Math.max(0, rows.length - 1));
|
|
13104
|
+
this.keys.height = Math.min(PALETTE_MAX, rows.length + PENDING_CHROME);
|
|
13105
|
+
this.keys.width = room;
|
|
13106
|
+
this.keys.left = Math.max(FRAME_PAD, Math.floor((this.renderer.width - room) / 2));
|
|
13107
|
+
this.keys.top = Math.max(2, Math.floor(this.renderer.height / 4));
|
|
13108
|
+
}
|
|
13003
13109
|
headerText(state) {
|
|
13004
13110
|
const branch = selectedBranch(state);
|
|
13005
13111
|
if (atHome(state)) return t`${fg(palette.faint)("")}`;
|
|
@@ -13109,7 +13215,8 @@ var init_render = __esmMin((() => {
|
|
|
13109
13215
|
this.compose,
|
|
13110
13216
|
this.palette,
|
|
13111
13217
|
this.pending,
|
|
13112
|
-
this.found
|
|
13218
|
+
this.found,
|
|
13219
|
+
this.keys
|
|
13113
13220
|
]);
|
|
13114
13221
|
}
|
|
13115
13222
|
watchChips() {
|
|
@@ -13163,11 +13270,13 @@ var init_render = __esmMin((() => {
|
|
|
13163
13270
|
if (this.shown !== void 0) this.footer.content = this.footerText(this.shown);
|
|
13164
13271
|
}
|
|
13165
13272
|
homeKeys(state) {
|
|
13166
|
-
const chips = this.chipRow().chunks;
|
|
13167
13273
|
const said = state.notice.length === 0 ? state.waiting : state.notice;
|
|
13168
|
-
|
|
13274
|
+
const tail = said.length === 0 ? "" : ` ${said}`;
|
|
13275
|
+
const room = Math.max(0, homeWidth(this.renderer.width) - tail.length);
|
|
13276
|
+
const chips = keptWithin(this.chipRow().chunks, room);
|
|
13277
|
+
if (tail.length === 0) return new StyledText([...chips]);
|
|
13169
13278
|
const colour = state.notice.length === 0 ? palette.accent : palette.attention;
|
|
13170
|
-
return new StyledText([...chips, fg(colour)(
|
|
13279
|
+
return new StyledText([...chips, fg(colour)(tail)]);
|
|
13171
13280
|
}
|
|
13172
13281
|
chipRow() {
|
|
13173
13282
|
return new StyledText(this.chips.flatMap((chip, index) => {
|
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.37",
|
|
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": {
|