COD-130 session-row ⋯ becomes a context menu

The per-row ⋯ in the session list was a details toggle that did nothing in
the Session Manager modal (swallowed by the modal's capture-phase
close-on-click). Replace it with a real kebab context menu.

- terminal-ui.js: ⋯ now opens _openSessionRowMenu() — a body-anchored popup
  (fixed-positioned, flips/clamps to viewport, z-index above the modal) with:
  Resume/Switch-to (live→select tab, closed→resume), Open folder in the file
  browser (live sessions only — the browser is session-scoped), Copy path
  (_copyText + toast, when workingDir present), and Show details (the old
  inline prompt/path panel). Closes on outside-click / Escape / scroll / resize.
- panels-ui.js: _loadSessionManagerList scopes its modal-close to the
  .history-item-main (resume) click, so the ⋯/menu no longer closes the modal.
- styles.css: .session-row-menu + .session-row-menu-item.

Verified in Chromium on an isolated beta: ⋯ opens the menu with the modal
still open; closed rows show Resume/Copy path/Show details, live rows add
Switch-to + Open folder; Show details expands inline (modal stays open),
Copy path copies the path, Resume closes the modal, Escape closes only the
menu. Gates: tsc 0, lint 0, frontend-syntax + public-asset format clean.
This commit is contained in:
Aamer Akhter
2026-07-12 12:19:10 -04:00
parent 2235f06ea5
commit 6cac517fa6
3 changed files with 213 additions and 8 deletions
+4 -4
View File
@@ -379,10 +379,10 @@ Object.assign(CodemanApp.prototype, {
}
for (const s of sessions) {
const item = this._buildHistoryItem(s, this.cases, { showViewAll: false });
// Close the modal when an item is clicked; the underlying
// resume/select (registered on the item) still fires because this
// is a capture-phase listener that does not stop propagation.
item.addEventListener('click', () => this.closeSessionManager(), true);
// COD-130: scope the modal-close to the main (resume) row only, in the
// bubble phase. The ⋯ kebab button calls stopPropagation(), so clicking
// it (or its menu) no longer closes the Session Manager modal.
item.querySelector('.history-item-main')?.addEventListener('click', () => this.closeSessionManager());
list.appendChild(item);
}
} catch (err) {