Project rename: distinguishable names for duplicate projects (#1003)
* Add project rename so duplicates get distinguishable names Two checkouts of the same remote collapse into a single project record (same projectId), which left users unable to tell duplicates apart in the UI. customName lives alongside the derived displayName as an override that reconciliation never touches, so renames persist across git-remote changes. The rename UI lives in project settings. Closes #987 (rename half). * Fix COMPAT(projectCustomName) version to v0.1.76 * Update useProjects shape test for new projectCustomName key * Use sendCorrelatedSessionRequest for renameProject Match the pattern used by checkoutPrMerge and other newer RPCs instead of hand-rolling the select callback. * Use project.rename.{request,response} dotted RPC names Match the convention from docs/rpc-namespacing.md (added in 75a6f8277). Schemas, type exports, daemon client, session handler, and tests all move to the namespaced names. No back-compat shim needed since the RPC hasn't shipped.
This commit is contained in:
@@ -22,6 +22,7 @@ export interface ProjectHostEntry {
|
||||
export interface ProjectSummary {
|
||||
projectKey: string;
|
||||
projectName: string;
|
||||
projectCustomName?: string | null;
|
||||
hosts: ProjectHostEntry[];
|
||||
totalWorkspaceCount: number;
|
||||
hostCount: number;
|
||||
@@ -56,6 +57,7 @@ interface HostGroup {
|
||||
interface ProjectGroup {
|
||||
projectKey: string;
|
||||
projectName: string;
|
||||
projectCustomName: string | null;
|
||||
hostsByServerId: Map<string, HostGroup>;
|
||||
}
|
||||
|
||||
@@ -119,6 +121,7 @@ function toProjectSummary(draft: ProjectGroup): ProjectSummary {
|
||||
return {
|
||||
projectKey: draft.projectKey,
|
||||
projectName: draft.projectName,
|
||||
projectCustomName: draft.projectCustomName,
|
||||
hosts,
|
||||
totalWorkspaceCount,
|
||||
hostCount: hosts.length,
|
||||
@@ -139,9 +142,13 @@ export function buildProjects(input: BuildProjectsInput): BuildProjectsResult {
|
||||
group = {
|
||||
projectKey,
|
||||
projectName: workspace.projectDisplayName,
|
||||
projectCustomName: workspace.projectCustomName ?? null,
|
||||
hostsByServerId: new Map(),
|
||||
};
|
||||
groups.set(projectKey, group);
|
||||
} else if (workspace.projectCustomName && !group.projectCustomName) {
|
||||
group.projectCustomName = workspace.projectCustomName;
|
||||
group.projectName = workspace.projectDisplayName;
|
||||
}
|
||||
|
||||
let hostGroup = group.hostsByServerId.get(host.serverId);
|
||||
|
||||
Reference in New Issue
Block a user