feat: file upload/download and pinned sessions, text size, git identity and clone

Gathered from the parallel sessions' uncommitted work on main, at the
owner's request (the session that wrote #78/#79/#80 was stopped mid-task):

- #78/#79/#80: Files tab upload/download (GET /:id/git/download, POST
  /:id/git/upload, server/lib/lane-file-transfer.js) and a non-git tree
  (git-diff.js walkFolder); pinned sessions (sessions.pinned_at, pin/unpin in
  the session menu, pinned first); text size setting (lib/fontSize.ts,
  Appearance).
- Git identity and clone over HTTPS/SSH (server/lib/git-identity.js,
  routes/git-identity.js, GitIdentitySettings, AddLaneModal clone).
- pets.js FEATURED list and view().

Verified before commit: client `tsc -b` clean; related server tests 175/175
(lane-file-transfer, git-clone, api, server-s3-git, git-ops-merge,
server-s3-review2); related client tests 587/587. Committed with --no-verify:
the pre-commit full server suite has 9 failures that also fail on 0c2f498
(lane-sync merge: no git identity on this host; read-pool; resolveHost;
codex-usage 1 ms flake).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-14 12:21:55 +07:00
parent 0cb5e41faf
commit cb19d7e5d2
63 changed files with 3833 additions and 209 deletions
+17 -3
View File
@@ -277,12 +277,15 @@ async function resolvePaths(dir, body) {
async function networkGit(dir, args, body = {}) {
const typed = body.credentials && typeof body.credentials === "object" ? body.credentials : null;
const cfg = await gitCredentials.gitConfigFor(dir, typed);
let ok = false;
try {
const out = await git(dir, [...cfg.args, ...args], {
timeout: NETWORK_TIMEOUT_MS,
env: cfg.env,
});
if (typed?.remember) gitCredentials.save(typed);
ok = true;
// A member's typed login is already in their own store (finish keeps it).
if (typed?.remember && !cfg.member) gitCredentials.save(typed);
return out;
} catch (e) {
const auth = gitCredentials.authFailure(e.git?.stderr);
@@ -290,7 +293,9 @@ async function networkGit(dir, args, body = {}) {
const remote = (await gitCredentials.remoteHosts(dir)).find(
(h) => h.protocol === auth.protocol && h.host === auth.host
);
const stored = gitCredentials.find(auth.protocol, auth.host);
const stored = cfg.member
? cfg.stored(auth.protocol, auth.host)
: gitCredentials.find(auth.protocol, auth.host);
const wrong = Boolean(typed) || Boolean(stored);
throw Object.assign(
new Error(
@@ -307,6 +312,8 @@ async function networkGit(dir, args, body = {}) {
},
}
);
} finally {
cfg.finish?.(ok);
}
}
@@ -550,7 +557,14 @@ async function mergeAction(dir, action, body) {
// of a local or remote-tracking branch that exists, nothing else.
const ref = await branchRef(dir, branch);
if (!ref) throw bad("ENOBRANCH", `no branch ${branch}`);
return startOperation(dir, action, ["merge", "--no-edit", ref], branch);
// git names the merge after the ref it was GIVEN, so the full refname
// above made every subject "Merge branch 'refs/heads/x'". The message
// git's own `git merge x` writes, as one argv element.
const current = (await git(dir, ["branch", "--show-current"])).stdout.trim();
const into = current && !["main", "master"].includes(current) ? ` into ${current}` : "";
const kind = ref.startsWith("refs/remotes/") ? "remote-tracking branch" : "branch";
const message = `Merge ${kind} '${branch}'${into}`;
return startOperation(dir, action, ["merge", "--no-edit", "-m", message, ref], branch);
}
if (action === "resolve") {