chat: merge caret + title into one back trigger

Caret and "chat" label were two hit targets with two hover states and
tooltips. Collapse them into a single <button id="chat-header-nav">
with one tooltip ("back to conversations") — the caret becomes a
visibility-only hint inside the button, shown when there's somewhere
to go back to, hidden on the list itself. The .navigable class
controls whether the button reads as interactive, so clicking the
label while already on the list is a cursor-default no-op.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
thandClaude Opus 4.6 committed 2026-04-15 21:33:22 +02:00
1 parent d2f7b98e6c
commit 0022f64c50
6 files changed
+52 -20

No files matched your search

+6 -6
View File
@@ -30,20 +30,20 @@ describe('Chat: flyout', () => {
expect(f.classList.contains('hidden')).toBe(true);
});
it('header-back visibility matches active view', async () => {
it('header back-caret visibility matches active view', async () => {
await ensureFlyoutClosed();
click('#chat-footer-btn');
await waitFor(() => !$('#chat-flyout').classList.contains('hidden'));
// Wait for loadConversations + initial view pick to settle.
await sleep(150);
const back = $('#chat-header-back');
const caret = $('#chat-header-back-caret');
const threadShown = !$('#chat-thread-view').classList.contains('hidden');
const listShown = !$('#chat-list-view').classList.contains('hidden');
// Exactly one of thread / list should be active here (pick view
// is only reached via the + button).
expect(threadShown || listShown).toBe(true);
if (threadShown) expect(back.classList.contains('hidden')).toBe(false);
if (listShown) expect(back.classList.contains('hidden')).toBe(true);
if (threadShown) expect(caret.classList.contains('hidden')).toBe(false);
if (listShown) expect(caret.classList.contains('hidden')).toBe(true);
await ensureFlyoutClosed();
});
@@ -57,9 +57,9 @@ describe('Chat: flyout', () => {
expect($('#chat-pick-view').classList.contains('hidden')).toBe(false);
expect($('#chat-list-view').classList.contains('hidden')).toBe(true);
expect($('#chat-thread-view').classList.contains('hidden')).toBe(true);
// Header back is only for thread view — not needed when pick has
// Back caret is only for thread view — not needed when pick has
// its own dedicated back button.
expect($('#chat-header-back').classList.contains('hidden')).toBe(true);
expect($('#chat-header-back-caret').classList.contains('hidden')).toBe(true);
click('#chat-pick-back');
await sleep(50);
expect($('#chat-pick-view').classList.contains('hidden')).toBe(true);