@eliya-oss/agent-diff 0.1.0-alpha.67 → 0.1.0-alpha.69
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 +22 -0
- package/README.md +1 -1
- package/dist/main.js +362 -647
- package/package.json +1 -1
- package/skills/adiff/SKILL.md +1 -2
package/dist/main.js
CHANGED
|
@@ -6473,9 +6473,10 @@ var init_SchemaAST = __esmMin((() => {
|
|
|
6473
6473
|
}));
|
|
6474
6474
|
//#endregion
|
|
6475
6475
|
//#region node_modules/.pnpm/effect@4.0.0-rc.110/node_modules/effect/dist/Fiber.js
|
|
6476
|
-
var interrupt;
|
|
6476
|
+
var await_, interrupt;
|
|
6477
6477
|
var init_Fiber = __esmMin((() => {
|
|
6478
6478
|
init_effect();
|
|
6479
|
+
await_ = fiberAwait;
|
|
6479
6480
|
interrupt = fiberInterrupt;
|
|
6480
6481
|
}));
|
|
6481
6482
|
//#endregion
|
|
@@ -8586,24 +8587,6 @@ var init_git = __esmMin((() => {
|
|
|
8586
8587
|
init_error$3();
|
|
8587
8588
|
}));
|
|
8588
8589
|
//#endregion
|
|
8589
|
-
//#region src/domain/review/lifecycle.ts
|
|
8590
|
-
var commentOn, stage, submitAll;
|
|
8591
|
-
var init_lifecycle = __esmMin((() => {
|
|
8592
|
-
init_dist();
|
|
8593
|
-
commentOn = (id, anchor, body) => ({
|
|
8594
|
-
id,
|
|
8595
|
-
anchor,
|
|
8596
|
-
body,
|
|
8597
|
-
state: "draft",
|
|
8598
|
-
reply: none()
|
|
8599
|
-
});
|
|
8600
|
-
stage = (staged, comment) => [...staged, comment];
|
|
8601
|
-
submitAll = (staged) => staged.map((comment) => ({
|
|
8602
|
-
...comment,
|
|
8603
|
-
state: "submitted"
|
|
8604
|
-
}));
|
|
8605
|
-
}));
|
|
8606
|
-
//#endregion
|
|
8607
8590
|
//#region src/domain/review/vouch.ts
|
|
8608
8591
|
var isVouched, vouch;
|
|
8609
8592
|
var init_vouch = __esmMin((() => {
|
|
@@ -8626,7 +8609,7 @@ var init_model$3 = __esmMin((() => {
|
|
|
8626
8609
|
//#endregion
|
|
8627
8610
|
//#region src/domain/review/index.ts
|
|
8628
8611
|
var init_review = __esmMin((() => {
|
|
8629
|
-
|
|
8612
|
+
init_dist();
|
|
8630
8613
|
init_vouch();
|
|
8631
8614
|
init_model$3();
|
|
8632
8615
|
}));
|
|
@@ -8645,7 +8628,6 @@ var init_model$2 = __esmMin((() => {
|
|
|
8645
8628
|
emptyBranchState = {
|
|
8646
8629
|
vouches: {},
|
|
8647
8630
|
consumed: 0,
|
|
8648
|
-
pending: [],
|
|
8649
8631
|
settled: {},
|
|
8650
8632
|
removed: {},
|
|
8651
8633
|
base: "",
|
|
@@ -8687,7 +8669,6 @@ var init_schema = __esmMin((() => {
|
|
|
8687
8669
|
BranchState = Struct({
|
|
8688
8670
|
vouches: optionalKey(Record(String$1, String$1)),
|
|
8689
8671
|
consumed: optionalKey(Int),
|
|
8690
|
-
pending: optionalKey(ArraySchema(StoredComment)),
|
|
8691
8672
|
settled: optionalKey(Record(String$1, String$1)),
|
|
8692
8673
|
removed: optionalKey(Record(String$1, String$1)),
|
|
8693
8674
|
base: optionalKey(String$1),
|
|
@@ -8811,53 +8792,22 @@ var init_service$1 = __esmMin((() => {
|
|
|
8811
8792
|
parent: held.parent
|
|
8812
8793
|
};
|
|
8813
8794
|
});
|
|
8814
|
-
cursorOps = (state,
|
|
8815
|
-
return {
|
|
8816
|
-
|
|
8817
|
-
|
|
8818
|
-
|
|
8819
|
-
|
|
8820
|
-
|
|
8821
|
-
|
|
8822
|
-
|
|
8823
|
-
|
|
8824
|
-
|
|
8825
|
-
|
|
8826
|
-
|
|
8827
|
-
|
|
8828
|
-
|
|
8829
|
-
|
|
8830
|
-
...current,
|
|
8831
|
-
pending
|
|
8832
|
-
});
|
|
8833
|
-
return some(pending);
|
|
8834
|
-
}),
|
|
8835
|
-
unstage: fn("Store.unstage")(function* (worktreePath, id) {
|
|
8836
|
-
const current = yield* state(worktreePath);
|
|
8837
|
-
if (!current.pending.some((entry) => entry.id === id)) return none();
|
|
8838
|
-
const pending = current.pending.filter((entry) => entry.id !== id);
|
|
8839
|
-
yield* saveState(worktreePath, {
|
|
8840
|
-
...current,
|
|
8841
|
-
pending
|
|
8842
|
-
});
|
|
8843
|
-
return some(pending);
|
|
8844
|
-
}),
|
|
8845
|
-
take: fn("Store.take")(function* (worktreePath) {
|
|
8846
|
-
const batches = yield* inbox(worktreePath);
|
|
8847
|
-
const current = yield* state(worktreePath);
|
|
8848
|
-
const answered = new Set((yield* spoken(worktreePath)).map((entry) => entry.comment));
|
|
8849
|
-
const owed = (comment) => !answered.has(comment.id) && !Object.hasOwn(current.settled, comment.id) && !Object.hasOwn(current.removed, comment.id);
|
|
8850
|
-
return batches.flatMap((batch) => {
|
|
8851
|
-
const comments = batch.comments.filter(owed);
|
|
8852
|
-
return comments.length === 0 ? [] : [{
|
|
8853
|
-
id: batch.id,
|
|
8854
|
-
at: batch.at,
|
|
8855
|
-
head: batch.head,
|
|
8856
|
-
comments
|
|
8857
|
-
}];
|
|
8858
|
-
});
|
|
8859
|
-
})
|
|
8860
|
-
};
|
|
8795
|
+
cursorOps = (state, inbox, spoken) => {
|
|
8796
|
+
return { take: fn("Store.take")(function* (worktreePath) {
|
|
8797
|
+
const batches = yield* inbox(worktreePath);
|
|
8798
|
+
const current = yield* state(worktreePath);
|
|
8799
|
+
const answered = new Set((yield* spoken(worktreePath)).map((entry) => entry.comment));
|
|
8800
|
+
const owed = (comment) => !answered.has(comment.id) && !Object.hasOwn(current.settled, comment.id) && !Object.hasOwn(current.removed, comment.id);
|
|
8801
|
+
return batches.flatMap((batch) => {
|
|
8802
|
+
const comments = batch.comments.filter(owed);
|
|
8803
|
+
return comments.length === 0 ? [] : [{
|
|
8804
|
+
id: batch.id,
|
|
8805
|
+
at: batch.at,
|
|
8806
|
+
head: batch.head,
|
|
8807
|
+
comments
|
|
8808
|
+
}];
|
|
8809
|
+
});
|
|
8810
|
+
}) };
|
|
8861
8811
|
};
|
|
8862
8812
|
settingsOps = (root) => {
|
|
8863
8813
|
return {
|
|
@@ -9050,7 +9000,7 @@ var init_service$1 = __esmMin((() => {
|
|
|
9050
9000
|
const { submit, inbox } = inboxOps(root);
|
|
9051
9001
|
const { state, saveState } = stateOps(root);
|
|
9052
9002
|
const talk = answerOps(root);
|
|
9053
|
-
const cursors = cursorOps(state,
|
|
9003
|
+
const cursors = cursorOps(state, inbox, talk.answers);
|
|
9054
9004
|
return {
|
|
9055
9005
|
root,
|
|
9056
9006
|
branchAt: (worktreePath) => promise(() => headOf$1(worktreePath)),
|
|
@@ -9079,7 +9029,7 @@ var init_store = __esmMin((() => {
|
|
|
9079
9029
|
}));
|
|
9080
9030
|
//#endregion
|
|
9081
9031
|
//#region src/cli/error.ts
|
|
9082
|
-
var UnknownBranch, UnknownBase, UnknownFile, UnknownComment, UnselectableRange, UnknownCommand, MissingOption,
|
|
9032
|
+
var UnknownBranch, UnknownBase, UnknownFile, UnknownComment, UnselectableRange, UnknownCommand, MissingOption, UnknownWorktree, MalformedLayers, NoLayers, InitUnwritable;
|
|
9083
9033
|
var init_error$1 = __esmMin((() => {
|
|
9084
9034
|
init_dist();
|
|
9085
9035
|
UnknownBranch = class extends TaggedError("UnknownBranch") {};
|
|
@@ -9089,7 +9039,6 @@ var init_error$1 = __esmMin((() => {
|
|
|
9089
9039
|
UnselectableRange = class extends TaggedError("UnselectableRange") {};
|
|
9090
9040
|
UnknownCommand = class extends TaggedError("UnknownCommand") {};
|
|
9091
9041
|
MissingOption = class extends TaggedError("MissingOption") {};
|
|
9092
|
-
EmptyReview = class extends TaggedError("EmptyReview") {};
|
|
9093
9042
|
UnknownWorktree = class extends TaggedError("UnknownWorktree") {};
|
|
9094
9043
|
MalformedLayers = class extends TaggedError("MalformedLayers") {};
|
|
9095
9044
|
NoLayers = class extends TaggedError("NoLayers") {};
|
|
@@ -9097,7 +9046,7 @@ var init_error$1 = __esmMin((() => {
|
|
|
9097
9046
|
}));
|
|
9098
9047
|
//#endregion
|
|
9099
9048
|
//#region src/cli/commands.ts
|
|
9100
|
-
var CONTEXT, WHOLE_FILE$1, POLL, AUTO, askedFor, basedOn, worktreeNamed, findBranch, baseFor, patchesOf, findPatch, rowsCovering, waitingOn, listBranches, blobOf, toggleVouch, reviewProgress,
|
|
9049
|
+
var CONTEXT, WHOLE_FILE$1, POLL, AUTO, askedFor, basedOn, worktreeNamed, findBranch, baseFor, patchesOf, findPatch, rowsCovering, waitingOn, listBranches, blobOf, toggleVouch, reviewProgress, bodyOf, sentOf, listSent, submitComment, listPatches, flatten, takeComments, repoOf$1, worktreeOf$1, branchAt, awaitComments, saveReport, fileSource, fileBefore, saveWrap, setBase, clearBase, markRead;
|
|
9101
9050
|
var init_commands = __esmMin((() => {
|
|
9102
9051
|
init_dist();
|
|
9103
9052
|
init_patch();
|
|
@@ -9191,11 +9140,9 @@ var init_commands = __esmMin((() => {
|
|
|
9191
9140
|
})).map((row) => row.index);
|
|
9192
9141
|
waitingOn = fn("Cli.waitingOn")(function* (worktree) {
|
|
9193
9142
|
const store = yield* Store;
|
|
9194
|
-
const state = yield* store.state(worktree.path);
|
|
9195
9143
|
const owed = yield* store.take(worktree.path);
|
|
9196
9144
|
const told = yield* store.layers(worktree.path);
|
|
9197
9145
|
return {
|
|
9198
|
-
staged: state.pending.length,
|
|
9199
9146
|
unread: owed.reduce((total, batch) => total + batch.comments.length, 0),
|
|
9200
9147
|
layers: match$3(told, {
|
|
9201
9148
|
onNone: () => 0,
|
|
@@ -9223,7 +9170,6 @@ var init_commands = __esmMin((() => {
|
|
|
9223
9170
|
files: stat.files,
|
|
9224
9171
|
added: stat.added,
|
|
9225
9172
|
removed: stat.removed,
|
|
9226
|
-
staged: waiting.staged,
|
|
9227
9173
|
unread: waiting.unread,
|
|
9228
9174
|
layers: waiting.layers,
|
|
9229
9175
|
stale: waiting.stale,
|
|
@@ -9270,77 +9216,8 @@ var init_commands = __esmMin((() => {
|
|
|
9270
9216
|
path: patch.path,
|
|
9271
9217
|
blob: patch.blob
|
|
9272
9218
|
})).filter((file) => isVouched(current.vouches, file.path, file.blob)).map((f) => f.path),
|
|
9273
|
-
total: patches.length
|
|
9274
|
-
pending: current.pending.length
|
|
9275
|
-
};
|
|
9276
|
-
});
|
|
9277
|
-
anchorRequest = fn("Cli.anchorRequest")(function* (request) {
|
|
9278
|
-
const worktree = yield* findBranch(request.repo, request.branch);
|
|
9279
|
-
const patches = yield* patchesOf(worktree, WHOLE_FILE$1);
|
|
9280
|
-
const resolved = yield* match$3(findPatch(patches, request.file), {
|
|
9281
|
-
onNone: () => new UnknownFile({
|
|
9282
|
-
file: request.file,
|
|
9283
|
-
known: patches.map((candidate) => candidate.path)
|
|
9284
|
-
}),
|
|
9285
|
-
onSome: succeed$1
|
|
9286
|
-
});
|
|
9287
|
-
const rows = rowsCovering(resolved, request.side, request.start, request.end);
|
|
9288
|
-
const first = rows[0];
|
|
9289
|
-
const last = rows.at(-1);
|
|
9290
|
-
const found = first === void 0 || last === void 0 ? none() : anchorFor(resolved, first, last);
|
|
9291
|
-
return {
|
|
9292
|
-
worktree,
|
|
9293
|
-
anchor: yield* match$3(found, {
|
|
9294
|
-
onNone: () => new UnselectableRange({
|
|
9295
|
-
file: request.file,
|
|
9296
|
-
start: request.start,
|
|
9297
|
-
end: request.end
|
|
9298
|
-
}),
|
|
9299
|
-
onSome: succeed$1
|
|
9300
|
-
})
|
|
9301
|
-
};
|
|
9302
|
-
});
|
|
9303
|
-
stageComment = fn("Cli.stageComment")(function* (request) {
|
|
9304
|
-
const store = yield* Store;
|
|
9305
|
-
const { worktree, anchor } = yield* anchorRequest(request);
|
|
9306
|
-
const first = stage([], commentOn(request.id, anchor, request.body))[0];
|
|
9307
|
-
const entry = {
|
|
9308
|
-
id: request.id,
|
|
9309
|
-
anchor,
|
|
9310
|
-
body: first === void 0 ? request.body : first.body
|
|
9219
|
+
total: patches.length
|
|
9311
9220
|
};
|
|
9312
|
-
return { pending: (yield* store.stage(worktree.path, entry)).length };
|
|
9313
|
-
});
|
|
9314
|
-
editStaged = fn("Cli.editStaged")(function* (request) {
|
|
9315
|
-
const store = yield* Store;
|
|
9316
|
-
const worktree = yield* findBranch(request.repo, request.branch);
|
|
9317
|
-
const current = yield* store.state(worktree.path);
|
|
9318
|
-
const found = current.pending.find((entry) => entry.id === request.id);
|
|
9319
|
-
if (found === void 0) return yield* new UnknownComment({ id: request.id });
|
|
9320
|
-
const pending = yield* store.restage(worktree.path, {
|
|
9321
|
-
...found,
|
|
9322
|
-
body: request.body
|
|
9323
|
-
});
|
|
9324
|
-
return { pending: getOrElse(pending, () => current.pending).length };
|
|
9325
|
-
});
|
|
9326
|
-
dropStaged = fn("Cli.dropStaged")(function* (repo, branch, id) {
|
|
9327
|
-
const store = yield* Store;
|
|
9328
|
-
const worktree = yield* findBranch(repo, branch);
|
|
9329
|
-
const pending = yield* store.unstage(worktree.path, id);
|
|
9330
|
-
if (isNone(pending)) return yield* new UnknownComment({ id });
|
|
9331
|
-
return { pending: pending.value.length };
|
|
9332
|
-
});
|
|
9333
|
-
listPending = fn("Cli.listPending")(function* (repo, branch) {
|
|
9334
|
-
const store = yield* Store;
|
|
9335
|
-
const worktree = yield* findBranch(repo, branch);
|
|
9336
|
-
return (yield* store.state(worktree.path)).pending.map((entry) => ({
|
|
9337
|
-
id: entry.id,
|
|
9338
|
-
file: entry.anchor.path,
|
|
9339
|
-
side: entry.anchor.side,
|
|
9340
|
-
start: entry.anchor.start,
|
|
9341
|
-
end: entry.anchor.end,
|
|
9342
|
-
body: entry.body
|
|
9343
|
-
}));
|
|
9344
9221
|
});
|
|
9345
9222
|
bodyOf = (entry) => entry.body;
|
|
9346
9223
|
sentOf = (comment, reading) => {
|
|
@@ -9375,29 +9252,6 @@ var init_commands = __esmMin((() => {
|
|
|
9375
9252
|
read: current.read
|
|
9376
9253
|
}));
|
|
9377
9254
|
});
|
|
9378
|
-
submitReview = fn("Cli.submitReview")(function* (repo, branch, id, at) {
|
|
9379
|
-
const store = yield* Store;
|
|
9380
|
-
const worktree = yield* findBranch(repo, branch);
|
|
9381
|
-
const current = yield* store.state(worktree.path);
|
|
9382
|
-
if (current.pending.length === 0) return yield* new EmptyReview({ branch });
|
|
9383
|
-
const comments = submitAll(current.pending.map((entry) => commentOn(entry.id, entry.anchor, entry.body))).map((comment) => ({
|
|
9384
|
-
id: comment.id,
|
|
9385
|
-
anchor: comment.anchor,
|
|
9386
|
-
body: comment.body
|
|
9387
|
-
}));
|
|
9388
|
-
const batch = {
|
|
9389
|
-
id,
|
|
9390
|
-
at,
|
|
9391
|
-
head: worktree.head,
|
|
9392
|
-
comments
|
|
9393
|
-
};
|
|
9394
|
-
yield* store.submit(worktree.path, batch);
|
|
9395
|
-
yield* store.saveState(worktree.path, {
|
|
9396
|
-
...current,
|
|
9397
|
-
pending: []
|
|
9398
|
-
});
|
|
9399
|
-
return { submitted: comments.length };
|
|
9400
|
-
});
|
|
9401
9255
|
submitComment = fn("Cli.submitComment")(function* (request) {
|
|
9402
9256
|
const store = yield* Store;
|
|
9403
9257
|
const worktree = yield* findBranch(request.repo, request.branch);
|
|
@@ -9796,7 +9650,7 @@ var init_pane = __esmMin((() => {
|
|
|
9796
9650
|
init_commands();
|
|
9797
9651
|
init_init();
|
|
9798
9652
|
init_pane();
|
|
9799
|
-
var version$1 = "0.1.0-alpha.
|
|
9653
|
+
var version$1 = "0.1.0-alpha.69";
|
|
9800
9654
|
//#endregion
|
|
9801
9655
|
//#region src/cli/upgrade.ts
|
|
9802
9656
|
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, runUpgrade, statusOf$1, sayFound, sayDone, attempted, REFRESH_MS, refreshSkills, updatedIn, sayRefreshed, upgradeReport;
|
|
@@ -10365,7 +10219,7 @@ var init_layers = __esmMin((() => {
|
|
|
10365
10219
|
}));
|
|
10366
10220
|
//#endregion
|
|
10367
10221
|
//#region src/cli/threads.ts
|
|
10368
|
-
var stateOf$1, spoken$1, threadOf, threadsIn, idsIn, isKnown,
|
|
10222
|
+
var stateOf$1, spoken$1, threadOf, threadsIn, idsIn, isKnown, listThreads, answerComment, settleThread, removeComment, without, restoreComment, settleRead;
|
|
10369
10223
|
var init_threads = __esmMin((() => {
|
|
10370
10224
|
init_dist();
|
|
10371
10225
|
init_store();
|
|
@@ -10406,31 +10260,18 @@ var init_threads = __esmMin((() => {
|
|
|
10406
10260
|
const store = yield* Store;
|
|
10407
10261
|
return idsIn(yield* store.inbox(worktreePath)).includes(id);
|
|
10408
10262
|
});
|
|
10409
|
-
stagedOf = (entry) => ({
|
|
10410
|
-
id: entry.id,
|
|
10411
|
-
file: entry.anchor.path,
|
|
10412
|
-
side: entry.anchor.side,
|
|
10413
|
-
start: entry.anchor.start,
|
|
10414
|
-
end: entry.anchor.end,
|
|
10415
|
-
body: entry.body,
|
|
10416
|
-
state: "staged",
|
|
10417
|
-
stale: false,
|
|
10418
|
-
outside: false,
|
|
10419
|
-
unread: 0,
|
|
10420
|
-
answers: []
|
|
10421
|
-
});
|
|
10422
10263
|
listThreads = fn("Cli.listThreads")(function* (repo, branch, base) {
|
|
10423
10264
|
const store = yield* Store;
|
|
10424
10265
|
const worktree = yield* findBranch(repo, branch, base);
|
|
10425
10266
|
const current = yield* store.state(worktree.path);
|
|
10426
|
-
return
|
|
10267
|
+
return threadsIn(yield* store.inbox(worktree.path), {
|
|
10427
10268
|
answers: yield* store.answers(worktree.path),
|
|
10428
10269
|
settled: current.settled,
|
|
10429
10270
|
removed: current.removed,
|
|
10430
10271
|
head: worktree.head,
|
|
10431
10272
|
shown: new Set((yield* patchesOf(worktree)).map((patch) => patch.path)),
|
|
10432
10273
|
read: current.read
|
|
10433
|
-
})
|
|
10274
|
+
});
|
|
10434
10275
|
});
|
|
10435
10276
|
answerComment = fn("Cli.answerComment")(function* (request) {
|
|
10436
10277
|
const store = yield* Store;
|
|
@@ -10450,11 +10291,16 @@ var init_threads = __esmMin((() => {
|
|
|
10450
10291
|
const worktree = yield* findBranch(repo, branch);
|
|
10451
10292
|
if (!(yield* isKnown(worktree.path, id))) return yield* new UnknownComment({ id });
|
|
10452
10293
|
const current = yield* store.state(worktree.path);
|
|
10294
|
+
const replies = (yield* store.answers(worktree.path)).filter((entry) => entry.comment === id);
|
|
10453
10295
|
yield* store.saveState(worktree.path, {
|
|
10454
10296
|
...current,
|
|
10455
10297
|
settled: {
|
|
10456
10298
|
...current.settled,
|
|
10457
10299
|
[id]: at
|
|
10300
|
+
},
|
|
10301
|
+
read: {
|
|
10302
|
+
...current.read,
|
|
10303
|
+
[id]: replies.length
|
|
10458
10304
|
}
|
|
10459
10305
|
});
|
|
10460
10306
|
return { settled: id };
|
|
@@ -10463,26 +10309,20 @@ var init_threads = __esmMin((() => {
|
|
|
10463
10309
|
const store = yield* Store;
|
|
10464
10310
|
const worktree = yield* findBranch(repo, branch);
|
|
10465
10311
|
const current = yield* store.state(worktree.path);
|
|
10466
|
-
if (current.pending.some((entry) => entry.id === id)) {
|
|
10467
|
-
const pending = yield* store.unstage(worktree.path, id);
|
|
10468
|
-
if (isNone(pending)) return yield* new UnknownComment({ id });
|
|
10469
|
-
return {
|
|
10470
|
-
removed: id,
|
|
10471
|
-
staged: true
|
|
10472
|
-
};
|
|
10473
|
-
}
|
|
10474
10312
|
if (!(yield* isKnown(worktree.path, id))) return yield* new UnknownComment({ id });
|
|
10313
|
+
const replies = (yield* store.answers(worktree.path)).filter((entry) => entry.comment === id);
|
|
10475
10314
|
yield* store.saveState(worktree.path, {
|
|
10476
10315
|
...current,
|
|
10477
10316
|
removed: {
|
|
10478
10317
|
...current.removed,
|
|
10479
10318
|
[id]: at
|
|
10319
|
+
},
|
|
10320
|
+
read: {
|
|
10321
|
+
...current.read,
|
|
10322
|
+
[id]: replies.length
|
|
10480
10323
|
}
|
|
10481
10324
|
});
|
|
10482
|
-
return {
|
|
10483
|
-
removed: id,
|
|
10484
|
-
staged: false
|
|
10485
|
-
};
|
|
10325
|
+
return { removed: id };
|
|
10486
10326
|
});
|
|
10487
10327
|
without = (entries, id) => Object.fromEntries(Object.entries(entries).filter(([key]) => key !== id));
|
|
10488
10328
|
restoreComment = fn("Cli.restoreComment")(function* (repo, branch, id) {
|
|
@@ -10714,53 +10554,9 @@ var init_catalog = __esmMin((() => {
|
|
|
10714
10554
|
dataKey: "reviewed",
|
|
10715
10555
|
example: "adiff review progress --repo . --branch cdr-1"
|
|
10716
10556
|
},
|
|
10717
|
-
{
|
|
10718
|
-
name: "comment stage",
|
|
10719
|
-
about: "Put a comment in the review, to go out when `review send` sends it",
|
|
10720
|
-
group: WRITE_COMMENTS,
|
|
10721
|
-
addresses: "review",
|
|
10722
|
-
safety: "write",
|
|
10723
|
-
options: [...addressing, ...range],
|
|
10724
|
-
dataKey: "pending",
|
|
10725
|
-
example: "adiff comment stage --repo . --branch cdr-1 --file src/api.ts --start 4 --end 4 --body \"why\""
|
|
10726
|
-
},
|
|
10727
|
-
{
|
|
10728
|
-
name: "comment edit",
|
|
10729
|
-
about: "Reword a staged comment. It keeps its id and the lines it was written against",
|
|
10730
|
-
group: WRITE_COMMENTS,
|
|
10731
|
-
addresses: "review",
|
|
10732
|
-
safety: "write",
|
|
10733
|
-
options: [
|
|
10734
|
-
...addressing,
|
|
10735
|
-
{
|
|
10736
|
-
name: "id",
|
|
10737
|
-
required: true,
|
|
10738
|
-
value: "id",
|
|
10739
|
-
about: "The staged comment, as `review progress` reported it"
|
|
10740
|
-
},
|
|
10741
|
-
{
|
|
10742
|
-
name: "body",
|
|
10743
|
-
required: true,
|
|
10744
|
-
value: "text",
|
|
10745
|
-
about: "What it should say instead"
|
|
10746
|
-
}
|
|
10747
|
-
],
|
|
10748
|
-
dataKey: "pending",
|
|
10749
|
-
example: "adiff comment edit --repo . --branch cdr-1 --id c1 --body \"why is this unused\""
|
|
10750
|
-
},
|
|
10751
|
-
{
|
|
10752
|
-
name: "review send",
|
|
10753
|
-
about: "Send the staged comments as one review, so the agent wakes once",
|
|
10754
|
-
group: WRITE_COMMENTS,
|
|
10755
|
-
addresses: "review",
|
|
10756
|
-
safety: "write",
|
|
10757
|
-
options: [...addressing],
|
|
10758
|
-
dataKey: "sent",
|
|
10759
|
-
example: "adiff review send --repo . --branch cdr-1"
|
|
10760
|
-
},
|
|
10761
10557
|
{
|
|
10762
10558
|
name: "comment send",
|
|
10763
|
-
about: "Send one comment against a line range
|
|
10559
|
+
about: "Send one comment against a line range, straight to the agent",
|
|
10764
10560
|
group: WRITE_COMMENTS,
|
|
10765
10561
|
addresses: "review",
|
|
10766
10562
|
safety: "write",
|
|
@@ -10865,7 +10661,7 @@ var init_catalog = __esmMin((() => {
|
|
|
10865
10661
|
},
|
|
10866
10662
|
{
|
|
10867
10663
|
name: "comment remove",
|
|
10868
|
-
about: "Take a comment out of the review,
|
|
10664
|
+
about: "Take a comment out of the review, leaving what was already delivered on the record",
|
|
10869
10665
|
group: FOLLOW_UP,
|
|
10870
10666
|
addresses: "review",
|
|
10871
10667
|
safety: "write",
|
|
@@ -11027,11 +10823,6 @@ var init_report$1 = __esmMin((() => {
|
|
|
11027
10823
|
suggestion: "The error lists the files this branch changed. Use one of those paths.",
|
|
11028
10824
|
retriable: false
|
|
11029
10825
|
},
|
|
11030
|
-
EmptyReview: {
|
|
11031
|
-
exit: 2,
|
|
11032
|
-
suggestion: "Stage a comment with `adiff comment stage` before submitting the review.",
|
|
11033
|
-
retriable: false
|
|
11034
|
-
},
|
|
11035
10826
|
UnknownWorktree: {
|
|
11036
10827
|
exit: 3,
|
|
11037
10828
|
suggestion: "--worktree takes the path of a worktree of the repository under review. The error lists the ones that exist; pass one of those, or run the command from inside it with `--worktree .`.",
|
|
@@ -11592,7 +11383,7 @@ var init_tree = __esmMin((() => {
|
|
|
11592
11383
|
return node.children.reduce((total, child) => total + filesUnder(tree, child), 0);
|
|
11593
11384
|
};
|
|
11594
11385
|
crowdedDirectories = (tree, limit) => tree.nodes.filter((node) => node.kind === "directory" && directFiles(tree, node.id) > limit).map((node) => node.path);
|
|
11595
|
-
})), nothingReviewed, initialState, TREE_MAX, TREE_MIN, TREE_SHARE, DIFF_MIN, DIFF_ROOMY, bodyRoom, treeWidth, reviewWidth, panelFits, panelShown, onLayers, selectedLayer, proseFor, layerFiles, layerHolding, layerOpen, chunked, packed, shortened, wordWrapped, wrapped, NO_NOTE, noteRows$1, proseRow, proseRows$1, titleRows, clipEnd, FILE_LEAD, fileRows, layerRows, railWindow, selectedBranch, selectedPatch, pullHere, knownToHaveNoPull, kept, treeOf, reviewedCountIn, treeRows, crowdedOf, foldersOfFile, isReviewed, treeWindow, commentsOn, hiddenLines, markedRows, carriesLine, selectedRows, snippetOf, selectedLineCount, lineOf, caretAt, drafted, WORD, wordLeft, wordRight, caretByWord, lineStart, lineEnd, caretToEdge,
|
|
11386
|
+
})), nothingReviewed, initialState, TREE_MAX, TREE_MIN, TREE_SHARE, DIFF_MIN, DIFF_ROOMY, bodyRoom, treeWidth, reviewWidth, panelFits, panelShown, onLayers, selectedLayer, proseFor, layerFiles, layerHolding, layerOpen, chunked, packed, shortened, wordWrapped, wrapped, NO_NOTE, noteRows$1, proseRow, proseRows$1, titleRows, clipEnd, FILE_LEAD, fileRows, layerRows, railWindow, selectedBranch, selectedPatch, pullHere, knownToHaveNoPull, kept, treeOf, reviewedCountIn, treeRows, crowdedOf, foldersOfFile, isReviewed, treeStart, treeWindow, commentsOn, hiddenLines, markedRows, carriesLine, selectedRows, snippetOf, selectedLineCount, lineOf, caretAt, drafted, WORD, wordLeft, wordRight, caretByWord, lineStart, lineEnd, caretToEdge, composeTarget, selectedLines, KEYWORDS, NAME, longestName$1, searchTerm, matchHere, selectionReadout, WHOLE_FILE, CONTEXT_STEPS, wholeFileOff, contextToggled, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, rowShowing, lineOnSide, commentRowsIn, threadsAtRow, stopsAtRow, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, answersIn, newerOf, sectionOf, sentEntry, panelEntries, panelEntry, threadChosen, spokenSince, hunkStarts, changeAround, nextUnreviewed, reviewedCount, fileOrder, layerFile, selectionRange;
|
|
11596
11387
|
var init_model = __esmMin((() => {
|
|
11597
11388
|
init_dist();
|
|
11598
11389
|
init_patch();
|
|
@@ -11608,7 +11399,9 @@ var init_model = __esmMin((() => {
|
|
|
11608
11399
|
hideReviewed: false,
|
|
11609
11400
|
newestFirst: true,
|
|
11610
11401
|
tallest: 0,
|
|
11611
|
-
scroll: -1
|
|
11402
|
+
scroll: -1,
|
|
11403
|
+
railRows: 12,
|
|
11404
|
+
railScroll: -1
|
|
11612
11405
|
};
|
|
11613
11406
|
initialState = (branches) => ({
|
|
11614
11407
|
...nothingReviewed,
|
|
@@ -11631,11 +11424,7 @@ var init_model = __esmMin((() => {
|
|
|
11631
11424
|
returnTo: "branches",
|
|
11632
11425
|
closed: [],
|
|
11633
11426
|
vouched: [],
|
|
11634
|
-
staged: 0,
|
|
11635
|
-
pending: [],
|
|
11636
11427
|
sent: [],
|
|
11637
|
-
pendingIndex: 0,
|
|
11638
|
-
editing: void 0,
|
|
11639
11428
|
viewport: 20,
|
|
11640
11429
|
context: 3,
|
|
11641
11430
|
contextWas: 3,
|
|
@@ -11801,15 +11590,21 @@ var init_model = __esmMin((() => {
|
|
|
11801
11590
|
const patch = state.patches[fileIndex];
|
|
11802
11591
|
return patch !== void 0 && state.vouched.includes(patch.path);
|
|
11803
11592
|
};
|
|
11593
|
+
treeStart = (state, height) => {
|
|
11594
|
+
const rows = treeRows(state);
|
|
11595
|
+
if (rows.length <= height) return 0;
|
|
11596
|
+
const last = rows.length - height;
|
|
11597
|
+
if (state.railScroll >= 0) return Math.min(state.railScroll, last);
|
|
11598
|
+
const here = rows.findIndex((row) => row.fileIndex === state.patchIndex);
|
|
11599
|
+
return Math.max(0, Math.min(last, (here === -1 ? 0 : here) - Math.floor(height / 2)));
|
|
11600
|
+
};
|
|
11804
11601
|
treeWindow = (state, height) => {
|
|
11805
11602
|
const rows = treeRows(state);
|
|
11806
11603
|
if (rows.length <= height) return {
|
|
11807
11604
|
rows,
|
|
11808
11605
|
more: 0
|
|
11809
11606
|
};
|
|
11810
|
-
const
|
|
11811
|
-
const anchor = here === -1 ? 0 : here;
|
|
11812
|
-
const start = Math.max(0, Math.min(rows.length - height, anchor - Math.floor(height / 2)));
|
|
11607
|
+
const start = treeStart(state, height);
|
|
11813
11608
|
return {
|
|
11814
11609
|
rows: rows.slice(start, start + height),
|
|
11815
11610
|
more: rows.length - (start + height)
|
|
@@ -11818,13 +11613,13 @@ var init_model = __esmMin((() => {
|
|
|
11818
11613
|
commentsOn = (state, fileIndex) => {
|
|
11819
11614
|
const patch = state.patches[fileIndex];
|
|
11820
11615
|
if (patch === void 0) return 0;
|
|
11821
|
-
return state.
|
|
11616
|
+
return state.sent.filter((entry) => entry.file === patch.path).length;
|
|
11822
11617
|
};
|
|
11823
11618
|
hiddenLines = (state) => shownOf(state)?.gaps.reduce((total, gap) => total + gap.hidden, 0) ?? 0;
|
|
11824
11619
|
markedRows = (state) => {
|
|
11825
11620
|
const patch = selectedPatch(state);
|
|
11826
11621
|
if (patch === void 0) return /* @__PURE__ */ new Set();
|
|
11827
|
-
const rows = state.
|
|
11622
|
+
const rows = state.sent.filter((entry) => entry.file === patch.path).flatMap((entry) => patch.rows.filter((row) => match$3(row.newLine, {
|
|
11828
11623
|
onNone: () => false,
|
|
11829
11624
|
onSome: (line) => line >= entry.start && line <= entry.end
|
|
11830
11625
|
})).map((row) => row.index));
|
|
@@ -11868,13 +11663,7 @@ var init_model = __esmMin((() => {
|
|
|
11868
11663
|
return found === -1 ? draft.length : found;
|
|
11869
11664
|
};
|
|
11870
11665
|
caretToEdge = (state, edge) => edge === "start" ? lineStart(state.draft, caretAt(state)) : lineEnd(state.draft, caretAt(state));
|
|
11871
|
-
editedComment = (state) => state.editing === void 0 ? void 0 : state.pending.find((entry) => entry.id === state.editing);
|
|
11872
11666
|
composeTarget = (state) => {
|
|
11873
|
-
const edited = editedComment(state);
|
|
11874
|
-
if (edited !== void 0) {
|
|
11875
|
-
const span = edited.start === edited.end ? `${edited.start}` : `${edited.start}-${edited.end}`;
|
|
11876
|
-
return `Comment on ${edited.file}:${span}`;
|
|
11877
|
-
}
|
|
11878
11667
|
const patch = selectedPatch(state);
|
|
11879
11668
|
if (patch === void 0) return "";
|
|
11880
11669
|
const [from, to] = selectionRange(state);
|
|
@@ -11994,7 +11783,7 @@ var init_model = __esmMin((() => {
|
|
|
11994
11783
|
commentRowsIn = (state, fileIndex) => {
|
|
11995
11784
|
const patch = fileIndex === state.patchIndex ? selectedPatch(state) : state.patches[fileIndex];
|
|
11996
11785
|
if (patch === void 0) return [];
|
|
11997
|
-
const notes =
|
|
11786
|
+
const notes = state.sent.filter((entry) => entry.file === patch.path);
|
|
11998
11787
|
return patch.rows.filter((row) => notes.some((note) => lineOnSide(row, note.side) === note.end)).map((row) => row.index).toSorted((left, right) => left - right);
|
|
11999
11788
|
};
|
|
12000
11789
|
threadsAtRow = (state, row) => {
|
|
@@ -12014,10 +11803,10 @@ var init_model = __esmMin((() => {
|
|
|
12014
11803
|
openCommentRows = (state) => {
|
|
12015
11804
|
const patch = selectedPatch(state);
|
|
12016
11805
|
if (patch === void 0) return [];
|
|
12017
|
-
const open =
|
|
11806
|
+
const open = state.sent.filter((entry) => entry.file === patch.path && entry.settled !== true);
|
|
12018
11807
|
return patch.rows.filter((row) => open.some((note) => lineOnSide(row, note.side) === note.end)).map((row) => row.index);
|
|
12019
11808
|
};
|
|
12020
|
-
filesWithComments = (state) => state.patches.flatMap((patch, index) =>
|
|
11809
|
+
filesWithComments = (state) => state.patches.flatMap((patch, index) => state.sent.some((entry) => entry.file === patch.path) ? [index] : []);
|
|
12021
11810
|
answerCount = (comments) => comments.reduce((total, entry) => total + (entry.answers?.length ?? 0), 0);
|
|
12022
11811
|
answersIn = (comment) => comment.answers?.length ?? 0;
|
|
12023
11812
|
newerOf = (state, comment) => {
|
|
@@ -12037,28 +11826,17 @@ var init_model = __esmMin((() => {
|
|
|
12037
11826
|
};
|
|
12038
11827
|
};
|
|
12039
11828
|
panelEntries = (state) => {
|
|
12040
|
-
const staged = state.pending.map((comment) => ({
|
|
12041
|
-
section: "staged",
|
|
12042
|
-
comment,
|
|
12043
|
-
fresh: false,
|
|
12044
|
-
unread: 0
|
|
12045
|
-
}));
|
|
12046
11829
|
const delivered = state.sent.map((comment) => sentEntry(state, comment));
|
|
12047
11830
|
const ordered = (section) => {
|
|
12048
11831
|
const found = delivered.filter((entry) => entry.section === section);
|
|
12049
11832
|
return state.newestFirst ? found.toReversed() : found;
|
|
12050
11833
|
};
|
|
12051
|
-
return [
|
|
12052
|
-
...staged,
|
|
12053
|
-
...ordered("with"),
|
|
12054
|
-
...ordered("answered")
|
|
12055
|
-
];
|
|
11834
|
+
return [...ordered("with"), ...ordered("answered")];
|
|
12056
11835
|
};
|
|
12057
11836
|
panelEntry = (state) => panelEntries(state)[state.panelIndex];
|
|
12058
11837
|
threadChosen = (state) => {
|
|
12059
11838
|
if (state.focus !== "review") return void 0;
|
|
12060
|
-
|
|
12061
|
-
return entry === void 0 || entry.section === "staged" ? void 0 : entry.comment;
|
|
11839
|
+
return panelEntry(state)?.comment;
|
|
12062
11840
|
};
|
|
12063
11841
|
spokenSince = (seen, now) => Math.max(0, answerCount(now) - answerCount(seen));
|
|
12064
11842
|
hunkStarts = (state) => {
|
|
@@ -12126,7 +11904,7 @@ var init_report = __esmMin((() => {
|
|
|
12126
11904
|
`- branch \`${selectedBranch(state)?.branch ?? "none"}\``,
|
|
12127
11905
|
`- file \`${selectedPatch(state)?.path ?? "none"}\`, row ${state.cursor + 1}`,
|
|
12128
11906
|
`- screen \`${state.screen}\`, focus \`${state.focus}\`, selecting ${String(state.selecting)}`,
|
|
12129
|
-
`- ${state.
|
|
11907
|
+
`- ${state.vouched.length} of ${state.patches.length} reviewed`
|
|
12130
11908
|
];
|
|
12131
11909
|
fenced = (title, lines) => [
|
|
12132
11910
|
`## ${title}`,
|
|
@@ -12187,19 +11965,25 @@ var init_watch = __esmMin((() => {
|
|
|
12187
11965
|
}));
|
|
12188
11966
|
//#endregion
|
|
12189
11967
|
//#region src/tui/command.ts
|
|
12190
|
-
var command, commands, TEXT_SCREENS, PRINTABLE_KEY, takesText, commandsFor, listableFor, glossaryFor, actionFor, GLYPHS, displayKey, hintsFor;
|
|
11968
|
+
var EVERY_PANE, command, commands, TEXT_SCREENS, PRINTABLE_KEY, takesText, commandsFor, listableFor, glossaryFor, actionFor, GLYPHS, displayKey, hintsFor;
|
|
12191
11969
|
var init_command = __esmMin((() => {
|
|
11970
|
+
EVERY_PANE = [
|
|
11971
|
+
"tree",
|
|
11972
|
+
"diff",
|
|
11973
|
+
"review"
|
|
11974
|
+
];
|
|
12192
11975
|
command = (input) => ({
|
|
12193
|
-
category: "
|
|
11976
|
+
category: "Reading",
|
|
12194
11977
|
hint: "",
|
|
12195
11978
|
listed: true,
|
|
12196
|
-
|
|
11979
|
+
whenComments: false,
|
|
12197
11980
|
counted: false,
|
|
12198
11981
|
whenLayers: false,
|
|
12199
11982
|
whenThread: false,
|
|
12200
11983
|
whenSelecting: false,
|
|
12201
11984
|
whenReviewed: false,
|
|
12202
11985
|
whenPull: false,
|
|
11986
|
+
panes: EVERY_PANE,
|
|
12203
11987
|
rank: 0,
|
|
12204
11988
|
...input
|
|
12205
11989
|
});
|
|
@@ -12242,7 +12026,7 @@ var init_command = __esmMin((() => {
|
|
|
12242
12026
|
command({
|
|
12243
12027
|
action: "branch.pull",
|
|
12244
12028
|
title: "Open the pull request in a browser",
|
|
12245
|
-
category: "
|
|
12029
|
+
category: "Branches",
|
|
12246
12030
|
keys: ["p"],
|
|
12247
12031
|
screens: ["review"],
|
|
12248
12032
|
hint: "pull request",
|
|
@@ -12251,85 +12035,99 @@ var init_command = __esmMin((() => {
|
|
|
12251
12035
|
}),
|
|
12252
12036
|
command({
|
|
12253
12037
|
action: "cursor.next",
|
|
12038
|
+
category: "Moving",
|
|
12254
12039
|
title: "Next line",
|
|
12255
12040
|
keys: ["down", "j"],
|
|
12256
12041
|
screens: ["review"]
|
|
12257
12042
|
}),
|
|
12258
12043
|
command({
|
|
12259
12044
|
action: "cursor.prev",
|
|
12045
|
+
category: "Moving",
|
|
12260
12046
|
title: "Previous line",
|
|
12261
12047
|
keys: ["up", "k"],
|
|
12262
12048
|
screens: ["review"]
|
|
12263
12049
|
}),
|
|
12264
12050
|
command({
|
|
12265
12051
|
action: "cursor.top",
|
|
12052
|
+
category: "Moving",
|
|
12266
12053
|
title: "Go to first line",
|
|
12267
12054
|
keys: ["g"],
|
|
12268
12055
|
screens: ["review"]
|
|
12269
12056
|
}),
|
|
12270
12057
|
command({
|
|
12271
12058
|
action: "cursor.bottom",
|
|
12059
|
+
category: "Moving",
|
|
12272
12060
|
title: "Go to last line",
|
|
12273
12061
|
keys: ["G"],
|
|
12274
12062
|
screens: ["review"]
|
|
12275
12063
|
}),
|
|
12276
12064
|
command({
|
|
12277
12065
|
action: "cursor.pageDown",
|
|
12066
|
+
category: "Moving",
|
|
12278
12067
|
title: "Half page down",
|
|
12279
12068
|
keys: ["ctrl+d"],
|
|
12280
12069
|
screens: ["review"]
|
|
12281
12070
|
}),
|
|
12282
12071
|
command({
|
|
12283
12072
|
action: "cursor.pageUp",
|
|
12073
|
+
category: "Moving",
|
|
12284
12074
|
title: "Half page up",
|
|
12285
12075
|
keys: ["ctrl+u"],
|
|
12286
12076
|
screens: ["review"]
|
|
12287
12077
|
}),
|
|
12288
12078
|
command({
|
|
12289
12079
|
action: "context.more",
|
|
12080
|
+
category: "Reading",
|
|
12290
12081
|
title: "Show more context",
|
|
12291
12082
|
keys: ["+", "="],
|
|
12292
12083
|
screens: ["review"]
|
|
12293
12084
|
}),
|
|
12294
12085
|
command({
|
|
12295
12086
|
action: "context.less",
|
|
12087
|
+
category: "Reading",
|
|
12296
12088
|
title: "Show less context",
|
|
12297
12089
|
keys: ["-", "_"],
|
|
12298
12090
|
screens: ["review"]
|
|
12299
12091
|
}),
|
|
12300
12092
|
command({
|
|
12301
12093
|
action: "context.whole",
|
|
12094
|
+
category: "Reading",
|
|
12302
12095
|
title: "Show the whole file, or go back to the diff",
|
|
12303
12096
|
keys: ["F"],
|
|
12304
12097
|
screens: ["review"]
|
|
12305
12098
|
}),
|
|
12306
12099
|
command({
|
|
12307
12100
|
action: "comment.next",
|
|
12101
|
+
category: "Comments",
|
|
12308
12102
|
title: "Next comment",
|
|
12309
12103
|
keys: ["n"],
|
|
12310
12104
|
screens: ["review"],
|
|
12311
|
-
|
|
12105
|
+
whenComments: true
|
|
12312
12106
|
}),
|
|
12313
12107
|
command({
|
|
12314
12108
|
action: "comment.prev",
|
|
12109
|
+
category: "Comments",
|
|
12315
12110
|
title: "Previous comment",
|
|
12316
12111
|
keys: ["N"],
|
|
12317
12112
|
screens: ["review"]
|
|
12318
12113
|
}),
|
|
12319
12114
|
command({
|
|
12320
12115
|
action: "hunk.next",
|
|
12116
|
+
category: "Moving",
|
|
12321
12117
|
title: "Next change",
|
|
12322
12118
|
keys: ["}"],
|
|
12323
12119
|
screens: ["review"]
|
|
12324
12120
|
}),
|
|
12325
12121
|
command({
|
|
12326
12122
|
action: "hunk.prev",
|
|
12123
|
+
category: "Moving",
|
|
12327
12124
|
title: "Previous change",
|
|
12328
12125
|
keys: ["{"],
|
|
12329
12126
|
screens: ["review"]
|
|
12330
12127
|
}),
|
|
12331
12128
|
command({
|
|
12332
12129
|
action: "file.next",
|
|
12130
|
+
panes: ["tree", "diff"],
|
|
12333
12131
|
title: "Next file",
|
|
12334
12132
|
category: "Files",
|
|
12335
12133
|
keys: ["]"],
|
|
@@ -12347,14 +12145,14 @@ var init_command = __esmMin((() => {
|
|
|
12347
12145
|
command({
|
|
12348
12146
|
action: "focus.toggle",
|
|
12349
12147
|
title: "Switch pane",
|
|
12350
|
-
category: "
|
|
12148
|
+
category: "Reading",
|
|
12351
12149
|
keys: ["tab"],
|
|
12352
12150
|
screens: ["review"]
|
|
12353
12151
|
}),
|
|
12354
12152
|
command({
|
|
12355
12153
|
action: "focus.back",
|
|
12356
12154
|
title: "Switch pane, the other way",
|
|
12357
|
-
category: "
|
|
12155
|
+
category: "Reading",
|
|
12358
12156
|
keys: ["shift+tab"],
|
|
12359
12157
|
screens: ["review"],
|
|
12360
12158
|
listed: false
|
|
@@ -12362,7 +12160,7 @@ var init_command = __esmMin((() => {
|
|
|
12362
12160
|
command({
|
|
12363
12161
|
action: "panel.toggle",
|
|
12364
12162
|
title: "Show or hide the review panel",
|
|
12365
|
-
category: "
|
|
12163
|
+
category: "Comments",
|
|
12366
12164
|
keys: ["a"],
|
|
12367
12165
|
screens: ["review"],
|
|
12368
12166
|
hint: "review"
|
|
@@ -12370,7 +12168,7 @@ var init_command = __esmMin((() => {
|
|
|
12370
12168
|
command({
|
|
12371
12169
|
action: "nav.zoom",
|
|
12372
12170
|
title: "Hide the file list and the review panel",
|
|
12373
|
-
category: "
|
|
12171
|
+
category: "Reading",
|
|
12374
12172
|
keys: ["z", "\\"],
|
|
12375
12173
|
screens: ["review"]
|
|
12376
12174
|
}),
|
|
@@ -12390,13 +12188,16 @@ var init_command = __esmMin((() => {
|
|
|
12390
12188
|
}),
|
|
12391
12189
|
command({
|
|
12392
12190
|
action: "select.hunk",
|
|
12191
|
+
category: "Selecting",
|
|
12393
12192
|
title: "Select the change under the cursor",
|
|
12394
12193
|
keys: ["V"],
|
|
12395
12194
|
screens: ["review"]
|
|
12396
12195
|
}),
|
|
12397
12196
|
command({
|
|
12398
12197
|
action: "selection.copy",
|
|
12399
|
-
|
|
12198
|
+
panes: ["diff"],
|
|
12199
|
+
category: "Selecting",
|
|
12200
|
+
title: "Copy the selection, or the line the cursor is on",
|
|
12400
12201
|
keys: ["y"],
|
|
12401
12202
|
screens: ["review"],
|
|
12402
12203
|
hint: "copy",
|
|
@@ -12405,6 +12206,7 @@ var init_command = __esmMin((() => {
|
|
|
12405
12206
|
}),
|
|
12406
12207
|
command({
|
|
12407
12208
|
action: "search.open",
|
|
12209
|
+
category: "Selecting",
|
|
12408
12210
|
title: "Find the selection elsewhere",
|
|
12409
12211
|
keys: ["/"],
|
|
12410
12212
|
screens: ["review"]
|
|
@@ -12434,6 +12236,7 @@ var init_command = __esmMin((() => {
|
|
|
12434
12236
|
}),
|
|
12435
12237
|
command({
|
|
12436
12238
|
action: "select.swap",
|
|
12239
|
+
category: "Selecting",
|
|
12437
12240
|
title: "Grow the selection from its other end",
|
|
12438
12241
|
keys: ["o"],
|
|
12439
12242
|
screens: ["review"]
|
|
@@ -12441,18 +12244,20 @@ var init_command = __esmMin((() => {
|
|
|
12441
12244
|
command({
|
|
12442
12245
|
action: "wrap.toggle",
|
|
12443
12246
|
title: "Wrap long lines",
|
|
12444
|
-
category: "
|
|
12247
|
+
category: "Reading",
|
|
12445
12248
|
keys: ["w"],
|
|
12446
12249
|
screens: ["review"]
|
|
12447
12250
|
}),
|
|
12448
12251
|
command({
|
|
12449
12252
|
action: "pan.right",
|
|
12253
|
+
category: "Reading",
|
|
12450
12254
|
title: "Pan the diff right",
|
|
12451
12255
|
keys: [">"],
|
|
12452
12256
|
screens: ["review"]
|
|
12453
12257
|
}),
|
|
12454
12258
|
command({
|
|
12455
12259
|
action: "pan.left",
|
|
12260
|
+
category: "Reading",
|
|
12456
12261
|
title: "Pan the diff left",
|
|
12457
12262
|
keys: ["<"],
|
|
12458
12263
|
screens: ["review"]
|
|
@@ -12469,14 +12274,15 @@ var init_command = __esmMin((() => {
|
|
|
12469
12274
|
command({
|
|
12470
12275
|
action: "review.reload",
|
|
12471
12276
|
title: "Read the branch again",
|
|
12472
|
-
category: "
|
|
12277
|
+
category: "Branches",
|
|
12473
12278
|
keys: ["r"],
|
|
12474
12279
|
screens: ["review"]
|
|
12475
12280
|
}),
|
|
12476
12281
|
command({
|
|
12477
12282
|
action: "thread.settle",
|
|
12283
|
+
panes: ["diff", "review"],
|
|
12478
12284
|
title: "Settle the thread here",
|
|
12479
|
-
category: "
|
|
12285
|
+
category: "Comments",
|
|
12480
12286
|
keys: ["d"],
|
|
12481
12287
|
screens: ["review"],
|
|
12482
12288
|
hint: "settle",
|
|
@@ -12484,27 +12290,37 @@ var init_command = __esmMin((() => {
|
|
|
12484
12290
|
}),
|
|
12485
12291
|
command({
|
|
12486
12292
|
action: "thread.settleRead",
|
|
12293
|
+
panes: ["review"],
|
|
12487
12294
|
title: "Settle every answer already read",
|
|
12488
|
-
category: "
|
|
12295
|
+
category: "Comments",
|
|
12489
12296
|
keys: ["D"],
|
|
12490
|
-
screens: ["review"]
|
|
12297
|
+
screens: ["review"],
|
|
12298
|
+
hint: "settle read",
|
|
12299
|
+
rank: 1
|
|
12491
12300
|
}),
|
|
12492
12301
|
command({
|
|
12493
12302
|
action: "thread.remove",
|
|
12303
|
+
panes: ["review"],
|
|
12304
|
+
hint: "remove",
|
|
12305
|
+
rank: 2,
|
|
12494
12306
|
title: "Remove the comment here",
|
|
12495
|
-
category: "
|
|
12307
|
+
category: "Comments",
|
|
12496
12308
|
keys: ["X"],
|
|
12497
12309
|
screens: ["review"]
|
|
12498
12310
|
}),
|
|
12499
12311
|
command({
|
|
12500
12312
|
action: "panel.flip",
|
|
12313
|
+
panes: ["review"],
|
|
12314
|
+
hint: "order",
|
|
12315
|
+
rank: 4,
|
|
12501
12316
|
title: "Read the review oldest first, or newest first",
|
|
12502
|
-
category: "
|
|
12317
|
+
category: "Comments",
|
|
12503
12318
|
keys: ["O"],
|
|
12504
12319
|
screens: ["review"]
|
|
12505
12320
|
}),
|
|
12506
12321
|
command({
|
|
12507
12322
|
action: "tree.winnow",
|
|
12323
|
+
panes: ["tree"],
|
|
12508
12324
|
title: "Hide the files already reviewed",
|
|
12509
12325
|
category: "Files",
|
|
12510
12326
|
keys: ["f"],
|
|
@@ -12515,6 +12331,7 @@ var init_command = __esmMin((() => {
|
|
|
12515
12331
|
}),
|
|
12516
12332
|
command({
|
|
12517
12333
|
action: "rail.toggle",
|
|
12334
|
+
panes: ["tree"],
|
|
12518
12335
|
title: "Switch between layers and files",
|
|
12519
12336
|
category: "Files",
|
|
12520
12337
|
keys: ["s"],
|
|
@@ -12539,6 +12356,7 @@ var init_command = __esmMin((() => {
|
|
|
12539
12356
|
}),
|
|
12540
12357
|
command({
|
|
12541
12358
|
action: "file.vouch",
|
|
12359
|
+
panes: ["tree", "diff"],
|
|
12542
12360
|
title: "Mark reviewed",
|
|
12543
12361
|
category: "Files",
|
|
12544
12362
|
keys: ["m"],
|
|
@@ -12555,6 +12373,8 @@ var init_command = __esmMin((() => {
|
|
|
12555
12373
|
}),
|
|
12556
12374
|
command({
|
|
12557
12375
|
action: "select.start",
|
|
12376
|
+
panes: ["diff"],
|
|
12377
|
+
category: "Selecting",
|
|
12558
12378
|
title: "Start a selection",
|
|
12559
12379
|
keys: ["v"],
|
|
12560
12380
|
screens: ["review"],
|
|
@@ -12563,6 +12383,8 @@ var init_command = __esmMin((() => {
|
|
|
12563
12383
|
}),
|
|
12564
12384
|
command({
|
|
12565
12385
|
action: "compose.open",
|
|
12386
|
+
panes: ["diff"],
|
|
12387
|
+
category: "Comments",
|
|
12566
12388
|
title: "Comment on the selection",
|
|
12567
12389
|
keys: ["c", "return"],
|
|
12568
12390
|
screens: ["review"],
|
|
@@ -12572,20 +12394,21 @@ var init_command = __esmMin((() => {
|
|
|
12572
12394
|
command({
|
|
12573
12395
|
action: "report.open",
|
|
12574
12396
|
title: "Report a bug",
|
|
12575
|
-
category: "
|
|
12397
|
+
category: "App",
|
|
12576
12398
|
keys: ["ctrl+b"],
|
|
12577
12399
|
screens: ["branches", "review"]
|
|
12578
12400
|
}),
|
|
12579
12401
|
command({
|
|
12580
12402
|
action: "report.mode",
|
|
12581
12403
|
title: "Send a minimal report instead of a full one",
|
|
12582
|
-
category: "
|
|
12404
|
+
category: "App",
|
|
12583
12405
|
keys: ["ctrl+t"],
|
|
12584
12406
|
screens: ["report"],
|
|
12585
12407
|
listed: false
|
|
12586
12408
|
}),
|
|
12587
12409
|
command({
|
|
12588
12410
|
action: "report.send",
|
|
12411
|
+
category: "App",
|
|
12589
12412
|
title: "Send the report",
|
|
12590
12413
|
keys: ["ctrl+s"],
|
|
12591
12414
|
screens: ["report"],
|
|
@@ -12595,80 +12418,23 @@ var init_command = __esmMin((() => {
|
|
|
12595
12418
|
command({
|
|
12596
12419
|
action: "palette.open",
|
|
12597
12420
|
title: "Find a command",
|
|
12598
|
-
category: "
|
|
12421
|
+
category: "App",
|
|
12599
12422
|
keys: ["ctrl+p"],
|
|
12600
|
-
screens: ["review"
|
|
12423
|
+
screens: ["review"],
|
|
12601
12424
|
listed: false
|
|
12602
12425
|
}),
|
|
12603
12426
|
command({
|
|
12604
12427
|
action: "compose.submit",
|
|
12428
|
+
category: "Comments",
|
|
12605
12429
|
title: "Send the comment",
|
|
12606
12430
|
keys: ["ctrl+s"],
|
|
12607
12431
|
screens: ["compose"],
|
|
12608
12432
|
hint: "send",
|
|
12609
12433
|
listed: false
|
|
12610
12434
|
}),
|
|
12611
|
-
command({
|
|
12612
|
-
action: "pending.open",
|
|
12613
|
-
title: "Send what is staged",
|
|
12614
|
-
keys: ["S"],
|
|
12615
|
-
screens: ["review"],
|
|
12616
|
-
hint: "send",
|
|
12617
|
-
whenStaged: true,
|
|
12618
|
-
counted: true,
|
|
12619
|
-
rank: 6
|
|
12620
|
-
}),
|
|
12621
|
-
command({
|
|
12622
|
-
action: "pending.submit",
|
|
12623
|
-
title: "Send the review",
|
|
12624
|
-
keys: ["ctrl+s"],
|
|
12625
|
-
screens: ["pending"],
|
|
12626
|
-
hint: "send",
|
|
12627
|
-
listed: false,
|
|
12628
|
-
rank: 2
|
|
12629
|
-
}),
|
|
12630
|
-
command({
|
|
12631
|
-
action: "pending.edit",
|
|
12632
|
-
title: "Reword this comment",
|
|
12633
|
-
category: "Review",
|
|
12634
|
-
keys: ["e"],
|
|
12635
|
-
screens: ["pending"],
|
|
12636
|
-
hint: "reword",
|
|
12637
|
-
rank: 3
|
|
12638
|
-
}),
|
|
12639
|
-
command({
|
|
12640
|
-
action: "pending.drop",
|
|
12641
|
-
title: "Withdraw this comment",
|
|
12642
|
-
category: "Review",
|
|
12643
|
-
keys: ["X"],
|
|
12644
|
-
screens: ["pending"],
|
|
12645
|
-
hint: "withdraw",
|
|
12646
|
-
rank: 4
|
|
12647
|
-
}),
|
|
12648
|
-
command({
|
|
12649
|
-
action: "pending.next",
|
|
12650
|
-
title: "Next staged comment",
|
|
12651
|
-
keys: ["down", "j"],
|
|
12652
|
-
screens: ["pending"],
|
|
12653
|
-
listed: false
|
|
12654
|
-
}),
|
|
12655
|
-
command({
|
|
12656
|
-
action: "pending.prev",
|
|
12657
|
-
title: "Previous staged comment",
|
|
12658
|
-
keys: ["up", "k"],
|
|
12659
|
-
screens: ["pending"],
|
|
12660
|
-
listed: false
|
|
12661
|
-
}),
|
|
12662
|
-
command({
|
|
12663
|
-
action: "compose.stage",
|
|
12664
|
-
title: "Add to review",
|
|
12665
|
-
keys: ["ctrl+a"],
|
|
12666
|
-
screens: ["compose"],
|
|
12667
|
-
hint: "stage",
|
|
12668
|
-
listed: false
|
|
12669
|
-
}),
|
|
12670
12435
|
command({
|
|
12671
12436
|
action: "compose.newline",
|
|
12437
|
+
category: "Comments",
|
|
12672
12438
|
title: "New line",
|
|
12673
12439
|
keys: ["return"],
|
|
12674
12440
|
screens: ["compose"],
|
|
@@ -12676,6 +12442,7 @@ var init_command = __esmMin((() => {
|
|
|
12676
12442
|
}),
|
|
12677
12443
|
command({
|
|
12678
12444
|
action: "palette.run",
|
|
12445
|
+
category: "App",
|
|
12679
12446
|
title: "Run the highlighted command",
|
|
12680
12447
|
keys: ["return"],
|
|
12681
12448
|
screens: ["palette", "keys"],
|
|
@@ -12685,12 +12452,11 @@ var init_command = __esmMin((() => {
|
|
|
12685
12452
|
command({
|
|
12686
12453
|
action: "keys.open",
|
|
12687
12454
|
title: "List every key",
|
|
12688
|
-
category: "
|
|
12455
|
+
category: "App",
|
|
12689
12456
|
keys: ["?"],
|
|
12690
12457
|
screens: [
|
|
12691
12458
|
"branches",
|
|
12692
12459
|
"review",
|
|
12693
|
-
"pending",
|
|
12694
12460
|
"search"
|
|
12695
12461
|
],
|
|
12696
12462
|
hint: "keys",
|
|
@@ -12700,7 +12466,7 @@ var init_command = __esmMin((() => {
|
|
|
12700
12466
|
command({
|
|
12701
12467
|
action: "keys.next",
|
|
12702
12468
|
title: "Next key",
|
|
12703
|
-
category: "
|
|
12469
|
+
category: "App",
|
|
12704
12470
|
keys: ["down", "j"],
|
|
12705
12471
|
screens: ["keys"],
|
|
12706
12472
|
listed: false
|
|
@@ -12708,7 +12474,7 @@ var init_command = __esmMin((() => {
|
|
|
12708
12474
|
command({
|
|
12709
12475
|
action: "keys.prev",
|
|
12710
12476
|
title: "Previous key",
|
|
12711
|
-
category: "
|
|
12477
|
+
category: "App",
|
|
12712
12478
|
keys: ["up", "k"],
|
|
12713
12479
|
screens: ["keys"],
|
|
12714
12480
|
listed: false
|
|
@@ -12716,13 +12482,12 @@ var init_command = __esmMin((() => {
|
|
|
12716
12482
|
command({
|
|
12717
12483
|
action: "back",
|
|
12718
12484
|
title: "Go back",
|
|
12719
|
-
category: "
|
|
12485
|
+
category: "App",
|
|
12720
12486
|
keys: ["escape", "q"],
|
|
12721
12487
|
screens: [
|
|
12722
12488
|
"review",
|
|
12723
12489
|
"compose",
|
|
12724
12490
|
"palette",
|
|
12725
|
-
"pending",
|
|
12726
12491
|
"report",
|
|
12727
12492
|
"search",
|
|
12728
12493
|
"keys"
|
|
@@ -12734,7 +12499,7 @@ var init_command = __esmMin((() => {
|
|
|
12734
12499
|
command({
|
|
12735
12500
|
action: "quit",
|
|
12736
12501
|
title: "Quit",
|
|
12737
|
-
category: "
|
|
12502
|
+
category: "App",
|
|
12738
12503
|
keys: ["q"],
|
|
12739
12504
|
screens: ["branches"],
|
|
12740
12505
|
hint: "quit",
|
|
@@ -12744,6 +12509,7 @@ var init_command = __esmMin((() => {
|
|
|
12744
12509
|
];
|
|
12745
12510
|
TEXT_SCREENS = /* @__PURE__ */ new Set([
|
|
12746
12511
|
"compose",
|
|
12512
|
+
"keys",
|
|
12747
12513
|
"palette",
|
|
12748
12514
|
"report"
|
|
12749
12515
|
]);
|
|
@@ -12770,15 +12536,15 @@ var init_command = __esmMin((() => {
|
|
|
12770
12536
|
if (key.startsWith("ctrl+")) return `^${key.slice(5)}`;
|
|
12771
12537
|
return GLYPHS[key] ?? key;
|
|
12772
12538
|
};
|
|
12773
|
-
hintsFor = (screen, offered) => commandsFor(screen).filter((entry) => entry.hint.length > 0).filter((entry) => !entry.
|
|
12539
|
+
hintsFor = (screen, offered) => commandsFor(screen).filter((entry) => entry.hint.length > 0).filter((entry) => !entry.whenComments || offered.comments > 0).filter((entry) => !entry.whenLayers || offered.layers > 0).filter((entry) => !entry.whenThread || offered.onThread).filter((entry) => !entry.whenSelecting || offered.selecting).filter((entry) => !entry.whenReviewed || offered.reviewed > 0).filter((entry) => !entry.whenPull || offered.pull).filter((entry) => entry.panes.includes(offered.pane)).toSorted((left, right) => left.rank - right.rank).map((entry) => ({
|
|
12774
12540
|
key: displayKey(entry.keys[0] ?? ""),
|
|
12775
|
-
hint: entry.counted ? `${entry.hint} ${offered.
|
|
12541
|
+
hint: entry.counted ? `${entry.hint} ${offered.comments}` : entry.hint,
|
|
12776
12542
|
press: entry.keys[0] ?? ""
|
|
12777
12543
|
}));
|
|
12778
12544
|
}));
|
|
12779
12545
|
//#endregion
|
|
12780
12546
|
//#region src/tui/match.ts
|
|
12781
|
-
var subsequence, label, matches, closeness, searchCommands;
|
|
12547
|
+
var subsequence, label, matches, closeness, searchCommands, searchGlossary;
|
|
12782
12548
|
var init_match = __esmMin((() => {
|
|
12783
12549
|
init_command();
|
|
12784
12550
|
subsequence = (haystack, needle) => {
|
|
@@ -12800,10 +12566,11 @@ var init_match = __esmMin((() => {
|
|
|
12800
12566
|
return label(entry).includes(wanted) ? 2 : 3;
|
|
12801
12567
|
};
|
|
12802
12568
|
searchCommands = (screen, query) => listableFor(screen).filter((entry) => matches(entry, query)).toSorted((left, right) => closeness(left, query) - closeness(right, query));
|
|
12569
|
+
searchGlossary = (screen, query) => glossaryFor(screen).filter((entry) => matches(entry, query));
|
|
12803
12570
|
}));
|
|
12804
12571
|
//#endregion
|
|
12805
12572
|
//#region src/tui/reduce.ts
|
|
12806
|
-
var clamp, lastRow, rowsIn, withCursorVisible, moveCursor, stepStop, scrolled, draggedTo, atRow, noneLeft, layerHunk, nextFileWithComments, atComment, nothingOpen, layerComment, PAN_STEP, panned,
|
|
12573
|
+
var clamp, lastRow, rowsIn, withCursorVisible, moveCursor, stepStop, scrolled, draggedTo, atRow, noneLeft, layerHunk, nextFileWithComments, atComment, nothingOpen, layerComment, PAN_STEP, panned, moveLayer, inRail, railScrolled, movePanel, layerDown, PANES, panesShown, focusStepped, togglePanel, packedAway, zoom, toggleRail, foldDirectory, foldLayer, foldThread, fold, moveBranch, moveFile, selectHunk, swapEnds, atBranch, startSelection, openCompose, goBack, walkMatches, openPalette, openKeys, movePalette, paletteMatches, keyMatches, offered, paletteChoice, transitions, reduce, atFile, withContext, withFull, revealsAfter, gapOpened, panBy, withSent, withArrived, withColumns, withLayers, withPulls, withSilentForge, withBranches, withSource, withVouched, restoredTo, openedAt, withPatches, inserted, asksAQuery, typed, TAB_WIDTH, SPACE_CODE, ERASED_FROM, ERASED_TO, readable, legible, pasted, backspaced, cutBackTo, wordBackspaced, lineBackspaced, deleted, caretMoved, caretJumped, caretHomed, paletteMoved, paletteClosed, withWaiting, withMatches, withNoticeHere, withNotice;
|
|
12807
12574
|
var init_reduce = __esmMin((() => {
|
|
12808
12575
|
init_dist();
|
|
12809
12576
|
init_patch();
|
|
@@ -12918,10 +12685,6 @@ var init_reduce = __esmMin((() => {
|
|
|
12918
12685
|
pan: Math.max(0, state.pan + delta)
|
|
12919
12686
|
};
|
|
12920
12687
|
};
|
|
12921
|
-
movePending = (state, delta) => ({
|
|
12922
|
-
...state,
|
|
12923
|
-
pendingIndex: clamp(state.pendingIndex + delta, 0, Math.max(0, state.pending.length - 1))
|
|
12924
|
-
});
|
|
12925
12688
|
moveLayer = (state, delta) => {
|
|
12926
12689
|
const layerIndex = clamp(state.layerIndex + delta, 0, Math.max(0, state.layers.length - 1));
|
|
12927
12690
|
const landed = {
|
|
@@ -12939,7 +12702,17 @@ var init_reduce = __esmMin((() => {
|
|
|
12939
12702
|
};
|
|
12940
12703
|
};
|
|
12941
12704
|
inRail = (state, delta) => onLayers(state) ? moveLayer(state, delta) : moveFile(state, delta);
|
|
12942
|
-
|
|
12705
|
+
railScrolled = (state, delta) => {
|
|
12706
|
+
if (onLayers(state)) return inRail(state, delta);
|
|
12707
|
+
const height = Math.max(1, state.railRows);
|
|
12708
|
+
const rows = treeRows(state).length;
|
|
12709
|
+
if (rows <= height) return state;
|
|
12710
|
+
const start = treeStart(state, height);
|
|
12711
|
+
return {
|
|
12712
|
+
...state,
|
|
12713
|
+
railScroll: clamp(start + delta, 0, rows - height)
|
|
12714
|
+
};
|
|
12715
|
+
};
|
|
12943
12716
|
movePanel = (state, delta) => ({
|
|
12944
12717
|
...state,
|
|
12945
12718
|
panelIndex: clamp(state.panelIndex + delta, 0, Math.max(0, panelEntries(state).length - 1))
|
|
@@ -13080,10 +12853,6 @@ var init_reduce = __esmMin((() => {
|
|
|
13080
12853
|
matches: [],
|
|
13081
12854
|
term: ""
|
|
13082
12855
|
};
|
|
13083
|
-
if (state.screen === "pending") return {
|
|
13084
|
-
...state,
|
|
13085
|
-
screen: "review"
|
|
13086
|
-
};
|
|
13087
12856
|
if (state.screen === "report") return {
|
|
13088
12857
|
...state,
|
|
13089
12858
|
screen: state.returnTo,
|
|
@@ -13097,7 +12866,8 @@ var init_reduce = __esmMin((() => {
|
|
|
13097
12866
|
};
|
|
13098
12867
|
if (state.screen === "keys") return {
|
|
13099
12868
|
...state,
|
|
13100
|
-
screen: state.returnTo
|
|
12869
|
+
screen: state.returnTo,
|
|
12870
|
+
query: ""
|
|
13101
12871
|
};
|
|
13102
12872
|
if (state.screen === "compose") return {
|
|
13103
12873
|
...state,
|
|
@@ -13139,7 +12909,8 @@ var init_reduce = __esmMin((() => {
|
|
|
13139
12909
|
paletteIndex: clamp(state.paletteIndex + delta, 0, Math.max(0, offered(state).length - 1))
|
|
13140
12910
|
});
|
|
13141
12911
|
paletteMatches = (state) => searchCommands(state.returnTo, state.query);
|
|
13142
|
-
|
|
12912
|
+
keyMatches = (state) => searchGlossary(state.returnTo, state.query);
|
|
12913
|
+
offered = (state) => state.screen === "keys" ? keyMatches(state) : paletteMatches(state);
|
|
13143
12914
|
paletteChoice = (state) => offered(state)[state.paletteIndex]?.action;
|
|
13144
12915
|
transitions = {
|
|
13145
12916
|
"branch.first": (state) => atBranch(state, 0),
|
|
@@ -13168,13 +12939,6 @@ var init_reduce = __esmMin((() => {
|
|
|
13168
12939
|
"select.swap": swapEnds,
|
|
13169
12940
|
"compose.open": openCompose,
|
|
13170
12941
|
"compose.submit": (state) => state,
|
|
13171
|
-
"compose.stage": (state) => state,
|
|
13172
|
-
"pending.open": (state) => state,
|
|
13173
|
-
"pending.submit": (state) => state,
|
|
13174
|
-
"pending.edit": (state) => state,
|
|
13175
|
-
"pending.drop": (state) => state,
|
|
13176
|
-
"pending.next": (state) => movePending(state, 1),
|
|
13177
|
-
"pending.prev": (state) => movePending(state, -1),
|
|
13178
12942
|
"compose.newline": (state) => inserted(state, "\n"),
|
|
13179
12943
|
"focus.toggle": (state) => ({
|
|
13180
12944
|
...state,
|
|
@@ -13285,13 +13049,6 @@ var init_reduce = __esmMin((() => {
|
|
|
13285
13049
|
selecting: false
|
|
13286
13050
|
});
|
|
13287
13051
|
};
|
|
13288
|
-
withPending = (state, pending, screen) => ({
|
|
13289
|
-
...state,
|
|
13290
|
-
pending,
|
|
13291
|
-
pendingIndex: 0,
|
|
13292
|
-
staged: pending.length,
|
|
13293
|
-
screen
|
|
13294
|
-
});
|
|
13295
13052
|
panBy = (state, delta) => state.wrap ? state : {
|
|
13296
13053
|
...state,
|
|
13297
13054
|
pan: Math.max(0, state.pan + delta)
|
|
@@ -13410,7 +13167,8 @@ var init_reduce = __esmMin((() => {
|
|
|
13410
13167
|
caret: at + text.length
|
|
13411
13168
|
};
|
|
13412
13169
|
};
|
|
13413
|
-
|
|
13170
|
+
asksAQuery = (state) => state.screen === "palette" || state.screen === "keys";
|
|
13171
|
+
typed = (state, character) => asksAQuery(state) ? {
|
|
13414
13172
|
...state,
|
|
13415
13173
|
query: `${state.query}${character}`,
|
|
13416
13174
|
paletteIndex: 0
|
|
@@ -13428,10 +13186,10 @@ var init_reduce = __esmMin((() => {
|
|
|
13428
13186
|
pasted = (state, text) => {
|
|
13429
13187
|
const clean = legible(stripAnsiSequences(text));
|
|
13430
13188
|
if (clean.length === 0) return state;
|
|
13431
|
-
return typed(state, state
|
|
13189
|
+
return typed(state, asksAQuery(state) ? clean.replace(/\n/g, " ") : clean);
|
|
13432
13190
|
};
|
|
13433
13191
|
backspaced = (state) => {
|
|
13434
|
-
if (state
|
|
13192
|
+
if (asksAQuery(state)) return {
|
|
13435
13193
|
...state,
|
|
13436
13194
|
query: state.query.slice(0, -1),
|
|
13437
13195
|
paletteIndex: 0
|
|
@@ -13453,8 +13211,8 @@ var init_reduce = __esmMin((() => {
|
|
|
13453
13211
|
caret: to
|
|
13454
13212
|
};
|
|
13455
13213
|
};
|
|
13456
|
-
wordBackspaced = (state) => state
|
|
13457
|
-
lineBackspaced = (state) => state
|
|
13214
|
+
wordBackspaced = (state) => asksAQuery(state) ? backspaced(state) : cutBackTo(state, caretByWord(state, -1));
|
|
13215
|
+
lineBackspaced = (state) => asksAQuery(state) ? backspaced(state) : cutBackTo(state, caretToEdge(state, "start"));
|
|
13458
13216
|
deleted = (state) => {
|
|
13459
13217
|
const at = caretAt(state);
|
|
13460
13218
|
if (at >= state.draft.length) return state;
|
|
@@ -13476,11 +13234,6 @@ var init_reduce = __esmMin((() => {
|
|
|
13476
13234
|
...state,
|
|
13477
13235
|
caret: caretToEdge(state, edge)
|
|
13478
13236
|
});
|
|
13479
|
-
withDraft = (state, draft) => ({
|
|
13480
|
-
...state,
|
|
13481
|
-
draft,
|
|
13482
|
-
caret: draft.length
|
|
13483
|
-
});
|
|
13484
13237
|
paletteMoved = (state, delta) => movePalette(state, delta);
|
|
13485
13238
|
paletteClosed = (state) => ({
|
|
13486
13239
|
...state,
|
|
@@ -13516,7 +13269,6 @@ var init_marks = __esmMin((() => {
|
|
|
13516
13269
|
sets = {
|
|
13517
13270
|
ring: {
|
|
13518
13271
|
comment: "○",
|
|
13519
|
-
staged: "○",
|
|
13520
13272
|
sent: "✓",
|
|
13521
13273
|
rule: "│",
|
|
13522
13274
|
cursor: "▎",
|
|
@@ -13528,7 +13280,6 @@ var init_marks = __esmMin((() => {
|
|
|
13528
13280
|
},
|
|
13529
13281
|
bubble: {
|
|
13530
13282
|
comment: "◗",
|
|
13531
|
-
staged: "◗",
|
|
13532
13283
|
sent: "◖",
|
|
13533
13284
|
rule: "┃",
|
|
13534
13285
|
cursor: "▌",
|
|
@@ -13540,7 +13291,6 @@ var init_marks = __esmMin((() => {
|
|
|
13540
13291
|
},
|
|
13541
13292
|
quote: {
|
|
13542
13293
|
comment: "❞",
|
|
13543
|
-
staged: "❝",
|
|
13544
13294
|
sent: "✓",
|
|
13545
13295
|
rule: "┊",
|
|
13546
13296
|
cursor: "▎",
|
|
@@ -13552,7 +13302,6 @@ var init_marks = __esmMin((() => {
|
|
|
13552
13302
|
},
|
|
13553
13303
|
diamond: {
|
|
13554
13304
|
comment: "◆",
|
|
13555
|
-
staged: "◇",
|
|
13556
13305
|
sent: "◈",
|
|
13557
13306
|
rule: "╎",
|
|
13558
13307
|
cursor: "▎",
|
|
@@ -13564,7 +13313,6 @@ var init_marks = __esmMin((() => {
|
|
|
13564
13313
|
},
|
|
13565
13314
|
dot: {
|
|
13566
13315
|
comment: "●",
|
|
13567
|
-
staged: "●",
|
|
13568
13316
|
sent: "✓",
|
|
13569
13317
|
rule: "▏",
|
|
13570
13318
|
cursor: "▎",
|
|
@@ -13581,7 +13329,6 @@ var init_marks = __esmMin((() => {
|
|
|
13581
13329
|
folderOpen: "",
|
|
13582
13330
|
file: "",
|
|
13583
13331
|
comment: "○",
|
|
13584
|
-
staged: "○",
|
|
13585
13332
|
sent: "✓",
|
|
13586
13333
|
rule: "│",
|
|
13587
13334
|
cursor: "▎",
|
|
@@ -13674,7 +13421,7 @@ var init_theme = __esmMin((() => {
|
|
|
13674
13421
|
}));
|
|
13675
13422
|
//#endregion
|
|
13676
13423
|
//#region src/tui/diffview.ts
|
|
13677
|
-
var WASH, NOTE_MIN, ANSWER_MARK, OVERSCAN, SIGN_WIDTH, SCROLL_ROWS, PAN_COLUMNS, WAYS, notchesIn, wheelTo, SIGNS, numberFor, DiffView, startsOf, bareOf, keyOf, groupOf, isChrome, heldAt, NO_SPANS, lineStarts, overLine, shifted, acrossLines, spansByLine, textAt, noteSpans, NOTE_PAINT, wrap, headOf, spokenLines, answerLines, noteLines, noteRows, proseRows, proseAt, notesAt, codeRow, rowsFor, layout, lineNumbers, BARE_SIGN, signFor, lineSigns, sideLineOf;
|
|
13424
|
+
var WASH, NOTE_MIN, ANSWER_MARK, OVERSCAN, SIGN_WIDTH, SCROLL_ROWS, PAN_COLUMNS, WAYS, notchesIn, wheelTo, SIGNS, numberFor, DiffView, startsOf, bareOf, keyOf, groupOf, isChrome, heldAt, sameLine, NO_SPANS, lineStarts, overLine, shifted, acrossLines, spansByLine, textAt, noteSpans, NOTE_PAINT, wrap, headOf, spokenLines, answerLines, noteLines, noteRows, proseRows, proseAt, notesAt, codeRow, rowsFor, layout, lineNumbers, BARE_SIGN, signFor, lineSigns, sideLineOf;
|
|
13678
13425
|
var init_diffview = __esmMin((() => {
|
|
13679
13426
|
init_dist();
|
|
13680
13427
|
init_patch();
|
|
@@ -13694,7 +13441,7 @@ var init_diffview = __esmMin((() => {
|
|
|
13694
13441
|
ANSWER_MARK = "↳";
|
|
13695
13442
|
OVERSCAN = 2;
|
|
13696
13443
|
SIGN_WIDTH = 2;
|
|
13697
|
-
SCROLL_ROWS =
|
|
13444
|
+
SCROLL_ROWS = 1;
|
|
13698
13445
|
PAN_COLUMNS = 8;
|
|
13699
13446
|
WAYS = {
|
|
13700
13447
|
up: {
|
|
@@ -13745,7 +13492,10 @@ var init_diffview = __esmMin((() => {
|
|
|
13745
13492
|
pinnedText = "";
|
|
13746
13493
|
newLit = [];
|
|
13747
13494
|
oldLit = [];
|
|
13748
|
-
|
|
13495
|
+
newFor = "";
|
|
13496
|
+
oldFor = "";
|
|
13497
|
+
newText = [];
|
|
13498
|
+
oldText = [];
|
|
13749
13499
|
shown;
|
|
13750
13500
|
noted = "";
|
|
13751
13501
|
display = [];
|
|
@@ -13835,6 +13585,7 @@ var init_diffview = __esmMin((() => {
|
|
|
13835
13585
|
this.numbers.onMouseDown = (event) => handlers.down(event.y);
|
|
13836
13586
|
this.numbers.onMouseDrag = (event) => handlers.drag(event.y);
|
|
13837
13587
|
this.numbers.onMouseDragEnd = (event) => handlers.dragEnd(event.y);
|
|
13588
|
+
this.numbers.onMouseUp = (event) => handlers.dragEnd(event.y);
|
|
13838
13589
|
}
|
|
13839
13590
|
refresh() {
|
|
13840
13591
|
this.shown = void 0;
|
|
@@ -13881,23 +13632,36 @@ var init_diffview = __esmMin((() => {
|
|
|
13881
13632
|
}
|
|
13882
13633
|
lit(path, side, lines, found) {
|
|
13883
13634
|
const held = spansByLine(lines, found);
|
|
13884
|
-
if (side === "new")
|
|
13885
|
-
|
|
13886
|
-
|
|
13635
|
+
if (side === "new") {
|
|
13636
|
+
this.newLit = held;
|
|
13637
|
+
this.newText = lines;
|
|
13638
|
+
this.newFor = path;
|
|
13639
|
+
} else {
|
|
13640
|
+
this.oldLit = held;
|
|
13641
|
+
this.oldText = lines;
|
|
13642
|
+
this.oldFor = path;
|
|
13643
|
+
}
|
|
13887
13644
|
this.feed();
|
|
13888
13645
|
this.code.requestRender();
|
|
13889
13646
|
}
|
|
13890
13647
|
litRow(entry) {
|
|
13891
|
-
|
|
13892
|
-
const row = this.shown.rows[entry.row];
|
|
13648
|
+
const row = this.shown?.rows[entry.row];
|
|
13893
13649
|
if (row === void 0) return NO_SPANS;
|
|
13894
13650
|
const fresh = getOrUndefined$1(row.newLine);
|
|
13895
|
-
if (fresh !== void 0) return this.
|
|
13651
|
+
if (fresh !== void 0) return this.sideRow(row.text, fresh, "new");
|
|
13896
13652
|
const gone = getOrUndefined$1(row.oldLine);
|
|
13897
|
-
return gone === void 0 ? NO_SPANS : this.
|
|
13653
|
+
return gone === void 0 ? NO_SPANS : this.sideRow(row.text, gone, "old");
|
|
13654
|
+
}
|
|
13655
|
+
sideRow(text, line, side) {
|
|
13656
|
+
const path = side === "new" ? this.newFor : this.oldFor;
|
|
13657
|
+
if (this.shown?.path !== path) return NO_SPANS;
|
|
13658
|
+
const source = side === "new" ? this.newText : this.oldText;
|
|
13659
|
+
if (!sameLine(source[line - 1], text)) return NO_SPANS;
|
|
13660
|
+
return (side === "new" ? this.newLit : this.oldLit)[line - 1] ?? NO_SPANS;
|
|
13898
13661
|
}
|
|
13899
13662
|
ownSpans() {
|
|
13900
|
-
if (this.shown === void 0
|
|
13663
|
+
if (this.shown === void 0) return void 0;
|
|
13664
|
+
if (this.shown.path !== this.newFor && this.shown.path !== this.oldFor) return void 0;
|
|
13901
13665
|
const spans = [];
|
|
13902
13666
|
let at = 0;
|
|
13903
13667
|
for (const entry of this.display) {
|
|
@@ -14009,6 +13773,22 @@ var init_diffview = __esmMin((() => {
|
|
|
14009
13773
|
tallestRows() {
|
|
14010
13774
|
return this.tallest();
|
|
14011
13775
|
}
|
|
13776
|
+
screenRowOf(row) {
|
|
13777
|
+
return this.visualOfRow(row);
|
|
13778
|
+
}
|
|
13779
|
+
blockAt(row, stop) {
|
|
13780
|
+
const first = this.display.findIndex((entry) => entry.row === row && entry.stop === stop);
|
|
13781
|
+
if (first === -1) return {
|
|
13782
|
+
start: 0,
|
|
13783
|
+
rows: 0
|
|
13784
|
+
};
|
|
13785
|
+
let last = first;
|
|
13786
|
+
while (this.display[last + 1]?.row === row && this.display[last + 1]?.stop === stop) last += 1;
|
|
13787
|
+
return {
|
|
13788
|
+
start: first,
|
|
13789
|
+
rows: last - first + 1
|
|
13790
|
+
};
|
|
13791
|
+
}
|
|
14012
13792
|
scrollTo(row, cursor, held = -1) {
|
|
14013
13793
|
const highest = Math.max(0, this.tallest() - this.rows());
|
|
14014
13794
|
if (held >= 0) {
|
|
@@ -14059,6 +13839,7 @@ var init_diffview = __esmMin((() => {
|
|
|
14059
13839
|
};
|
|
14060
13840
|
isChrome = (entry) => entry.comment || entry.gap || entry.prose;
|
|
14061
13841
|
heldAt = (entry, pan) => isChrome(entry) && pan > 0 ? `${" ".repeat(pan)}${entry.text}` : entry.text;
|
|
13842
|
+
sameLine = (source, row) => source !== void 0 && source.trimEnd() === row.trimEnd();
|
|
14062
13843
|
NO_SPANS = [];
|
|
14063
13844
|
lineStarts = (lines) => {
|
|
14064
13845
|
const starts = [];
|
|
@@ -14151,10 +13932,9 @@ var init_diffview = __esmMin((() => {
|
|
|
14151
13932
|
headOf = (note) => {
|
|
14152
13933
|
const moved = note.stale ? ", the branch moved on" : "";
|
|
14153
13934
|
if (note.settled) return `${marks().sent} settled${moved}`;
|
|
14154
|
-
if (note.asks) return `${marks().
|
|
13935
|
+
if (note.asks) return `${marks().comment} asked back${moved}`;
|
|
14155
13936
|
if (note.answers.length > 0) return `${marks().sent} answered${moved}`;
|
|
14156
|
-
|
|
14157
|
-
return `${marks().staged} staged`;
|
|
13937
|
+
return `${marks().sent} sent${moved}`;
|
|
14158
13938
|
};
|
|
14159
13939
|
spokenLines = (body, room) => {
|
|
14160
13940
|
return wrap(body.replaceAll("\n", " "), Math.max(NOTE_MIN, room - 2)).map((text, at) => at === 0 ? `${ANSWER_MARK} ${text}` : ` ${text}`);
|
|
@@ -14239,7 +14019,7 @@ var init_diffview = __esmMin((() => {
|
|
|
14239
14019
|
}));
|
|
14240
14020
|
//#endregion
|
|
14241
14021
|
//#region src/tui/render.ts
|
|
14242
|
-
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_CHROME, PENDING_CHROME, PALETTE_WIDTH, PANEL_SHARE, PANEL_MAX, PANEL_FLOOR, PANEL_FOOT, PANEL_QUARTER, PANEL_FIFTH, PANE_CHROME, PANE_EDGES, PANE_INSET, BRANCH_WIDTH, BRANCH_NAME_MIN, BRANCH_TAIL, EMPTY_LIST, MODAL_MARGIN, shareOf, homeWidth, longestName, commandRow, modalWidth, panelWidth, panelTop, panelRows, composeRoom, laidOut$1, STICKY_MAX, pickPaint, SELECTION, CURSOR, ACCENT, GAP_PAINT, bar, makeList, makeDiffPane, makePanel, makeListParts, makeListText, makeGutter, makeScroller, makeScrim, makeScroll, makePalette, makePaletteParts,
|
|
14022
|
+
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_CHROME, PENDING_CHROME, PALETTE_WIDTH, PANEL_SHARE, PANEL_MAX, PANEL_FLOOR, PANEL_FOOT, PANEL_QUARTER, PANEL_FIFTH, PANE_CHROME, PANE_EDGES, PANE_INSET, BRANCH_WIDTH, BRANCH_NAME_MIN, BRANCH_TAIL, EMPTY_LIST, MODAL_MARGIN, shareOf, homeWidth, longestName, commandRow, modalWidth, panelWidth, panelTop, panelRows, composeRoom, laidOut$1, STICKY_MAX, pickPaint, SELECTION, CURSOR, ACCENT, GAP_PAINT, bar, makeList, makeDiffPane, makePanel, makeListParts, makeListText, makeGutter, makeScroller, makeScrim, makeScroll, makePalette, makePaletteParts, makeChoices, stack, makeBody, makeHome, makeModals, makeKeysParts, makeFoundParts, FONTS, logoFont, makeLanding, makeLogo, makeComposeParts, makeCompose, clip, clipHead, clipMiddle, clipPath, treeLabel, waitingLabel, inRange, notesOf, notesFor, paired, keptWithin, CHIP_CHUNKS, shortPath, HOME_PATH_MIN, HOME_PATH_CHROME, elide, contextLabel, nameRoom, columns, FORGE_SILENT, unaskedForge, branchHeading, atHome, layersCell, baseLabel, stateCell, branchCells, headerParts, HEADER_GAP, HEADER_PATH_MIN, headerRoom, headerFitted, fallbackScope, treeMarks, treeTail, treeLine, STEP_NUMBER, STEP_LEAD, NOTE_LEAD, STEP_GAP, STALE_ROOM, STALE_LONG, STALE_SHORT, staleBanner, layerRoom, layerFold, layerHead, layerText, layerPaint, PANEL_TITLES, PANEL_ORDER, PANEL_LEAD, PANEL_EMPTY, panelMark, panelWhere, panelBody, panelPair, panelSection, PULL_HINT, panelText, Screen;
|
|
14243
14023
|
var init_render = __esmMin((() => {
|
|
14244
14024
|
init_command();
|
|
14245
14025
|
init_patch();
|
|
@@ -14454,12 +14234,6 @@ var init_render = __esmMin((() => {
|
|
|
14454
14234
|
choices
|
|
14455
14235
|
};
|
|
14456
14236
|
};
|
|
14457
|
-
makePendingParts = (renderer) => {
|
|
14458
|
-
const parts = makePaletteParts(renderer);
|
|
14459
|
-
parts.box.id = "pending";
|
|
14460
|
-
parts.query.height = 0;
|
|
14461
|
-
return parts;
|
|
14462
|
-
};
|
|
14463
14237
|
makeChoices = (renderer) => new SelectRenderable(renderer, {
|
|
14464
14238
|
id: "palette-choices",
|
|
14465
14239
|
flexGrow: 1,
|
|
@@ -14493,14 +14267,12 @@ var init_render = __esmMin((() => {
|
|
|
14493
14267
|
});
|
|
14494
14268
|
makeModals = (renderer) => ({
|
|
14495
14269
|
palette: makePaletteParts(renderer),
|
|
14496
|
-
staged: makePendingParts(renderer),
|
|
14497
14270
|
found: makeFoundParts(renderer),
|
|
14498
14271
|
keys: makeKeysParts(renderer)
|
|
14499
14272
|
});
|
|
14500
14273
|
makeKeysParts = (renderer) => {
|
|
14501
14274
|
const parts = makePaletteParts(renderer);
|
|
14502
14275
|
parts.box.id = "keys";
|
|
14503
|
-
parts.query.height = 0;
|
|
14504
14276
|
return parts;
|
|
14505
14277
|
};
|
|
14506
14278
|
makeFoundParts = (renderer) => {
|
|
@@ -14615,10 +14387,7 @@ var init_render = __esmMin((() => {
|
|
|
14615
14387
|
const lead = `${indent}${shut ? "▸" : "▾"} ${shut ? marks().folder : marks().folderOpen} `;
|
|
14616
14388
|
return `${lead}${clipPath(row.name, Math.max(4, room - lead.length))}`;
|
|
14617
14389
|
};
|
|
14618
|
-
waitingLabel = (branch) => {
|
|
14619
|
-
if (branch.staged > 0) return `${branch.staged} staged`;
|
|
14620
|
-
return branch.unread > 0 ? `${branch.unread} unanswered` : "";
|
|
14621
|
-
};
|
|
14390
|
+
waitingLabel = (branch) => branch.unread > 0 ? `${branch.unread} unanswered` : "";
|
|
14622
14391
|
inRange = (state, row, from, to) => state.selecting && row >= from && row <= to;
|
|
14623
14392
|
notesOf = (comments, path, sent, opened = []) => comments.filter((entry) => entry.file === path).map((entry) => ({
|
|
14624
14393
|
id: entry.id ?? "",
|
|
@@ -14632,7 +14401,7 @@ var init_render = __esmMin((() => {
|
|
|
14632
14401
|
asks: entry.asks === true,
|
|
14633
14402
|
answers: entry.answers ?? []
|
|
14634
14403
|
}));
|
|
14635
|
-
notesFor = (state, path) =>
|
|
14404
|
+
notesFor = (state, path) => notesOf(state.sent, path, true, state.opened);
|
|
14636
14405
|
paired = (chunks) => {
|
|
14637
14406
|
const chips = [];
|
|
14638
14407
|
for (let at = 0; at < chunks.length; at += CHIP_CHUNKS) chips.push(chunks.slice(at, at + CHIP_CHUNKS));
|
|
@@ -14711,7 +14480,6 @@ var init_render = __esmMin((() => {
|
|
|
14711
14480
|
state.patches.length === 0 ? "nothing to read" : `${state.patchIndex + 1}/${state.patches.length}`,
|
|
14712
14481
|
pullHere(state).length === 0 ? "" : `${pullHere(state)} pull request`,
|
|
14713
14482
|
state.vouched.length === 0 ? "" : reviewedCount(state),
|
|
14714
|
-
state.staged === 0 ? "" : `${state.staged} staged`,
|
|
14715
14483
|
contextLabel(state.context),
|
|
14716
14484
|
hiddenLines(state) === 0 ? "" : `⋯ ${hiddenLines(state)} lines hidden`,
|
|
14717
14485
|
pan === 0 ? "" : `→ ${pan} columns`
|
|
@@ -14779,15 +14547,10 @@ var init_render = __esmMin((() => {
|
|
|
14779
14547
|
return row.index === state.layerIndex ? palette.ink : palette.muted;
|
|
14780
14548
|
};
|
|
14781
14549
|
PANEL_TITLES = {
|
|
14782
|
-
staged: "Staged",
|
|
14783
14550
|
with: "With the agent",
|
|
14784
14551
|
answered: "Answered"
|
|
14785
14552
|
};
|
|
14786
|
-
PANEL_ORDER = [
|
|
14787
|
-
"staged",
|
|
14788
|
-
"with",
|
|
14789
|
-
"answered"
|
|
14790
|
-
];
|
|
14553
|
+
PANEL_ORDER = ["with", "answered"];
|
|
14791
14554
|
PANEL_LEAD = 3;
|
|
14792
14555
|
PANEL_EMPTY = "No comment on this branch yet.";
|
|
14793
14556
|
panelMark = (state, at) => {
|
|
@@ -14874,12 +14637,10 @@ var init_render = __esmMin((() => {
|
|
|
14874
14637
|
paletteTitle;
|
|
14875
14638
|
paletteQuery;
|
|
14876
14639
|
paletteChoices;
|
|
14877
|
-
pending;
|
|
14878
14640
|
keys;
|
|
14879
14641
|
keysTitle;
|
|
14642
|
+
keysQuery;
|
|
14880
14643
|
keysChoices;
|
|
14881
|
-
pendingTitle;
|
|
14882
|
-
pendingChoices;
|
|
14883
14644
|
found;
|
|
14884
14645
|
foundTitle;
|
|
14885
14646
|
foundPeek;
|
|
@@ -14926,10 +14687,8 @@ var init_render = __esmMin((() => {
|
|
|
14926
14687
|
this.paletteChoices = modals.palette.choices;
|
|
14927
14688
|
this.keys = modals.keys.box;
|
|
14928
14689
|
this.keysTitle = modals.keys.title;
|
|
14690
|
+
this.keysQuery = modals.keys.query;
|
|
14929
14691
|
this.keysChoices = modals.keys.choices;
|
|
14930
|
-
this.pending = modals.staged.box;
|
|
14931
|
-
this.pendingTitle = modals.staged.title;
|
|
14932
|
-
this.pendingChoices = modals.staged.choices;
|
|
14933
14692
|
this.found = modals.found.box;
|
|
14934
14693
|
this.foundTitle = modals.found.title;
|
|
14935
14694
|
this.foundPeek = modals.found.query;
|
|
@@ -14991,6 +14750,21 @@ var init_render = __esmMin((() => {
|
|
|
14991
14750
|
tallestRows() {
|
|
14992
14751
|
return this.view.tallestRows();
|
|
14993
14752
|
}
|
|
14753
|
+
railRows() {
|
|
14754
|
+
return this.listRoom();
|
|
14755
|
+
}
|
|
14756
|
+
scrolledAt() {
|
|
14757
|
+
return this.lastTop;
|
|
14758
|
+
}
|
|
14759
|
+
rowAtScreen(visual) {
|
|
14760
|
+
return this.view.rowAt(visual);
|
|
14761
|
+
}
|
|
14762
|
+
screenRowOf(row) {
|
|
14763
|
+
return this.view.screenRowOf(row);
|
|
14764
|
+
}
|
|
14765
|
+
blockAt(row, stop) {
|
|
14766
|
+
return this.view.blockAt(row, stop);
|
|
14767
|
+
}
|
|
14994
14768
|
diffRows() {
|
|
14995
14769
|
const edges = this.diffPane.border === true ? PANE_EDGES : 0;
|
|
14996
14770
|
const pane = this.diffPane.height - edges - this.view.pinRows();
|
|
@@ -14999,12 +14773,13 @@ var init_render = __esmMin((() => {
|
|
|
14999
14773
|
update(state) {
|
|
15000
14774
|
this.shown = state;
|
|
15001
14775
|
this.chips = hintsFor(state.screen, {
|
|
15002
|
-
|
|
14776
|
+
comments: state.sent.length,
|
|
15003
14777
|
layers: state.layers.length,
|
|
15004
14778
|
onThread: state.stop > 0 || threadChosen(state) !== void 0,
|
|
15005
14779
|
selecting: state.selecting,
|
|
15006
14780
|
reviewed: reviewedCountIn(state),
|
|
15007
|
-
pull: pullHere(state).length > 0
|
|
14781
|
+
pull: pullHere(state).length > 0,
|
|
14782
|
+
pane: state.screen === "review" ? state.focus : "diff"
|
|
15008
14783
|
});
|
|
15009
14784
|
this.header.content = this.headerText(state);
|
|
15010
14785
|
this.footer.content = this.footerText(state);
|
|
@@ -15021,7 +14796,6 @@ var init_render = __esmMin((() => {
|
|
|
15021
14796
|
this.paintCompose(state);
|
|
15022
14797
|
this.paintPalette(state);
|
|
15023
14798
|
this.paintKeys(state);
|
|
15024
|
-
this.paintPending(state);
|
|
15025
14799
|
this.paintFound(state);
|
|
15026
14800
|
this.paintReport(state);
|
|
15027
14801
|
this.scrim.visible = state.screen !== "branches" && state.screen !== "review";
|
|
@@ -15053,12 +14827,14 @@ var init_render = __esmMin((() => {
|
|
|
15053
14827
|
this.keys.visible = state.screen === "keys";
|
|
15054
14828
|
if (state.screen !== "keys") {
|
|
15055
14829
|
this.keysTitle.content = "";
|
|
14830
|
+
this.keysQuery.content = "";
|
|
15056
14831
|
this.keysChoices.options = [];
|
|
15057
14832
|
return;
|
|
15058
14833
|
}
|
|
15059
|
-
const rows =
|
|
14834
|
+
const rows = keyMatches(state);
|
|
15060
14835
|
const room = panelWidth(this.renderer.width);
|
|
15061
|
-
this.keysTitle.content =
|
|
14836
|
+
this.keysTitle.content = rows.length === 0 ? "No key matches" : `Keys here, ${rows.length} of them`;
|
|
14837
|
+
this.keysQuery.content = state.query.length === 0 ? "Type to filter…" : `${state.query}▏`;
|
|
15062
14838
|
this.keysChoices.options = rows.map((entry) => ({
|
|
15063
14839
|
name: commandRow(entry, room - MODAL_ROOM),
|
|
15064
14840
|
description: "",
|
|
@@ -15155,27 +14931,6 @@ var init_render = __esmMin((() => {
|
|
|
15155
14931
|
this.view.paint(this.linePaint(state), top, height);
|
|
15156
14932
|
this.paintGutter(state, top, height);
|
|
15157
14933
|
}
|
|
15158
|
-
paintPending(state) {
|
|
15159
|
-
this.pending.visible = state.screen === "pending";
|
|
15160
|
-
if (state.screen !== "pending") {
|
|
15161
|
-
this.pendingTitle.content = "";
|
|
15162
|
-
this.pendingChoices.options = [];
|
|
15163
|
-
return;
|
|
15164
|
-
}
|
|
15165
|
-
const count = state.pending.length;
|
|
15166
|
-
const room = panelWidth(this.renderer.width);
|
|
15167
|
-
this.pendingTitle.content = `Send ${count} comment${count === 1 ? "" : "s"} as one review, waking the agent once`;
|
|
15168
|
-
this.pendingChoices.options = state.pending.map((entry) => ({
|
|
15169
|
-
name: clip(`${entry.file}:${entry.start}-${entry.end} ${entry.body.split("\n")[0] ?? ""}`, Math.max(1, room - MODAL_ROOM)),
|
|
15170
|
-
description: "",
|
|
15171
|
-
value: entry.file
|
|
15172
|
-
}));
|
|
15173
|
-
this.pendingChoices.selectedIndex = state.pendingIndex;
|
|
15174
|
-
this.pending.height = Math.min(panelRows(this.renderer.height, PANEL_QUARTER), state.pending.length + PENDING_CHROME);
|
|
15175
|
-
this.pending.width = room;
|
|
15176
|
-
this.pending.left = Math.max(FRAME_PAD, Math.floor((this.renderer.width - room) / 2));
|
|
15177
|
-
this.pending.top = panelTop(this.renderer.height, PANEL_QUARTER);
|
|
15178
|
-
}
|
|
15179
14934
|
assemble(renderer) {
|
|
15180
14935
|
this.diffScroll.add(this.view.node());
|
|
15181
14936
|
this.diffPane.add(this.view.pinNode());
|
|
@@ -15199,7 +14954,6 @@ var init_render = __esmMin((() => {
|
|
|
15199
14954
|
this.scrim,
|
|
15200
14955
|
this.compose,
|
|
15201
14956
|
this.palette,
|
|
15202
|
-
this.pending,
|
|
15203
14957
|
this.found,
|
|
15204
14958
|
this.keys
|
|
15205
14959
|
]);
|
|
@@ -15451,6 +15205,11 @@ var init_display = __esmMin((() => {
|
|
|
15451
15205
|
rows: sync(() => screen.viewportRows()),
|
|
15452
15206
|
room: sync(() => screen.noteRoom()),
|
|
15453
15207
|
tallest: sync(() => screen.tallestRows()),
|
|
15208
|
+
rail: sync(() => screen.railRows()),
|
|
15209
|
+
at: sync(() => screen.scrolledAt()),
|
|
15210
|
+
rowAt: (visual) => sync(() => screen.rowAtScreen(visual)),
|
|
15211
|
+
screenRowOf: (row) => sync(() => screen.screenRowOf(row)),
|
|
15212
|
+
block: (row, stop) => sync(() => screen.blockAt(row, stop)),
|
|
15454
15213
|
columns: sync(() => screen.columns()),
|
|
15455
15214
|
listen: listenWith(screen),
|
|
15456
15215
|
light: (path, side, lines) => lightWith(screen, path, side, lines)
|
|
@@ -15532,7 +15291,7 @@ var init_upgrade = __esmMin((() => {
|
|
|
15532
15291
|
return due ? `adiff ${latest} is out · adiff upgrade` : "";
|
|
15533
15292
|
}).pipe(withSpan("Tui.upgradeHint"));
|
|
15534
15293
|
upgradeHint = worded.pipe(orElseSucceed(() => ""));
|
|
15535
|
-
})), PRINTABLE, KEY_HISTORY, TRAIL_HISTORY, clockOf, momentOf, noticeOf, copyToClipboard, asKey, openedPull, byWord, WORD_STEP, caretSideways, caretFor, erasedBy, LISTENS, listens, laidOut, keyName, App, settledPath, openingOn, launch, told, untilDestroyed, runOn, runTui;
|
|
15294
|
+
})), PRINTABLE, KEY_HISTORY, TRAIL_HISTORY, clockOf, momentOf, noticeOf, handOver, copyToClipboard, lineUnder, asKey, openedPull, byWord, WORD_STEP, caretSideways, caretFor, erasedBy, LISTENS, listens, laidOut, keyName, App, settledPath, openingOn, launch, told, untilDestroyed, runOn, runTui;
|
|
15536
15295
|
var init_app = __esmMin((() => {
|
|
15537
15296
|
init_dist();
|
|
15538
15297
|
init_report();
|
|
@@ -15562,9 +15321,25 @@ var init_app = __esmMin((() => {
|
|
|
15562
15321
|
return `${clockOf(elapsed)} ${named.padEnd(16)} ${place.padEnd(16)} row ${String(state.cursor + 1).padStart(5)} ${file}`;
|
|
15563
15322
|
};
|
|
15564
15323
|
noticeOf = (notice, elapsed) => `${clockOf(elapsed)} ${"said".padEnd(16)} ${notice}`;
|
|
15324
|
+
handOver = (text) => {
|
|
15325
|
+
if (platform() !== "darwin" || !process.stdout.isTTY) return;
|
|
15326
|
+
const pipe = spawn("pbcopy", { stdio: [
|
|
15327
|
+
"pipe",
|
|
15328
|
+
"ignore",
|
|
15329
|
+
"ignore"
|
|
15330
|
+
] });
|
|
15331
|
+
pipe.on("error", () => void 0);
|
|
15332
|
+
pipe.stdin.on("error", () => void 0);
|
|
15333
|
+
pipe.stdin.end(text);
|
|
15334
|
+
};
|
|
15565
15335
|
copyToClipboard = (text) => {
|
|
15566
15336
|
const encoded = Buffer.from(text, "utf8").toString("base64");
|
|
15567
15337
|
process.stdout.write(`\u001B]52;c;${encoded}\u0007`);
|
|
15338
|
+
handOver(text);
|
|
15339
|
+
};
|
|
15340
|
+
lineUnder = (state) => {
|
|
15341
|
+
const row = selectedPatch(state)?.rows[state.cursor];
|
|
15342
|
+
return row === void 0 ? [] : [row.text];
|
|
15568
15343
|
};
|
|
15569
15344
|
asKey = (name) => name.startsWith("ctrl+") ? {
|
|
15570
15345
|
name: name.slice(5),
|
|
@@ -15634,6 +15409,7 @@ var init_app = __esmMin((() => {
|
|
|
15634
15409
|
wheel = 0;
|
|
15635
15410
|
sideways = 0;
|
|
15636
15411
|
listening;
|
|
15412
|
+
lighting;
|
|
15637
15413
|
constructor(options) {
|
|
15638
15414
|
this.renderer = options.renderer;
|
|
15639
15415
|
this.repo = options.repo;
|
|
@@ -15648,7 +15424,7 @@ var init_app = __esmMin((() => {
|
|
|
15648
15424
|
runSync(this.display.listen({
|
|
15649
15425
|
onScroll: (delta) => this.onWheel(delta),
|
|
15650
15426
|
onPan: (delta) => this.onPanWheel(delta),
|
|
15651
|
-
onDrag: (from, to) => this.
|
|
15427
|
+
onDrag: (from, to, done) => this.dragged(from, to, done),
|
|
15652
15428
|
onChip: (key) => this.dispatchTask(this.onKey(asKey(key))),
|
|
15653
15429
|
onRail: (delta) => this.dispatchTask(this.rolled(delta))
|
|
15654
15430
|
}));
|
|
@@ -15656,6 +15432,7 @@ var init_app = __esmMin((() => {
|
|
|
15656
15432
|
renderer.keyInput.on("paste", (event) => this.dispatchPaste(event));
|
|
15657
15433
|
renderer.on("destroy", () => this.stopWatching());
|
|
15658
15434
|
renderer.on("destroy", () => this.stopFading());
|
|
15435
|
+
renderer.on("destroy", () => this.stopLighting());
|
|
15659
15436
|
renderer.on("destroy", () => this.stopPainting());
|
|
15660
15437
|
renderer.on("destroy", () => this.stopConsuming());
|
|
15661
15438
|
renderer.on("frame", () => this.syncGeometry());
|
|
@@ -15760,7 +15537,11 @@ var init_app = __esmMin((() => {
|
|
|
15760
15537
|
if (this.consuming === void 0) return Promise.resolve();
|
|
15761
15538
|
const done = makeUnsafe$4();
|
|
15762
15539
|
offerUnsafe(this.intents, Intent.Ping({ done }));
|
|
15763
|
-
return runPromise(_await(done));
|
|
15540
|
+
return runPromise(andThen(_await(done), this.stillLighting()));
|
|
15541
|
+
}
|
|
15542
|
+
stillLighting() {
|
|
15543
|
+
const fiber = this.lighting;
|
|
15544
|
+
return fiber === void 0 ? void_ : asVoid(await_(fiber));
|
|
15764
15545
|
}
|
|
15765
15546
|
onWheel(delta) {
|
|
15766
15547
|
this.wheel += delta;
|
|
@@ -15783,7 +15564,7 @@ var init_app = __esmMin((() => {
|
|
|
15783
15564
|
if (down !== 0) this.commit(paletteMoved(this.state, down));
|
|
15784
15565
|
return;
|
|
15785
15566
|
}
|
|
15786
|
-
const moved = down === 0 ? this.measured() : scrolled(this.
|
|
15567
|
+
const moved = down === 0 ? this.measured() : scrolled(this.standing(), down);
|
|
15787
15568
|
this.commit(across === 0 ? moved : panBy(moved, across));
|
|
15788
15569
|
}
|
|
15789
15570
|
syncGeometry() {
|
|
@@ -15808,11 +15589,26 @@ var init_app = __esmMin((() => {
|
|
|
15808
15589
|
});
|
|
15809
15590
|
return;
|
|
15810
15591
|
}
|
|
15592
|
+
const railRows = runSync(this.display.rail);
|
|
15593
|
+
if (railRows !== this.state.railRows) {
|
|
15594
|
+
this.commit({
|
|
15595
|
+
...this.state,
|
|
15596
|
+
railRows
|
|
15597
|
+
});
|
|
15598
|
+
return;
|
|
15599
|
+
}
|
|
15811
15600
|
const room = runSync(this.display.room);
|
|
15812
15601
|
if (room === this.roomed) return;
|
|
15813
15602
|
this.roomed = room;
|
|
15814
15603
|
runSync(this.display.paint(this.state));
|
|
15815
15604
|
}
|
|
15605
|
+
standing() {
|
|
15606
|
+
const held = this.measured();
|
|
15607
|
+
return held.scroll >= 0 ? held : {
|
|
15608
|
+
...held,
|
|
15609
|
+
scroll: runSync(this.display.at)
|
|
15610
|
+
};
|
|
15611
|
+
}
|
|
15816
15612
|
measured() {
|
|
15817
15613
|
return {
|
|
15818
15614
|
...this.state,
|
|
@@ -15828,7 +15624,11 @@ var init_app = __esmMin((() => {
|
|
|
15828
15624
|
since() {
|
|
15829
15625
|
return Date.now() - this.began;
|
|
15830
15626
|
}
|
|
15831
|
-
commit(
|
|
15627
|
+
commit(given) {
|
|
15628
|
+
const next = given.patchIndex === this.state.patchIndex ? given : {
|
|
15629
|
+
...given,
|
|
15630
|
+
railScroll: -1
|
|
15631
|
+
};
|
|
15832
15632
|
const appeared = next.notice.length > 0 && next.notice !== this.state.notice;
|
|
15833
15633
|
if (appeared) this.recordNotice(next.notice);
|
|
15834
15634
|
this.rememberPlace(next);
|
|
@@ -15851,6 +15651,11 @@ var init_app = __esmMin((() => {
|
|
|
15851
15651
|
watch(fiber) {
|
|
15852
15652
|
this.consuming = fiber;
|
|
15853
15653
|
}
|
|
15654
|
+
stopLighting() {
|
|
15655
|
+
const fiber = this.lighting;
|
|
15656
|
+
this.lighting = void 0;
|
|
15657
|
+
if (fiber !== void 0) runFork(interrupt(fiber));
|
|
15658
|
+
}
|
|
15854
15659
|
stopFading() {
|
|
15855
15660
|
const fiber = this.fading;
|
|
15856
15661
|
this.fading = void 0;
|
|
@@ -15877,28 +15682,23 @@ var init_app = __esmMin((() => {
|
|
|
15877
15682
|
"branch.pull": () => this.showPull(),
|
|
15878
15683
|
"compose.open": () => this.compose(),
|
|
15879
15684
|
"compose.submit": () => this.send(),
|
|
15880
|
-
"compose.stage": () => this.stage(),
|
|
15881
15685
|
"palette.run": () => this.runChoice(),
|
|
15882
15686
|
"comment.next": () => this.walkComments(1),
|
|
15883
15687
|
"comment.prev": () => this.walkComments(-1),
|
|
15884
15688
|
"file.next": () => this.moveFile(1),
|
|
15885
15689
|
"file.prev": () => this.moveFile(-1),
|
|
15886
|
-
"cursor.next": () => this.
|
|
15887
|
-
"cursor.prev": () => this.
|
|
15690
|
+
"cursor.next": () => this.stepped(1),
|
|
15691
|
+
"cursor.prev": () => this.stepped(-1),
|
|
15888
15692
|
"rail.toggle": () => this.commitSynced("rail.toggle"),
|
|
15889
15693
|
"file.vouch": () => this.vouch(false),
|
|
15890
15694
|
"file.vouch.next": () => this.vouch(true),
|
|
15891
15695
|
"thread.settle": () => this.settleHere(),
|
|
15892
15696
|
"thread.settleRead": () => this.settleWhatIsRead(),
|
|
15893
15697
|
"thread.remove": () => this.removeHere(),
|
|
15894
|
-
"selection.copy": () => sync(() => this.copySelection()),
|
|
15698
|
+
"selection.copy": () => sync(() => this.copySelection(false)),
|
|
15895
15699
|
"search.open": () => this.findSelection(),
|
|
15896
15700
|
"search.jump": () => this.openMatch(),
|
|
15897
15701
|
"review.reload": () => this.state.screen === "branches" ? this.reloadList() : this.reloadBranch(),
|
|
15898
|
-
"pending.open": () => this.openPending(),
|
|
15899
|
-
"pending.edit": () => sync(() => this.editStagedComment()),
|
|
15900
|
-
"pending.drop": () => this.dropStagedComment(),
|
|
15901
|
-
"pending.submit": () => this.sendReview(),
|
|
15902
15702
|
"report.open": () => sync(() => this.commit(reduce(this.measured(), "report.open"))),
|
|
15903
15703
|
back: () => this.goBack(),
|
|
15904
15704
|
"report.send": () => this.sendReport(),
|
|
@@ -15963,7 +15763,7 @@ var init_app = __esmMin((() => {
|
|
|
15963
15763
|
if (PRINTABLE.test(key.sequence)) this.commit(typed(this.state, key.sequence));
|
|
15964
15764
|
}
|
|
15965
15765
|
onCaret(key) {
|
|
15966
|
-
if (this.state.screen === "palette") return false;
|
|
15766
|
+
if (this.state.screen === "palette" || this.state.screen === "keys") return false;
|
|
15967
15767
|
const moved = caretFor(this.state, key);
|
|
15968
15768
|
if (moved === void 0) return false;
|
|
15969
15769
|
this.commit(moved);
|
|
@@ -15989,11 +15789,10 @@ var init_app = __esmMin((() => {
|
|
|
15989
15789
|
return gen({ self: this }, function* () {
|
|
15990
15790
|
const patches = yield* listPatches(this.repo, name);
|
|
15991
15791
|
const progress = yield* reviewProgress(this.repo, name);
|
|
15992
|
-
const pending = yield* listPending(this.repo, name);
|
|
15993
15792
|
const layers = yield* listLayers(this.repo, name);
|
|
15994
15793
|
const sent = yield* this.loadSent(name);
|
|
15995
15794
|
const opened = withVouched(withPatches(this.state, patches), progress.vouched);
|
|
15996
|
-
return withLayers(withSent(
|
|
15795
|
+
return withLayers(withSent(opened, sent), layers);
|
|
15997
15796
|
});
|
|
15998
15797
|
}
|
|
15999
15798
|
openBranch() {
|
|
@@ -16004,15 +15803,26 @@ var init_app = __esmMin((() => {
|
|
|
16004
15803
|
yield* this.loadSource();
|
|
16005
15804
|
});
|
|
16006
15805
|
}
|
|
16007
|
-
|
|
16008
|
-
|
|
15806
|
+
dragged(from, to, done) {
|
|
15807
|
+
this.commit(draggedTo(this.measured(), from, to));
|
|
15808
|
+
if (done && from !== to) this.copySelection(true);
|
|
15809
|
+
}
|
|
15810
|
+
copySelection(keep) {
|
|
15811
|
+
const said = keep ? withNoticeHere : withNotice;
|
|
15812
|
+
const thread = threadAtStop(this.state);
|
|
15813
|
+
if (thread !== void 0) {
|
|
15814
|
+
copyToClipboard(`${thread.body}\n`);
|
|
15815
|
+
this.commit(said(this.state, "comment copied"));
|
|
15816
|
+
return;
|
|
15817
|
+
}
|
|
15818
|
+
const lines = this.state.selecting ? selectedLines(this.state) : lineUnder(this.state);
|
|
16009
15819
|
if (lines.length === 0) {
|
|
16010
|
-
this.commit(withNoticeHere(this.state, "nothing
|
|
15820
|
+
this.commit(withNoticeHere(this.state, "nothing to copy"));
|
|
16011
15821
|
return;
|
|
16012
15822
|
}
|
|
16013
15823
|
copyToClipboard(`${lines.join("\n")}\n`);
|
|
16014
15824
|
const many = lines.length === 1 ? "1 line copied" : `${lines.length} lines copied`;
|
|
16015
|
-
this.commit(
|
|
15825
|
+
this.commit(said(this.state, many));
|
|
16016
15826
|
}
|
|
16017
15827
|
findSelection() {
|
|
16018
15828
|
return gen({ self: this }, function* () {
|
|
@@ -16076,6 +15886,7 @@ var init_app = __esmMin((() => {
|
|
|
16076
15886
|
}
|
|
16077
15887
|
const at = this.state.patches.findIndex((patch) => patch.path === entry.comment.file);
|
|
16078
15888
|
if (this.state.patches[at] === void 0) {
|
|
15889
|
+
yield* this.readAnswers(entry.comment.id);
|
|
16079
15890
|
this.commit(withNoticeHere(this.state, `${entry.comment.file} is not on this branch`));
|
|
16080
15891
|
return;
|
|
16081
15892
|
}
|
|
@@ -16084,6 +15895,7 @@ var init_app = __esmMin((() => {
|
|
|
16084
15895
|
patchIndex: at
|
|
16085
15896
|
});
|
|
16086
15897
|
if (shown !== void 0 && rowShowing(shown, entry.comment.end) === void 0) {
|
|
15898
|
+
yield* this.readAnswers(entry.comment.id);
|
|
16087
15899
|
this.commit(withNoticeHere(this.state, "that comment is outside this diff"));
|
|
16088
15900
|
return;
|
|
16089
15901
|
}
|
|
@@ -16195,6 +16007,39 @@ var init_app = __esmMin((() => {
|
|
|
16195
16007
|
if (this.state.patchIndex !== was) yield* this.turnedTo();
|
|
16196
16008
|
});
|
|
16197
16009
|
}
|
|
16010
|
+
stepped(delta) {
|
|
16011
|
+
return gen({ self: this }, function* () {
|
|
16012
|
+
if (this.paged(delta)) return;
|
|
16013
|
+
this.catchUp();
|
|
16014
|
+
yield* this.commitSynced(delta > 0 ? "cursor.next" : "cursor.prev");
|
|
16015
|
+
});
|
|
16016
|
+
}
|
|
16017
|
+
catchUp() {
|
|
16018
|
+
const state = this.state;
|
|
16019
|
+
if (state.screen !== "review" || state.focus !== "diff" || state.scroll < 0) return;
|
|
16020
|
+
const last = state.scroll + Math.max(1, runSync(this.display.rows)) - 1;
|
|
16021
|
+
const at = runSync(this.display.screenRowOf(state.cursor)) ?? last;
|
|
16022
|
+
if (at >= state.scroll && at <= last) return;
|
|
16023
|
+
const wanted = at < state.scroll ? state.scroll : last;
|
|
16024
|
+
const top = runSync(this.display.rowAt(state.scroll));
|
|
16025
|
+
this.commit({
|
|
16026
|
+
...state,
|
|
16027
|
+
cursor: runSync(this.display.rowAt(wanted)),
|
|
16028
|
+
stop: 0,
|
|
16029
|
+
top
|
|
16030
|
+
});
|
|
16031
|
+
}
|
|
16032
|
+
paged(delta) {
|
|
16033
|
+
if (this.state.screen !== "review" || this.state.focus !== "diff") return false;
|
|
16034
|
+
const state = this.standing();
|
|
16035
|
+
const span = runSync(this.display.block(state.cursor, state.stop));
|
|
16036
|
+
const height = Math.max(1, state.viewport);
|
|
16037
|
+
if (span.rows <= height) return false;
|
|
16038
|
+
const room = delta > 0 ? span.start + span.rows - height : span.start;
|
|
16039
|
+
if (delta > 0 ? state.scroll >= room : state.scroll <= room) return false;
|
|
16040
|
+
this.commit(scrolled(state, delta * Math.max(1, height - 2)));
|
|
16041
|
+
return true;
|
|
16042
|
+
}
|
|
16198
16043
|
commitSynced(action) {
|
|
16199
16044
|
return gen({ self: this }, function* () {
|
|
16200
16045
|
const was = this.state.patchIndex;
|
|
@@ -16205,7 +16050,7 @@ var init_app = __esmMin((() => {
|
|
|
16205
16050
|
rolled(delta) {
|
|
16206
16051
|
return gen({ self: this }, function* () {
|
|
16207
16052
|
const was = this.state.patchIndex;
|
|
16208
|
-
this.commit(
|
|
16053
|
+
this.commit(railScrolled(this.measured(), delta));
|
|
16209
16054
|
if (this.state.patchIndex !== was) yield* this.turnedTo();
|
|
16210
16055
|
});
|
|
16211
16056
|
}
|
|
@@ -16236,64 +16081,6 @@ var init_app = __esmMin((() => {
|
|
|
16236
16081
|
this.commit(withNotice(atFile(next, target), `marked ${patch.path}`));
|
|
16237
16082
|
});
|
|
16238
16083
|
}
|
|
16239
|
-
request() {
|
|
16240
|
-
const patch = selectedPatch(this.state);
|
|
16241
|
-
const branch = selectedBranch(this.state);
|
|
16242
|
-
const [from, to] = selectionRange(this.state);
|
|
16243
|
-
if (patch === void 0 || branch === void 0 || this.state.draft.length === 0) return void 0;
|
|
16244
|
-
const anchor = anchorFor(patch, from, to);
|
|
16245
|
-
if (isNone(anchor)) return void 0;
|
|
16246
|
-
return {
|
|
16247
|
-
repo: this.repo,
|
|
16248
|
-
branch: branch.branch,
|
|
16249
|
-
file: patch.path,
|
|
16250
|
-
side: anchor.value.side,
|
|
16251
|
-
start: anchor.value.start,
|
|
16252
|
-
end: anchor.value.end,
|
|
16253
|
-
body: this.state.draft,
|
|
16254
|
-
id: randomUUID(),
|
|
16255
|
-
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
16256
|
-
};
|
|
16257
|
-
}
|
|
16258
|
-
stage() {
|
|
16259
|
-
return gen({ self: this }, function* () {
|
|
16260
|
-
const editing = this.state.editing;
|
|
16261
|
-
if (editing !== void 0) {
|
|
16262
|
-
yield* this.restage(editing);
|
|
16263
|
-
return;
|
|
16264
|
-
}
|
|
16265
|
-
const request = this.request();
|
|
16266
|
-
if (request === void 0) {
|
|
16267
|
-
this.commit(withNotice(this.state, "nothing to stage"));
|
|
16268
|
-
return;
|
|
16269
|
-
}
|
|
16270
|
-
yield* stageComment(request);
|
|
16271
|
-
const branch = selectedBranch(this.state);
|
|
16272
|
-
const pending = branch === void 0 ? [] : yield* listPending(this.repo, branch.branch);
|
|
16273
|
-
const next = withPending(this.state, pending, "review");
|
|
16274
|
-
this.commit(withNotice(next, `${pending.length} staged, press S to send`));
|
|
16275
|
-
});
|
|
16276
|
-
}
|
|
16277
|
-
restage(id) {
|
|
16278
|
-
return gen({ self: this }, function* () {
|
|
16279
|
-
const branch = selectedBranch(this.state);
|
|
16280
|
-
if (branch === void 0) return;
|
|
16281
|
-
yield* editStaged({
|
|
16282
|
-
repo: this.repo,
|
|
16283
|
-
branch: branch.branch,
|
|
16284
|
-
id,
|
|
16285
|
-
body: this.state.draft
|
|
16286
|
-
});
|
|
16287
|
-
const pending = yield* listPending(this.repo, branch.branch);
|
|
16288
|
-
const next = withPending({
|
|
16289
|
-
...this.state,
|
|
16290
|
-
editing: void 0,
|
|
16291
|
-
draft: "",
|
|
16292
|
-
caret: 0
|
|
16293
|
-
}, pending, "pending");
|
|
16294
|
-
this.commit(withNoticeHere(next, "reworded"));
|
|
16295
|
-
});
|
|
16296
|
-
}
|
|
16297
16084
|
loadSent(branch) {
|
|
16298
16085
|
return listSent(this.repo, branch);
|
|
16299
16086
|
}
|
|
@@ -16333,9 +16120,16 @@ var init_app = __esmMin((() => {
|
|
|
16333
16120
|
const source = yield* fileSource(this.repo, branch.branch, asked);
|
|
16334
16121
|
if (selectedPatch(this.state)?.path !== asked) return;
|
|
16335
16122
|
this.commit(withSource(this.state, source));
|
|
16336
|
-
yield* this.display.light(asked, "new", source);
|
|
16337
16123
|
const before = yield* fileBefore(this.repo, branch.branch, asked);
|
|
16338
|
-
if (
|
|
16124
|
+
if (selectedPatch(this.state)?.path !== asked) return;
|
|
16125
|
+
this.stopLighting();
|
|
16126
|
+
this.lighting = yield* forkDetach(this.lightUp(asked, source, before));
|
|
16127
|
+
});
|
|
16128
|
+
}
|
|
16129
|
+
lightUp(path, source, before) {
|
|
16130
|
+
return gen({ self: this }, function* () {
|
|
16131
|
+
yield* this.display.light(path, "new", source);
|
|
16132
|
+
if (before.length > 0) yield* this.display.light(path, "old", before);
|
|
16339
16133
|
});
|
|
16340
16134
|
}
|
|
16341
16135
|
expand(delta) {
|
|
@@ -16353,52 +16147,6 @@ var init_app = __esmMin((() => {
|
|
|
16353
16147
|
this.commit(withContext(this.state, next, patches, cursor));
|
|
16354
16148
|
});
|
|
16355
16149
|
}
|
|
16356
|
-
openPending() {
|
|
16357
|
-
return gen({ self: this }, function* () {
|
|
16358
|
-
const branch = selectedBranch(this.state);
|
|
16359
|
-
if (branch === void 0) return;
|
|
16360
|
-
const pending = yield* listPending(this.repo, branch.branch);
|
|
16361
|
-
if (pending.length === 0) {
|
|
16362
|
-
this.commit(withNotice(this.state, "nothing staged"));
|
|
16363
|
-
return;
|
|
16364
|
-
}
|
|
16365
|
-
this.commit(withPending(this.state, pending, "pending"));
|
|
16366
|
-
});
|
|
16367
|
-
}
|
|
16368
|
-
editStagedComment() {
|
|
16369
|
-
const entry = this.state.pending[this.state.pendingIndex];
|
|
16370
|
-
if (entry?.id === void 0) return;
|
|
16371
|
-
this.commit(withDraft({
|
|
16372
|
-
...this.state,
|
|
16373
|
-
screen: "compose",
|
|
16374
|
-
editing: entry.id
|
|
16375
|
-
}, entry.body));
|
|
16376
|
-
}
|
|
16377
|
-
dropStagedComment() {
|
|
16378
|
-
return gen({ self: this }, function* () {
|
|
16379
|
-
const branch = selectedBranch(this.state);
|
|
16380
|
-
const entry = this.state.pending[this.state.pendingIndex];
|
|
16381
|
-
if (branch === void 0 || entry?.id === void 0) return;
|
|
16382
|
-
yield* dropStaged(this.repo, branch.branch, entry.id);
|
|
16383
|
-
const pending = yield* listPending(this.repo, branch.branch);
|
|
16384
|
-
const kept = withPending(this.state, pending, pending.length === 0 ? "review" : "pending");
|
|
16385
|
-
const at = Math.min(this.state.pendingIndex, Math.max(0, pending.length - 1));
|
|
16386
|
-
const said = pending.length === 0 ? "nothing staged" : `withdrawn — ${pending.length} left`;
|
|
16387
|
-
this.commit(withNoticeHere({
|
|
16388
|
-
...kept,
|
|
16389
|
-
pendingIndex: at
|
|
16390
|
-
}, said));
|
|
16391
|
-
});
|
|
16392
|
-
}
|
|
16393
|
-
sendReview() {
|
|
16394
|
-
return gen({ self: this }, function* () {
|
|
16395
|
-
const branch = selectedBranch(this.state);
|
|
16396
|
-
if (branch === void 0) return;
|
|
16397
|
-
const report = yield* submitReview(this.repo, branch.branch, randomUUID(), (/* @__PURE__ */ new Date()).toISOString());
|
|
16398
|
-
const cleared = withSent(withPending(this.state, [], "review"), yield* this.loadSent(branch.branch));
|
|
16399
|
-
this.commit(withNotice(cleared, `review sent — ${report.submitted} comment${report.submitted === 1 ? "" : "s"}, one wake-up`));
|
|
16400
|
-
});
|
|
16401
|
-
}
|
|
16402
16150
|
remember(action, key) {
|
|
16403
16151
|
if (takesText(this.state.screen) && action === void 0) return;
|
|
16404
16152
|
const named = action ?? keyName(key);
|
|
@@ -16536,7 +16284,8 @@ var tui_exports = /* @__PURE__ */ __exportAll({
|
|
|
16536
16284
|
palette: () => palette,
|
|
16537
16285
|
runOn: () => runOn,
|
|
16538
16286
|
runTui: () => runTui,
|
|
16539
|
-
searchCommands: () => searchCommands
|
|
16287
|
+
searchCommands: () => searchCommands,
|
|
16288
|
+
syntaxTheme: () => syntaxTheme
|
|
16540
16289
|
});
|
|
16541
16290
|
var init_tui = __esmMin((() => {
|
|
16542
16291
|
init_app();
|
|
@@ -16620,42 +16369,12 @@ const commentResolve = fn("Main.commentResolve")(function* (options) {
|
|
|
16620
16369
|
});
|
|
16621
16370
|
const commentRemove = fn("Main.commentRemove")(function* (options) {
|
|
16622
16371
|
const report = yield* removeComment(yield* required(options, "repo"), yield* required(options, "branch"), yield* required(options, "id"), options["at"] ?? (/* @__PURE__ */ new Date()).toISOString());
|
|
16623
|
-
yield* answer(options, {
|
|
16624
|
-
removed: report.removed,
|
|
16625
|
-
staged: report.staged
|
|
16626
|
-
});
|
|
16372
|
+
yield* answer(options, { removed: report.removed });
|
|
16627
16373
|
});
|
|
16628
16374
|
const commentRestore = fn("Main.commentRestore")(function* (options) {
|
|
16629
16375
|
const report = yield* restoreComment(yield* required(options, "repo"), yield* required(options, "branch"), yield* required(options, "id"));
|
|
16630
16376
|
yield* answer(options, { restored: report.restored });
|
|
16631
16377
|
});
|
|
16632
|
-
const commentStage = fn("Main.commentStage")(function* (options) {
|
|
16633
|
-
const report = yield* stageComment({
|
|
16634
|
-
repo: yield* required(options, "repo"),
|
|
16635
|
-
branch: yield* required(options, "branch"),
|
|
16636
|
-
file: yield* required(options, "file"),
|
|
16637
|
-
start: yield* numeric(options, "start"),
|
|
16638
|
-
end: yield* numeric(options, "end"),
|
|
16639
|
-
body: yield* required(options, "body"),
|
|
16640
|
-
side: options["side"] === "old" ? "old" : "new",
|
|
16641
|
-
id: options["id"] ?? randomUUID(),
|
|
16642
|
-
at: options["at"] ?? (/* @__PURE__ */ new Date()).toISOString()
|
|
16643
|
-
});
|
|
16644
|
-
yield* answer(options, { pending: report.pending });
|
|
16645
|
-
});
|
|
16646
|
-
const commentEdit = fn("Main.commentEdit")(function* (options) {
|
|
16647
|
-
const report = yield* editStaged({
|
|
16648
|
-
repo: yield* required(options, "repo"),
|
|
16649
|
-
branch: yield* required(options, "branch"),
|
|
16650
|
-
id: yield* required(options, "id"),
|
|
16651
|
-
body: yield* required(options, "body")
|
|
16652
|
-
});
|
|
16653
|
-
yield* answer(options, { pending: report.pending });
|
|
16654
|
-
});
|
|
16655
|
-
const reviewSend = fn("Main.reviewSend")(function* (options) {
|
|
16656
|
-
const report = yield* submitReview(yield* required(options, "repo"), yield* required(options, "branch"), options["id"] ?? randomUUID(), options["at"] ?? (/* @__PURE__ */ new Date()).toISOString());
|
|
16657
|
-
yield* answer(options, { sent: report.submitted });
|
|
16658
|
-
});
|
|
16659
16378
|
const fileReview = fn("Main.fileReview")(function* (options) {
|
|
16660
16379
|
const report = yield* toggleVouch({
|
|
16661
16380
|
repo: yield* required(options, "repo"),
|
|
@@ -16671,8 +16390,7 @@ const reviewStatus = fn("Main.reviewStatus")(function* (options) {
|
|
|
16671
16390
|
const report = yield* reviewProgress(yield* required(options, "repo"), yield* required(options, "branch"), options["base"]);
|
|
16672
16391
|
yield* answer(options, {
|
|
16673
16392
|
reviewed: report.vouched,
|
|
16674
|
-
total: report.total
|
|
16675
|
-
pending: report.pending
|
|
16393
|
+
total: report.total
|
|
16676
16394
|
});
|
|
16677
16395
|
});
|
|
16678
16396
|
const documentAt = fn("Main.documentAt")(function* (source) {
|
|
@@ -16728,15 +16446,12 @@ const routes = {
|
|
|
16728
16446
|
"base set": baseSet,
|
|
16729
16447
|
"base clear": baseClear,
|
|
16730
16448
|
"comment send": commentSend,
|
|
16731
|
-
"comment stage": commentStage,
|
|
16732
|
-
"comment edit": commentEdit,
|
|
16733
16449
|
"comment take": commentTake,
|
|
16734
16450
|
"comment answer": commentAnswer,
|
|
16735
16451
|
"comment list": commentList,
|
|
16736
16452
|
"comment resolve": commentResolve,
|
|
16737
16453
|
"comment remove": commentRemove,
|
|
16738
16454
|
"comment restore": commentRestore,
|
|
16739
|
-
"review send": reviewSend,
|
|
16740
16455
|
"review pane": reviewPane,
|
|
16741
16456
|
"review progress": reviewStatus,
|
|
16742
16457
|
"layers set": layersSet,
|