diff --git a/src/frontend/app.js b/src/frontend/app.js index 9c65d1d..6e6cc71 100644 --- a/src/frontend/app.js +++ b/src/frontend/app.js @@ -1416,7 +1416,8 @@ function renderCard(s, idx) { return '' + escHtml(t) + ' ×'; }).join(''); - var html = '
'; + var cardLabel = escHtml(projName + ': ' + getSessionDisplayName(s).slice(0, 80) + ' — ' + toolLabel + ', ' + timeAgo(s.last_ts)); + var html = '
'; html += '
'; html += ''; html += renderToolBadges(s.tool, s); @@ -1519,7 +1520,8 @@ function renderListCard(s, idx) { if (isSelected) classes += ' selected'; if (isFocused) classes += ' focused'; - var html = '
'; + var listLabel = escHtml(projName + ': ' + getSessionDisplayName(s).slice(0, 80) + ' — ' + getToolLabel(s.tool, true) + ', ' + timeAgo(s.last_ts)); + var html = '
'; html += renderToolBadges(s.tool, s); if (showBadges && s.mcp_servers && s.mcp_servers.length > 0) { s.mcp_servers.forEach(function(m) { @@ -1652,6 +1654,21 @@ function onCardClick(id, event) { } } +// Session cards (.card / .list-row / .qa-item) are plain divs with nested +// interactive controls (checkbox, star, tag, launch buttons) — not real +// '; } var totalCells = startWeekday + daysInMonth; var remaining = (7 - (totalCells % 7)) % 7; for (var n = 1; n <= remaining; n++) { - html += '
' + n + '
'; + html += ''; } html += '
'; @@ -147,8 +174,7 @@ function calPreset(days) { } renderCalendar(); onDateFilter(); - var popup = document.getElementById('calendarPopup'); - if (popup) popup.classList.remove('open'); + closeCalendar(false); // the preset button stays visually in place; no need to yank focus } function updateDateBtn() { diff --git a/src/frontend/detail.js b/src/frontend/detail.js index 3fb7cd1..92d9e6e 100644 --- a/src/frontend/detail.js +++ b/src/frontend/detail.js @@ -102,6 +102,10 @@ async function openDetail(s) { panel.classList.add('open'); overlay.classList.add('open'); + // Detail is a real dialog (role="dialog" aria-modal, index.html) — trap Tab + // inside it and return focus to whatever opened it on close, same helper + // the Add Project / Projects Settings modals use. + if (typeof _installModalFocusTrap === 'function') _installModalFocusTrap(panel); // Load messages if (s.has_detail) { @@ -194,8 +198,10 @@ async function openDetail(s) { function closeDetail() { var panel = document.getElementById('detailPanel'); var overlay = document.getElementById('overlay'); - if (panel) panel.classList.remove('open'); + if (!panel || !panel.classList.contains('open')) return; // already closed — don't steal focus back a 2nd time + panel.classList.remove('open'); if (overlay) overlay.classList.remove('open'); + if (typeof _uninstallModalFocusTrap === 'function') _uninstallModalFocusTrap(); } var structuredMessageRenderers = { diff --git a/src/frontend/index.html b/src/frontend/index.html index 6d23236..b822a16 100644 --- a/src/frontend/index.html +++ b/src/frontend/index.html @@ -249,11 +249,11 @@ - -
+
-
+ @@ -292,10 +292,10 @@

Delete Session?