Add paged chat history loading

This commit is contained in:
Federico Jaramillo Martinez
2026-05-07 15:46:08 +02:00
parent 5430a44561
commit eb59f1eb00
42 changed files with 1894 additions and 333 deletions
+12 -9
View File
@@ -14,15 +14,18 @@ export class WorkspaceService {
const worktrees = await discoverGitWorktrees(project.path);
if (worktrees.length === 0) return [this.single(project)];
return worktrees.map((worktree) => ({
id: idFor(`${project.id}:${worktree.path}`),
projectId: project.id,
path: worktree.path,
label: worktree.branch || (worktree.detached ? "detached" : worktree.path.split("/").filter(Boolean).at(-1) || worktree.path),
branch: worktree.branch,
isMain: worktree.path === project.path,
isGitWorktree: true,
}));
return worktrees.map((worktree) => {
const leafName = worktree.path.split("/").filter((part) => part !== "").at(-1);
return {
id: idFor(`${project.id}:${worktree.path}`),
projectId: project.id,
path: worktree.path,
label: worktree.branch ?? (worktree.detached === true ? "detached" : leafName ?? worktree.path),
...(worktree.branch === undefined ? {} : { branch: worktree.branch }),
isMain: worktree.path === project.path,
isGitWorktree: true,
};
});
}
private single(project: Project): Workspace {