fix(web): give the chat composer a single focus outline (UF-043)

The composer textarea drew its own focus ring inside the rounded box, which
already turns amber on focus-within. The ring is gone; the box's border stays
the focus indicator (8.14:1 dark, 4.92:1 light against the composer).
This commit is contained in:
shumeiko.it
2026-10-26 00:32:11 +01:00
parent efcb19e682
commit ae8233b8f6
3 changed files with 16 additions and 3 deletions

View File

@@ -1698,7 +1698,8 @@ const ChatApp = ({
onChange={handleInputChange}
onKeyDown={handleKeyDown}
placeholder="Reply, or ask Waggle to take the next step…"
className="min-h-[64px] max-h-[300px] flex-1 resize-none bg-transparent py-1 text-[14.5px] text-[var(--text)] placeholder:text-[var(--text-dim)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--focus-ring)] focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--surface)]"
// The surrounding box's focus-within border is the focus indicator.
className="min-h-[64px] max-h-[300px] flex-1 resize-none bg-transparent py-1 text-[14.5px] text-[var(--text)] placeholder:text-[var(--text-dim)] focus-visible:outline-none"
rows={3}
/>
<div className="flex items-center gap-2.5 pb-0.5">

View File

@@ -1018,8 +1018,10 @@ describe('ChatApp — composer input primacy', () => {
const composer = screen.getByRole('textbox', { name: /message composer/i });
expect(composer).toHaveAttribute('name', 'message');
expect(composer).toHaveAttribute('autocomplete', 'off');
expect(composer.className).toContain('focus-visible:ring-2');
expect(composer.className).toContain('focus-visible:ring-[var(--focus-ring)]');
// One focus indicator: the surrounding box's border, not a second ring on
// the textarea inside it.
expect(composer.className).not.toContain('focus-visible:ring');
expect(composer.parentElement?.className).toContain('focus-within:border-[var(--focus-ring)]');
});
it('the textarea stays enabled even while a reply streams (isLoading)', () => {