Keep selected projects when switching hosts (#2700)
* fix(app): preserve project selection across hosts Rendered project identity and persisted equivalence were conflated after duplicate-project handling. Keep them separate so host changes resolve selectable equivalents deterministically without resetting legacy sidebar identity. * fix(app): restore selected clone after host round trip Keep manual origin and current destination placements separately so switching back restores the chosen checkout while archive gaps preserve the active host selection. * fix(app): key status icons by project view * fix(app): preserve origin during archive gaps
This commit is contained in:
@@ -54,7 +54,7 @@ function target(input: {
|
||||
optionId: buildProjectOptionId(input.serverId, input.projectKey),
|
||||
serverId: input.serverId,
|
||||
serverName: input.serverId === "host-a" ? "Host A" : "Host B",
|
||||
projectKey: input.projectKey,
|
||||
projectViewKey: input.projectKey,
|
||||
projectName: input.projectName,
|
||||
cwd: input.cwd,
|
||||
isGit: input.isGit ?? true,
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
|
||||
function makeProject(overrides: Partial<ProjectSummary>): ProjectSummary {
|
||||
return {
|
||||
projectKey: "proj",
|
||||
viewKey: "proj",
|
||||
projectName: "Project",
|
||||
hosts: [],
|
||||
totalWorkspaceCount: 0,
|
||||
|
||||
@@ -7,14 +7,14 @@ export interface ScheduleProjectTarget {
|
||||
optionId: string;
|
||||
serverId: string;
|
||||
serverName: string;
|
||||
projectKey: string;
|
||||
projectViewKey: string;
|
||||
projectName: string;
|
||||
cwd: string;
|
||||
isGit: boolean;
|
||||
}
|
||||
|
||||
export function buildProjectOptionId(serverId: string, projectKey: string): string {
|
||||
return `${PROJECT_OPTION_PREFIX}${serverId}:${projectKey}`;
|
||||
export function buildProjectOptionId(serverId: string, projectViewKey: string): string {
|
||||
return `${PROJECT_OPTION_PREFIX}${serverId}:${projectViewKey}`;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -33,10 +33,10 @@ export function buildScheduleProjectTargets(
|
||||
continue;
|
||||
}
|
||||
targets.push({
|
||||
optionId: buildProjectOptionId(host.serverId, project.projectKey),
|
||||
optionId: buildProjectOptionId(host.serverId, project.viewKey),
|
||||
serverId: host.serverId,
|
||||
serverName: host.serverName,
|
||||
projectKey: project.projectKey,
|
||||
projectViewKey: project.viewKey,
|
||||
projectName: host.projectName,
|
||||
cwd,
|
||||
isGit: Boolean(host.gitRuntime),
|
||||
|
||||
@@ -17,7 +17,7 @@ function projectTarget(input: {
|
||||
optionId: buildProjectOptionId("host-a", input.projectKey),
|
||||
serverId: "host-a",
|
||||
serverName: "Host A",
|
||||
projectKey: input.projectKey,
|
||||
projectViewKey: input.projectKey,
|
||||
projectName: input.projectName,
|
||||
cwd: input.cwd,
|
||||
isGit: true,
|
||||
|
||||
Reference in New Issue
Block a user