Title: fix(emcn): stop wiping virtualized code viewer row measurements on content changes by waleedlatif1 · Pull Request #5649 · simstudioai/sim · GitHub
Open Graph Title: fix(emcn): stop wiping virtualized code viewer row measurements on content changes by waleedlatif1 · Pull Request #5649 · simstudioai/sim
X Title: fix(emcn): stop wiping virtualized code viewer row measurements on content changes by waleedlatif1 · Pull Request #5649 · simstudioai/sim
Description: Summary Fixes wrapped lines overlapping in the virtualized Code.Viewer (workflow editor terminal Output/Input panel) — reported in Slack with a wrapped conversationId line drawing over the row below it Root cause: the re-measure effect called virtualizer.measure() on every visibleLines identity change. TanStack Virtual's measure() wipes the size cache without re-measuring mounted rows — ResizeObserver only fires on size changes and React never re-invokes an unchanged measureElement ref — so any content change that keeps row heights (Prism finishing its lazy load right after first open, search-highlight wrapping) permanently collapsed every wrapped row to the 21px estimate The wipe now runs only when leaving wrap mode, the one transition that needs it: refs detach with wrapped heights still cached, and falling back to the fixed estimate is exactly correct for nowrap. Entering wrap re-measures as refs attach, and genuine height changes are caught by the per-row ResizeObserver, so no other trigger is needed (this also removes a redundant mount-time wipe + re-measure pass) Type of Change Bug fix Testing Reproduced deterministically in an isolated Playwright harness rendering Code.Viewer with virtualized + wrapText: before the fix, a height-preserving content change left rows at translateY(0/21/42…) while wrapped rows measured taller (overlap); after, every row's offset equals the cumulative measured heights. Ran a 12-scenario matrix (prism lazy-load, search set/clear, JSON collapse toggle on/off, content change both directions, width narrow/restore, wrap off/on, search after wrap cycle): original code fails 8/12 with overlap, fixed code passes 12/12 including every scenario the original passed. Typecheck (emcn + sim) and biome clean. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)
Open Graph Description: Summary Fixes wrapped lines overlapping in the virtualized Code.Viewer (workflow editor terminal Output/Input panel) — reported in Slack with a wrapped conversationId line drawing over the row bel...
X Description: Summary Fixes wrapped lines overlapping in the virtualized Code.Viewer (workflow editor terminal Output/Input panel) — reported in Slack with a wrapped conversationId line drawing over the row bel...
Opengraph URL: https://github.com/simstudioai/sim/pull/5649
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:b1df998c-6e8d-fddc-5fd8-440f6ab21410 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 8B4E:1BD5CA:B603C8:FA0F7E:6AFB52A6 |
| html-safe-nonce | f8581af1f2f97af170d2fc6217a6f3bae7936dc99988564f8bbc041163ee7482 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjRFOjFCRDVDQTpCNjAzQzg6RkEwRjdFOjZBRkI1MkE2IiwidmlzaXRvcl9pZCI6IjM5NjY2MzUyNjcyNjY5MjUyMjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f56b8371872c67bd3308aa6f3336235b5d70e4887a9cb45ec1d85883fc16f84f |
| hovercard-subject-tag | pull_request:4048474444 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/5649/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Summary Fixes wrapped lines overlapping in the virtualized Code.Viewer (workflow editor terminal Output/Input panel) — reported in Slack with a wrapped conversationId line drawing over the row bel... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7122bb414b542dba14d71a3f0b9f6fd2abce715b9f5912d082800563e6c806d1 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cbf66c024bb6d10e6955baa7413c54cf13a201bb |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width