Skip to content

fix(articles): the composer stalled on long articles, and hid its own image generator - #895

Merged
github-actions[bot] merged 1 commit into
mainfrom
fix/composer-reflow
Sep 5, 2026
Merged

fix(articles): the composer stalled on long articles, and hid its own image generator#895
github-actions[bot] merged 1 commit into
mainfrom
fix/composer-reflow

Conversation

@catomean

@catomean catomean commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Both found by writing a real 1,440-word article in it rather than testing it.

The stall

The body textarea auto-grows, and the effect did this on every keystroke:

el.style.height = 'auto';                   // invalidates layout
el.style.height = `${el.scrollHeight}px`;   // forces it to recompute

A forced synchronous reflow, twice per character, over an element whose height is the whole document by construction (overflow-hidden + auto-grow). The cost scales with article length, which is exactly why it survived this long: imperceptible at 200 words, and at ~1,400 words the tab stopped responding for tens of seconds at a time, mid-sentence.

Long-form writing is the one case this editor exists for and the one case it degraded in.

Now coalesced into a single animation frame — a burst of typing produces one measurement instead of one per character — and an unchanged height is not rewritten, since assigning the same px value still dirties layout.

The hidden generator

The cover-image button said "Suggest with AI". The picker behind it has three modes: Search, Generate (the user's own key, via ImageGeneratePanel) and Upload.

A writer read "Suggest" as stock-photo search, never opened it, and left the site to make a cover image that the picker would have generated two clicks away. Relabelled "Generate or find with AI".

The pattern

Same shape as every other finding from this dogfooding run: the capability was already built and already wired, and nothing at the point of need said so.

Typecheck and prettier clean; full verify passed via the pre-push gate.

🤖 Generated with Claude Code

… image generator

Both found by writing a real 1,440-word article in it rather than testing it.

**The stall.** The body textarea auto-grows, and the effect did this on every
keystroke:

    el.style.height = 'auto';                  // invalidates layout
    el.style.height = `${el.scrollHeight}px`;  // forces it to recompute

That is a forced synchronous reflow, twice per character, over an element whose
height IS the whole document by construction (overflow-hidden + auto-grow). The
cost scales with article length, which is why nobody hits it: imperceptible at
200 words, and at ~1,400 words the tab stopped responding for tens of seconds
at a time mid-sentence. Long-form writing is exactly the case this editor
exists for and exactly the case it degrades in.

Now coalesced into one animation frame, so a burst of typing produces one
measurement instead of one per character, and an unchanged height is not
rewritten — assigning the same px value still dirties layout.

**The hidden generator.** The cover-image button said "Suggest with AI". The
picker behind it has three modes: Search, **Generate** (the user's own key, via
ImageGeneratePanel) and Upload. A writer read "Suggest" as stock-photo search,
never opened it, and left the site to make a cover image the picker would have
generated two clicks away. Relabelled "Generate or find with AI".

Same shape as the other findings this week: the capability was already built and
wired, and nothing at the point of need said so.

Typecheck and prettier clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G2LBioUzJP4oBL9LeH9qAe
@github-actions
github-actions Bot merged commit 34e9f74 into main Sep 5, 2026
6 checks passed
@github-actions
github-actions Bot deleted the fix/composer-reflow branch September 5, 2026 16:04
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