fix(articles): the composer stalled on long articles, and hid its own image generator - #895
Merged
Merged
Conversation
… 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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
verifypassed via the pre-push gate.🤖 Generated with Claude Code