@eliya-oss/agent-diff 0.1.0-alpha.54 → 0.1.0-alpha.56
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 +12 -0
- package/dist/main.js +307 -61
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @eliya-oss/agent-diff
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.56
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- A branch stacked on another branch shows the work it adds, not its parent's as well. The diff was always taken against the default branch, so branch B built on branch A reported A's files as B's and the reviewer walked files they had already reviewed on A. The base is now whichever local branch this one was started from, found by looking for the closest ancestor branch among the local tips, and every command that resolves a diff takes `--base <ref>` to override the guess. `branch list` reports the base and how it was chosen on each row, so a non-default base is visible rather than surprising, and the review screen says `on <branch>` beside a branch that is not on the default. `adiff base set` remembers a base for a branch and `adiff base clear` goes back to detection. A base that names no ref, or one with no shared history, fails with exit 3 and a suggestion rather than quietly falling back to the default and reporting a file count that looks right.
|
|
8
|
+
|
|
9
|
+
## 0.1.0-alpha.55
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- The review screen says which pane you are in. It was one frame around everything with rules between the panes, which drew the seams but never told you which side of them your next keystroke was going to land on — and `tab` moves between three panes where most keys mean something different. Each pane is its own bordered box now, and the one holding the focus is lit in the accent colour while the others stay dim, so exactly one border is bright at any time. `tab` also walks the panes left to right now, the way they are drawn, rather than starting in the middle and jumping to the left pane before crossing to the right; `shift+tab` walks back.
|
|
14
|
+
|
|
3
15
|
## 0.1.0-alpha.54
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/main.js
CHANGED
|
@@ -8019,7 +8019,7 @@ var init_run = __esmMin((() => {
|
|
|
8019
8019
|
}));
|
|
8020
8020
|
//#endregion
|
|
8021
8021
|
//#region src/service/git/service.ts
|
|
8022
|
-
var GREP_CONTEXT, DEFAULT_BRANCH_CANDIDATES, STAT, Git, parseStat, readEntries, baseNames, mergeBases, findDefaultBranch, defaultBranch, mergeBaseOf, toWorktree, splitLines, absent, readText, settled, listWorktrees, readDiff, readStat, readSource, readGrep, shape, GitLive;
|
|
8022
|
+
var GREP_CONTEXT, DEFAULT_BRANCH_CANDIDATES, STAT, Git, parseStat, readEntries, baseNames, mergeBases, findDefaultBranch, defaultBranch, mergeBaseOf, toWorktree, branchTips, parents, parentOf, splitLines, absent, readText, settled, listWorktrees, readDiff, readStat, readSource, readGrep, shape, GitLive;
|
|
8023
8023
|
var init_service$2 = __esmMin((() => {
|
|
8024
8024
|
init_dist();
|
|
8025
8025
|
init_error$3();
|
|
@@ -8100,6 +8100,36 @@ var init_service$2 = __esmMin((() => {
|
|
|
8100
8100
|
own
|
|
8101
8101
|
};
|
|
8102
8102
|
});
|
|
8103
|
+
branchTips = fn("Git.branchTips")(function* (repo) {
|
|
8104
|
+
const raw = yield* gitOrEmpty(repo, [
|
|
8105
|
+
"for-each-ref",
|
|
8106
|
+
"--format=%(objectname) %(refname:short)",
|
|
8107
|
+
"refs/heads"
|
|
8108
|
+
]);
|
|
8109
|
+
const tips = /* @__PURE__ */ new Map();
|
|
8110
|
+
for (const line of raw.split("\n")) {
|
|
8111
|
+
const [sha, ...rest] = line.trim().split(" ");
|
|
8112
|
+
const name = rest.join(" ");
|
|
8113
|
+
if (sha === void 0 || sha.length === 0 || name.length === 0) continue;
|
|
8114
|
+
const held = tips.get(sha);
|
|
8115
|
+
if (held === void 0) tips.set(sha, [name]);
|
|
8116
|
+
else held.push(name);
|
|
8117
|
+
}
|
|
8118
|
+
return tips;
|
|
8119
|
+
});
|
|
8120
|
+
parents = /* @__PURE__ */ new Map();
|
|
8121
|
+
parentOf = fn("Git.parentOf")(function* (repo, branch, fallback) {
|
|
8122
|
+
const own = (yield* gitOrEmpty(repo, ["rev-list", `${fallback}..${branch}`])).split("\n").map((line) => line.trim()).filter((line) => line.length > 0);
|
|
8123
|
+
const tip = own[0];
|
|
8124
|
+
if (tip === void 0) return fallback;
|
|
8125
|
+
const key = `${repo} ${branch} ${tip} ${fallback}`;
|
|
8126
|
+
const known = parents.get(key);
|
|
8127
|
+
if (known !== void 0) return known;
|
|
8128
|
+
const tips = yield* branchTips(repo);
|
|
8129
|
+
const found = own.slice(1).flatMap((sha) => tips.get(sha) ?? []).find((name) => name !== branch);
|
|
8130
|
+
parents.set(key, found ?? fallback);
|
|
8131
|
+
return found ?? fallback;
|
|
8132
|
+
});
|
|
8103
8133
|
splitLines = (text) => text.split("\n");
|
|
8104
8134
|
absent = succeed(none());
|
|
8105
8135
|
readText = fn("Git.readText")(function* (absolute, path) {
|
|
@@ -8175,7 +8205,23 @@ var init_service$2 = __esmMin((() => {
|
|
|
8175
8205
|
diff: readDiff,
|
|
8176
8206
|
stat: readStat,
|
|
8177
8207
|
source: readSource,
|
|
8178
|
-
grep: readGrep
|
|
8208
|
+
grep: readGrep,
|
|
8209
|
+
defaultBranch,
|
|
8210
|
+
stackParent: (repo, branch) => defaultBranch(repo).pipe(flatMap((fallback) => parentOf(repo, branch, fallback))),
|
|
8211
|
+
resolves: fn("Git.resolves")(function* (repo, ref) {
|
|
8212
|
+
return (yield* gitOrEmpty(repo, [
|
|
8213
|
+
"rev-parse",
|
|
8214
|
+
"--verify",
|
|
8215
|
+
`${ref}^{commit}`
|
|
8216
|
+
])).trim().length > 0;
|
|
8217
|
+
}),
|
|
8218
|
+
sharedWith: fn("Git.sharedWith")(function* (repo, branch, ref) {
|
|
8219
|
+
return (yield* gitOrEmpty(repo, [
|
|
8220
|
+
"merge-base",
|
|
8221
|
+
branch,
|
|
8222
|
+
ref
|
|
8223
|
+
])).trim();
|
|
8224
|
+
})
|
|
8179
8225
|
};
|
|
8180
8226
|
GitLive = succeed$1(Git)(shape);
|
|
8181
8227
|
}));
|
|
@@ -8247,7 +8293,8 @@ var init_model$2 = __esmMin((() => {
|
|
|
8247
8293
|
consumed: 0,
|
|
8248
8294
|
pending: [],
|
|
8249
8295
|
settled: {},
|
|
8250
|
-
removed: {}
|
|
8296
|
+
removed: {},
|
|
8297
|
+
base: ""
|
|
8251
8298
|
};
|
|
8252
8299
|
}));
|
|
8253
8300
|
//#endregion
|
|
@@ -8287,7 +8334,8 @@ var init_schema = __esmMin((() => {
|
|
|
8287
8334
|
consumed: optionalKey(Int),
|
|
8288
8335
|
pending: optionalKey(ArraySchema(StoredComment)),
|
|
8289
8336
|
settled: optionalKey(Record(String$1, String$1)),
|
|
8290
|
-
removed: optionalKey(Record(String$1, String$1))
|
|
8337
|
+
removed: optionalKey(Record(String$1, String$1)),
|
|
8338
|
+
base: optionalKey(String$1)
|
|
8291
8339
|
});
|
|
8292
8340
|
Settings = Struct({ wrap: optionalKey(Boolean) });
|
|
8293
8341
|
UpgradeCheck = Struct({
|
|
@@ -8675,10 +8723,11 @@ var init_store = __esmMin((() => {
|
|
|
8675
8723
|
}));
|
|
8676
8724
|
//#endregion
|
|
8677
8725
|
//#region src/cli/error.ts
|
|
8678
|
-
var UnknownBranch, UnknownFile, UnknownComment, UnselectableRange, UnknownCommand, MissingOption, EmptyReview, UnknownWorktree, MalformedLayers, NoLayers, InitUnwritable;
|
|
8726
|
+
var UnknownBranch, UnknownBase, UnknownFile, UnknownComment, UnselectableRange, UnknownCommand, MissingOption, EmptyReview, UnknownWorktree, MalformedLayers, NoLayers, InitUnwritable;
|
|
8679
8727
|
var init_error$1 = __esmMin((() => {
|
|
8680
8728
|
init_dist();
|
|
8681
8729
|
UnknownBranch = class extends TaggedError("UnknownBranch") {};
|
|
8730
|
+
UnknownBase = class extends TaggedError("UnknownBase") {};
|
|
8682
8731
|
UnknownFile = class extends TaggedError("UnknownFile") {};
|
|
8683
8732
|
UnknownComment = class extends TaggedError("UnknownComment") {};
|
|
8684
8733
|
UnselectableRange = class extends TaggedError("UnselectableRange") {};
|
|
@@ -8692,7 +8741,7 @@ var init_error$1 = __esmMin((() => {
|
|
|
8692
8741
|
}));
|
|
8693
8742
|
//#endregion
|
|
8694
8743
|
//#region src/cli/commands.ts
|
|
8695
|
-
var CONTEXT, WHOLE_FILE$1, POLL, findBranch, patchesOf, findPatch, rowsCovering, waitingOn, listBranches, blobOf, toggleVouch, reviewProgress, anchorRequest, stageComment, editStaged, dropStaged, listPending, bodyOf, sentOf, listSent, submitReview, submitComment, listPatches, flatten, takeComments, repoOf$1, worktreeOf$1, branchAt, awaitComments, saveReport, fileSource, saveWrap;
|
|
8744
|
+
var CONTEXT, WHOLE_FILE$1, POLL, AUTO, askedFor, basedOn, worktreeNamed, findBranch, baseFor, patchesOf, findPatch, rowsCovering, waitingOn, listBranches, blobOf, toggleVouch, reviewProgress, anchorRequest, stageComment, editStaged, dropStaged, listPending, bodyOf, sentOf, listSent, submitReview, submitComment, listPatches, flatten, takeComments, repoOf$1, worktreeOf$1, branchAt, awaitComments, saveReport, fileSource, saveWrap, setBase, clearBase;
|
|
8696
8745
|
var init_commands = __esmMin((() => {
|
|
8697
8746
|
init_dist();
|
|
8698
8747
|
init_patch();
|
|
@@ -8703,7 +8752,64 @@ var init_commands = __esmMin((() => {
|
|
|
8703
8752
|
CONTEXT = 3;
|
|
8704
8753
|
WHOLE_FILE$1 = 1e5;
|
|
8705
8754
|
POLL = "500 millis";
|
|
8706
|
-
|
|
8755
|
+
AUTO = "auto";
|
|
8756
|
+
askedFor = (asked, held) => {
|
|
8757
|
+
if (asked !== void 0 && asked !== AUTO) return {
|
|
8758
|
+
ref: asked,
|
|
8759
|
+
basis: "set"
|
|
8760
|
+
};
|
|
8761
|
+
if (asked === AUTO) return {
|
|
8762
|
+
ref: "",
|
|
8763
|
+
basis: "stacked"
|
|
8764
|
+
};
|
|
8765
|
+
return held.length === 0 ? {
|
|
8766
|
+
ref: "",
|
|
8767
|
+
basis: "stacked"
|
|
8768
|
+
} : {
|
|
8769
|
+
ref: held,
|
|
8770
|
+
basis: "set"
|
|
8771
|
+
};
|
|
8772
|
+
};
|
|
8773
|
+
basedOn = fn("Cli.basedOn")(function* (repo, worktree, asked) {
|
|
8774
|
+
const git = yield* Git;
|
|
8775
|
+
const held = (yield* (yield* Store).state(worktree.path)).base;
|
|
8776
|
+
const wanted = askedFor(asked, held);
|
|
8777
|
+
const fallback = yield* git.defaultBranch(repo);
|
|
8778
|
+
const guessed = wanted.ref.length === 0;
|
|
8779
|
+
const ref = guessed ? yield* git.stackParent(repo, worktree.branch) : wanted.ref;
|
|
8780
|
+
const asItWas = {
|
|
8781
|
+
worktree,
|
|
8782
|
+
base: ref,
|
|
8783
|
+
basis: "default"
|
|
8784
|
+
};
|
|
8785
|
+
if (!(yield* git.resolves(repo, ref))) {
|
|
8786
|
+
if (guessed) return asItWas;
|
|
8787
|
+
return yield* new UnknownBase({
|
|
8788
|
+
branch: worktree.branch,
|
|
8789
|
+
base: ref,
|
|
8790
|
+
reason: "missing"
|
|
8791
|
+
});
|
|
8792
|
+
}
|
|
8793
|
+
const shared = yield* git.sharedWith(repo, worktree.branch, ref);
|
|
8794
|
+
if (shared.length === 0) {
|
|
8795
|
+
if (guessed) return asItWas;
|
|
8796
|
+
return yield* new UnknownBase({
|
|
8797
|
+
branch: worktree.branch,
|
|
8798
|
+
base: ref,
|
|
8799
|
+
reason: "unrelated"
|
|
8800
|
+
});
|
|
8801
|
+
}
|
|
8802
|
+
const basis = guessed ? ref === fallback ? "default" : "stacked" : wanted.basis;
|
|
8803
|
+
return {
|
|
8804
|
+
worktree: {
|
|
8805
|
+
...worktree,
|
|
8806
|
+
base: shared.slice(0, 8)
|
|
8807
|
+
},
|
|
8808
|
+
base: ref,
|
|
8809
|
+
basis
|
|
8810
|
+
};
|
|
8811
|
+
});
|
|
8812
|
+
worktreeNamed = fn("Cli.worktreeNamed")(function* (repo, branch) {
|
|
8707
8813
|
const worktrees = yield* (yield* Git).worktrees(repo);
|
|
8708
8814
|
const found = worktrees.find((worktree) => worktree.branch === branch);
|
|
8709
8815
|
return yield* found === void 0 ? new UnknownBranch({
|
|
@@ -8712,6 +8818,12 @@ var init_commands = __esmMin((() => {
|
|
|
8712
8818
|
known: worktrees.map((w) => w.branch)
|
|
8713
8819
|
}) : succeed(found);
|
|
8714
8820
|
});
|
|
8821
|
+
findBranch = fn("Cli.findBranch")(function* (repo, branch, base) {
|
|
8822
|
+
return (yield* basedOn(repo, yield* worktreeNamed(repo, branch), base)).worktree;
|
|
8823
|
+
});
|
|
8824
|
+
baseFor = fn("Cli.baseFor")(function* (repo, branch, base) {
|
|
8825
|
+
return yield* basedOn(repo, yield* worktreeNamed(repo, branch), base);
|
|
8826
|
+
});
|
|
8715
8827
|
patchesOf = fn("Cli.patchesOf")(function* (worktree, context = CONTEXT) {
|
|
8716
8828
|
const raw = yield* (yield* Git).diff(worktree, context);
|
|
8717
8829
|
return parsePatches(raw);
|
|
@@ -8739,11 +8851,13 @@ var init_commands = __esmMin((() => {
|
|
|
8739
8851
|
})
|
|
8740
8852
|
};
|
|
8741
8853
|
});
|
|
8742
|
-
listBranches = fn("Cli.listBranches")(function* (repo) {
|
|
8854
|
+
listBranches = fn("Cli.listBranches")(function* (repo, base) {
|
|
8743
8855
|
const git = yield* Git;
|
|
8744
8856
|
const worktrees = yield* git.worktrees(repo);
|
|
8745
8857
|
const summaries = [];
|
|
8746
|
-
for (const
|
|
8858
|
+
for (const found of worktrees) {
|
|
8859
|
+
const based = yield* basedOn(repo, found, base);
|
|
8860
|
+
const worktree = based.worktree;
|
|
8747
8861
|
const stat = yield* git.stat(worktree);
|
|
8748
8862
|
const waiting = yield* waitingOn(worktree);
|
|
8749
8863
|
summaries.push({
|
|
@@ -8757,7 +8871,9 @@ var init_commands = __esmMin((() => {
|
|
|
8757
8871
|
unread: waiting.unread,
|
|
8758
8872
|
layers: waiting.layers,
|
|
8759
8873
|
stale: waiting.stale,
|
|
8760
|
-
own: worktree.own
|
|
8874
|
+
own: worktree.own,
|
|
8875
|
+
base: based.base,
|
|
8876
|
+
basis: based.basis
|
|
8761
8877
|
});
|
|
8762
8878
|
}
|
|
8763
8879
|
return summaries.filter((summary) => summary.files > 0);
|
|
@@ -8788,9 +8904,9 @@ var init_commands = __esmMin((() => {
|
|
|
8788
8904
|
total: patches.length
|
|
8789
8905
|
};
|
|
8790
8906
|
});
|
|
8791
|
-
reviewProgress = fn("Cli.reviewProgress")(function* (repo, branch) {
|
|
8907
|
+
reviewProgress = fn("Cli.reviewProgress")(function* (repo, branch, base) {
|
|
8792
8908
|
const store = yield* Store;
|
|
8793
|
-
const worktree = yield* findBranch(repo, branch);
|
|
8909
|
+
const worktree = yield* findBranch(repo, branch, base);
|
|
8794
8910
|
const patches = yield* patchesOf(worktree);
|
|
8795
8911
|
const current = yield* store.state(worktree.path);
|
|
8796
8912
|
return {
|
|
@@ -8871,7 +8987,8 @@ var init_commands = __esmMin((() => {
|
|
|
8871
8987
|
}));
|
|
8872
8988
|
});
|
|
8873
8989
|
bodyOf = (entry) => entry.body;
|
|
8874
|
-
sentOf = (comment,
|
|
8990
|
+
sentOf = (comment, reading) => {
|
|
8991
|
+
const { spoken, settled, head, shown } = reading;
|
|
8875
8992
|
const mine = spoken.filter((entry) => entry.comment === comment.id);
|
|
8876
8993
|
return {
|
|
8877
8994
|
id: comment.id,
|
|
@@ -8882,16 +8999,23 @@ var init_commands = __esmMin((() => {
|
|
|
8882
8999
|
body: comment.body,
|
|
8883
9000
|
settled: Object.hasOwn(settled, comment.id),
|
|
8884
9001
|
stale: comment.head !== head,
|
|
9002
|
+
outside: !shown.has(comment.file),
|
|
8885
9003
|
asks: mine.at(-1)?.asks === true,
|
|
8886
9004
|
answers: mine.map(bodyOf)
|
|
8887
9005
|
};
|
|
8888
9006
|
};
|
|
8889
|
-
listSent = fn("Cli.listSent")(function* (repo, branch) {
|
|
9007
|
+
listSent = fn("Cli.listSent")(function* (repo, branch, base) {
|
|
8890
9008
|
const store = yield* Store;
|
|
8891
|
-
const worktree = yield* findBranch(repo, branch);
|
|
9009
|
+
const worktree = yield* findBranch(repo, branch, base);
|
|
8892
9010
|
const spoken = yield* store.answers(worktree.path);
|
|
8893
9011
|
const current = yield* store.state(worktree.path);
|
|
8894
|
-
|
|
9012
|
+
const shown = new Set((yield* patchesOf(worktree)).map((patch) => patch.path));
|
|
9013
|
+
return flatten(yield* store.inbox(worktree.path)).filter((comment) => !Object.hasOwn(current.removed, comment.id)).map((comment) => sentOf(comment, {
|
|
9014
|
+
spoken,
|
|
9015
|
+
settled: current.settled,
|
|
9016
|
+
head: worktree.head,
|
|
9017
|
+
shown
|
|
9018
|
+
}));
|
|
8895
9019
|
});
|
|
8896
9020
|
submitReview = fn("Cli.submitReview")(function* (repo, branch, id, at) {
|
|
8897
9021
|
const store = yield* Store;
|
|
@@ -9003,6 +9127,35 @@ var init_commands = __esmMin((() => {
|
|
|
9003
9127
|
wrap
|
|
9004
9128
|
});
|
|
9005
9129
|
});
|
|
9130
|
+
setBase = fn("Cli.setBase")(function* (repo, branch, base) {
|
|
9131
|
+
const store = yield* Store;
|
|
9132
|
+
const based = yield* baseFor(repo, branch, base);
|
|
9133
|
+
const current = yield* store.state(based.worktree.path);
|
|
9134
|
+
yield* store.saveState(based.worktree.path, {
|
|
9135
|
+
...current,
|
|
9136
|
+
base
|
|
9137
|
+
});
|
|
9138
|
+
return {
|
|
9139
|
+
branch,
|
|
9140
|
+
base: based.base,
|
|
9141
|
+
basis: based.basis
|
|
9142
|
+
};
|
|
9143
|
+
});
|
|
9144
|
+
clearBase = fn("Cli.clearBase")(function* (repo, branch) {
|
|
9145
|
+
const store = yield* Store;
|
|
9146
|
+
const worktree = yield* findBranch(repo, branch);
|
|
9147
|
+
const current = yield* store.state(worktree.path);
|
|
9148
|
+
yield* store.saveState(worktree.path, {
|
|
9149
|
+
...current,
|
|
9150
|
+
base: ""
|
|
9151
|
+
});
|
|
9152
|
+
const based = yield* baseFor(repo, branch);
|
|
9153
|
+
return {
|
|
9154
|
+
branch,
|
|
9155
|
+
base: based.base,
|
|
9156
|
+
basis: based.basis
|
|
9157
|
+
};
|
|
9158
|
+
});
|
|
9006
9159
|
}));
|
|
9007
9160
|
//#endregion
|
|
9008
9161
|
//#region src/cli/init.ts
|
|
@@ -9258,7 +9411,7 @@ var init_pane = __esmMin((() => {
|
|
|
9258
9411
|
init_commands();
|
|
9259
9412
|
init_init();
|
|
9260
9413
|
init_pane();
|
|
9261
|
-
var version$1 = "0.1.0-alpha.
|
|
9414
|
+
var version$1 = "0.1.0-alpha.56";
|
|
9262
9415
|
//#endregion
|
|
9263
9416
|
//#region src/cli/upgrade.ts
|
|
9264
9417
|
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;
|
|
@@ -9762,16 +9915,18 @@ var init_layers = __esmMin((() => {
|
|
|
9762
9915
|
};
|
|
9763
9916
|
resolve$1 = (path) => realpath(path).catch(() => path);
|
|
9764
9917
|
resolveAll = (paths) => Promise.all(paths.map(resolve$1));
|
|
9765
|
-
worktreeAt = fn("Cli.worktreeAt")(function* (worktreePath) {
|
|
9918
|
+
worktreeAt = fn("Cli.worktreeAt")(function* (worktreePath, base) {
|
|
9766
9919
|
const git = yield* Git;
|
|
9767
9920
|
const asked = yield* promise(() => resolve$1(worktreePath));
|
|
9768
9921
|
const worktrees = yield* git.worktrees(asked);
|
|
9769
9922
|
const paths = worktrees.map((entry) => entry.path);
|
|
9770
9923
|
const found = worktrees[(yield* promise(() => resolveAll(paths))).indexOf(asked)];
|
|
9771
|
-
|
|
9924
|
+
if (found === void 0) return yield* new UnknownWorktree({
|
|
9772
9925
|
worktree: asked,
|
|
9773
9926
|
known: worktrees.map((entry) => entry.path)
|
|
9774
|
-
})
|
|
9927
|
+
});
|
|
9928
|
+
const repo = yield* git.repoOf(found.path);
|
|
9929
|
+
return (yield* basedOn(repo, found, base)).worktree;
|
|
9775
9930
|
});
|
|
9776
9931
|
storedLayers = fn("Cli.storedLayers")(function* (worktree) {
|
|
9777
9932
|
const store = yield* Store;
|
|
@@ -9818,7 +9973,8 @@ var init_layers = __esmMin((() => {
|
|
|
9818
9973
|
const patches = yield* patchesOf(worktree);
|
|
9819
9974
|
return {
|
|
9820
9975
|
layers: reportedLayers(patches, found.value),
|
|
9821
|
-
stale: found.value.head !== worktree.head
|
|
9976
|
+
stale: found.value.head !== worktree.head,
|
|
9977
|
+
rebased: found.value.base !== worktree.base
|
|
9822
9978
|
};
|
|
9823
9979
|
});
|
|
9824
9980
|
}));
|
|
@@ -9854,6 +10010,7 @@ var init_threads = __esmMin((() => {
|
|
|
9854
10010
|
body: comment.body,
|
|
9855
10011
|
state: stateOf$1(mine, Object.hasOwn(reading.settled, comment.id), Object.hasOwn(reading.removed, comment.id)),
|
|
9856
10012
|
stale: batch.head !== reading.head,
|
|
10013
|
+
outside: !reading.shown.has(comment.anchor.path),
|
|
9857
10014
|
answers: mine.map(spoken$1)
|
|
9858
10015
|
};
|
|
9859
10016
|
};
|
|
@@ -9872,17 +10029,19 @@ var init_threads = __esmMin((() => {
|
|
|
9872
10029
|
body: entry.body,
|
|
9873
10030
|
state: "staged",
|
|
9874
10031
|
stale: false,
|
|
10032
|
+
outside: false,
|
|
9875
10033
|
answers: []
|
|
9876
10034
|
});
|
|
9877
|
-
listThreads = fn("Cli.listThreads")(function* (repo, branch) {
|
|
10035
|
+
listThreads = fn("Cli.listThreads")(function* (repo, branch, base) {
|
|
9878
10036
|
const store = yield* Store;
|
|
9879
|
-
const worktree = yield* findBranch(repo, branch);
|
|
10037
|
+
const worktree = yield* findBranch(repo, branch, base);
|
|
9880
10038
|
const current = yield* store.state(worktree.path);
|
|
9881
10039
|
return [...threadsIn(yield* store.inbox(worktree.path), {
|
|
9882
10040
|
answers: yield* store.answers(worktree.path),
|
|
9883
10041
|
settled: current.settled,
|
|
9884
10042
|
removed: current.removed,
|
|
9885
|
-
head: worktree.head
|
|
10043
|
+
head: worktree.head,
|
|
10044
|
+
shown: new Set((yield* patchesOf(worktree)).map((patch) => patch.path))
|
|
9886
10045
|
}), ...current.pending.map(stagedOf)];
|
|
9887
10046
|
});
|
|
9888
10047
|
answerComment = fn("Cli.answerComment")(function* (request) {
|
|
@@ -9981,7 +10140,7 @@ var init_parse = __esmMin((() => {
|
|
|
9981
10140
|
}));
|
|
9982
10141
|
//#endregion
|
|
9983
10142
|
//#region src/cli/catalog.ts
|
|
9984
|
-
var worktreeOf, repoOf, branchOf, addressing, repo, opening$1, file, range, READ_A_BRANCH, WRITE_COMMENTS, ANSWER_COMMENTS, FOLLOW_UP, SET_UP, catalog, commandNames, findCommand, verbsUnder, groups, NEAR, distance, NEAR_ENOUGH, nearestCommand;
|
|
10143
|
+
var worktreeOf, repoOf, branchOf, addressing, baseOf, based, repo, opening$1, file, range, READ_A_BRANCH, WRITE_COMMENTS, ANSWER_COMMENTS, FOLLOW_UP, SET_UP, catalog, commandNames, findCommand, verbsUnder, groups, NEAR, distance, NEAR_ENOUGH, nearestCommand;
|
|
9985
10144
|
var init_catalog = __esmMin((() => {
|
|
9986
10145
|
worktreeOf = {
|
|
9987
10146
|
name: "worktree",
|
|
@@ -10006,6 +10165,13 @@ var init_catalog = __esmMin((() => {
|
|
|
10006
10165
|
repoOf,
|
|
10007
10166
|
branchOf
|
|
10008
10167
|
];
|
|
10168
|
+
baseOf = {
|
|
10169
|
+
name: "base",
|
|
10170
|
+
required: false,
|
|
10171
|
+
value: "ref",
|
|
10172
|
+
about: "Ref to diff against, instead of the one this branch is stacked on. `auto` asks for the stacked parent explicitly"
|
|
10173
|
+
};
|
|
10174
|
+
based = [...addressing, baseOf];
|
|
10009
10175
|
repo = {
|
|
10010
10176
|
name: "repo",
|
|
10011
10177
|
required: true,
|
|
@@ -10063,7 +10229,7 @@ var init_catalog = __esmMin((() => {
|
|
|
10063
10229
|
group: READ_A_BRANCH,
|
|
10064
10230
|
addresses: "repo",
|
|
10065
10231
|
safety: "read",
|
|
10066
|
-
options: [repo],
|
|
10232
|
+
options: [repo, baseOf],
|
|
10067
10233
|
dataKey: "branches",
|
|
10068
10234
|
example: "adiff branch list --repo . --fields branch,files"
|
|
10069
10235
|
},
|
|
@@ -10073,7 +10239,11 @@ var init_catalog = __esmMin((() => {
|
|
|
10073
10239
|
group: READ_A_BRANCH,
|
|
10074
10240
|
addresses: "repo",
|
|
10075
10241
|
safety: "read",
|
|
10076
|
-
options: [
|
|
10242
|
+
options: [
|
|
10243
|
+
repo,
|
|
10244
|
+
opening$1,
|
|
10245
|
+
baseOf
|
|
10246
|
+
],
|
|
10077
10247
|
dataKey: "",
|
|
10078
10248
|
example: "adiff review open --repo . --branch cdr-1"
|
|
10079
10249
|
},
|
|
@@ -10083,7 +10253,11 @@ var init_catalog = __esmMin((() => {
|
|
|
10083
10253
|
group: READ_A_BRANCH,
|
|
10084
10254
|
addresses: "repo",
|
|
10085
10255
|
safety: "read",
|
|
10086
|
-
options: [
|
|
10256
|
+
options: [
|
|
10257
|
+
repo,
|
|
10258
|
+
opening$1,
|
|
10259
|
+
baseOf
|
|
10260
|
+
],
|
|
10087
10261
|
dataKey: "pane",
|
|
10088
10262
|
example: "adiff review pane --repo ."
|
|
10089
10263
|
},
|
|
@@ -10093,17 +10267,42 @@ var init_catalog = __esmMin((() => {
|
|
|
10093
10267
|
group: READ_A_BRANCH,
|
|
10094
10268
|
addresses: "review",
|
|
10095
10269
|
safety: "write",
|
|
10096
|
-
options: [...
|
|
10270
|
+
options: [...based, file],
|
|
10097
10271
|
dataKey: "reviewed",
|
|
10098
10272
|
example: "adiff file review --worktree . --file src/api.ts"
|
|
10099
10273
|
},
|
|
10274
|
+
{
|
|
10275
|
+
name: "base set",
|
|
10276
|
+
about: "Remember the ref this branch is diffed against, so it is not retyped on every command",
|
|
10277
|
+
group: READ_A_BRANCH,
|
|
10278
|
+
addresses: "review",
|
|
10279
|
+
safety: "write",
|
|
10280
|
+
options: [...addressing, {
|
|
10281
|
+
name: "base",
|
|
10282
|
+
required: true,
|
|
10283
|
+
value: "ref",
|
|
10284
|
+
about: "Ref to diff this branch against"
|
|
10285
|
+
}],
|
|
10286
|
+
dataKey: "base",
|
|
10287
|
+
example: "adiff base set --repo . --branch cdr-2 --base cdr-1"
|
|
10288
|
+
},
|
|
10289
|
+
{
|
|
10290
|
+
name: "base clear",
|
|
10291
|
+
about: "Forget a remembered base, so the branch goes back to using the one it is stacked on",
|
|
10292
|
+
group: READ_A_BRANCH,
|
|
10293
|
+
addresses: "review",
|
|
10294
|
+
safety: "write",
|
|
10295
|
+
options: [...addressing],
|
|
10296
|
+
dataKey: "base",
|
|
10297
|
+
example: "adiff base clear --repo . --branch cdr-2"
|
|
10298
|
+
},
|
|
10100
10299
|
{
|
|
10101
10300
|
name: "review progress",
|
|
10102
10301
|
about: "Which files of a review are marked reviewed, and how many there are",
|
|
10103
10302
|
group: READ_A_BRANCH,
|
|
10104
10303
|
addresses: "review",
|
|
10105
10304
|
safety: "read",
|
|
10106
|
-
options: [...
|
|
10305
|
+
options: [...based],
|
|
10107
10306
|
dataKey: "reviewed",
|
|
10108
10307
|
example: "adiff review progress --repo . --branch cdr-1"
|
|
10109
10308
|
},
|
|
@@ -10212,7 +10411,7 @@ var init_catalog = __esmMin((() => {
|
|
|
10212
10411
|
group: ANSWER_COMMENTS,
|
|
10213
10412
|
addresses: "review",
|
|
10214
10413
|
safety: "write",
|
|
10215
|
-
options: [...
|
|
10414
|
+
options: [...based, {
|
|
10216
10415
|
name: "json",
|
|
10217
10416
|
required: true,
|
|
10218
10417
|
value: "file|-",
|
|
@@ -10227,7 +10426,7 @@ var init_catalog = __esmMin((() => {
|
|
|
10227
10426
|
group: ANSWER_COMMENTS,
|
|
10228
10427
|
addresses: "review",
|
|
10229
10428
|
safety: "read",
|
|
10230
|
-
options: [...
|
|
10429
|
+
options: [...based],
|
|
10231
10430
|
dataKey: "layers",
|
|
10232
10431
|
example: "adiff layers show --worktree . --fields layers,uncovered"
|
|
10233
10432
|
},
|
|
@@ -10410,6 +10609,11 @@ var init_report$1 = __esmMin((() => {
|
|
|
10410
10609
|
suggestion: "Run `adiff branch list` for the branches that have something to review.",
|
|
10411
10610
|
retriable: false
|
|
10412
10611
|
},
|
|
10612
|
+
UnknownBase: {
|
|
10613
|
+
exit: 3,
|
|
10614
|
+
suggestion: "--base takes a ref this repository can resolve and that shares history with the branch. Run `adiff base clear --repo . --branch <name>` to go back to picking the base automatically.",
|
|
10615
|
+
retriable: false
|
|
10616
|
+
},
|
|
10413
10617
|
UnknownFile: {
|
|
10414
10618
|
exit: 3,
|
|
10415
10619
|
suggestion: "The error lists the files this branch changed. Use one of those paths.",
|
|
@@ -10979,7 +11183,7 @@ var init_tree = __esmMin((() => {
|
|
|
10979
11183
|
return node.children.reduce((total, child) => total + filesUnder(tree, child), 0);
|
|
10980
11184
|
};
|
|
10981
11185
|
crowdedDirectories = (tree, limit) => tree.nodes.filter((node) => node.kind === "directory" && directFiles(tree, node.id) > limit).map((node) => node.path);
|
|
10982
|
-
})), nothingReviewed, initialState,
|
|
11186
|
+
})), 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, treeOf, treeRows, crowdedOf, foldersOfFile, isReviewed, treeWindow, commentsOn, hiddenLines, markedRows, carriesLine, selectedRows, snippetOf, selectedLineCount, lineOf, caretAt, drafted, WORD, wordLeft, wordRight, caretByWord, lineStart, lineEnd, caretToEdge, editedComment, composeTarget, selectedLines, KEYWORDS, NAME, longestName$1, searchTerm, matchHere, selectionReadout, WHOLE_FILE, CONTEXT_STEPS, wholeFileOff, contextToggled, layerContext, newLineAt, sourceLineAt, rowAtSourceLine, lineOnSide, commentRowsIn, threadsAtRow, stopsAtRow, threadAtStop, threadAtRow, openCommentRows, filesWithComments, answerCount, answersIn, newerOf, sectionOf, sentEntry, panelEntries, panelEntry, threadChosen, spokenSince, hunkStarts, changeAround, nextUnreviewed, reviewedCount, fileOrder, layerFile, selectionRange;
|
|
10983
11187
|
var init_model = __esmMin((() => {
|
|
10984
11188
|
init_dist();
|
|
10985
11189
|
init_patch();
|
|
@@ -11040,21 +11244,19 @@ var init_model = __esmMin((() => {
|
|
|
11040
11244
|
matchIndex: 0,
|
|
11041
11245
|
rail: "tree"
|
|
11042
11246
|
});
|
|
11043
|
-
BODY_BORDER = 2;
|
|
11044
11247
|
TREE_MAX = 34;
|
|
11045
11248
|
TREE_MIN = 18;
|
|
11046
11249
|
TREE_SHARE = .3;
|
|
11047
|
-
DIFF_MIN =
|
|
11048
|
-
|
|
11049
|
-
|
|
11050
|
-
bodyRoom = (columns) => Math.max(0, columns - 2 - BODY_BORDER);
|
|
11250
|
+
DIFF_MIN = 26;
|
|
11251
|
+
DIFF_ROOMY = 58;
|
|
11252
|
+
bodyRoom = (columns) => Math.max(0, columns - 2);
|
|
11051
11253
|
treeWidth = (columns) => {
|
|
11052
11254
|
const room = bodyRoom(columns);
|
|
11053
11255
|
const wanted = Math.min(TREE_MAX, Math.max(TREE_MIN, Math.floor(room * TREE_SHARE)));
|
|
11054
11256
|
return Math.max(0, Math.min(wanted, room - DIFF_MIN));
|
|
11055
11257
|
};
|
|
11056
|
-
reviewWidth = () =>
|
|
11057
|
-
panelFits = (state) => bodyRoom(state.columns) - treeWidth(state.columns) -
|
|
11258
|
+
reviewWidth = () => 36;
|
|
11259
|
+
panelFits = (state) => bodyRoom(state.columns) - treeWidth(state.columns) - reviewWidth() >= DIFF_ROOMY;
|
|
11058
11260
|
panelShown = (state) => state.screen !== "branches" && state.panelOpen && panelFits(state);
|
|
11059
11261
|
onLayers = (state) => state.rail === "layers" && state.layers.length > 0;
|
|
11060
11262
|
selectedLayer = (state) => state.layers[state.layerIndex];
|
|
@@ -11716,6 +11918,14 @@ var init_command = __esmMin((() => {
|
|
|
11716
11918
|
keys: ["tab"],
|
|
11717
11919
|
screens: ["review"]
|
|
11718
11920
|
}),
|
|
11921
|
+
command({
|
|
11922
|
+
action: "focus.back",
|
|
11923
|
+
title: "Switch pane, the other way",
|
|
11924
|
+
category: "General",
|
|
11925
|
+
keys: ["shift+tab"],
|
|
11926
|
+
screens: ["review"],
|
|
11927
|
+
listed: false
|
|
11928
|
+
}),
|
|
11719
11929
|
command({
|
|
11720
11930
|
action: "panel.toggle",
|
|
11721
11931
|
title: "Show or hide the review panel",
|
|
@@ -12125,7 +12335,7 @@ var init_match = __esmMin((() => {
|
|
|
12125
12335
|
}));
|
|
12126
12336
|
//#endregion
|
|
12127
12337
|
//#region src/tui/reduce.ts
|
|
12128
|
-
var clamp, lastRow, rowsIn, withCursorVisible, moveCursor, stepStop, scrolled, draggedTo, atRow, noneLeft, layerHunk, nextFileWithComments, atComment, nothingOpen, layerComment, PAN_STEP, panned, movePending, moveLayer, inRail, movePanel, layerDown,
|
|
12338
|
+
var clamp, lastRow, rowsIn, withCursorVisible, moveCursor, stepStop, scrolled, draggedTo, atRow, noneLeft, layerHunk, nextFileWithComments, atComment, nothingOpen, layerComment, PAN_STEP, panned, movePending, moveLayer, inRail, 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, offered, paletteChoice, transitions, reduce, atFile, withContext, withFull, revealsAfter, gapOpened, withPending, panBy, withSent, withArrived, withColumns, withLayers, withPulls, withSilentForge, withBranches, withSource, withVouched, restoredTo, withPatches, inserted, typed, TAB_WIDTH, SPACE_CODE, ERASED_FROM, ERASED_TO, readable, legible, pasted, backspaced, deleted, caretMoved, caretJumped, caretHomed, withDraft, paletteMoved, paletteClosed, withWaiting, withMatches, withNoticeHere, withNotice;
|
|
12129
12339
|
var init_reduce = __esmMin((() => {
|
|
12130
12340
|
init_dist();
|
|
12131
12341
|
init_patch();
|
|
@@ -12267,10 +12477,16 @@ var init_reduce = __esmMin((() => {
|
|
|
12267
12477
|
if (state.focus === "review") return movePanel(state, delta);
|
|
12268
12478
|
return stepStop(state, delta);
|
|
12269
12479
|
};
|
|
12270
|
-
|
|
12271
|
-
|
|
12272
|
-
|
|
12273
|
-
|
|
12480
|
+
PANES = [
|
|
12481
|
+
"tree",
|
|
12482
|
+
"diff",
|
|
12483
|
+
"review"
|
|
12484
|
+
];
|
|
12485
|
+
panesShown = (state) => PANES.filter((pane) => pane !== "review" || panelShown(state));
|
|
12486
|
+
focusStepped = (state, delta) => {
|
|
12487
|
+
const shown = panesShown(state);
|
|
12488
|
+
const at = shown.indexOf(state.focus);
|
|
12489
|
+
return shown[((at === -1 ? 0 : at) + delta + shown.length) % shown.length] ?? state.focus;
|
|
12274
12490
|
};
|
|
12275
12491
|
togglePanel = (state) => {
|
|
12276
12492
|
if (!state.panelOpen && !panelFits(state)) return withNotice(state, "the terminal is too narrow for the review panel");
|
|
@@ -12490,7 +12706,12 @@ var init_reduce = __esmMin((() => {
|
|
|
12490
12706
|
"compose.newline": (state) => inserted(state, "\n"),
|
|
12491
12707
|
"focus.toggle": (state) => ({
|
|
12492
12708
|
...state,
|
|
12493
|
-
focus:
|
|
12709
|
+
focus: focusStepped(state, 1),
|
|
12710
|
+
navOpen: true
|
|
12711
|
+
}),
|
|
12712
|
+
"focus.back": (state) => ({
|
|
12713
|
+
...state,
|
|
12714
|
+
focus: focusStepped(state, -1),
|
|
12494
12715
|
navOpen: true
|
|
12495
12716
|
}),
|
|
12496
12717
|
"panel.toggle": togglePanel,
|
|
@@ -13389,7 +13610,7 @@ var init_diffview = __esmMin((() => {
|
|
|
13389
13610
|
}));
|
|
13390
13611
|
//#endregion
|
|
13391
13612
|
//#region src/tui/render.ts
|
|
13392
|
-
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_INSET, BRANCH_WIDTH, BRANCH_NAME_MIN, BRANCH_TAIL, EMPTY_LIST, MODAL_MARGIN, shareOf, homeWidth, longestName, commandRow, modalWidth, panelWidth, panelTop, panelRows, composeRoom, laidOut, STICKY_MAX, pickPaint, SELECTION, CURSOR, ACCENT, GAP_PAINT, bar, makeList, makeDiffPane, makePanel, makeListParts, makeListText, makeGutter, makeScroller, makeScrim, makeScroll, makePalette, makePaletteParts, makePendingParts, 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, 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;
|
|
13613
|
+
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, STICKY_MAX, pickPaint, SELECTION, CURSOR, ACCENT, GAP_PAINT, bar, makeList, makeDiffPane, makePanel, makeListParts, makeListText, makeGutter, makeScroller, makeScrim, makeScroll, makePalette, makePaletteParts, makePendingParts, 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;
|
|
13393
13614
|
var init_render = __esmMin((() => {
|
|
13394
13615
|
init_command();
|
|
13395
13616
|
init_patch();
|
|
@@ -13425,6 +13646,7 @@ var init_render = __esmMin((() => {
|
|
|
13425
13646
|
PANEL_QUARTER = 4;
|
|
13426
13647
|
PANEL_FIFTH = 5;
|
|
13427
13648
|
PANE_CHROME = 3;
|
|
13649
|
+
PANE_EDGES = 2;
|
|
13428
13650
|
PANE_INSET = 1;
|
|
13429
13651
|
BRANCH_WIDTH = 82;
|
|
13430
13652
|
BRANCH_NAME_MIN = 12;
|
|
@@ -13491,7 +13713,6 @@ var init_render = __esmMin((() => {
|
|
|
13491
13713
|
flexDirection: "column",
|
|
13492
13714
|
minHeight: 0,
|
|
13493
13715
|
overflow: "hidden",
|
|
13494
|
-
border: ["right"],
|
|
13495
13716
|
borderColor: palette.rule
|
|
13496
13717
|
});
|
|
13497
13718
|
};
|
|
@@ -13512,7 +13733,6 @@ var init_render = __esmMin((() => {
|
|
|
13512
13733
|
flexDirection: "column",
|
|
13513
13734
|
minHeight: 0,
|
|
13514
13735
|
overflow: "hidden",
|
|
13515
|
-
border: ["left"],
|
|
13516
13736
|
borderColor: palette.rule,
|
|
13517
13737
|
visible: false
|
|
13518
13738
|
});
|
|
@@ -13840,8 +14060,10 @@ var init_render = __esmMin((() => {
|
|
|
13840
14060
|
if (branch.layers === 0) return "";
|
|
13841
14061
|
return branch.stale ? `${branch.layers} stale` : `${branch.layers} layers`;
|
|
13842
14062
|
};
|
|
14063
|
+
baseLabel = (branch) => branch.basis === "default" ? "" : `on ${branch.base}`;
|
|
13843
14064
|
stateCell = (state, branch) => [
|
|
13844
14065
|
branch.own ? "here" : "",
|
|
14066
|
+
baseLabel(branch),
|
|
13845
14067
|
state.pulls[branch.branch] ?? "",
|
|
13846
14068
|
waitingLabel(branch).trim()
|
|
13847
14069
|
].filter((part) => part.length > 0).join(" ");
|
|
@@ -14122,7 +14344,8 @@ var init_render = __esmMin((() => {
|
|
|
14122
14344
|
return this.view.room();
|
|
14123
14345
|
}
|
|
14124
14346
|
diffRows() {
|
|
14125
|
-
const
|
|
14347
|
+
const edges = this.diffPane.border === true ? PANE_EDGES : 0;
|
|
14348
|
+
const pane = this.diffPane.height - edges - this.view.pinRows();
|
|
14126
14349
|
return Math.max(1, pane > 0 ? pane : this.diffScroll.height);
|
|
14127
14350
|
}
|
|
14128
14351
|
update(state) {
|
|
@@ -14233,7 +14456,7 @@ var init_render = __esmMin((() => {
|
|
|
14233
14456
|
this.panelPane.visible = shown;
|
|
14234
14457
|
this.panelPane.width = shown ? reviewWidth() : 0;
|
|
14235
14458
|
this.panelPane.paddingLeft = shown ? 1 : 0;
|
|
14236
|
-
this.panelPane.paddingTop =
|
|
14459
|
+
this.panelPane.paddingTop = 0;
|
|
14237
14460
|
this.panel.content = shown ? panelText(state, reviewWidth() - PANE_CHROME) : "";
|
|
14238
14461
|
}
|
|
14239
14462
|
listText(state) {
|
|
@@ -14248,7 +14471,8 @@ var init_render = __esmMin((() => {
|
|
|
14248
14471
|
return new StyledText([...rows, ...more]);
|
|
14249
14472
|
}
|
|
14250
14473
|
listRoom() {
|
|
14251
|
-
|
|
14474
|
+
const edges = this.listPane.border === true ? PANE_EDGES : PANE_INSET;
|
|
14475
|
+
return Math.max(1, this.listPane.height - edges);
|
|
14252
14476
|
}
|
|
14253
14477
|
layerRail(state) {
|
|
14254
14478
|
const banner = state.layersStale ? 1 : 0;
|
|
@@ -14413,21 +14637,32 @@ var init_render = __esmMin((() => {
|
|
|
14413
14637
|
const inset = onBranches ? 0 : 1;
|
|
14414
14638
|
this.listPane.width = onBranches ? this.homeRoom(state) : this.paneRoom();
|
|
14415
14639
|
this.listPane.visible = onBranches || state.navOpen;
|
|
14416
|
-
this.listPane.border = onBranches ? [] : ["right"];
|
|
14417
14640
|
this.listPane.paddingLeft = inset;
|
|
14418
|
-
this.listPane.paddingRight =
|
|
14419
|
-
this.listPane.paddingTop =
|
|
14641
|
+
this.listPane.paddingRight = 0;
|
|
14642
|
+
this.listPane.paddingTop = 0;
|
|
14420
14643
|
this.listPane.marginRight = 0;
|
|
14421
14644
|
this.diffPane.paddingLeft = inset;
|
|
14422
14645
|
this.list.flexGrow = inset;
|
|
14646
|
+
this.paintFocus(state, onBranches);
|
|
14423
14647
|
this.paintChrome(onBranches);
|
|
14424
14648
|
}
|
|
14649
|
+
paintFocus(state, onBranches) {
|
|
14650
|
+
const lit = (held) => !onBranches && state.focus === held ? palette.accent : palette.rule;
|
|
14651
|
+
for (const pane of [
|
|
14652
|
+
this.listPane,
|
|
14653
|
+
this.diffPane,
|
|
14654
|
+
this.panelPane
|
|
14655
|
+
]) {
|
|
14656
|
+
pane.border = onBranches ? [] : true;
|
|
14657
|
+
pane.borderStyle = "rounded";
|
|
14658
|
+
}
|
|
14659
|
+
this.listPane.borderColor = onBranches ? palette.rule : lit("tree");
|
|
14660
|
+
this.diffPane.borderColor = lit("diff");
|
|
14661
|
+
this.panelPane.borderColor = lit("review");
|
|
14662
|
+
}
|
|
14425
14663
|
paintChrome(onBranches) {
|
|
14426
14664
|
const place = onBranches ? "center" : "flex-start";
|
|
14427
|
-
this.body.border =
|
|
14428
|
-
this.body.borderStyle = "rounded";
|
|
14429
|
-
this.body.borderColor = palette.rule;
|
|
14430
|
-
this.listPane.borderColor = palette.rule;
|
|
14665
|
+
this.body.border = [];
|
|
14431
14666
|
this.listPane.backgroundColor = "transparent";
|
|
14432
14667
|
this.logo.visible = onBranches;
|
|
14433
14668
|
this.landing.visible = onBranches;
|
|
@@ -14699,6 +14934,7 @@ var init_app = __esmMin((() => {
|
|
|
14699
14934
|
LISTENS = /* @__PURE__ */ new Set(["keys", "palette"]);
|
|
14700
14935
|
listens = (screen) => LISTENS.has(screen);
|
|
14701
14936
|
keyName = (key) => {
|
|
14937
|
+
if (key.shift && key.name === "tab") return "shift+tab";
|
|
14702
14938
|
const base = key.shift && key.name.length === 1 ? key.name.toUpperCase() : key.name;
|
|
14703
14939
|
return key.ctrl ? `ctrl+${base}` : base;
|
|
14704
14940
|
};
|
|
@@ -15579,9 +15815,17 @@ const answer = (options, body) => sync(() => {
|
|
|
15579
15815
|
})}\n`);
|
|
15580
15816
|
});
|
|
15581
15817
|
const branchList = fn("Main.branchList")(function* (options) {
|
|
15582
|
-
const branches = yield* listBranches(yield* required(options, "repo"));
|
|
15818
|
+
const branches = yield* listBranches(yield* required(options, "repo"), options["base"]);
|
|
15583
15819
|
yield* answer(options, { branches });
|
|
15584
15820
|
});
|
|
15821
|
+
const baseSet = fn("Main.baseSet")(function* (options) {
|
|
15822
|
+
const report = yield* setBase(yield* required(options, "repo"), yield* required(options, "branch"), yield* required(options, "base"));
|
|
15823
|
+
yield* answer(options, { base: report });
|
|
15824
|
+
});
|
|
15825
|
+
const baseClear = fn("Main.baseClear")(function* (options) {
|
|
15826
|
+
const report = yield* clearBase(yield* required(options, "repo"), yield* required(options, "branch"));
|
|
15827
|
+
yield* answer(options, { base: report });
|
|
15828
|
+
});
|
|
15585
15829
|
const commentSend = fn("Main.commentSend")(function* (options) {
|
|
15586
15830
|
const batch = yield* submitComment({
|
|
15587
15831
|
repo: yield* required(options, "repo"),
|
|
@@ -15676,7 +15920,7 @@ const fileReview = fn("Main.fileReview")(function* (options) {
|
|
|
15676
15920
|
});
|
|
15677
15921
|
});
|
|
15678
15922
|
const reviewStatus = fn("Main.reviewStatus")(function* (options) {
|
|
15679
|
-
const report = yield* reviewProgress(yield* required(options, "repo"), yield* required(options, "branch"));
|
|
15923
|
+
const report = yield* reviewProgress(yield* required(options, "repo"), yield* required(options, "branch"), options["base"]);
|
|
15680
15924
|
yield* answer(options, {
|
|
15681
15925
|
reviewed: report.vouched,
|
|
15682
15926
|
total: report.total,
|
|
@@ -15733,6 +15977,8 @@ const saidUpgrade = fn("Main.saidUpgrade")(function* (found, ran, skills) {
|
|
|
15733
15977
|
});
|
|
15734
15978
|
const routes = {
|
|
15735
15979
|
"branch list": branchList,
|
|
15980
|
+
"base set": baseSet,
|
|
15981
|
+
"base clear": baseClear,
|
|
15736
15982
|
"comment send": commentSend,
|
|
15737
15983
|
"comment stage": commentStage,
|
|
15738
15984
|
"comment edit": commentEdit,
|
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.56",
|
|
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": {
|