René's URL Explorer Experiment


Title: perf(workflow): scope resize CSS-var writes to the container, not :root by waleedlatif1 · Pull Request #5738 · simstudioai/sim · GitHub

Open Graph Title: perf(workflow): scope resize CSS-var writes to the container, not :root by waleedlatif1 · Pull Request #5738 · simstudioai/sim

X Title: perf(workflow): scope resize CSS-var writes to the container, not :root by waleedlatif1 · Pull Request #5738 · simstudioai/sim

Description: Summary Resizing the editor panel, terminal, output panel, and sidebar on the workflow canvas was still laggy on real workflows even after the drag handles stopped re-rendering React per frame (#5730). A Chrome DevTools CPU/tracing capture showed the remaining cost is style recalculation, not JS or layout: ~3.9s of Document::recalcStyle over a 50-move panel drag. Root cause: each drag frame wrote its CSS variable to document.documentElement. On a large document (~42k elements) any inline custom-property write on the root recalculates style for the whole tree — measured at ~77ms per write, independent of what reads the variable (an unused --zzz var costs the same 77ms). Writing the same variable to the element that consumes it recalcs only that subtree (~0.5ms — a ~150x reduction). Fix: useDragResize now writes the variable to a caller-provided target element during the drag and reconciles to :root once on release (so on-demand readers, the pre-hydration blocking script, and rehydration are all unchanged). panel → .panel-container, terminal → .terminal-container, output panel → .terminal-container (both the panel and logs column inherit it), sidebar → .sidebar-shell-outer. The terminal's expanded-threshold sync writes store state directly instead of setTerminalHeight so it no longer touches :root mid-drag (that was a ~77ms hitch right at the collapse threshold). Measured (near-empty canvas, 50-move drag, CDP trace + rAF frame timing) Handle Before After Panel style+layout 3891ms 56ms Panel frame p95 / max 91.6 / 108ms 8.4 / 8.8ms Panel main-thread blocking 4566ms 0ms Terminal recalcStyle 3899ms 16ms Terminal blocking 5558ms 0ms Sidebar recalc ~77ms/frame ~1ms/frame Frames drop from ~11fps (91ms) to a solid 120fps (8.3ms) with zero long-tasks. Type of Change Performance improvement Testing Verified with Playwright + CDP against a live dev workflow: all four handles engage, drive their element's width/height live during the drag (scoped inline var), commit the final value to :root + the store on release, remove the scoped override (reconciled), and persist. Before/after CPU profiles and traces captured for each handle. 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 Resizing the editor panel, terminal, output panel, and sidebar on the workflow canvas was still laggy on real workflows even after the drag handles stopped re-rendering React per frame (#5...

X Description: Summary Resizing the editor panel, terminal, output panel, and sidebar on the workflow canvas was still laggy on real workflows even after the drag handles stopped re-rendering React per frame (#5...

Opengraph URL: https://github.com/simstudioai/sim/pull/5738

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:d45c203b-11bd-c810-78b7-beb61c7cb8ce
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idC720:1B3B59:29F8543:3A3A266:6A632B58
html-safe-nonce3d13c24a94534fed7bd2de42961a4eccf334b05443d9ace5f7b04f11b81eecdf
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzIwOjFCM0I1OToyOUY4NTQzOjNBM0EyNjY6NkE2MzJCNTgiLCJ2aXNpdG9yX2lkIjoiMjUxOTA0OTUwODMwOTExNzc4NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac412dd9eebd86a876a93f780df43333085cc0426bf472688df128506582f4e91b
hovercard-subject-tagpull_request:4078898077
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/5738/files
twitter:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
og:image:altSummary Resizing the editor panel, terminal, output panel, and sidebar on the workflow canvas was still laggy on real workflows even after the drag handles stopped re-rendering React per frame (#5...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None30c644d502bce6cd2e59f9000b4744f2b64819abea8e8f959b18e3ad793125aa
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release331492a48ebd91d66ef2de38e1901bb911c9fe9b
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/5738/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F5738%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F5738%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/5738/files
Reloadhttps://github.com/simstudioai/sim/pull/5738/files
Reloadhttps://github.com/simstudioai/sim/pull/5738/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5738/files
simstudioai https://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Notifications https://github.com/login?return_to=%2Fsimstudioai%2Fsim
Fork 3.7k https://github.com/login?return_to=%2Fsimstudioai%2Fsim
Star 29.2k https://github.com/login?return_to=%2Fsimstudioai%2Fsim
Code https://github.com/simstudioai/sim
Issues 111 https://github.com/simstudioai/sim/issues
Pull requests 120 https://github.com/simstudioai/sim/pulls
Actions https://github.com/simstudioai/sim/actions
Projects https://github.com/simstudioai/sim/projects
Security and quality 0 https://github.com/simstudioai/sim/security
Insights https://github.com/simstudioai/sim/pulse
Code https://github.com/simstudioai/sim
Issues https://github.com/simstudioai/sim/issues
Pull requests https://github.com/simstudioai/sim/pulls
Actions https://github.com/simstudioai/sim/actions
Projects https://github.com/simstudioai/sim/projects
Security and quality https://github.com/simstudioai/sim/security
Insights https://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
waleedlatif1https://github.com/waleedlatif1
staginghttps://github.com/simstudioai/sim/tree/staging
canvas-resize-perfhttps://github.com/simstudioai/sim/tree/canvas-resize-perf
Conversation 28 https://github.com/simstudioai/sim/pull/5738
Commits 5 https://github.com/simstudioai/sim/pull/5738/commits
Checks 19 https://github.com/simstudioai/sim/pull/5738/checks
Files changed https://github.com/simstudioai/sim/pull/5738/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5738/files
perf(workflow): scope resize CSS-var writes to the container, not :root https://github.com/simstudioai/sim/pull/5738/files#top
Show all changes 5 commits https://github.com/simstudioai/sim/pull/5738/files
67420f4 perf(workflow): scope resize CSS-var writes to the container, not :root waleedlatif1 Jul 17, 2026 https://github.com/simstudioai/sim/pull/5738/commits/67420f45d4275d8ff19ecd46797c9a5802f58587
4b86960 perf(workflow): keep float boundary-sync live during scoped resize drags waleedlatif1 Jul 17, 2026 https://github.com/simstudioai/sim/pull/5738/commits/4b869607d4299efdc211e784d1f7d08d94002122
d7579ed fix(workflow): finalize drag on unmount + clamp reads scoped output w… waleedlatif1 Jul 17, 2026 https://github.com/simstudioai/sim/pull/5738/commits/d7579edb512c83995b7f8a1c5d11e063ce7611b5
558ea27 fix(workflow): robust drag finalize — last-applied value, sidebar unm… waleedlatif1 Jul 17, 2026 https://github.com/simstudioai/sim/pull/5738/commits/558ea274f5907485c13f5022bd99036b3256b2f0
4a8b2b9 fix(workflow): sidebar flick-safety + clamp reads committed :root width waleedlatif1 Jul 17, 2026 https://github.com/simstudioai/sim/pull/5738/commits/4a8b2b98c23103b47a8e932025d193a482644294
Clear filters https://github.com/simstudioai/sim/pull/5738/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5738/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5738/files
use-panel-resize.ts https://github.com/simstudioai/sim/pull/5738/files#diff-11895d710b76e2f1e60778b49a06b6bc08c19a9665d337489a51d2b5e6392a69
use-output-panel-resize.ts https://github.com/simstudioai/sim/pull/5738/files#diff-ce1b7c0be2bd39052c56b35979b836baa9f5623847ba041d7f3ca44e2d023074
use-terminal-resize.ts https://github.com/simstudioai/sim/pull/5738/files#diff-50edfbb28dedbddfec4682d444d7a482dbe2c661879a0416c3af3c6d073dcf31
terminal.tsx https://github.com/simstudioai/sim/pull/5738/files#diff-b7270601a9b60f9a2fc070d315d46c75e78edd2e5cd3e8bc29d5dcb3d6037284
use-float-boundary-sync.ts https://github.com/simstudioai/sim/pull/5738/files#diff-b91a61bb1a01b832f6aebbe7f9cd9005efb5ae5ebe276f96501f53171bc0f806
use-sidebar-resize.ts https://github.com/simstudioai/sim/pull/5738/files#diff-c7f7c66cd05b7ea232f5874bcb417ae2bb58c2adc2b9b370ea8a09b55e3fe423
use-drag-resize.ts https://github.com/simstudioai/sim/pull/5738/files#diff-2d10c9f0e8d1defe9bdb17527c5122f781a6e752efce42aa4da91cc268ce4870
...sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/hooks/use-panel-resize.tshttps://github.com/simstudioai/sim/pull/5738/files#diff-11895d710b76e2f1e60778b49a06b6bc08c19a9665d337489a51d2b5e6392a69
View file https://github.com/simstudioai/sim/blob/4a8b2b98c23103b47a8e932025d193a482644294/apps/sim/app/workspace/%5BworkspaceId%5D/w/%5BworkflowId%5D/components/panel/hooks/use-panel-resize.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5738/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5738/files#diff-11895d710b76e2f1e60778b49a06b6bc08c19a9665d337489a51d2b5e6392a69
https://github.com/simstudioai/sim/pull/5738/files#diff-11895d710b76e2f1e60778b49a06b6bc08c19a9665d337489a51d2b5e6392a69
...rkspace/[workspaceId]/w/[workflowId]/components/terminal/hooks/use-output-panel-resize.tshttps://github.com/simstudioai/sim/pull/5738/files#diff-ce1b7c0be2bd39052c56b35979b836baa9f5623847ba041d7f3ca44e2d023074
View file https://github.com/simstudioai/sim/blob/4a8b2b98c23103b47a8e932025d193a482644294/apps/sim/app/workspace/%5BworkspaceId%5D/w/%5BworkflowId%5D/components/terminal/hooks/use-output-panel-resize.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5738/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5738/files#diff-ce1b7c0be2bd39052c56b35979b836baa9f5623847ba041d7f3ca44e2d023074
https://github.com/simstudioai/sim/pull/5738/files#diff-ce1b7c0be2bd39052c56b35979b836baa9f5623847ba041d7f3ca44e2d023074
Please reload this pagehttps://github.com/simstudioai/sim/pull/5738/files
...p/workspace/[workspaceId]/w/[workflowId]/components/terminal/hooks/use-terminal-resize.tshttps://github.com/simstudioai/sim/pull/5738/files#diff-50edfbb28dedbddfec4682d444d7a482dbe2c661879a0416c3af3c6d073dcf31
View file https://github.com/simstudioai/sim/blob/4a8b2b98c23103b47a8e932025d193a482644294/apps/sim/app/workspace/%5BworkspaceId%5D/w/%5BworkflowId%5D/components/terminal/hooks/use-terminal-resize.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5738/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5738/files#diff-50edfbb28dedbddfec4682d444d7a482dbe2c661879a0416c3af3c6d073dcf31
https://github.com/simstudioai/sim/pull/5738/files#diff-50edfbb28dedbddfec4682d444d7a482dbe2c661879a0416c3af3c6d073dcf31
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/terminal/terminal.tsxhttps://github.com/simstudioai/sim/pull/5738/files#diff-b7270601a9b60f9a2fc070d315d46c75e78edd2e5cd3e8bc29d5dcb3d6037284
View file https://github.com/simstudioai/sim/blob/4a8b2b98c23103b47a8e932025d193a482644294/apps/sim/app/workspace/%5BworkspaceId%5D/w/%5BworkflowId%5D/components/terminal/terminal.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5738/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5738/files#diff-b7270601a9b60f9a2fc070d315d46c75e78edd2e5cd3e8bc29d5dcb3d6037284
https://github.com/simstudioai/sim/pull/5738/files#diff-b7270601a9b60f9a2fc070d315d46c75e78edd2e5cd3e8bc29d5dcb3d6037284
https://github.com/simstudioai/sim/pull/5738/files#diff-b7270601a9b60f9a2fc070d315d46c75e78edd2e5cd3e8bc29d5dcb3d6037284
https://github.com/simstudioai/sim/pull/5738/files#diff-b7270601a9b60f9a2fc070d315d46c75e78edd2e5cd3e8bc29d5dcb3d6037284
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/float/use-float-boundary-sync.tshttps://github.com/simstudioai/sim/pull/5738/files#diff-b91a61bb1a01b832f6aebbe7f9cd9005efb5ae5ebe276f96501f53171bc0f806
View file https://github.com/simstudioai/sim/blob/4a8b2b98c23103b47a8e932025d193a482644294/apps/sim/app/workspace/%5BworkspaceId%5D/w/%5BworkflowId%5D/hooks/float/use-float-boundary-sync.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5738/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5738/files#diff-b91a61bb1a01b832f6aebbe7f9cd9005efb5ae5ebe276f96501f53171bc0f806
https://github.com/simstudioai/sim/pull/5738/files#diff-b91a61bb1a01b832f6aebbe7f9cd9005efb5ae5ebe276f96501f53171bc0f806
https://github.com/simstudioai/sim/pull/5738/files#diff-b91a61bb1a01b832f6aebbe7f9cd9005efb5ae5ebe276f96501f53171bc0f806
https://github.com/simstudioai/sim/pull/5738/files#diff-b91a61bb1a01b832f6aebbe7f9cd9005efb5ae5ebe276f96501f53171bc0f806
https://github.com/simstudioai/sim/pull/5738/files#diff-b91a61bb1a01b832f6aebbe7f9cd9005efb5ae5ebe276f96501f53171bc0f806
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/hooks/use-sidebar-resize.tshttps://github.com/simstudioai/sim/pull/5738/files#diff-c7f7c66cd05b7ea232f5874bcb417ae2bb58c2adc2b9b370ea8a09b55e3fe423
View file https://github.com/simstudioai/sim/blob/4a8b2b98c23103b47a8e932025d193a482644294/apps/sim/app/workspace/%5BworkspaceId%5D/w/components/sidebar/hooks/use-sidebar-resize.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5738/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5738/files#diff-c7f7c66cd05b7ea232f5874bcb417ae2bb58c2adc2b9b370ea8a09b55e3fe423
https://github.com/simstudioai/sim/pull/5738/files#diff-c7f7c66cd05b7ea232f5874bcb417ae2bb58c2adc2b9b370ea8a09b55e3fe423
Please reload this pagehttps://github.com/simstudioai/sim/pull/5738/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5738/files
https://github.com/simstudioai/sim/pull/5738/files#diff-c7f7c66cd05b7ea232f5874bcb417ae2bb58c2adc2b9b370ea8a09b55e3fe423
Please reload this pagehttps://github.com/simstudioai/sim/pull/5738/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5738/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.