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:
@@ -1938,6 +1938,27 @@ export class DaemonClient {
|
||||
}
|
||||
}
|
||||
|
||||
async renameProject(
|
||||
projectId: string,
|
||||
customName: string | null,
|
||||
requestId?: string,
|
||||
): Promise<{ customName: string | null }> {
|
||||
const payload = await this.sendCorrelatedSessionRequest({
|
||||
requestId,
|
||||
message: {
|
||||
type: "project.rename.request",
|
||||
projectId,
|
||||
customName,
|
||||
},
|
||||
responseType: "project.rename.response",
|
||||
timeout: 10000,
|
||||
});
|
||||
if (!payload.accepted) {
|
||||
throw new Error(payload.error ?? "renameProject rejected");
|
||||
}
|
||||
return { customName: payload.customName };
|
||||
}
|
||||
|
||||
async resumeAgent(
|
||||
handle: AgentPersistenceHandle,
|
||||
overrides?: Partial<AgentSessionConfig>,
|
||||
|
||||
Reference in New Issue
Block a user