rusackas commented on PR #41697:
URL: https://github.com/apache/superset/pull/41697#issuecomment-4895377085

   A note on the test coverage here, since the failure mode is subtle.
   
   The interesting one is `explicitly loads the editor font and re-measures 
when it resolves`: it mocks `document.fonts` with `ready` **already settled** 
and a `load()` promise that resolves later, which is exactly the state from 
@TasmiaZerin1128's recording... IBM Plex Mono loads lazily, so by the time the 
editor mounts, `fonts.ready` has long since resolved and the old code never 
re-measured. That test fails against the previous revision of this branch and 
passes now, so it's a true regression pin for the reported drift, asserting 
Ace's `renderer.updateFontSize()` (the re-measure that realigns the caret) 
fires once the font's own load resolves.
   
   The other two: `does not crash when the Font Loading API is unavailable` 
covers the CodeAnt catch above (the old optional chain threw at `.catch` when 
`document.fonts` was missing), and the `loadingdone` test pins the catch-all 
path for fonts that finish even later, plus the unmount unsubscribe so 
destroyed editors don't get re-measured.
   
   Worth saying plainly: these pin the re-measure *triggers*, not caret pixels. 
A true pixel assertion needs a real browser with a deliberately delayed font 
fetch, which is playwright territory and flaky by nature, so the confirmation 
that the drift is gone is @TasmiaZerin1128's repro on the updated branch. 🤞


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to