SShortSingh.
Back to feed

Cached Row Heights Go Stale in Virtualized Lists, Causing Scroll Jumps

0
·2 views

A developer's follow-up on ResizeObserver feedback loops warns that fixing the loop by measuring rows once creates a new issue: cached row heights can become outdated when content changes after measurement. Common triggers include late-loading fonts, images without fixed aspect ratios, and diff viewers that reflow lines on toggle. The resulting errors appear far from their source, such as a scrollbar jump when a user scrolls past rows whose true heights differ from the cached values. The article evaluates CSS content-visibility as a partial fix, noting it self-corrects only for rows already rendered and cannot be invalidated for offscreen rows. It proposes a two-tier cache that reconciles heights when rows enter the viewport, recomputing total height only when a previously seen value changes.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Coding agents repeat work after lost responses; an operation-key journal fix stops duplicate execution

A developer found that coding agents often redo completed work when a tool call succeeds but its response is lost, since the agent sees no reply and retries. Testing on a production endpoint showed the retried call executed a second time, producing two separate receipts for one logical operation, and recovery by key returned a not-found error. A fix shipped that binds each operation to a caller-supplied key stored in a journal, so agents look up prior outcomes before acting. Under this approach, identical retries replay the saved result, and reusing a key for different parameters is refused. The author reports that the repeat call executed zero additional times after the fix was deployed.

0
ProgrammingDEV Community ·

Rive and Exode Use 'State Machine' Differently, With Distinct Scopes and Trade-offs

The article argues that Rive and Exode both use the term 'state machine' but mean different things, which matters before choosing one. Rive's state machine is scoped to a single animated artwork, reacting to typed inputs and transitions while staying isolated from page layout and application data. Exode's state machine operates above the scene, managing application-level states like submitting or error and coordinating multiple objects and listeners. The piece weighs practical strengths: Rive has a smaller, more mature runtime, stronger character rigging, and official game engine support, while Exode offers real responsive layout, DOM semantics for accessibility, and an open JSON format.

0
ProgrammingDEV Community ·

Writing Text That Sounds Natural When Read Aloud by AI Voices

The source text matters as much as the speech model when producing AI voice output, since awkward sentences or unclear punctuation can make even high-quality voices sound robotic. Each TTS engine, such as Google Cloud TTS, Amazon Polly, or ElevenLabs, has distinct strengths and typical pitfalls that developers should understand. Punctuation acts as a rhythm guide for the voice, so commas, periods, and ellipses should be used deliberately to shape pauses and pacing. Clear pronoun references and sentence length also affect intonation, with overly long sentences best split into shorter ones. The article offers practical templates and code examples for integrating ElevenLabs into a development workflow.