docs(runner): the resize nudge does not re-measure Handsontable (DEV-2581) - #247
Merged
Merged
Conversation
…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>
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.
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.tssaid the injectedresizedispatch asks for a re-measure because "Handsontable's own listener callsrefreshDimensions()". Measured on a live preview of6z5k1q2bd4, it does not:resize<body>padding toggle, revertedHT 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.
/dis 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
importor 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 test842 tests / 0 fail,pipeline/head-assets.test.mjs37/37. The diff contains no non-comment lines (checked mechanically). Carries aRefactor-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.