mirror of
https://gitee.com/zhangsken/opencode.git
synced 2026-10-16 10:30:01 +08:00
feat(core): order projects by recent activity (#50790)
This commit is contained in:
@@ -93,7 +93,7 @@ describe("normalizeProviderList", () => {
|
||||
|
||||
describe("normalizeProjectInfo", () => {
|
||||
test("keeps the project VCS backend", () => {
|
||||
const project = { id: "prj", canonical: "/repo", time: { created: 1, updated: 1 }, sandboxes: [] }
|
||||
const project = { id: "prj", canonical: "/repo", time: { created: 1, updated: 1, active: 1 }, sandboxes: [] }
|
||||
expect(normalizeProjectInfo({ ...project, vcs: "git" } as Project).vcs).toBe("git")
|
||||
expect(normalizeProjectInfo({ ...project, vcs: "hg" } as Project).vcs).toBe("hg")
|
||||
expect(normalizeProjectInfo(project as Project).vcs).toBeUndefined()
|
||||
@@ -124,7 +124,7 @@ describe("updateProjectInfo", () => {
|
||||
canonical: "/repo",
|
||||
name: "Repo",
|
||||
icon: { color: "purple" },
|
||||
time: { created: 1, updated: 2 },
|
||||
time: { created: 1, updated: 2, active: 2 },
|
||||
sandboxes: ["/repo-sandbox"],
|
||||
} satisfies Project
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ test("settings project inventory reads metadata without acquiring directory stor
|
||||
name: `Project ${index}`,
|
||||
icon: { color: "orange" },
|
||||
commands: { start: "bun install" },
|
||||
time: { created: 1, updated: 1 },
|
||||
time: { created: 1, updated: 1, active: 1 },
|
||||
sandboxes: [],
|
||||
worktrees: [],
|
||||
}))
|
||||
|
||||
@@ -107,7 +107,7 @@ describe("withWorktreeInventory", () => {
|
||||
id: "project",
|
||||
canonical: "/repo",
|
||||
name: "Before",
|
||||
time: { created: 1, updated: 1 },
|
||||
time: { created: 1, updated: 1, active: 1 },
|
||||
sandboxes: [],
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user