Skip to content

ui-react: remove the dead .composer-grow CSS and retarget the typing benchmark #2597

Open

Description

@schlessera

Context

packages/ui-react/src/theme.css:611-649 still ships the stacked-grid auto-grow composer: .composer-grow, its ::after mirror and the > textarea rules. No component renders that class. The live composer is the kit Composer, which sizes itself with field-sizing: content (fieldSizing, packages/ui-kit/src/chrome/Composer.tsx:243). The composer follows soft wrap (docs/decisions/design-kit/components-and-interactions.md:820-827) records the mirror as a refused alternative.

The only remaining reference is the typing benchmark, which selects ".composer-grow textarea" (textarea, packages/ui-react/tests/render/typing-bench.tsx:112-115). That selector now matches nothing, so once the chat surface mounts, the benchmark throws composer textarea not found before it measures anything. The guard it exists for, keystroke cost growing with transcript length, is therefore off.

Guide forms/form-fields-automatically-fit-contents treats the mirror only as a fallback: "The most robust fallback for textareas uses a CSS Grid trick where a hidden pseudo-element mirrors the user's input". The composer already has its own rows fallback.

Scope

  • Delete the .composer-grow block and the comment above it (packages/ui-react/src/theme.css:611-649).
  • Retarget the benchmark at the kit composer's own textarea, textarea[data-composer] (data-composer, packages/ui-kit/src/chrome/Composer.tsx:308-309), and update its comment at typing-bench.tsx:110-111. Keep the existing disabled and value checks.

Out of scope

  • Any change to Composer or its sizing.
  • Turning the benchmark into an asserted test, or changing what it measures.
  • streaming-bench.tsx.

Acceptance criteria

  • git grep -n "composer-grow" -- packages returns nothing.
  • cd packages/ui-react && bun run tests/render/typing-bench.tsx 6 completes and prints its table. On the unchanged tree it throws composer textarea not found. Record both runs in the PR.
  • No visual baseline changes, because the removed rules matched nothing.

Verification

cd packages/ui-react && bun run tests/render/typing-bench.tsx 6
bun run test
bun run typecheck
bun run lint
bun run visual

Contract impact

  • This touches the integration contract, so it needs the contract label, a CONTRACT: commit prefix, and the doc updated in the same commit.
  • This changes a published package's behaviour, so it needs a changeset.

theme.css ships in @schlessera/brain-ui-react. The class was never documented in docs/integration-contract/, so a patch changeset is enough.

Activity

  1. added
    type: refactor
    area: ui-react
    priority: p3
    agent-ready
    on Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyarea: ui-reactpriority: p3type: refactor

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions