@eliya-oss/agent-diff 0.1.0-alpha.110 → 0.1.0-alpha.112
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 +16 -0
- package/dist/main.js +253 -185
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @eliya-oss/agent-diff
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.112
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- The review panel says what state a thread is in. A question the agent asked back — the one thing that stops the review until you answer — was filed under "Answered" with the same mark as an ordinary answer. It now has a section of its own at the top, and settled threads have one at the bottom instead of sitting in place with one glyph missing. When there are more threads than fit, the panel says how many are above and below rather than ending mid-list.
|
|
8
|
+
|
|
9
|
+
The box a comment is written in stays on screen. Past about seven hundred characters at 80x24 it grew through the pane border, the send hint and the footer, and you carried on typing with the caret off the bottom of the terminal.
|
|
10
|
+
|
|
11
|
+
`a` says the terminal is too narrow for the review panel every time, not only the first — it used to toggle an invisible flag and look dead. A path that is not a git repository says so, instead of "nothing to review". The key sheet no longer says "4 of them" while drawing three. And the key sheet and the command palette answer to the words a reviewer would actually type: `resolve` finds settle, `search` finds find, `shortcuts` finds the key sheet.
|
|
12
|
+
|
|
13
|
+
## 0.1.0-alpha.111
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Removes code nothing called any more, and gives each duplicated constant one home. Nothing about what adiff does changes.
|
|
18
|
+
|
|
3
19
|
## 0.1.0-alpha.110
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/main.js
CHANGED
|
@@ -4690,16 +4690,11 @@ var init_Effect = __esmMin((() => {
|
|
|
4690
4690
|
function resolve$2(ast) {
|
|
4691
4691
|
return ast.checks ? ast.checks[ast.checks.length - 1].annotations : ast.annotations;
|
|
4692
4692
|
}
|
|
4693
|
-
|
|
4694
|
-
function resolveAt(key) {
|
|
4695
|
-
return (ast) => resolve$2(ast)?.[key];
|
|
4696
|
-
}
|
|
4697
|
-
var SENTINELS_ANNOTATION_KEY, CONSTRUCTOR_ANNOTATION_KEY, resolveBrands, getExpected;
|
|
4693
|
+
var SENTINELS_ANNOTATION_KEY, CONSTRUCTOR_ANNOTATION_KEY, getExpected;
|
|
4698
4694
|
var init_annotations = __esmMin((() => {
|
|
4699
4695
|
init_Function();
|
|
4700
4696
|
SENTINELS_ANNOTATION_KEY = "~sentinels";
|
|
4701
4697
|
CONSTRUCTOR_ANNOTATION_KEY = "~constructor";
|
|
4702
|
-
resolveBrands = /*#__PURE__*/ resolveAt("brands");
|
|
4703
4698
|
getExpected = /*#__PURE__*/ memoize((ast) => {
|
|
4704
4699
|
const identifier = resolve$2(ast)?.identifier;
|
|
4705
4700
|
if (typeof identifier === "string") return identifier;
|
|
@@ -5772,11 +5767,6 @@ function appendTransformation(from, transformation, to) {
|
|
|
5772
5767
|
const link = new Link(from, transformation);
|
|
5773
5768
|
return replaceEncoding(to, to.encoding ? [...to.encoding, link] : [link]);
|
|
5774
5769
|
}
|
|
5775
|
-
/** @internal */
|
|
5776
|
-
function brand$1(ast, brand) {
|
|
5777
|
-
const existing = resolveBrands(ast);
|
|
5778
|
-
return annotate(ast, { brands: existing ? [...existing, brand] : [brand] });
|
|
5779
|
-
}
|
|
5780
5770
|
function mapOrSame(as, f) {
|
|
5781
5771
|
let changed = false;
|
|
5782
5772
|
const out = new Array(as.length);
|
|
@@ -8056,31 +8046,6 @@ function Literals(literals) {
|
|
|
8056
8046
|
}
|
|
8057
8047
|
});
|
|
8058
8048
|
}
|
|
8059
|
-
/**
|
|
8060
|
-
* Adds a nominal brand to a schema, intersecting the output type with
|
|
8061
|
-
* `Brand.Brand<B>` to prevent accidental mixing of structurally identical types.
|
|
8062
|
-
*
|
|
8063
|
-
* **When to use**
|
|
8064
|
-
*
|
|
8065
|
-
* Use to make values decoded by an existing schema nominally distinct when the
|
|
8066
|
-
* schema already carries the runtime validation you need.
|
|
8067
|
-
*
|
|
8068
|
-
* **Gotchas**
|
|
8069
|
-
*
|
|
8070
|
-
* `brand` adds brand metadata and narrows the TypeScript output type, but it
|
|
8071
|
-
* does not add runtime checks.
|
|
8072
|
-
*
|
|
8073
|
-
* @see {@link fromBrand} for applying a Brand constructor's checks along with the brand tag
|
|
8074
|
-
*
|
|
8075
|
-
* @category branding
|
|
8076
|
-
* @since 3.10.0
|
|
8077
|
-
*/
|
|
8078
|
-
function brand(identifier) {
|
|
8079
|
-
return (schema) => make$1(brand$1(schema.ast, identifier), {
|
|
8080
|
-
schema,
|
|
8081
|
-
identifier
|
|
8082
|
-
});
|
|
8083
|
-
}
|
|
8084
8049
|
function decodeTo(to, transformation) {
|
|
8085
8050
|
return (from) => {
|
|
8086
8051
|
return make$1(decodeTo$1(from.ast, to.ast, transformation ? make$8(transformation) : passthrough()), {
|
|
@@ -8580,7 +8545,7 @@ var init_error$2 = __esmMin((() => {
|
|
|
8580
8545
|
//#endregion
|
|
8581
8546
|
//#region src/service/store/model.ts
|
|
8582
8547
|
var emptyBranchState;
|
|
8583
|
-
var init_model$
|
|
8548
|
+
var init_model$4 = __esmMin((() => {
|
|
8584
8549
|
emptyBranchState = {
|
|
8585
8550
|
vouches: {},
|
|
8586
8551
|
consumed: 0,
|
|
@@ -8698,11 +8663,14 @@ var init_paths = __esmMin((() => {
|
|
|
8698
8663
|
upgradePath = (root) => join(root, "upgrade.json");
|
|
8699
8664
|
reportsDir = (root) => join(root, "reports");
|
|
8700
8665
|
reportPath = (root, stamp) => join(reportsDir(root), `${stamp}.md`);
|
|
8701
|
-
}))
|
|
8666
|
+
}));
|
|
8667
|
+
//#endregion
|
|
8668
|
+
//#region src/service/store/service.ts
|
|
8669
|
+
var Store, ensureDir, readOptional, missing$1, damaged, jsonOf, decoded, asSettings, asUpgradeCheck, asBatch, asAnswer, asState, asLayers, asDrafts, linesOf, readLines, parseSettings, parseUpgradeCheck, parseState, parseLayers, cursorOps, settingsOps, upgradeOps, reportOps, HEAD_REF, gitDirOf, headOf$1, repoOf$2, keyOf$2, wasKeyOf, there, adopted, moved, adopt, keyIn, answerOps, draftsOps, layersOps, inboxOps, LOCK_TRIES, LOCK_WAIT_MS, LOCK_STALE_MS, held$1, stale$1, stolen, taken, freed, stateOps, makeStore, storeAt;
|
|
8702
8670
|
var init_service$1 = __esmMin((() => {
|
|
8703
8671
|
init_dist();
|
|
8704
8672
|
init_error$2();
|
|
8705
|
-
init_model$
|
|
8673
|
+
init_model$4();
|
|
8706
8674
|
init_schema();
|
|
8707
8675
|
init_paths();
|
|
8708
8676
|
Store = class extends Service()("adiff/Store") {};
|
|
@@ -8855,7 +8823,7 @@ var init_service$1 = __esmMin((() => {
|
|
|
8855
8823
|
return named?.[1] === void 0 ? raw.trim() : named[1];
|
|
8856
8824
|
}).catch(() => "");
|
|
8857
8825
|
repoOf$2 = (worktreePath) => gitDirOf(worktreePath).then((dir) => readFile(join(dir, "commondir"), "utf8").then((raw) => resolve(dir, raw.trim())).catch(() => dir));
|
|
8858
|
-
keyOf$2 = (worktreePath) => promise(() =>
|
|
8826
|
+
keyOf$2 = (worktreePath) => map(all([promise(() => repoOf$2(worktreePath)), promise(() => headOf$1(worktreePath))], { concurrency: 2 }), ([repo, head]) => `${repo}#${head}`);
|
|
8859
8827
|
wasKeyOf = (worktreePath) => promise(() => headOf$1(worktreePath).then((head) => `${worktreePath}#${head}`));
|
|
8860
8828
|
there = (path) => stat(path).then(() => true, () => false);
|
|
8861
8829
|
adopted = /* @__PURE__ */ new Set();
|
|
@@ -9054,7 +9022,6 @@ var init_service$1 = __esmMin((() => {
|
|
|
9054
9022
|
};
|
|
9055
9023
|
};
|
|
9056
9024
|
storeAt = (root) => succeed$2(Store)(makeStore(root));
|
|
9057
|
-
storeAt(defaultRoot());
|
|
9058
9025
|
}));
|
|
9059
9026
|
//#endregion
|
|
9060
9027
|
//#region src/service/store/index.ts
|
|
@@ -9062,20 +9029,21 @@ var init_store = __esmMin((() => {
|
|
|
9062
9029
|
init_service$1();
|
|
9063
9030
|
init_error$2();
|
|
9064
9031
|
init_paths();
|
|
9065
|
-
init_model$
|
|
9066
|
-
}))
|
|
9067
|
-
|
|
9068
|
-
|
|
9069
|
-
|
|
9070
|
-
|
|
9032
|
+
init_model$4();
|
|
9033
|
+
}));
|
|
9034
|
+
//#endregion
|
|
9035
|
+
//#region src/domain/patch/model.ts
|
|
9036
|
+
var WHOLE_FILE, lineOn;
|
|
9037
|
+
var init_model$3 = __esmMin((() => {
|
|
9038
|
+
WHOLE_FILE = 1e5;
|
|
9071
9039
|
lineOn = (row, side) => side === "new" ? row.newLine : row.oldLine;
|
|
9072
9040
|
}));
|
|
9073
9041
|
//#endregion
|
|
9074
9042
|
//#region src/domain/patch/anchor.ts
|
|
9075
|
-
var sideOf, linesOn, anchorFor;
|
|
9043
|
+
var sideOf, linesOn, anchorFor, rowsForRange;
|
|
9076
9044
|
var init_anchor = __esmMin((() => {
|
|
9077
9045
|
init_dist();
|
|
9078
|
-
init_model$
|
|
9046
|
+
init_model$3();
|
|
9079
9047
|
sideOf = (rows) => rows.some((row) => isSome(row.newLine)) ? "new" : "old";
|
|
9080
9048
|
linesOn = (rows, side) => rows.flatMap((row) => match$3(lineOn(row, side), {
|
|
9081
9049
|
onNone: () => [],
|
|
@@ -9098,6 +9066,16 @@ var init_anchor = __esmMin((() => {
|
|
|
9098
9066
|
snippet: onSide.map((row) => row.text).join("\n")
|
|
9099
9067
|
});
|
|
9100
9068
|
};
|
|
9069
|
+
rowsForRange = (patch, range) => {
|
|
9070
|
+
const covered = patch.rows.filter((row) => match$3(lineOn(row, range.side), {
|
|
9071
|
+
onNone: () => false,
|
|
9072
|
+
onSome: (line) => line >= range.start && line <= range.end
|
|
9073
|
+
}));
|
|
9074
|
+
const first = covered[0];
|
|
9075
|
+
const last = covered.at(-1);
|
|
9076
|
+
if (first === void 0 || last === void 0) return none();
|
|
9077
|
+
return some([first.index, last.index]);
|
|
9078
|
+
};
|
|
9101
9079
|
}));
|
|
9102
9080
|
//#endregion
|
|
9103
9081
|
//#region src/domain/patch/parse.ts
|
|
@@ -9193,11 +9171,6 @@ var init_parse$1 = __esmMin((() => {
|
|
|
9193
9171
|
};
|
|
9194
9172
|
}));
|
|
9195
9173
|
//#endregion
|
|
9196
|
-
//#region src/domain/patch/render.ts
|
|
9197
|
-
var init_render$1 = __esmMin((() => {
|
|
9198
|
-
init_model$4();
|
|
9199
|
-
}));
|
|
9200
|
-
//#endregion
|
|
9201
9174
|
//#region src/domain/patch/sticky.ts
|
|
9202
9175
|
var CLOSER, COMMENT, LOOKAHEAD, indentOf, pinnable, limitFrom, stickyChain;
|
|
9203
9176
|
var init_sticky = __esmMin((() => {
|
|
@@ -9238,14 +9211,16 @@ var init_sticky = __esmMin((() => {
|
|
|
9238
9211
|
var init_patch = __esmMin((() => {
|
|
9239
9212
|
init_anchor();
|
|
9240
9213
|
init_parse$1();
|
|
9241
|
-
init_render$1();
|
|
9242
9214
|
init_sticky();
|
|
9243
|
-
init_model$
|
|
9244
|
-
}))
|
|
9215
|
+
init_model$3();
|
|
9216
|
+
}));
|
|
9217
|
+
//#endregion
|
|
9218
|
+
//#region src/service/git/error.ts
|
|
9219
|
+
var GitCommandFailed, NotARepository, FileUnreadable;
|
|
9245
9220
|
var init_error$1 = __esmMin((() => {
|
|
9246
9221
|
init_dist();
|
|
9247
9222
|
GitCommandFailed = class extends TaggedError("GitCommandFailed") {};
|
|
9248
|
-
TaggedError("NotARepository");
|
|
9223
|
+
NotARepository = class extends TaggedError("NotARepository") {};
|
|
9249
9224
|
FileUnreadable = class extends TaggedError("FileUnreadable") {};
|
|
9250
9225
|
}));
|
|
9251
9226
|
//#endregion
|
|
@@ -9273,16 +9248,12 @@ var init_run = __esmMin((() => {
|
|
|
9273
9248
|
gitOrEmpty = fn("Git.runOrEmpty")(function* (cwd, args) {
|
|
9274
9249
|
return yield* git(cwd, args).pipe(catchTag("GitCommandFailed", () => succeed$1("")));
|
|
9275
9250
|
});
|
|
9276
|
-
}));
|
|
9277
|
-
//#endregion
|
|
9278
|
-
//#region src/service/git/service.ts
|
|
9279
|
-
var GREP_CONTEXT, AT_ONCE$1, DEFAULT_BRANCH_CANDIDATES, STAT, Git, parseStat, readEntries, baseNames, mergeBases, findDefaultBranch, defaultBranch, mergeBaseOf, toWorktree, branchTips, parents, parentOf, splitLines, absent, readText, settled, seenAs, listWorktrees, readDiff, readStat, readSource, readBlob, readGrep, shape, GitLive;
|
|
9251
|
+
})), GREP_CONTEXT, DEFAULT_BRANCH_CANDIDATES, STAT, Git, parseStat, readEntries, baseNames, mergeBases, findDefaultBranch, defaultBranch, mergeBaseOf, toWorktree, branchTips, parents, parentOf, splitLines, absent, readText, settled, seenAs, listWorktrees, readDiff, readStat, readSource, readBlob, readGrep, shape, GitLive;
|
|
9280
9252
|
var init_service = __esmMin((() => {
|
|
9281
9253
|
init_dist();
|
|
9282
9254
|
init_error$1();
|
|
9283
9255
|
init_run();
|
|
9284
9256
|
GREP_CONTEXT = 2;
|
|
9285
|
-
AT_ONCE$1 = 8;
|
|
9286
9257
|
DEFAULT_BRANCH_CANDIDATES = [
|
|
9287
9258
|
"origin/master",
|
|
9288
9259
|
"origin/main",
|
|
@@ -9410,11 +9381,12 @@ var init_service = __esmMin((() => {
|
|
|
9410
9381
|
"list",
|
|
9411
9382
|
"--porcelain"
|
|
9412
9383
|
]);
|
|
9384
|
+
if (porcelain.trim().length === 0) return yield* new NotARepository({ path: repo });
|
|
9413
9385
|
const base = yield* defaultBranch(repo);
|
|
9414
9386
|
const entries = readEntries(porcelain);
|
|
9415
9387
|
const opened = yield* settled(repo);
|
|
9416
9388
|
const read = (entry) => seenAs(entry, base, opened);
|
|
9417
|
-
return yield* forEach(entries, read, { concurrency:
|
|
9389
|
+
return yield* forEach(entries, read, { concurrency: 8 });
|
|
9418
9390
|
});
|
|
9419
9391
|
readDiff = fn("Git.diff")(function* (worktree, context, only) {
|
|
9420
9392
|
const target = worktree.base.length > 0 ? worktree.base : "HEAD";
|
|
@@ -9514,16 +9486,10 @@ var init_vouch = __esmMin((() => {
|
|
|
9514
9486
|
};
|
|
9515
9487
|
};
|
|
9516
9488
|
}));
|
|
9517
|
-
var init_model$3 = __esmMin((() => {
|
|
9518
|
-
init_dist();
|
|
9519
|
-
String$1.pipe(brand("@adiff/CommentId"));
|
|
9520
|
-
}));
|
|
9521
9489
|
//#endregion
|
|
9522
9490
|
//#region src/domain/review/index.ts
|
|
9523
9491
|
var init_review = __esmMin((() => {
|
|
9524
|
-
init_dist();
|
|
9525
9492
|
init_vouch();
|
|
9526
|
-
init_model$3();
|
|
9527
9493
|
}));
|
|
9528
9494
|
//#endregion
|
|
9529
9495
|
//#region src/domain/preferences/model.ts
|
|
@@ -9600,7 +9566,10 @@ var init_error = __esmMin((() => {
|
|
|
9600
9566
|
PullMoved = class extends TaggedError("PullMoved") {};
|
|
9601
9567
|
NoLayers = class extends TaggedError("NoLayers") {};
|
|
9602
9568
|
InitUnwritable = class extends TaggedError("InitUnwritable") {};
|
|
9603
|
-
}))
|
|
9569
|
+
}));
|
|
9570
|
+
//#endregion
|
|
9571
|
+
//#region src/cli/commands.ts
|
|
9572
|
+
var CONTEXT, POLL, AUTO, askedFor$1, basedOn, worktreeNamed, findBranch, baseFor, patchesOf, findPatch, waitingOn, summaryOf, summaryFor, listBranches, blobOf, vouchIn, toggleVouch, readingOf, progressIn, reviewProgress, bodyOf, saidTo, spunOf, sentOf, sentIn, listSent, anchorIn, commentIn, submitComment, without$1, submitReply, listPatches, patchIn, flatten, threadBefore, takeComments, repoOf$1, worktreeOf$1, branchAt, awaitComments, saveReport, fileSource, fileBefore, readPreferences, readPreference, ON, OFF, preferenceValue, savePreference, setBase, clearBase, markRead;
|
|
9604
9573
|
var init_commands = __esmMin((() => {
|
|
9605
9574
|
init_dist();
|
|
9606
9575
|
init_patch();
|
|
@@ -9610,7 +9579,6 @@ var init_commands = __esmMin((() => {
|
|
|
9610
9579
|
init_preferences();
|
|
9611
9580
|
init_error();
|
|
9612
9581
|
CONTEXT = 3;
|
|
9613
|
-
WHOLE_FILE$1 = 1e5;
|
|
9614
9582
|
POLL = "500 millis";
|
|
9615
9583
|
AUTO = "auto";
|
|
9616
9584
|
askedFor$1 = (asked, held) => {
|
|
@@ -9689,10 +9657,6 @@ var init_commands = __esmMin((() => {
|
|
|
9689
9657
|
return parsePatches(raw);
|
|
9690
9658
|
});
|
|
9691
9659
|
findPatch = (patches, file) => fromNullishOr(patches.find((patch) => patch.path === file));
|
|
9692
|
-
rowsCovering = (patch, side, start, end) => patch.rows.filter((row) => match$3(lineOn(row, side), {
|
|
9693
|
-
onNone: () => false,
|
|
9694
|
-
onSome: (line) => line >= start && line <= end
|
|
9695
|
-
})).map((row) => row.index);
|
|
9696
9660
|
waitingOn = fn("Cli.waitingOn")(function* (worktree) {
|
|
9697
9661
|
const store = yield* Store;
|
|
9698
9662
|
const owed = yield* store.take(worktree.path);
|
|
@@ -9709,7 +9673,6 @@ var init_commands = __esmMin((() => {
|
|
|
9709
9673
|
})
|
|
9710
9674
|
};
|
|
9711
9675
|
});
|
|
9712
|
-
AT_ONCE = 8;
|
|
9713
9676
|
summaryOf = fn("Cli.summaryOf")(function* (repo, found, base) {
|
|
9714
9677
|
const git = yield* Git;
|
|
9715
9678
|
const based = yield* basedOn(repo, found, base);
|
|
@@ -9737,7 +9700,7 @@ var init_commands = __esmMin((() => {
|
|
|
9737
9700
|
});
|
|
9738
9701
|
listBranches = fn("Cli.listBranches")(function* (repo, base) {
|
|
9739
9702
|
const worktrees = yield* (yield* Git).worktrees(repo);
|
|
9740
|
-
return (yield* forEach(worktrees, (found) => summaryOf(repo, found, base), { concurrency:
|
|
9703
|
+
return (yield* forEach(worktrees, (found) => summaryOf(repo, found, base), { concurrency: 8 })).filter((summary) => summary.files > 0);
|
|
9741
9704
|
});
|
|
9742
9705
|
blobOf = (patches, file) => map$4(findPatch(patches, file), (patch) => patch.blob);
|
|
9743
9706
|
vouchIn = fn("Cli.vouchIn")(function* (reading, file) {
|
|
@@ -9848,8 +9811,8 @@ var init_commands = __esmMin((() => {
|
|
|
9848
9811
|
return yield* sentIn(yield* readingOf(repo, branch, base));
|
|
9849
9812
|
});
|
|
9850
9813
|
anchorIn = fn("Cli.anchorIn")(function* (worktree, request) {
|
|
9851
|
-
const only = yield* patchesOf(worktree, WHOLE_FILE
|
|
9852
|
-
const patches = only.length > 0 ? only : yield* patchesOf(worktree, WHOLE_FILE
|
|
9814
|
+
const only = yield* patchesOf(worktree, WHOLE_FILE, request.file);
|
|
9815
|
+
const patches = only.length > 0 ? only : yield* patchesOf(worktree, WHOLE_FILE);
|
|
9853
9816
|
const patch = findPatch(patches, request.file);
|
|
9854
9817
|
const resolved = yield* match$3(patch, {
|
|
9855
9818
|
onNone: () => new UnknownFile({
|
|
@@ -9858,10 +9821,7 @@ var init_commands = __esmMin((() => {
|
|
|
9858
9821
|
}),
|
|
9859
9822
|
onSome: succeed$1
|
|
9860
9823
|
});
|
|
9861
|
-
const
|
|
9862
|
-
const first = rows[0];
|
|
9863
|
-
const last = rows.at(-1);
|
|
9864
|
-
const anchor = first === void 0 || last === void 0 ? none() : anchorFor(resolved, first, last, request.side);
|
|
9824
|
+
const anchor = flatMap$2(rowsForRange(resolved, request), ([first, last]) => anchorFor(resolved, first, last, request.side));
|
|
9865
9825
|
return yield* match$3(anchor, {
|
|
9866
9826
|
onNone: () => new UnselectableRange({
|
|
9867
9827
|
file: request.file,
|
|
@@ -10038,22 +9998,6 @@ var init_commands = __esmMin((() => {
|
|
|
10038
9998
|
byDefault: known.byDefault
|
|
10039
9999
|
};
|
|
10040
10000
|
});
|
|
10041
|
-
fn("Cli.saveWrap")(function* (wrap) {
|
|
10042
|
-
const store = yield* Store;
|
|
10043
|
-
const current = yield* store.settings;
|
|
10044
|
-
yield* store.saveSettings({
|
|
10045
|
-
...current,
|
|
10046
|
-
wrap
|
|
10047
|
-
});
|
|
10048
|
-
});
|
|
10049
|
-
fn("Cli.saveSticky")(function* (sticky) {
|
|
10050
|
-
const store = yield* Store;
|
|
10051
|
-
const current = yield* store.settings;
|
|
10052
|
-
yield* store.saveSettings({
|
|
10053
|
-
...current,
|
|
10054
|
-
sticky
|
|
10055
|
-
});
|
|
10056
|
-
});
|
|
10057
10001
|
setBase = fn("Cli.setBase")(function* (repo, branch, base) {
|
|
10058
10002
|
const store = yield* Store;
|
|
10059
10003
|
const based = yield* baseFor(repo, branch, base);
|
|
@@ -10457,7 +10401,7 @@ var init_pane = __esmMin((() => {
|
|
|
10457
10401
|
init_drafts();
|
|
10458
10402
|
init_init();
|
|
10459
10403
|
init_pane();
|
|
10460
|
-
var version$1 = "0.1.0-alpha.
|
|
10404
|
+
var version$1 = "0.1.0-alpha.112";
|
|
10461
10405
|
//#endregion
|
|
10462
10406
|
//#region src/cli/upgrade.ts
|
|
10463
10407
|
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;
|
|
@@ -10653,13 +10597,13 @@ var init_upgrade$1 = __esmMin((() => {
|
|
|
10653
10597
|
}));
|
|
10654
10598
|
//#endregion
|
|
10655
10599
|
//#region src/cli/search.ts
|
|
10656
|
-
var HIT, NEAR
|
|
10600
|
+
var HIT, NEAR, rowOf, readRows, near, byChangedFirst, searchIn, searchBranch;
|
|
10657
10601
|
var init_search = __esmMin((() => {
|
|
10658
10602
|
init_dist();
|
|
10659
10603
|
init_git();
|
|
10660
10604
|
init_commands();
|
|
10661
10605
|
HIT = /^(.+?):(\d+):(.*)$/;
|
|
10662
|
-
NEAR
|
|
10606
|
+
NEAR = /^(.+?)-(\d+)-(.*)$/;
|
|
10663
10607
|
rowOf = (line) => {
|
|
10664
10608
|
const hit = HIT.exec(line);
|
|
10665
10609
|
if (hit !== null) return {
|
|
@@ -10668,7 +10612,7 @@ var init_search = __esmMin((() => {
|
|
|
10668
10612
|
text: hit[3] ?? "",
|
|
10669
10613
|
hit: true
|
|
10670
10614
|
};
|
|
10671
|
-
const near = NEAR
|
|
10615
|
+
const near = NEAR.exec(line);
|
|
10672
10616
|
if (near === null) return void 0;
|
|
10673
10617
|
return {
|
|
10674
10618
|
path: near[1] ?? "",
|
|
@@ -10849,7 +10793,10 @@ var init_layers$1 = __esmMin((() => {
|
|
|
10849
10793
|
init_coverage();
|
|
10850
10794
|
init_version();
|
|
10851
10795
|
init_model$1();
|
|
10852
|
-
}))
|
|
10796
|
+
}));
|
|
10797
|
+
//#endregion
|
|
10798
|
+
//#region src/cli/layers.ts
|
|
10799
|
+
var STALE_ADVICE, unique, spansOfLayer, tidyPath, spanFault, blockFault, codeBlockOf, tidyBlock, blocksOf, layerFault, layerOf, parsed, readLayers, fromStored, toStored, reportedLayers, reportOf, resolve$1, resolveAll, worktreeAt, storedLayers, setLayers, showLayers, layersIn;
|
|
10853
10800
|
var init_layers = __esmMin((() => {
|
|
10854
10801
|
init_dist();
|
|
10855
10802
|
init_layers$1();
|
|
@@ -11057,9 +11004,6 @@ var init_layers = __esmMin((() => {
|
|
|
11057
11004
|
summary: found.value.summary
|
|
11058
11005
|
};
|
|
11059
11006
|
});
|
|
11060
|
-
fn("Cli.listLayers")(function* (repo, branch) {
|
|
11061
|
-
return yield* layersIn(yield* readingOf(repo, branch));
|
|
11062
|
-
});
|
|
11063
11007
|
}));
|
|
11064
11008
|
//#endregion
|
|
11065
11009
|
//#region src/cli/threads.ts
|
|
@@ -11311,7 +11255,7 @@ var init_parse = __esmMin((() => {
|
|
|
11311
11255
|
}));
|
|
11312
11256
|
//#endregion
|
|
11313
11257
|
//#region src/cli/catalog.ts
|
|
11314
|
-
var worktreeOf, repoOf, branchOf, fieldsOption, addressing, baseOf, based, repo, opening$2, file, range, READ_A_BRANCH, WRITE_COMMENTS, ANSWER_COMMENTS, FOLLOW_UP, DRAFTS, SET_UP, withFields, commands$1, catalog, commandNames, findCommand, VALUED_ANYWHERE, KNOWN_ANYWHERE, valuedIn, knownIn, verbsUnder, groups,
|
|
11258
|
+
var worktreeOf, repoOf, branchOf, fieldsOption, addressing, baseOf, based, repo, opening$2, file, range, READ_A_BRANCH, WRITE_COMMENTS, ANSWER_COMMENTS, FOLLOW_UP, DRAFTS, SET_UP, withFields, commands$1, catalog, commandNames, findCommand, VALUED_ANYWHERE, KNOWN_ANYWHERE, valuedIn, knownIn, verbsUnder, groups, MIN_EDITS, distance, CHARS_PER_EDIT, nearestCommand;
|
|
11315
11259
|
var init_catalog = __esmMin((() => {
|
|
11316
11260
|
worktreeOf = {
|
|
11317
11261
|
name: "worktree",
|
|
@@ -11855,7 +11799,7 @@ var init_catalog = __esmMin((() => {
|
|
|
11855
11799
|
knownIn = (name) => /* @__PURE__ */ new Set([...KNOWN_ANYWHERE, ...(findCommand(name)?.options ?? []).map((option) => option.name)]);
|
|
11856
11800
|
verbsUnder = (noun) => commandNames.filter((name) => name.startsWith(`${noun} `));
|
|
11857
11801
|
groups = [...new Set(catalog.map((command) => command.group))];
|
|
11858
|
-
|
|
11802
|
+
MIN_EDITS = 3;
|
|
11859
11803
|
distance = (left, right) => {
|
|
11860
11804
|
const previous = Array.from({ length: right.length + 1 }, (_, at) => at);
|
|
11861
11805
|
for (let row = 1; row <= left.length; row += 1) {
|
|
@@ -11870,12 +11814,12 @@ var init_catalog = __esmMin((() => {
|
|
|
11870
11814
|
}
|
|
11871
11815
|
return previous[right.length] ?? 0;
|
|
11872
11816
|
};
|
|
11873
|
-
|
|
11817
|
+
CHARS_PER_EDIT = 3;
|
|
11874
11818
|
nearestCommand = (name) => {
|
|
11875
11819
|
const noun = name.split(" ")[0] ?? "";
|
|
11876
11820
|
const under = verbsUnder(noun);
|
|
11877
11821
|
const candidates = under.length === 0 ? commandNames : under;
|
|
11878
|
-
const room = Math.max(
|
|
11822
|
+
const room = Math.max(MIN_EDITS, Math.floor(name.length / CHARS_PER_EDIT));
|
|
11879
11823
|
const scored = candidates.map((known) => ({
|
|
11880
11824
|
known,
|
|
11881
11825
|
gap: distance(name, known)
|
|
@@ -11962,7 +11906,7 @@ var init_report$1 = __esmMin((() => {
|
|
|
11962
11906
|
},
|
|
11963
11907
|
NotARepository: {
|
|
11964
11908
|
exit: 3,
|
|
11965
|
-
suggestion: "That path is not a git repository. Point --repo at one.",
|
|
11909
|
+
suggestion: "That path is not a git repository. Point --repo or --worktree at one, or run `adiff branch list` from inside the repository you mean.",
|
|
11966
11910
|
retriable: false
|
|
11967
11911
|
},
|
|
11968
11912
|
GitCommandFailed: {
|
|
@@ -12457,7 +12401,7 @@ var init_tree = __esmMin((() => {
|
|
|
12457
12401
|
return node.children.reduce((total, child) => total + filesUnder(tree, child), 0);
|
|
12458
12402
|
};
|
|
12459
12403
|
crowdedDirectories = (tree, limit) => tree.nodes.filter((node) => node.kind === "directory" && directFiles(tree, node.id) > limit).map((node) => node.path);
|
|
12460
|
-
})), nothingReviewed, initialState, TREE_MAX, TREE_ROOMY, TREE_WIDE, TREE_MIN, TREE_SHARE, DIFF_MIN, DIFF_ROOMY, bodyRoom, treeWidth, tooSmall, reviewWidth, panelFits, panelShown, onLayers, selectedLayer, proseFor, layerFiles, layerHolding, layerOpen, chunked, packed, shortened, wordWrapped, wrapped, clip
|
|
12404
|
+
})), nothingReviewed, initialState, TREE_MAX, TREE_ROOMY, TREE_WIDE, TREE_MIN, TREE_SHARE, DIFF_MIN, DIFF_ROOMY, bodyRoom, treeWidth, tooSmall, reviewWidth, panelFits, panelShown, onLayers, selectedLayer, proseFor, layerFiles, layerHolding, layerOpen, chunked, packed, shortened, wordWrapped, wrapped, clip, TITLE_ROWS, titleRows, shortDir, fileRow$1, shownFiles, dirOf, fileRows, layerRead, layerDone, countRow, layerBody, layerRows, nearFirst, layerFitted, railWindow, selectedBranch, selectedPatch, pullHere, knownToHaveNoPull, kept, treeOf, reviewedCountIn, CROWDED, treeRows, crowdedOf, foldersOfFile, isReviewed, treeStart, treeWindow, commentsOn, hiddenLines, markedRows, carriesLine, selectedRows, snippetOf, selectedLineCount, lineOf, brokenAt, laidLine, laidDraft, caretRow, caretColumn, caretOn, COMPOSE_BOX, COMPOSE_MARGIN, COMPOSE_PAD, COMPOSE_LEAST, composeBox, composeRoom$1, composeTarget, replyTarget, pickedText, selectedLines, shownMatches, matchHere, selectionReadout, CONTEXT_STEPS, wholeFileOff, contextToggled, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, rowShowing, lineOnSide, commentRowsIn, threadsAtRow, stopsAtRow, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, PANEL_SECTIONS, answersIn, newerOf, spokeLast, sectionOf, sentEntry, panelEntries, panelEntry, threadChosen, spokenSince, hunkStarts, openingRow, changeAround, nextUnreviewed, reviewedCount, fileOrder, filePlace, readingOrder, placeIn, layerFile, layerAfter, selectionRange;
|
|
12461
12405
|
var init_model = __esmMin((() => {
|
|
12462
12406
|
init_dist();
|
|
12463
12407
|
init_patch();
|
|
@@ -12581,13 +12525,13 @@ var init_model = __esmMin((() => {
|
|
|
12581
12525
|
const width = Math.max(1, room);
|
|
12582
12526
|
return text.split(/\s+/).filter((word) => word.length > 0).flatMap((word) => chunked(word, width)).reduce((lines, word) => packed(lines, word, width), []);
|
|
12583
12527
|
};
|
|
12584
|
-
clip
|
|
12528
|
+
clip = (label, room) => label.length > room ? `${label.slice(0, Math.max(0, room - 1))}…` : label;
|
|
12585
12529
|
TITLE_ROWS = 2;
|
|
12586
12530
|
titleRows = (state, layerIndex, room) => {
|
|
12587
12531
|
const lines = wordWrapped(state.layers[layerIndex]?.title ?? "", room);
|
|
12588
12532
|
const kept = lines.slice(0, TITLE_ROWS);
|
|
12589
12533
|
const last = kept.at(-1) ?? "";
|
|
12590
|
-
return (lines.length > TITLE_ROWS ? [...kept.slice(0, -1), clip
|
|
12534
|
+
return (lines.length > TITLE_ROWS ? [...kept.slice(0, -1), clip(`${last} …`, room)] : kept).map((text, at) => ({
|
|
12591
12535
|
index: layerIndex,
|
|
12592
12536
|
kind: "title",
|
|
12593
12537
|
text,
|
|
@@ -12598,7 +12542,7 @@ var init_model = __esmMin((() => {
|
|
|
12598
12542
|
const whole = `${dir}/`;
|
|
12599
12543
|
if (whole.length <= room) return whole;
|
|
12600
12544
|
const parts = dir.split("/");
|
|
12601
|
-
if (parts.length < 3) return `${clip
|
|
12545
|
+
if (parts.length < 3) return `${clip(dir, Math.max(1, room - 1))}/`;
|
|
12602
12546
|
return `${parts[0] ?? ""}/…/${parts.at(-1) ?? ""}/`;
|
|
12603
12547
|
};
|
|
12604
12548
|
fileRow$1 = (state, layerIndex, at, room) => {
|
|
@@ -12607,7 +12551,7 @@ var init_model = __esmMin((() => {
|
|
|
12607
12551
|
return {
|
|
12608
12552
|
index: layerIndex,
|
|
12609
12553
|
kind: "file",
|
|
12610
|
-
text: clip
|
|
12554
|
+
text: clip(name, room),
|
|
12611
12555
|
lead: false,
|
|
12612
12556
|
fileIndex: at,
|
|
12613
12557
|
reviewed: isReviewed(state, at),
|
|
@@ -12653,7 +12597,7 @@ var init_model = __esmMin((() => {
|
|
|
12653
12597
|
return [{
|
|
12654
12598
|
index,
|
|
12655
12599
|
kind: "count",
|
|
12656
|
-
text: clip
|
|
12600
|
+
text: clip(said, room),
|
|
12657
12601
|
lead: false
|
|
12658
12602
|
}];
|
|
12659
12603
|
};
|
|
@@ -12707,11 +12651,12 @@ var init_model = __esmMin((() => {
|
|
|
12707
12651
|
kept = (state, at) => !state.hideReviewed || at === state.patchIndex || !isReviewed(state, at);
|
|
12708
12652
|
treeOf = (state) => buildTree(state.patches.map((patch, at) => kept(state, at) ? patch.path : ""));
|
|
12709
12653
|
reviewedCountIn = (state) => state.patches.filter((_, at) => isReviewed(state, at)).length;
|
|
12654
|
+
CROWDED = 8;
|
|
12710
12655
|
treeRows = (state) => {
|
|
12711
12656
|
const tree = treeOf(state);
|
|
12712
12657
|
return flattenTree(tree, state.closed);
|
|
12713
12658
|
};
|
|
12714
|
-
crowdedOf = (patches) => crowdedDirectories(buildTree(patches.map((patch) => patch.path)),
|
|
12659
|
+
crowdedOf = (patches) => crowdedDirectories(buildTree(patches.map((patch) => patch.path)), CROWDED);
|
|
12715
12660
|
foldersOfFile = (state, fileIndex) => {
|
|
12716
12661
|
const patch = state.patches[fileIndex];
|
|
12717
12662
|
if (patch === void 0) return [];
|
|
@@ -12864,7 +12809,6 @@ var init_model = __esmMin((() => {
|
|
|
12864
12809
|
const lines = selectedRows(state).length;
|
|
12865
12810
|
return `${patch.path} ${lines} ${lines === 1 ? "line" : "lines"}`;
|
|
12866
12811
|
};
|
|
12867
|
-
WHOLE_FILE = 1e5;
|
|
12868
12812
|
CONTEXT_STEPS = [
|
|
12869
12813
|
3,
|
|
12870
12814
|
10,
|
|
@@ -12930,6 +12874,12 @@ var init_model = __esmMin((() => {
|
|
|
12930
12874
|
};
|
|
12931
12875
|
filesWithComments = (state) => state.patches.flatMap((patch, index) => state.sent.some((entry) => entry.file === patch.path) ? [index] : []);
|
|
12932
12876
|
answerCount = (comments) => comments.reduce((total, entry) => total + (entry.answers?.length ?? 0), 0);
|
|
12877
|
+
PANEL_SECTIONS = [
|
|
12878
|
+
"asked",
|
|
12879
|
+
"with",
|
|
12880
|
+
"answered",
|
|
12881
|
+
"settled"
|
|
12882
|
+
];
|
|
12933
12883
|
answersIn = (comment) => comment.answers?.length ?? 0;
|
|
12934
12884
|
newerOf = (state, comment) => {
|
|
12935
12885
|
if (comment.id === void 0) return comment;
|
|
@@ -12939,8 +12889,10 @@ var init_model = __esmMin((() => {
|
|
|
12939
12889
|
};
|
|
12940
12890
|
spokeLast = (comment) => comment.turns?.at(-1)?.voice;
|
|
12941
12891
|
sectionOf = (comment) => {
|
|
12942
|
-
if (
|
|
12943
|
-
|
|
12892
|
+
if (comment.settled === true) return "settled";
|
|
12893
|
+
if (comment.asks === true) return "asked";
|
|
12894
|
+
if (spokeLast(comment) === "reviewer") return "with";
|
|
12895
|
+
return answersIn(comment) > 0 ? "answered" : "with";
|
|
12944
12896
|
};
|
|
12945
12897
|
sentEntry = (state, comment) => {
|
|
12946
12898
|
const newer = newerOf(state, comment);
|
|
@@ -12957,7 +12909,7 @@ var init_model = __esmMin((() => {
|
|
|
12957
12909
|
const found = delivered.filter((entry) => entry.section === section);
|
|
12958
12910
|
return state.newestFirst ? found.toReversed() : found;
|
|
12959
12911
|
};
|
|
12960
|
-
return
|
|
12912
|
+
return PANEL_SECTIONS.flatMap((section) => ordered(section));
|
|
12961
12913
|
};
|
|
12962
12914
|
panelEntry = (state) => panelEntries(state)[state.panelIndex];
|
|
12963
12915
|
threadChosen = (state) => {
|
|
@@ -13135,6 +13087,7 @@ var init_command = __esmMin((() => {
|
|
|
13135
13087
|
command = (input) => ({
|
|
13136
13088
|
category: "Reading",
|
|
13137
13089
|
hint: "",
|
|
13090
|
+
also: [],
|
|
13138
13091
|
listed: true,
|
|
13139
13092
|
whenComments: false,
|
|
13140
13093
|
counted: false,
|
|
@@ -13326,6 +13279,11 @@ var init_command = __esmMin((() => {
|
|
|
13326
13279
|
}),
|
|
13327
13280
|
command({
|
|
13328
13281
|
action: "panel.toggle",
|
|
13282
|
+
also: [
|
|
13283
|
+
"comments",
|
|
13284
|
+
"threads",
|
|
13285
|
+
"conversation"
|
|
13286
|
+
],
|
|
13329
13287
|
title: "Show or hide the review panel",
|
|
13330
13288
|
category: "Comments",
|
|
13331
13289
|
keys: ["a"],
|
|
@@ -13334,6 +13292,11 @@ var init_command = __esmMin((() => {
|
|
|
13334
13292
|
}),
|
|
13335
13293
|
command({
|
|
13336
13294
|
action: "nav.zoom",
|
|
13295
|
+
also: [
|
|
13296
|
+
"fullscreen",
|
|
13297
|
+
"maximise",
|
|
13298
|
+
"wide"
|
|
13299
|
+
],
|
|
13337
13300
|
title: "Hide the file list and the review panel",
|
|
13338
13301
|
category: "Reading",
|
|
13339
13302
|
keys: ["z", "\\"],
|
|
@@ -13365,7 +13328,7 @@ var init_command = __esmMin((() => {
|
|
|
13365
13328
|
command({
|
|
13366
13329
|
action: "select.shrink",
|
|
13367
13330
|
panes: ["diff"],
|
|
13368
|
-
title: "
|
|
13331
|
+
title: "Drop the last line from the selection",
|
|
13369
13332
|
category: "Selecting",
|
|
13370
13333
|
keys: ["shift+up"],
|
|
13371
13334
|
screens: ["review"],
|
|
@@ -13391,6 +13354,13 @@ var init_command = __esmMin((() => {
|
|
|
13391
13354
|
}),
|
|
13392
13355
|
command({
|
|
13393
13356
|
action: "search.open",
|
|
13357
|
+
also: [
|
|
13358
|
+
"search",
|
|
13359
|
+
"find",
|
|
13360
|
+
"grep",
|
|
13361
|
+
"look for",
|
|
13362
|
+
"where is"
|
|
13363
|
+
],
|
|
13394
13364
|
category: "Selecting",
|
|
13395
13365
|
title: "Find the selection elsewhere",
|
|
13396
13366
|
keys: ["/"],
|
|
@@ -13436,6 +13406,11 @@ var init_command = __esmMin((() => {
|
|
|
13436
13406
|
}),
|
|
13437
13407
|
command({
|
|
13438
13408
|
action: "wrap.toggle",
|
|
13409
|
+
also: [
|
|
13410
|
+
"wrap",
|
|
13411
|
+
"soft wrap",
|
|
13412
|
+
"long lines"
|
|
13413
|
+
],
|
|
13439
13414
|
title: "Wrap long lines",
|
|
13440
13415
|
category: "Reading",
|
|
13441
13416
|
keys: ["w"],
|
|
@@ -13473,6 +13448,12 @@ var init_command = __esmMin((() => {
|
|
|
13473
13448
|
}),
|
|
13474
13449
|
command({
|
|
13475
13450
|
action: "thread.settle",
|
|
13451
|
+
also: [
|
|
13452
|
+
"resolve",
|
|
13453
|
+
"close",
|
|
13454
|
+
"done",
|
|
13455
|
+
"accept"
|
|
13456
|
+
],
|
|
13476
13457
|
panes: ["diff", "review"],
|
|
13477
13458
|
title: "Settle the thread here",
|
|
13478
13459
|
category: "Comments",
|
|
@@ -13493,6 +13474,11 @@ var init_command = __esmMin((() => {
|
|
|
13493
13474
|
}),
|
|
13494
13475
|
command({
|
|
13495
13476
|
action: "thread.reply",
|
|
13477
|
+
also: [
|
|
13478
|
+
"respond",
|
|
13479
|
+
"answer",
|
|
13480
|
+
"write back"
|
|
13481
|
+
],
|
|
13496
13482
|
panes: ["review", "diff"],
|
|
13497
13483
|
hint: "reply",
|
|
13498
13484
|
rank: 1,
|
|
@@ -13504,6 +13490,12 @@ var init_command = __esmMin((() => {
|
|
|
13504
13490
|
}),
|
|
13505
13491
|
command({
|
|
13506
13492
|
action: "thread.remove",
|
|
13493
|
+
also: [
|
|
13494
|
+
"delete",
|
|
13495
|
+
"withdraw",
|
|
13496
|
+
"retract",
|
|
13497
|
+
"undo"
|
|
13498
|
+
],
|
|
13507
13499
|
panes: ["review"],
|
|
13508
13500
|
hint: "remove",
|
|
13509
13501
|
rank: 2,
|
|
@@ -13545,6 +13537,11 @@ var init_command = __esmMin((() => {
|
|
|
13545
13537
|
}),
|
|
13546
13538
|
command({
|
|
13547
13539
|
action: "layers.ask",
|
|
13540
|
+
also: [
|
|
13541
|
+
"reading order",
|
|
13542
|
+
"plan",
|
|
13543
|
+
"walkthrough"
|
|
13544
|
+
],
|
|
13548
13545
|
title: "Ask the agent for a reading order",
|
|
13549
13546
|
category: "Files",
|
|
13550
13547
|
keys: ["L"],
|
|
@@ -13552,6 +13549,11 @@ var init_command = __esmMin((() => {
|
|
|
13552
13549
|
}),
|
|
13553
13550
|
command({
|
|
13554
13551
|
action: "rail.toggle",
|
|
13552
|
+
also: [
|
|
13553
|
+
"sidebar",
|
|
13554
|
+
"outline",
|
|
13555
|
+
"toc"
|
|
13556
|
+
],
|
|
13555
13557
|
panes: ["tree", "diff"],
|
|
13556
13558
|
title: "Switch between layers and files",
|
|
13557
13559
|
category: "Files",
|
|
@@ -13563,6 +13565,11 @@ var init_command = __esmMin((() => {
|
|
|
13563
13565
|
}),
|
|
13564
13566
|
command({
|
|
13565
13567
|
action: "tree.collapse",
|
|
13568
|
+
also: [
|
|
13569
|
+
"fold",
|
|
13570
|
+
"hide",
|
|
13571
|
+
"shrink"
|
|
13572
|
+
],
|
|
13566
13573
|
title: "Close the folder, layer, gap, or settled thread",
|
|
13567
13574
|
category: "Files",
|
|
13568
13575
|
keys: ["h"],
|
|
@@ -13570,6 +13577,12 @@ var init_command = __esmMin((() => {
|
|
|
13570
13577
|
}),
|
|
13571
13578
|
command({
|
|
13572
13579
|
action: "tree.expand",
|
|
13580
|
+
also: [
|
|
13581
|
+
"expand",
|
|
13582
|
+
"unfold",
|
|
13583
|
+
"show more",
|
|
13584
|
+
"open"
|
|
13585
|
+
],
|
|
13573
13586
|
title: "Open the folder, layer, gap, or settled thread",
|
|
13574
13587
|
category: "Files",
|
|
13575
13588
|
keys: ["l"],
|
|
@@ -13577,6 +13590,12 @@ var init_command = __esmMin((() => {
|
|
|
13577
13590
|
}),
|
|
13578
13591
|
command({
|
|
13579
13592
|
action: "file.vouch",
|
|
13593
|
+
also: [
|
|
13594
|
+
"done",
|
|
13595
|
+
"approve",
|
|
13596
|
+
"tick",
|
|
13597
|
+
"check off"
|
|
13598
|
+
],
|
|
13580
13599
|
panes: ["tree", "diff"],
|
|
13581
13600
|
title: "Mark reviewed",
|
|
13582
13601
|
category: "Files",
|
|
@@ -13604,6 +13623,12 @@ var init_command = __esmMin((() => {
|
|
|
13604
13623
|
}),
|
|
13605
13624
|
command({
|
|
13606
13625
|
action: "compose.open",
|
|
13626
|
+
also: [
|
|
13627
|
+
"write",
|
|
13628
|
+
"note",
|
|
13629
|
+
"feedback",
|
|
13630
|
+
"say"
|
|
13631
|
+
],
|
|
13607
13632
|
panes: ["diff"],
|
|
13608
13633
|
category: "Comments",
|
|
13609
13634
|
title: "Comment on the selection",
|
|
@@ -13638,6 +13663,11 @@ var init_command = __esmMin((() => {
|
|
|
13638
13663
|
}),
|
|
13639
13664
|
command({
|
|
13640
13665
|
action: "palette.open",
|
|
13666
|
+
also: [
|
|
13667
|
+
"commands",
|
|
13668
|
+
"actions",
|
|
13669
|
+
"what can i do"
|
|
13670
|
+
],
|
|
13641
13671
|
title: "Find a command",
|
|
13642
13672
|
category: "App",
|
|
13643
13673
|
keys: ["ctrl+p"],
|
|
@@ -13664,6 +13694,12 @@ var init_command = __esmMin((() => {
|
|
|
13664
13694
|
}),
|
|
13665
13695
|
command({
|
|
13666
13696
|
action: "keys.open",
|
|
13697
|
+
also: [
|
|
13698
|
+
"help",
|
|
13699
|
+
"shortcuts",
|
|
13700
|
+
"bindings",
|
|
13701
|
+
"keys"
|
|
13702
|
+
],
|
|
13667
13703
|
title: "List every key",
|
|
13668
13704
|
category: "App",
|
|
13669
13705
|
keys: ["?"],
|
|
@@ -13774,7 +13810,7 @@ var init_match = __esmMin((() => {
|
|
|
13774
13810
|
}
|
|
13775
13811
|
return needle.length === 0;
|
|
13776
13812
|
};
|
|
13777
|
-
label = (entry) => `${entry.category} ${entry.title} ${entry.keys.join(" ")}`.toLowerCase();
|
|
13813
|
+
label = (entry) => `${entry.category} ${entry.title} ${entry.keys.join(" ")} ${entry.also.join(" ")}`.toLowerCase();
|
|
13778
13814
|
matches = (entry, query) => query.toLowerCase().split(/\s+/).filter((word) => word.length > 0).every((word) => subsequence(label(entry), word));
|
|
13779
13815
|
closeness = (entry, query) => {
|
|
13780
13816
|
const wanted = query.trim().toLowerCase();
|
|
@@ -13978,7 +14014,7 @@ var init_reduce = __esmMin((() => {
|
|
|
13978
14014
|
return shown[((at === -1 ? 0 : at) + delta + shown.length) % shown.length] ?? state.focus;
|
|
13979
14015
|
};
|
|
13980
14016
|
togglePanel = (state) => {
|
|
13981
|
-
if (!
|
|
14017
|
+
if (!panelFits(state)) return withNotice(state, "the terminal is too narrow for the review panel");
|
|
13982
14018
|
const panelOpen = !state.panelOpen;
|
|
13983
14019
|
return {
|
|
13984
14020
|
...state,
|
|
@@ -14549,20 +14585,21 @@ var init_reduce = __esmMin((() => {
|
|
|
14549
14585
|
selecting: false,
|
|
14550
14586
|
notice
|
|
14551
14587
|
});
|
|
14552
|
-
})),
|
|
14588
|
+
})), ring, sets, chosen, useMarks, marks;
|
|
14553
14589
|
var init_marks = __esmMin((() => {
|
|
14590
|
+
ring = {
|
|
14591
|
+
comment: "○",
|
|
14592
|
+
sent: "✓",
|
|
14593
|
+
rule: "│",
|
|
14594
|
+
cursor: "▎",
|
|
14595
|
+
tally: "•",
|
|
14596
|
+
reviewed: "✓",
|
|
14597
|
+
folder: "",
|
|
14598
|
+
folderOpen: "",
|
|
14599
|
+
file: ""
|
|
14600
|
+
};
|
|
14554
14601
|
sets = {
|
|
14555
|
-
ring
|
|
14556
|
-
comment: "○",
|
|
14557
|
-
sent: "✓",
|
|
14558
|
-
rule: "│",
|
|
14559
|
-
cursor: "▎",
|
|
14560
|
-
tally: "•",
|
|
14561
|
-
reviewed: "✓",
|
|
14562
|
-
folder: "",
|
|
14563
|
-
folderOpen: "",
|
|
14564
|
-
file: ""
|
|
14565
|
-
},
|
|
14602
|
+
ring,
|
|
14566
14603
|
bubble: {
|
|
14567
14604
|
comment: "◗",
|
|
14568
14605
|
sent: "◖",
|
|
@@ -14606,29 +14643,18 @@ var init_marks = __esmMin((() => {
|
|
|
14606
14643
|
folder: "",
|
|
14607
14644
|
folderOpen: "",
|
|
14608
14645
|
file: ""
|
|
14646
|
+
},
|
|
14647
|
+
plain: {
|
|
14648
|
+
...ring,
|
|
14649
|
+
folder: "▸",
|
|
14650
|
+
folderOpen: "▾",
|
|
14651
|
+
file: "·"
|
|
14609
14652
|
}
|
|
14610
14653
|
};
|
|
14611
14654
|
Object.keys(sets);
|
|
14612
|
-
ring = {
|
|
14613
|
-
folder: "",
|
|
14614
|
-
folderOpen: "",
|
|
14615
|
-
file: "",
|
|
14616
|
-
comment: "○",
|
|
14617
|
-
sent: "✓",
|
|
14618
|
-
rule: "│",
|
|
14619
|
-
cursor: "▎",
|
|
14620
|
-
tally: "•",
|
|
14621
|
-
reviewed: "✓"
|
|
14622
|
-
};
|
|
14623
|
-
plain = {
|
|
14624
|
-
...ring,
|
|
14625
|
-
folder: "▸",
|
|
14626
|
-
folderOpen: "▾",
|
|
14627
|
-
file: "·"
|
|
14628
|
-
};
|
|
14629
14655
|
chosen = ring;
|
|
14630
14656
|
useMarks = (name) => {
|
|
14631
|
-
chosen =
|
|
14657
|
+
chosen = sets[name] ?? ring;
|
|
14632
14658
|
};
|
|
14633
14659
|
marks = () => chosen;
|
|
14634
14660
|
useMarks(process.env["ADIFF_MARKS"] ?? "ring");
|
|
@@ -14656,7 +14682,7 @@ var init_theme = __esmMin((() => {
|
|
|
14656
14682
|
panel: "#0e1117",
|
|
14657
14683
|
overlay: "#181c26",
|
|
14658
14684
|
scrim: "#000000a0",
|
|
14659
|
-
rule: "#
|
|
14685
|
+
rule: "#3b4354",
|
|
14660
14686
|
note: "#9aa7c7",
|
|
14661
14687
|
cursor: "#232936",
|
|
14662
14688
|
selection: "#2b3854",
|
|
@@ -15366,7 +15392,7 @@ var init_diffview = __esmMin((() => {
|
|
|
15366
15392
|
}));
|
|
15367
15393
|
//#endregion
|
|
15368
15394
|
//#region src/tui/render.ts
|
|
15369
|
-
var ROW_HEIGHT, COMPOSE_WIDTH, GUTTER_X, CHIP_GAP,
|
|
15395
|
+
var ROW_HEIGHT, COMPOSE_WIDTH, GUTTER_X, CHIP_GAP, MODAL_ROOM, COMPOSE_CHROME, COMPOSE_ACTION_ROWS, reportActions, actionsText, SNIPPET_LINES, PALETTE_KEY, PALETTE_TITLE, PALETTE_GAP, PALETTE_CHROME, PENDING_CHROME, keysTitle, PALETTE_WIDTH, PANEL_SHARE, PANEL_MAX, PANEL_FLOOR, PANEL_FOOT, PANEL_QUARTER, PANEL_FIFTH, PANE_CHROME, PANE_EDGES, PANE_INSET, DIFF_FLOOR, COMPOSE_EDGE, CRAMPED, CRAMPED_ROWS, DIFF_CHROME_MOST, BRANCH_WIDTH, BRANCH_NAME_MIN, BRANCH_FIXED, STATE_MIN, EMPTY_LIST, MODAL_MARGIN, shareOf, homeWidth, longestName, longestState, keysOf, commandRow, modalWidth, panelWidth, panelTop, panelRows, composeRoom, laidOut$1, STICKY_MAX, pickPaint, PLAIN_PICKED, PICKED, PLAIN_CURSOR, UNDER_CURSOR, GAP_PAINT, frameRoot, crampedBar, bar, makeList, makeDiffPane, makePanel, makeListParts, makeListText, makeGutter, makeScroller, makeScrim, makeScroll, makePalette, asking, makePaletteParts, makeChoices, LIST_LEAD, windowed, listText, stack, makeBody, makeHome, makeModals, makeKeysParts, makeFoundParts, FONTS, logoFont, makeLanding, makeLogo, MAC_KEYS, makeComposeParts, makeCompose, clipHead, clipMiddle, clipPath, INDENT_MAX, treeLabel, waitingLabel, inRange, notesOf, notesFor, paired, chipWidth, WAYS_OUT, keptWithin, CHIP_CHUNKS, shortPath, HOME_PATH_MIN, HOME_PATH_CHROME, elide, SUMMARY_LINES, summaryLines, contextLabel, nameRoom, stateRoom, columns, FORGE_SILENT, unaskedForge, branchHeading, atHome, layersCell, baseLabel, stateCell, branchCells, placeLabel, headerParts, HEADER_GAP, HEADER_PATH_MIN, headerRoom, headerFitted, fallbackScope, treeMarks, treeTail, treeLine, GUTTER, DIR_LEAD, TITLE_LEAD, FILE_LEAD, STALE_ROOM, STALE_LONG, STALE_SHORT, staleBanner, layerRoom, layerMark, layerLead, layerGutter, layerText, litRow, leftOver, titlePaint, layerPaint, PANEL_TITLES, PANEL_ORDER, PANEL_LEAD, PANEL_EMPTY, restingOrHere, FOUND_LEAST, nothingYet, foundTitle, fileRow, blockOf, aroundRow, windowedBlocks, panelWhere, panelBody, panelPair, panelSection, PULL_HINT, panelWindow, moreLine, panelText, Screen;
|
|
15370
15396
|
var init_render = __esmMin((() => {
|
|
15371
15397
|
init_command();
|
|
15372
15398
|
init_layers$1();
|
|
@@ -15381,7 +15407,6 @@ var init_render = __esmMin((() => {
|
|
|
15381
15407
|
COMPOSE_WIDTH = 72;
|
|
15382
15408
|
GUTTER_X = 2;
|
|
15383
15409
|
CHIP_GAP = 4;
|
|
15384
|
-
FRAME_PAD = 1;
|
|
15385
15410
|
MODAL_ROOM = 8;
|
|
15386
15411
|
COMPOSE_CHROME = 3;
|
|
15387
15412
|
COMPOSE_ACTION_ROWS = 2;
|
|
@@ -15392,7 +15417,12 @@ var init_render = __esmMin((() => {
|
|
|
15392
15417
|
PALETTE_TITLE = 60;
|
|
15393
15418
|
PALETTE_GAP = 2;
|
|
15394
15419
|
PALETTE_CHROME = 4;
|
|
15395
|
-
PENDING_CHROME =
|
|
15420
|
+
PENDING_CHROME = 4;
|
|
15421
|
+
keysTitle = (found, shown) => {
|
|
15422
|
+
if (found === 0) return "No key matches";
|
|
15423
|
+
if (found <= shown) return `Keys here, ${found} of them`;
|
|
15424
|
+
return `Keys here, ${found} of them — arrows for the rest`;
|
|
15425
|
+
};
|
|
15396
15426
|
PALETTE_WIDTH = 76;
|
|
15397
15427
|
PANEL_SHARE = .62;
|
|
15398
15428
|
PANEL_MAX = 120;
|
|
@@ -15404,6 +15434,7 @@ var init_render = __esmMin((() => {
|
|
|
15404
15434
|
PANE_EDGES = 2;
|
|
15405
15435
|
PANE_INSET = 1;
|
|
15406
15436
|
DIFF_FLOOR = 24;
|
|
15437
|
+
COMPOSE_EDGE = 4;
|
|
15407
15438
|
CRAMPED = "adiff needs more room than this";
|
|
15408
15439
|
CRAMPED_ROWS = 4;
|
|
15409
15440
|
DIFF_CHROME_MOST = 16;
|
|
@@ -15476,8 +15507,8 @@ var init_render = __esmMin((() => {
|
|
|
15476
15507
|
};
|
|
15477
15508
|
frameRoot = (renderer) => {
|
|
15478
15509
|
renderer.root.flexDirection = "column";
|
|
15479
|
-
renderer.root.paddingLeft =
|
|
15480
|
-
renderer.root.paddingRight =
|
|
15510
|
+
renderer.root.paddingLeft = 1;
|
|
15511
|
+
renderer.root.paddingRight = 1;
|
|
15481
15512
|
renderer.root.paddingTop = 0;
|
|
15482
15513
|
renderer.root.paddingBottom = 0;
|
|
15483
15514
|
};
|
|
@@ -15839,7 +15870,6 @@ var init_render = __esmMin((() => {
|
|
|
15839
15870
|
paddingBottom: 1,
|
|
15840
15871
|
flexDirection: "column"
|
|
15841
15872
|
});
|
|
15842
|
-
clip = (label, room) => label.length > room ? `${label.slice(0, Math.max(0, room - 1))}…` : label;
|
|
15843
15873
|
clipHead = (label, room) => label.length > room ? `…${label.slice(label.length - Math.max(0, room - 1))}` : label;
|
|
15844
15874
|
clipMiddle = (label, room) => {
|
|
15845
15875
|
if (label.length <= room) return label;
|
|
@@ -16063,10 +16093,12 @@ var init_render = __esmMin((() => {
|
|
|
16063
16093
|
return titlePaint(state, row.index);
|
|
16064
16094
|
};
|
|
16065
16095
|
PANEL_TITLES = {
|
|
16096
|
+
asked: "Waiting on you",
|
|
16066
16097
|
with: "With the agent",
|
|
16067
|
-
answered: "Answered"
|
|
16098
|
+
answered: "Answered, not settled",
|
|
16099
|
+
settled: "Settled"
|
|
16068
16100
|
};
|
|
16069
|
-
PANEL_ORDER =
|
|
16101
|
+
PANEL_ORDER = PANEL_SECTIONS;
|
|
16070
16102
|
PANEL_LEAD = 3;
|
|
16071
16103
|
PANEL_EMPTY = "No comment on this branch yet.";
|
|
16072
16104
|
restingOrHere = (focused) => focused ? palette.selection : palette.resting;
|
|
@@ -16151,7 +16183,26 @@ var init_render = __esmMin((() => {
|
|
|
16151
16183
|
];
|
|
16152
16184
|
};
|
|
16153
16185
|
PULL_HINT = "answered, press r to pull";
|
|
16154
|
-
|
|
16186
|
+
panelWindow = (lines, rows) => {
|
|
16187
|
+
if (lines.length <= rows) return {
|
|
16188
|
+
lines,
|
|
16189
|
+
above: 0,
|
|
16190
|
+
below: 0
|
|
16191
|
+
};
|
|
16192
|
+
const room = Math.max(1, rows - 2);
|
|
16193
|
+
const at = Math.max(0, lines.findIndex((line) => line.here === true));
|
|
16194
|
+
const start = Math.max(0, Math.min(lines.length - room, at - Math.floor(room / 2)));
|
|
16195
|
+
return {
|
|
16196
|
+
lines: lines.slice(start, start + room),
|
|
16197
|
+
above: start,
|
|
16198
|
+
below: lines.length - (start + room)
|
|
16199
|
+
};
|
|
16200
|
+
};
|
|
16201
|
+
moreLine = (count, mark, room) => count === 0 ? [] : [{
|
|
16202
|
+
text: clip(` ${mark} ${count} more`, room),
|
|
16203
|
+
tone: palette.faint
|
|
16204
|
+
}];
|
|
16205
|
+
panelText = (state, room, rows) => {
|
|
16155
16206
|
const placed = panelEntries(state).map((entry, at) => ({
|
|
16156
16207
|
entry,
|
|
16157
16208
|
at
|
|
@@ -16169,7 +16220,14 @@ var init_render = __esmMin((() => {
|
|
|
16169
16220
|
text: PANEL_EMPTY,
|
|
16170
16221
|
tone: palette.muted
|
|
16171
16222
|
}] : body;
|
|
16172
|
-
|
|
16223
|
+
const window = panelWindow(lines, Math.max(1, rows - banner.length));
|
|
16224
|
+
const shown = [
|
|
16225
|
+
...banner,
|
|
16226
|
+
...moreLine(window.above, "▲", room),
|
|
16227
|
+
...window.lines,
|
|
16228
|
+
...moreLine(window.below, "▼", room)
|
|
16229
|
+
];
|
|
16230
|
+
return new StyledText(shown.map((line) => {
|
|
16173
16231
|
const drawn = fg(line.tone)(`${line.text.padEnd(room)}\n`);
|
|
16174
16232
|
return line.here === true ? bg(restingOrHere(state.focus === "review"))(drawn) : drawn;
|
|
16175
16233
|
}));
|
|
@@ -16410,7 +16468,7 @@ var init_render = __esmMin((() => {
|
|
|
16410
16468
|
this.paletteChoices.content = listText(matches.map((entry) => commandRow(entry, room - MODAL_ROOM)), Math.min(state.paletteIndex, Math.max(0, matches.length - 1)), paletteRoom - PALETTE_CHROME);
|
|
16411
16469
|
this.palette.height = paletteRoom;
|
|
16412
16470
|
this.palette.width = room;
|
|
16413
|
-
this.palette.left = Math.max(
|
|
16471
|
+
this.palette.left = Math.max(1, Math.floor((this.renderer.width - room) / 2));
|
|
16414
16472
|
this.palette.top = panelTop(this.renderer.height, PANEL_QUARTER);
|
|
16415
16473
|
}
|
|
16416
16474
|
paintKeys(state) {
|
|
@@ -16422,12 +16480,13 @@ var init_render = __esmMin((() => {
|
|
|
16422
16480
|
}
|
|
16423
16481
|
const rows = keyMatches(state);
|
|
16424
16482
|
const room = panelWidth(this.renderer.width);
|
|
16425
|
-
this.keysTitle.content = rows.length === 0 ? "No key matches" : `Keys here, ${rows.length} of them`;
|
|
16426
16483
|
const keysRoom = Math.min(panelRows(this.renderer.height, PANEL_QUARTER), rows.length + PENDING_CHROME);
|
|
16427
|
-
|
|
16484
|
+
const shown = Math.max(1, keysRoom - PENDING_CHROME);
|
|
16485
|
+
this.keysTitle.content = keysTitle(rows.length, shown);
|
|
16486
|
+
this.keysChoices.content = listText(rows.map((entry) => commandRow(entry, room - MODAL_ROOM)), Math.min(state.paletteIndex, Math.max(0, rows.length - 1)), shown);
|
|
16428
16487
|
this.keys.height = keysRoom;
|
|
16429
16488
|
this.keys.width = room;
|
|
16430
|
-
this.keys.left = Math.max(
|
|
16489
|
+
this.keys.left = Math.max(1, Math.floor((this.renderer.width - room) / 2));
|
|
16431
16490
|
this.keys.top = panelTop(this.renderer.height, PANEL_QUARTER);
|
|
16432
16491
|
}
|
|
16433
16492
|
headerText(state) {
|
|
@@ -16476,7 +16535,8 @@ var init_render = __esmMin((() => {
|
|
|
16476
16535
|
this.panelPane.width = shown ? reviewWidth() : 0;
|
|
16477
16536
|
this.panelPane.paddingLeft = shown ? 1 : 0;
|
|
16478
16537
|
this.panelPane.paddingTop = 0;
|
|
16479
|
-
|
|
16538
|
+
const rows = Math.max(1, this.panelPane.height - PANE_EDGES);
|
|
16539
|
+
this.panel.content = shown ? panelText(state, reviewWidth() - PANE_CHROME, rows) : "";
|
|
16480
16540
|
}
|
|
16481
16541
|
listText(state) {
|
|
16482
16542
|
if (atHome(state)) return this.branchTable(state);
|
|
@@ -16720,7 +16780,7 @@ var init_render = __esmMin((() => {
|
|
|
16720
16780
|
this.foundPeek.height = 0;
|
|
16721
16781
|
this.found.height = Math.min(most, Math.max(FOUND_LEAST, window.rows) + PALETTE_CHROME);
|
|
16722
16782
|
this.found.width = room;
|
|
16723
|
-
this.found.left = Math.max(
|
|
16783
|
+
this.found.left = Math.max(1, Math.floor((this.renderer.width - room) / 2));
|
|
16724
16784
|
this.found.top = panelTop(this.renderer.height, PANEL_FIFTH);
|
|
16725
16785
|
}
|
|
16726
16786
|
paintReport(state) {
|
|
@@ -16732,11 +16792,12 @@ var init_render = __esmMin((() => {
|
|
|
16732
16792
|
this.composeTitle.content = "Report a bug";
|
|
16733
16793
|
this.composeQuoted.content = lead.join("\n");
|
|
16734
16794
|
this.composeQuoted.height = lead.length;
|
|
16735
|
-
const
|
|
16795
|
+
const spare = this.renderer.height - lead.length - COMPOSE_ACTION_ROWS - COMPOSE_CHROME - COMPOSE_EDGE;
|
|
16796
|
+
const written = this.fitBody(state, room.text, Math.max(1, spare));
|
|
16736
16797
|
this.composeActions.content = reportActions(state.reportFull);
|
|
16737
16798
|
this.compose.height = lead.length + written + COMPOSE_ACTION_ROWS + COMPOSE_CHROME;
|
|
16738
16799
|
this.compose.width = room.box;
|
|
16739
|
-
this.compose.left = Math.max(
|
|
16800
|
+
this.compose.left = Math.max(1, Math.floor((this.renderer.width - room.box) / 2));
|
|
16740
16801
|
this.compose.top = Math.max(2, Math.floor(this.renderer.height / 4));
|
|
16741
16802
|
}
|
|
16742
16803
|
paintGutter(state, top, height) {
|
|
@@ -16775,9 +16836,10 @@ var init_render = __esmMin((() => {
|
|
|
16775
16836
|
});
|
|
16776
16837
|
};
|
|
16777
16838
|
}
|
|
16778
|
-
fitBody(state, room) {
|
|
16839
|
+
fitBody(state, room, most) {
|
|
16779
16840
|
if (this.composeBody.width !== room) this.composeBody.width = room;
|
|
16780
|
-
const
|
|
16841
|
+
const wanted = Math.max(1, laidDraft(state.draft, room).length);
|
|
16842
|
+
const rows = Math.max(1, Math.min(most, wanted));
|
|
16781
16843
|
if (this.composeBody.height !== rows) this.composeBody.height = rows;
|
|
16782
16844
|
return rows;
|
|
16783
16845
|
}
|
|
@@ -16785,19 +16847,21 @@ var init_render = __esmMin((() => {
|
|
|
16785
16847
|
this.compose.visible = state.screen === "compose";
|
|
16786
16848
|
if (state.screen !== "compose") return;
|
|
16787
16849
|
const room = composeRoom(this.renderer.width);
|
|
16788
|
-
const
|
|
16850
|
+
const shownLines = Math.max(1, Math.min(SNIPPET_LINES, Math.floor(this.renderer.height / 6)));
|
|
16851
|
+
const snippet = snippetOf(state, shownLines);
|
|
16789
16852
|
const more = selectedLineCount(state) - snippet.length;
|
|
16790
16853
|
const tail = more > 0 ? [` … ${more} more lines`] : [];
|
|
16791
16854
|
const quoted = [...snippet, ...tail].map((line) => clip(line, room.text));
|
|
16792
16855
|
this.composeTitle.content = clip(composeTarget(state), room.text);
|
|
16793
16856
|
this.composeQuoted.content = [...quoted, ""].join("\n");
|
|
16794
16857
|
this.composeQuoted.height = quoted.length + 1;
|
|
16795
|
-
const
|
|
16858
|
+
const spare = this.renderer.height - quoted.length - 1 - COMPOSE_ACTION_ROWS - COMPOSE_CHROME - COMPOSE_EDGE;
|
|
16859
|
+
const written = this.fitBody(state, room.text, Math.max(1, spare));
|
|
16796
16860
|
this.composeActions.content = actionsText();
|
|
16797
16861
|
const height = quoted.length + 1 + written + COMPOSE_ACTION_ROWS + COMPOSE_CHROME;
|
|
16798
16862
|
this.compose.height = height;
|
|
16799
16863
|
this.compose.width = room.box;
|
|
16800
|
-
this.compose.left = Math.max(
|
|
16864
|
+
this.compose.left = Math.max(1, Math.floor((this.renderer.width - room.box) / 2));
|
|
16801
16865
|
this.compose.top = Math.max(2, Math.floor((this.renderer.height - height) / 2));
|
|
16802
16866
|
}
|
|
16803
16867
|
};
|
|
@@ -16943,7 +17007,10 @@ var init_upgrade = __esmMin((() => {
|
|
|
16943
17007
|
return due ? `adiff ${latest} is out · adiff upgrade` : "";
|
|
16944
17008
|
}).pipe(withSpan("Tui.upgradeHint"));
|
|
16945
17009
|
upgradeHint = worded.pipe(orElseSucceed(() => ""));
|
|
16946
|
-
}))
|
|
17010
|
+
}));
|
|
17011
|
+
//#endregion
|
|
17012
|
+
//#region src/tui/app.ts
|
|
17013
|
+
var LEAVING_MS, LOOK_MS, LEAVING_SAID, NOTHING_WRITTEN, layersAsk, askedFor, alongFrom, NOTICE_MS, KEY_HISTORY, DRAIN_PASSES, TRAIL_HISTORY, clockOf, momentOf, noticeOf, COPIERS, wayland, seedFor, handOver, throughMultiplexer, copyToClipboard, lineUnder, asKey, openedPull, LISTENS, WRITES, OVER, overReview, writesInto, listens, LETTER, laidOut, ARROWS, SHIFTED, keyName, App, sentAway, turnedOver, settledPath, restsWhereItLanded, lonelyGaps, chosenIn, settingsHeld, firstBranches, missing, openingOn, launch, told, untilDestroyed, runOn, runTui;
|
|
16947
17014
|
var init_app = __esmMin((() => {
|
|
16948
17015
|
init_dist();
|
|
16949
17016
|
init_report();
|
|
@@ -16961,6 +17028,7 @@ var init_app = __esmMin((() => {
|
|
|
16961
17028
|
init_intent();
|
|
16962
17029
|
init_session();
|
|
16963
17030
|
init_upgrade();
|
|
17031
|
+
LEAVING_MS = 3e3;
|
|
16964
17032
|
LOOK_MS = 110;
|
|
16965
17033
|
LEAVING_SAID = "press ctrl+c again to leave";
|
|
16966
17034
|
NOTHING_WRITTEN = "nothing written yet";
|
|
@@ -17958,7 +18026,7 @@ var init_app = __esmMin((() => {
|
|
|
17958
18026
|
this.commit(reduce(this.measured(), "back"));
|
|
17959
18027
|
return;
|
|
17960
18028
|
}
|
|
17961
|
-
if (this.leaving !== void 0 && Date.now() - this.leaving <
|
|
18029
|
+
if (this.leaving !== void 0 && Date.now() - this.leaving < LEAVING_MS) {
|
|
17962
18030
|
this.renderer.destroy();
|
|
17963
18031
|
return;
|
|
17964
18032
|
}
|
|
@@ -18004,13 +18072,13 @@ var init_app = __esmMin((() => {
|
|
|
18004
18072
|
this.commit(withNoticeHere(this.state, "no pull request for this branch"));
|
|
18005
18073
|
return;
|
|
18006
18074
|
}
|
|
18007
|
-
const opened = yield* (yield*
|
|
18075
|
+
const opened = yield* (yield* Forge).openPull(this.repo, branch.branch).pipe(as(true), catchTag("ForgeUnavailable", () => succeed$1(false)));
|
|
18008
18076
|
this.commit(withNoticeHere(this.state, openedPull(pullHere(this.state), opened)));
|
|
18009
18077
|
});
|
|
18010
18078
|
}
|
|
18011
18079
|
loadPulls() {
|
|
18012
18080
|
return gen({ self: this }, function* () {
|
|
18013
|
-
const answered = yield* (yield*
|
|
18081
|
+
const answered = yield* (yield* Forge).pulls(this.repo).pipe(map(some), catchTag("ForgeUnavailable", () => succeed$1(none())));
|
|
18014
18082
|
this.commit(match$3(answered, {
|
|
18015
18083
|
onNone: () => withSilentForge(this.state),
|
|
18016
18084
|
onSome: (pulls) => withPulls(this.state, Object.fromEntries(pulls.map((pull) => [pull.branch, pull.state])))
|
package/package.json
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"bin": {
|
|
24
24
|
"adiff": "./bin/adiff.js"
|
|
25
25
|
},
|
|
26
|
-
"version": "0.1.0-alpha.
|
|
26
|
+
"version": "0.1.0-alpha.112",
|
|
27
27
|
"description": "Review the work an agent left you without losing the thread: comments live on the lines, the agent answers them, and each point stays open until you settle it.",
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"repository": {
|