René's URL Explorer Experiment


Title: fix(mothership): stop chat perf decay from permanently-animated streamed messages by TheodoreSpeaks · Pull Request #5411 · simstudioai/sim · GitHub

Open Graph Title: fix(mothership): stop chat perf decay from permanently-animated streamed messages by TheodoreSpeaks · Pull Request #5411 · simstudioai/sim

X Title: fix(mothership): stop chat perf decay from permanently-animated streamed messages by TheodoreSpeaks · Pull Request #5411 · simstudioai/sim

Description: Summary Chat perf decay (the main fix) Chat got progressively laggier over a long session because every streamed message stayed in Streamdown's animated pipeline forever — one span per character, tens of thousands of permanent DOM nodes in the mounted transcript. Refresh fixed it because reloaded transcripts render static. Settled messages now remount to a span-free tree 300ms after the reveal drains. Remount via `key` is required: streamdown 2.5 memoizes its default element components on className + source position, so flipping `isAnimating` off leaves stale span DOM in place (verified with a standalone repro). The settled instance keeps the streaming parser (`mode`), so the swap trades byte-identical pixels — no flash on replies with unbalanced markdown. Mid-stream: `sep: 'char'` → `'word'` (~5x fewer spans rebuilt per reveal tick; visually identical with `stagger: 0`), and fades stop past 6k revealed chars in one segment so walls of text can't swamp the frame budget. Unified the plain-text and special-tag render branches: most replies gain a trailing `` tag (suggested follow-ups) at the very end, and the old branch switch re-parented Streamdown at that moment — remounting it and re-fading the whole message from transparent (the long-standing "flash at the conclusion", predates this PR). Animation latches reset when a reused ChatContent instance receives replaced (non-append) content, so regenerated turns still animate; latches held in `useState` per the updated render-phase hook rules. Measured mid-stream on a single giant paragraph: p95 frame time 49.9ms → 9.4ms, long tasks 1256ms → 0 per 12s window; at ~10k chars: p95 83ms → 10ms. Spans drain to 0 after every turn; swap is pixel-stable (0 height/text delta). Text-selection follow-up (regression from #5389 that this branch merged in) The global solid-brand + forced-white `::selection` rendered black-on-blue in the chat input and every workflow subblock editor — those draw text in a mirror overlay the forced white can never reach (and Chromium ignores `::selection` color in form controls anyway). Kept one global rule, made it lighter across the board per Waleed's suggestion: `::selection { background-color: var(--selection-muted) }` (`#1a5cf647` light / `#4b83f759` dark), no text-color override so selected text keeps its own paint on every surface. Landing keeps a consistent, non-dimming branded selection; verified on landing, chat prose, and the overlay inputs in both themes. Type of Change Bug fix Testing Tested manually in the live app (streamed multi-turn chats; measured rAF frame deltas + long tasks before/after; DOM-diffed the settle swap; verified 0 animated spans after settle, no completion flash, no re-fade when follow-ups arrive; selection checked on landing/chat/inputs in light + dark). `vitest` message-content + smooth-text + file-viewer suites pass, `bun run lint`, `bun run check:api-validation:strict` pass. 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 Chat perf decay (the main fix) Chat got progressively laggier over a long session because every streamed message stayed in Streamdown's animated pipeline forever — one span per charact...

X Description: Summary Chat perf decay (the main fix) Chat got progressively laggier over a long session because every streamed message stayed in Streamdown's animated pipeline forever — one span per cha...

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

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,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-controllerpull_requests
route-actionfiles
fetch-noncev2:b6b2d26c-5f72-807a-d360-22e7ab86a467
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idAB3A:1EC912:9860EA:D7C1AD:6AFB5368
html-safe-nonce7f1df9874206ab14fe5b7ad208d8addc8bdd7a308d6222a067d2c7f4aa5404bd
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQjNBOjFFQzkxMjo5ODYwRUE6RDdDMUFEOjZBRkI1MzY4IiwidmlzaXRvcl9pZCI6IjE5MTY1NjA4MDMyMzAzMzk5NDQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacc6eb634f83d5ecdcffef98b02d7e83c354b9e38d7529ab998a7fc2e582971696
hovercard-subject-tagpull_request:3991372046
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/5411/files
twitter:imagehttps://avatars.githubusercontent.com/u/19564703?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/19564703?s=400&v=4
og:image:altSummary Chat perf decay (the main fix) Chat got progressively laggier over a long session because every streamed message stayed in Streamdown's animated pipeline forever — one span per charact...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None7122bb414b542dba14d71a3f0b9f6fd2abce715b9f5912d082800563e6c806d1
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
releasecbf66c024bb6d10e6955baa7413c54cf13a201bb
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/5411/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F5411%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F5411%2Ffiles
Sign uphttps://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/5411/files
Reloadhttps://github.com/simstudioai/sim/pull/5411/files
Reloadhttps://github.com/simstudioai/sim/pull/5411/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests197 (197)https://github.com/simstudioai/sim/pulls
Actionshttps://github.com/simstudioai/sim/actions
Projectshttps://github.com/simstudioai/sim/projects
Security and qualityhttps://github.com/simstudioai/sim/security
Insightshttps://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
TheodoreSpeakshttps://github.com/TheodoreSpeaks
staginghttps://github.com/simstudioai/sim/tree/staging
fix/mothership-performancehttps://github.com/simstudioai/sim/tree/fix/mothership-performance
Conversation 10 https://github.com/simstudioai/sim/pull/5411
Commits 9 https://github.com/simstudioai/sim/pull/5411/commits
Checks 17 https://github.com/simstudioai/sim/pull/5411/checks
Files changed https://github.com/simstudioai/sim/pull/5411/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5411/files
fix(mothership): stop chat perf decay from permanently-animated streamed messages https://github.com/simstudioai/sim/pull/5411/files#top
Show all changes 9 commits https://github.com/simstudioai/sim/pull/5411/files
61c9e19 fix(mothership): stop chat perf decay from permanently-animated strea… TheodoreSpeaks Jul 4, 2026 https://github.com/simstudioai/sim/pull/5411/commits/61c9e19047eaec6b9c784a4fc462079ca5f5bcf9
dfdb362 fix(mothership): reset animation latches when a reused ChatContent ge… TheodoreSpeaks Jul 4, 2026 https://github.com/simstudioai/sim/pull/5411/commits/dfdb3625917f5147e43d6b136a8f3fbafd81ac05
61f6e6c fix(mothership): keep streaming parser on settled messages to kill th… TheodoreSpeaks Jul 4, 2026 https://github.com/simstudioai/sim/pull/5411/commits/61f6e6cad0166c5571bd0ddcd283b1d33b27a4dc
3961a9c fix(mothership): unify plain/special render branches to stop whole-me… TheodoreSpeaks Jul 4, 2026 https://github.com/simstudioai/sim/pull/5411/commits/3961a9c18be87a3e42e57eaf29593ca6b67c1921
95f7c0f Merge remote-tracking branch 'origin/staging' into fix/mothership-per… TheodoreSpeaks Jul 4, 2026 https://github.com/simstudioai/sim/pull/5411/commits/95f7c0fa9cf68d011fdb614b6ec05cb8702cee1d
56f391b improvement(mothership): hold render-phase animation latches in useSt… TheodoreSpeaks Jul 4, 2026 https://github.com/simstudioai/sim/pull/5411/commits/56f391b4c9e2573fa72510beac9f425f642bd73b
0e288c2 fix(styling): translucent text-selection in form controls so field te… TheodoreSpeaks Jul 4, 2026 https://github.com/simstudioai/sim/pull/5411/commits/0e288c23e20ade1a5c59cafec8f763dedb2fb6e5
3687017 improvement(styling): one lighter translucent text-selection color ev… TheodoreSpeaks Jul 4, 2026 https://github.com/simstudioai/sim/pull/5411/commits/368701787635c7e28e5607daef82eb86fe57af01
5edddda chore(styling): selection-muted tokens as 8-digit hex to match color … TheodoreSpeaks Jul 4, 2026 https://github.com/simstudioai/sim/pull/5411/commits/5edddda6e4fbc1fa15c3210b15890a9c63ba6648
Clear filters https://github.com/simstudioai/sim/pull/5411/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5411/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/5411/files
globals.css https://github.com/simstudioai/sim/pull/5411/files#diff-a39154a049a8386121aeb235168db7af1a32dc7720f223bce3b809f4aebca0a9
chat-content.tsx https://github.com/simstudioai/sim/pull/5411/files#diff-431cad27d522bf111633c79d6973e5728792d1c6f60727071bf49f495d1153a2
apps/sim/app/_styles/globals.csshttps://github.com/simstudioai/sim/pull/5411/files#diff-a39154a049a8386121aeb235168db7af1a32dc7720f223bce3b809f4aebca0a9
View file https://github.com/simstudioai/sim/blob/5edddda6e4fbc1fa15c3210b15890a9c63ba6648/apps/sim/app/_styles/globals.css
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5411/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5411/files#diff-a39154a049a8386121aeb235168db7af1a32dc7720f223bce3b809f4aebca0a9
https://github.com/simstudioai/sim/pull/5411/files#diff-a39154a049a8386121aeb235168db7af1a32dc7720f223bce3b809f4aebca0a9
https://github.com/simstudioai/sim/pull/5411/files#diff-a39154a049a8386121aeb235168db7af1a32dc7720f223bce3b809f4aebca0a9
https://github.com/simstudioai/sim/pull/5411/files#diff-a39154a049a8386121aeb235168db7af1a32dc7720f223bce3b809f4aebca0a9
https://github.com/simstudioai/sim/pull/5411/files#diff-a39154a049a8386121aeb235168db7af1a32dc7720f223bce3b809f4aebca0a9
https://github.com/simstudioai/sim/pull/5411/files#diff-a39154a049a8386121aeb235168db7af1a32dc7720f223bce3b809f4aebca0a9
...ce/[workspaceId]/home/components/message-content/components/chat-content/chat-content.tsxhttps://github.com/simstudioai/sim/pull/5411/files#diff-431cad27d522bf111633c79d6973e5728792d1c6f60727071bf49f495d1153a2
View file https://github.com/simstudioai/sim/blob/5edddda6e4fbc1fa15c3210b15890a9c63ba6648/apps/sim/app/workspace/%5BworkspaceId%5D/home/components/message-content/components/chat-content/chat-content.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/5411/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/5411/files#diff-431cad27d522bf111633c79d6973e5728792d1c6f60727071bf49f495d1153a2
https://github.com/simstudioai/sim/pull/5411/files#diff-431cad27d522bf111633c79d6973e5728792d1c6f60727071bf49f495d1153a2
https://github.com/simstudioai/sim/pull/5411/files#diff-431cad27d522bf111633c79d6973e5728792d1c6f60727071bf49f495d1153a2
https://github.com/simstudioai/sim/pull/5411/files#diff-431cad27d522bf111633c79d6973e5728792d1c6f60727071bf49f495d1153a2
Please reload this pagehttps://github.com/simstudioai/sim/pull/5411/files
https://github.com/simstudioai/sim/pull/5411/files#diff-431cad27d522bf111633c79d6973e5728792d1c6f60727071bf49f495d1153a2
cursorhttps://github.com/apps/cursor
Jul 4, 2026https://github.com/simstudioai/sim/pull/5411/files#r3523708281
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmI1MjA1MTNiLTc4NDUtNDA5Zi1iZTY3LWI0YTE3ZTVmMjUyYSIsImVuY3J5cHRpb25LZXkiOiJWdmp1UV9uZTkyN3dmYkRmeHE3WlphWnRMVHByRmdkVFJCQUEtT2JJa0tRIiwiYnJhbmNoIjoiZml4L21vdGhlcnNoaXAtcGVyZm9ybWFuY2UiLCJyZXBvT3duZXIiOiJzaW1zdHVkaW9haSIsInJlcG9OYW1lIjoic2ltIn19
https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OmI1MjA1MTNiLTc4NDUtNDA5Zi1iZTY3LWI0YTE3ZTVmMjUyYSIsImVuY3J5cHRpb25LZXkiOiJWdmp1UV9uZTkyN3dmYkRmeHE3WlphWnRMVHByRmdkVFJCQUEtT2JJa0tRIiwiYnJhbmNoIjoiZml4L21vdGhlcnNoaXAtcGVyZm9ybWFuY2UiLCJyZXBvT3duZXIiOiJzaW1zdHVkaW9haSIsInJlcG9OYW1lIjoic2ltIiwicHJOdW1iZXIiOjU0MTEsImNvbW1pdFNoYSI6IjM5NjFhOWMxOGJlODdhM2U0MmU1N2VhZjI5NTkzY2E2YjY3YzE5MjEiLCJwcm92aWRlciI6ImdpdGh1YiJ9fQ
Cursor Bugbothttps://cursor.com/bugbot
3961a9chttps://github.com/simstudioai/sim/commit/3961a9c18be87a3e42e57eaf29593ca6b67c1921
herehttps://www.cursor.com/dashboard/bugbot
Please reload this pagehttps://github.com/simstudioai/sim/pull/5411/files
https://github.com/simstudioai/sim/pull/5411/files#diff-431cad27d522bf111633c79d6973e5728792d1c6f60727071bf49f495d1153a2
Please reload this pagehttps://github.com/simstudioai/sim/pull/5411/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.