feat(lanes): full-width Changes, Stage all, one-read expand-all
- The Changes panel's width control gains a full-width step (narrow → 50/50 → 70/30 → full → closed); the console beside it is hidden with CSS, never unmounted. - "Expand all folders" is one GET /api/lanes/:id/git/tree-all (one `git ls-files`, every level shaped like /git/tree) instead of one request and one git process per folder. - Overview: a Stage all button and the staged-only commit box sit above the file list and stay pinned while it scrolls; the Files finder is pinned too.
This commit is contained in:
@@ -19,6 +19,7 @@ const {
|
||||
listCommits,
|
||||
listPaths,
|
||||
listTree,
|
||||
listTreeAll,
|
||||
parseUnifiedDiff,
|
||||
readFileAt,
|
||||
} = require("../lib/git-diff");
|
||||
@@ -456,6 +457,22 @@ describe("listCommits / readFileAt / listPaths / listTree", () => {
|
||||
);
|
||||
await assert.rejects(() => listTree(LANE, { subdir: "../.." }), { code: "EBADPATH" });
|
||||
});
|
||||
|
||||
it("reads every level of the tree in one pass, grouped like listTree", async () => {
|
||||
write(LANE, "src/api/x.ts", "x\n");
|
||||
write(LANE, "src/main.ts", "m\n");
|
||||
gc(LANE, "add", "-A");
|
||||
gc(LANE, "commit", "-qm", "src");
|
||||
|
||||
const all = await listTreeAll(LANE);
|
||||
assert.equal(all.truncated, false);
|
||||
// Each level equals what the one-level read returns for it.
|
||||
for (const level of ["", "src", "src/api"]) {
|
||||
const one = await listTree(LANE, { subdir: level });
|
||||
assert.deepEqual(all.levels[level], one.entries, level);
|
||||
}
|
||||
assert.deepEqual(Object.keys(all.levels).sort(), ["", "src", "src/api"]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("runGitAction — per-file staging, discard and branches", () => {
|
||||
|
||||
Reference in New Issue
Block a user