diff --git a/web/PARITY.md b/web/PARITY.md index 84cf0acc..1756b990 100644 --- a/web/PARITY.md +++ b/web/PARITY.md @@ -10,20 +10,29 @@ Status legend: `todo` · `partial` (some of it works) · `done` (working + captu ### Always-visible chat row actions (2026-10-21) -Star and Chat actions are always visible in a reserved trailing column, separate -from title/path/model and the backend/activity mark. Native sibling buttons have -44px targets (48px for coarse pointers), keyboard focus rings, and no hover reveal -or opacity/layout transition. Only explicit activation opens the action menu; +Star is always visible at the top right and Chat actions at the bottom right of +a reserved trailing column that stretches with the row. The non-shrinking harness +mark precedes the title inside the native session button. Native sibling action +buttons have 44px targets (48px for coarse pointers), common ghost-button +background/border/hover/active/focus tokens, and no hover reveal or opacity/layout +transition. Only starred chats use an accented star. Session interaction feedback +belongs to the outer row, matching an ordinary row without an inner rectangle. +Only explicit activation opens the action menu; its existing Rename/Close/Reopen/Hide items and shared star API are unchanged. Menus preserve list scroll and anchor inside the viewport outside scroller clipping. `test/chat-row-actions-browser.mjs` uses actual `createChatView` with mock repo/rt, not native chats. It captures long-title/path, selected/starred, streaming, new, closed, hover, keyboard, explicit-menu and scroller-bottom states at 390/420/1100px, -plus coarse-pointer 390px. Geometry and hit-tests check non-overlap, target sizes, +plus coarse-pointer 390px. Geometry and hit-tests check top/right and bottom/right +anchoring (including taller content), left-before-title placement, non-overlap, target sizes, no hover-open/reveal, keyboard order, shared-star calls, retained selected chat, -Rename activation and exactly one thread-route dispatch. Capture manifest: -approved OpenCode temporary `chat-row-actions-captures/manifest.json` (16 PNGs). +Rename activation and exactly one route dispatch per thread/logo click. CDP-forced +normal/hover/active/hover+active/focus-visible states compare computed styles with +ordinary ghost and row buttons (selected and unselected), including coarse input; +real pointer movement, clicks and keyboard Tab/Enter separately verify behavior. +Capture manifest: approved OpenCode temporary +`chat-row-layout-followup-captures/manifest.json` (22 `topright-leftlogo-bottomright-*.png` captures). Usage-rail, composer-fit and miniatures browser regressions pass unchanged; 723 unit tests pass. Live authenticated/native-chat verification and deployment are not performed by this isolated fixture change; no parity status is promoted. diff --git a/web/chat.css b/web/chat.css index eebdc781..0f1535ef 100644 --- a/web/chat.css +++ b/web/chat.css @@ -166,7 +166,7 @@ --chat-row-control: 44px; position: relative; display: grid; - grid-template-columns: minmax(0, 1fr) 22px var(--chat-row-control); + grid-template-columns: minmax(0, 1fr) var(--chat-row-control); gap: 8px; align-items: start; cursor: pointer; @@ -189,18 +189,21 @@ text-align: left; cursor: pointer; } -.chat-session-button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; } -/* The inner session button must never take the generic button hover fill: on a - selected row it read as a darker rectangle inside the row's own padding. */ -.chat-session-button:hover { background: none; } +/* The row, not an inner rectangle, owns session hover/press/focus feedback. */ +.chat-row .chat-session-button:is(:hover, :active, :focus-visible) { background: transparent; outline: none; } +.chat-row:not(.selected):not(:hover):has(.chat-session-button:active) { background: var(--color-elevated-2); } +.chat-row:has(.chat-session-button:focus-visible) { + outline: var(--focus-ring-width) solid var(--focus-ring-color); + outline-offset: var(--focus-ring-offset); +} .chat-row .row-head { grid-column: 1; display: flex; gap: 8px; align-items: center; - flex-wrap: wrap; + flex-wrap: nowrap; } -.chat-row .row-title { min-width: 0; } +.chat-row .row-title { flex: 1 1 auto; min-width: 0; } .chat-row .row-meta { grid-column: 1; } .chat-row .chat-row-meta { overflow: hidden; @@ -211,9 +214,13 @@ /* Visible, dedicated trailing controls: no invisible hit targets, hover reveal, or overlays on the title, path, model or backend activity mark. */ .chat-row-actions { - grid-column: 3; + grid-column: 2; grid-row: 1; - display: grid; + align-self: stretch; + display: flex; + flex-direction: column; + justify-content: space-between; + min-height: calc(2 * var(--chat-row-control) + 2px); gap: 2px; } @@ -230,14 +237,10 @@ display: inline-flex; align-items: center; justify-content: center; - border-radius: var(--radius-control); - background: var(--color-surface); - color: var(--muted); font-size: 18px; line-height: 1; } -.chat-star:hover { color: var(--color-text); } -.chat-star.starred { color: var(--color-accent); } +button.chat-star.starred { color: var(--color-accent); } .chat-row .chat-menu-button { width: var(--chat-row-control); height: var(--chat-row-control); @@ -247,15 +250,12 @@ display: inline-flex; align-items: center; justify-content: center; - background: var(--color-surface); - border-radius: var(--radius-control); font-size: 18px; line-height: 1; } /* Viewport-anchored on explicit click so the list scroller cannot clip items. */ .chat-row .chat-menu-panel { position: fixed; top: auto; bottom: auto; right: auto; } .chat-menu-wrap { position: relative; } -.chat-row-actions button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; } .chat-menu-button { min-width: 30px; font-size: 15px; line-height: 1; } .chat-menu-panel { position: absolute; @@ -1188,9 +1188,6 @@ .chat-create-backend { padding: 6px 12px; border: 1px solid var(--border); color: var(--muted); } .chat-create-backend.selected { border-color: var(--accent); background: var(--tint-selected); color: var(--text); } .chat-backend-logo { - grid-column: 2; - grid-row: 1; - margin-top: 12px; display: inline-flex; align-items: center; justify-content: center; diff --git a/web/src/views/chat.js b/web/src/views/chat.js index 6102d909..0d24a06f 100644 --- a/web/src/views/chat.js +++ b/web/src/views/chat.js @@ -2109,6 +2109,7 @@ function renderChatRow(session, duplicateTitles = new Set(), home = "") { }, }); const head = h("span", { class: "row-head" }); + head.append(chatBackendLogo(session.backend, activity)); head.append(h("span", { class: "row-title chat-row-title", text: sessionTitle(session) })); // Only the status word, coloured, with no dot and no operator chip. A closed // session says so here instead of carrying a second chip. @@ -2128,11 +2129,11 @@ function renderChatRow(session, duplicateTitles = new Set(), home = "") { if (model !== "") { sessionButton.append(h("span", { class: "row-meta chat-row-model muted", text: model })); } - row.append(sessionButton, chatBackendLogo(session.backend, activity), renderChatActionsMenu(session, duplicateTitles)); + row.append(sessionButton, renderChatActionsMenu(session, duplicateTitles)); return row; } -/** Keep the fixed harness mark current without repainting the list or its rows. */ +/** Keep the harness mark current without repainting the list or its rows. */ function refreshChatRowActivity(sessionId, thread) { const row = document.querySelector(`#chatRows .chat-row[data-session="${CSS.escape(sessionId)}"]`); const icon = row?.querySelector(".chat-backend-logo"); @@ -2152,7 +2153,7 @@ function refreshChatRowActivity(sessionId, thread) { * order, the model note and the footer naming the value that will be sent. Every * server string is set with textContent. */ -/** One agent's mark on the right of its chat row. */ +/** One agent's mark immediately before its chat title. */ function chatBackendLogo(backend, activity = "idle") { const value = String(backend ?? "").trim().toLowerCase() || "opencode"; const label = chatBackendLabel(value); diff --git a/web/test/chat-row-actions-browser.mjs b/web/test/chat-row-actions-browser.mjs index 3fa61557..ab304627 100644 --- a/web/test/chat-row-actions-browser.mjs +++ b/web/test/chat-row-actions-browser.mjs @@ -14,6 +14,7 @@ const html = ` ``).join("")}
+