From 9e504bd579ec6f7adb1ab9979e00875ba89976c7 Mon Sep 17 00:00:00 2001 From: Phil LaFayette Date: Thu, 25 Jun 2026 20:48:53 -0500 Subject: [PATCH] Fix invisible text in composer code-block textarea The dedicated block-mode textarea (.block-textarea) rendered typed code invisible: the inline composer's "transparent-glyph + overlay" rule was written as the broad descendant selector `.input-wrap textarea` (specificity 0,1,1), which beat `.block-textarea` (0,1,0) and forced the block textarea's glyphs to `color: transparent`. Only the caret and the ember selection tint showed. Scope the overlay-transparency rules to the inline textarea via a dedicated `.inline-textarea` class (base, ::selection, ::placeholder, :focus-visible, ::-webkit-scrollbar). The block textarea now keeps its own visible `--code-block-fg`/`--text-primary` color and a normal, visible selection. The inline transparent-glyph + overlay technique (including the transparent selection that prevents the documented "doubled text" regression) is unchanged. Adds a regression test that proves the cascade outcome via element matches() against the rendered DOM: no transparent-color rule applies to the block textarea, a visible-color rule does, and the inline textarea is still targeted by a transparent-glyph rule. --- web/src/components/MessageInput.svelte | 27 ++- ...ssage-input-block-textarea-visible.spec.js | 164 ++++++++++++++++++ 2 files changed, 186 insertions(+), 5 deletions(-) create mode 100644 web/tests/message-input-block-textarea-visible.spec.js diff --git a/web/src/components/MessageInput.svelte b/web/src/components/MessageInput.svelte index db6cc74..3e44c86 100644 --- a/web/src/components/MessageInput.svelte +++ b/web/src/components/MessageInput.svelte @@ -1267,6 +1267,7 @@ {:else}{seg.text}{/if}{/each}{#if inputValue.endsWith('\n')} {/if}