Skip to content

docs(runner): the resize nudge does not re-measure Handsontable (DEV-2581) - #247

Merged
demtario merged 1 commit into
masterfrom
docs/DEV-2581-correct-nudge-comment
Aug 20, 2026
Merged

docs(runner): the resize nudge does not re-measure Handsontable (DEV-2581)#247
demtario merged 1 commit into
masterfrom
docs/DEV-2581-correct-nudge-comment

Conversation

@demtario

@demtario demtario commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Comment-only. One file, no behaviour change — and the measurement it records is the reason the code was deliberately not changed.

What was wrong

head-assets.ts said the injected resize dispatch asks for a re-measure because "Handsontable's own listener calls refreshDimensions()". Measured on a live preview of 6z5k1q2bd4, it does not:

lever clone row 8 aligned with master
initial 29px (master 49px) no
synthetic resize 29px no
1px <body> padding toggle, reverted 49px yes

HT checks the root element's own size and returns when it has not changed, and a late stylesheet changes intrinsic content heights without touching the root. Visible symptom: the master table re-flows when a wrapping cell grows, the row-header clone keeps stale heights, so row numbers drift against their rows and the header row looks cramped. /d is unaffected — its head links parse before the module runs, so the grid measures with the theme already applied.

Why the code is unchanged

The perturbation that does work was proposed and declined: a layout hack in the runtime is the wrong price for one class of demo. The supported route is CSS that reaches the page through the module graph — a package import or a local stylesheet — which the bundler injects at module eval, before the grid is constructed, so nothing needs re-measuring. DEV-2578 unblocks that for PR-pinned demos (theme CSS is currently unimportable from a pkg.pr.new build) and DEV-2577 makes it the authoring contract.

So a CDN-linked stylesheet leaves stale row metrics in Tier-1 until a demo takes that route. That is now written at the code site rather than living in a chat log.

The dispatch itself stays: it is a legitimate signal for demo code that re-lays itself out on resize, and it is bounded at one plus one per stylesheet.

Verification

pnpm test 842 tests / 0 fail, pipeline/head-assets.test.mjs 37/37. The diff contains no non-comment lines (checked mechanically). Carries a Refactor-only: trailer for the presence gate, since a comment correction has no test to add.

🤖 Generated with Claude Code


Note

Cursor Bugbot is generating a summary for commit 9e72380. Configure here.

…2581)

The comment claimed "Handsontable's own listener calls refreshDimensions()". Measured
on a live preview of 6z5k1q2bd4, it does not: when a late stylesheet grows a wrapping
cell the master row goes 29px -> 49px while the row-header clone stays at 29px, and
dispatching resize leaves them desynced. HT checks the root element's own size and
returns when it has not changed, and a late stylesheet changes intrinsic content
heights without touching the root. What does work is a real layout change its
ResizeObserver can see — a 1px padding toggle on <body>, reverted, was enough.

That perturbation was proposed and declined: a layout hack in the runtime is the
wrong price for one class of demo. The comment now records the measurement, the
declined option and the supported route — CSS through the module graph, which the
bundler injects at module eval before the grid is built, so nothing needs
re-measuring. DEV-2578 unblocks that for PR-pinned demos, DEV-2577 makes it the
authoring contract.

The dispatch itself stays: it is a legitimate signal for demo code that re-lays
itself out on resize, and it is bounded at one plus one per stylesheet.

Refactor-only: comment-only correction of a false claim; no behaviour change, and the measurement it records is the reason the code was deliberately *not* changed

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@demtario
demtario merged commit 1e38af8 into master Aug 20, 2026
7 checks passed
@demtario
demtario deleted the docs/DEV-2581-correct-nudge-comment branch August 20, 2026 12:35
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