COD-143 retain session name when resuming from the session manager

resumeHistorySession ignored the row's name and always synthesized a fresh
w<N>-<dir> name from the working dir, so resuming a custom-named session lost its
name. Thread the name through resumeHistorySession(sessionId, workingDir, name) and
extract the choice into a pure _resolveResumeName helper: prefer a non-empty existing
name, else generate the next free w<N>-<dir>. Forward s.name at all three call sites
(terminal-ui.js history-item + session-manager menu, session-ui.js run-mode history);
sessions without a name fall back to the generated name (unchanged behavior). The
unified session rows already carry name, so session-manager rows resume with it.
TDD: test/resume-name.test.ts drives the real _resolveResumeName via vm-harness.

(cherry picked from commit 56c7906a48d8b453ed55810a02ec70f72d34ed32)
This commit is contained in:
Aamer Akhter
2026-07-17 16:26:28 -04:00
parent 5792c2d62e
commit 7a86cf87f7
3 changed files with 115 additions and 15 deletions
+1 -1
View File
@@ -424,7 +424,7 @@ Object.assign(CodemanApp.prototype, {
btn.append(dirSpan, metaSpan);
btn.addEventListener('click', (e) => {
e.stopPropagation();
this.resumeHistorySession(s.sessionId, s.workingDir);
this.resumeHistorySession(s.sessionId, s.workingDir, s.name);
});
container.appendChild(btn);
}