Skip to content

Resize Composer when its available width changes - #31

Merged
WaylandYang merged 2 commits into
deeplethe:devfrom
Maya-Kid:codex/fix-composer-resize
Oct 15, 2026
Merged

WaylandYang merged 2 commits into
deeplethe:devfrom
Maya-Kid:codex/fix-composer-resize

Conversation

@Maya-Kid

Copy link
Copy Markdown
Contributor

Why

Composer only measured its textarea after text changed. Narrowing its parent could wrap an existing one-line draft into three lines while leaving the textarea 32px tall; typing another character was required to reveal the draft at its intended height.

What changes

Observe the textarea's available width and run its existing sizing logic when that width changes, including changes caused by panels or attachments. Ignore height-only observer notifications to avoid resize feedback and disconnect the observer on unmount. Existing text-change sizing and the maximum height remain unchanged.

How it was checked

  • Fresh npm ci, npm run docs, npm run typecheck, and npm run build pass on Node 26.3.0.
  • Chrome 155: complete /dev/examples reports 389/389 mounted and 0 failed in each theme, without page errors.
  • In both themes, changing a parent from 900px to 300px grows the unchanged draft from 32px to 80px; widening it restores 32px.
  • Adding a tag also recomputes wrapping without changing the draft. A long draft stays capped at 200px with internal scrolling; unmounting/remounting and resizing still work without observer errors.
  • Visually inspected the narrow, wrapped Composer with attachments in both themes.

Before review

  • Every commit is signed off (git commit -s)
  • npm run typecheck and npm run build pass
  • /dev/examples reports 0 failed
  • What the change touches was looked at in both themes, open states included
  • A component of Solid Glass's own has its example in src/examples/ and its page in content/solid/

Maya-Kid and others added 2 commits October 15, 2026 18:45
@WaylandYang
WaylandYang merged commit e867a7a into deeplethe:dev Oct 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants