Skip to content

fix(desktop): size the composer from CSS instead of a per-keystroke measure - #335

Open
raymondginger2018-sudo wants to merge 1 commit into
HKUDS:mainfrom
raymondginger2018-sudo:pr/desktop-composer-size
Open

raymondginger2018-sudo wants to merge 1 commit into
HKUDS:mainfrom
raymondginger2018-sudo:pr/desktop-composer-size

Conversation

@raymondginger2018-sudo

Copy link
Copy Markdown
Contributor

Summary

The composer reset its textarea to 0px and read scrollHeight on every keystroke to grow it — a forced layout in the input path. field-sizing: content with the existing min/max-height does the same job in CSS, so the effect now only restores the caret after a dictated transcript is inserted.

Changes

  • desktop/src/features/execution/Composer.module.css — field-sizing: content on the textarea (grows with the draft; max-height: 190px still caps it).
  • desktop/src/features/execution/Composer.tsx — drop the height = "0px" / scrollHeight measurement; keep the caret-restore logic for dictated text.

Compatibility

  • Browsers without field-sizing (pre-Baseline-June-2026) keep the min-height and scroll — the graceful fallback, not a broken layout.
  • WebView2 / Chromium in the desktop app supports it.
  • No dependency, protocol, or layout-contract change.

Tests

vitest run → 63 files / 440 tests passed on Node 25.2.1 (run with NODE_OPTIONS=--no-experimental-webstorage, the separate Node 25/26 jsdom fix); tsc --noEmit and eslint . clean.

…easure

The composer reset the textarea to `0px` and read `scrollHeight` on every
keystroke to grow it — a forced layout in the input path. `field-sizing:
content` with the existing min/max-height does the same job in CSS, so the
effect now only restores the caret after a dictated transcript is inserted.

Browsers without `field-sizing` keep the min-height and scroll, which is the
graceful fallback rather than a broken layout.

Tests: `vitest run` 440 passed on Node 25.2.1 (with
`NODE_OPTIONS=--no-experimental-webstorage`, the Node 25/26 jsdom issue fixed
separately); `tsc --noEmit` and `eslint .` clean.

This branch has not been deployed

No deployments
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.

1 participant