René's URL Explorer Experiment


Title: refactor(chat): clean up the deployed chat surface by waleedlatif1 · Pull Request #6220 · simstudioai/sim · GitHub

Open Graph Title: refactor(chat): clean up the deployed chat surface by waleedlatif1 · Pull Request #6220 · simstudioai/sim

X Title: refactor(chat): clean up the deployed chat surface by waleedlatif1 · Pull Request #6220 · simstudioai/sim

Description: Summary Eight-angle cleanup pass (effects, state, memo, callback, React Query, url-state, emcn, comments) run over the full contents of the deployed chat surface and the speech code that survived the voice-mode removal — not just a diff. Dead code enforceChatRateLimit — added for the TTS relay in #6212, orphaned when #6215 deleted that route. Zero consumers. ChatToolCallStatus, ChatErrorType, and six unused CHAT_ERROR_MESSAGES keys (only GENERIC_ERROR and CHAT_UNAVAILABLE are read). scrollToMessage was declared and destructured by ChatMessageContainer but never used in its body. Removing the prop also made the scrollToShowOnlyMessage branch unreachable, since the one caller passed true. permissionState and the language prop on useSpeechToText — both write-only across the repo. The image branch in ChatFileDownload's renderIcon returned the same DefaultFileIcon at the same size as the fallback. chatKeys.status/detail — aliases nothing imported, and misleading since they root under ['deployments', …] rather than chatKeys.all. Redundant state password-auth and email-auth each kept a boolean in lockstep with errors.length > 0; email-auth also validated on every keystroke and then immediately hid the result. file-download tracked hover in state to drive one opacity class → group-hover. Verified emcn Button sets no group class of its own. Memoization ChatMessageContainer's memo() could never bail: chat.tsx passes an inline arrow for scrollToBottom and displayMessages is a fresh array. Four of the five things that re-render ChatClient are its props anyway, so the memo is dropped rather than propped up. ClientChatMessage keeps its memo — it blocks markdown re-parsing during streaming — but loses the custom comparator, which compared proxies (a key:status fingerprint, files by length) and ignored attachments and type entirely. Default shallow compare on its single prop is simpler and stricter. Six useCallbacks whose consumers are native DOM handlers or inline arrows. Effects The scroll listener attached in an effect keyed on [chatConfig, authRequired] — values it never reads, standing in for "the container has mounted". Now a ref callback, so it no longer re-attaches on every config refetch. Design system / a11y z-[100] → z-[var(--z-dropdown)] (identical value), shadow-lg → shadow-medium, inline list styles → Tailwind, hover: → hover-hover: on touch-reachable targets, Check sourced from emcn alongside its Duplicate pair. Accessible names on the remove-attachment, stop, and send buttons — all previously announced as just "button". Dropped a keyboard handler on a role='group' div with no tabIndex (so target === currentTarget was unreachable), plus the Tooltip.Provider wrappers and delayDuration, which emcn documents as no-op passthroughs. Needs a visual check The scroll-listener change is the one behavioral risk. Please verify on a deployed chat: scroll up mid-conversation → jump-to-bottom button appears; click it → re-pins and hides; stream a reply while scrolled away → does not auto-follow. shadow-lg → shadow-medium is a small deliberate shadow change on the jump-to-bottom pill. Deliberately not included useSpeechToText fetching server state in an effect into useState — should become a useQuery, but its only consumer is the workspace home input, and the render path is hydration-sensitive. Wants its own PR. A real missing-invalidation bug: useUpdateChat doesn't invalidate deploymentKeys.info/versions/deployedState, though the PATCH can trigger a redeploy (api/chat/manage/[id]/route.ts calls performFullDeploy). useCreateChat invalidates for exactly this reason. Left out because it changes deployment-panel behavior I can't verify here — worth its own PR. Visual-risk items needing design sign-off: border-purple-500 drag state, text-purple-500 audio icon, off-scale text-sm/text-lg, the stop glyph → emcn Square, and consolidating the two chat auth screens onto the shared (auth)/components kit (which would shrink headings 40px → 32px). Type of Change Refactor / dead code removal Testing 1153 tests pass across chat, speech, settings, hooks and rate-limiter. Typecheck clean on apps/sim. Lint warnings in scope unchanged from staging's baseline (2). No behavior change intended except the two items called out above. 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 Eight-angle cleanup pass (effects, state, memo, callback, React Query, url-state, emcn, comments) run over the full contents of the deployed chat surface and the speech code that survived t...

X Description: Summary Eight-angle cleanup pass (effects, state, memo, callback, React Query, url-state, emcn, comments) run over the full contents of the deployed chat surface and the speech code that survived t...

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

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:8c218289-95c4-a267-c270-43944332cccd
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idDF46:F482B:27FECB:37D7E4:6AFB52D2
html-safe-nonceb906f8a94278854183766384e5cb248e5c1b3120000832c3f956452ae9891a38
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjQ2OkY0ODJCOjI3RkVDQjozN0Q3RTQ6NkFGQjUyRDIiLCJ2aXNpdG9yX2lkIjoiNTI2Nzk5NDI4MTg5MjMzNjMzOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmaca259485d33800107e7e217dff932078868af0375ad7ff2bcd8d918c68734abc7
hovercard-subject-tagpull_request:4197499182
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/6220/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 Eight-angle cleanup pass (effects, state, memo, callback, React Query, url-state, emcn, comments) run over the full contents of the deployed chat surface and the speech code that survived t...
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/6220/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F6220%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%2F6220%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/6220/files
Reloadhttps://github.com/simstudioai/sim/pull/6220/files
Reloadhttps://github.com/simstudioai/sim/pull/6220/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
waleedlatif1https://github.com/waleedlatif1
staginghttps://github.com/simstudioai/sim/tree/staging
chore/chat-surface-cleanuphttps://github.com/simstudioai/sim/tree/chore/chat-surface-cleanup
Conversation 10 https://github.com/simstudioai/sim/pull/6220
Commits 2 https://github.com/simstudioai/sim/pull/6220/commits
Checks 27 https://github.com/simstudioai/sim/pull/6220/checks
Files changed https://github.com/simstudioai/sim/pull/6220/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6220/files
refactor(chat): clean up the deployed chat surface https://github.com/simstudioai/sim/pull/6220/files#top
Show all changes 2 commits https://github.com/simstudioai/sim/pull/6220/files
3e65479 refactor(chat): clean up the deployed chat surface waleedlatif1 Aug 3, 2026 https://github.com/simstudioai/sim/pull/6220/commits/3e654797130277c78681d3ff0dcf66b14b71086c
0f1f509 fix(chat): restore markdown list markers waleedlatif1 Aug 3, 2026 https://github.com/simstudioai/sim/pull/6220/commits/0f1f509ffade6650694b1bf0332ece068e62d736
Clear filters https://github.com/simstudioai/sim/pull/6220/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6220/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6220/files
chat.tsx https://github.com/simstudioai/sim/pull/6220/files#diff-fae318707f9a158c797e4f84f75bff8d0db61f29ba25ca13b69398045f6cd56a
loading.tsx https://github.com/simstudioai/sim/pull/6220/files#diff-0c0af9bf4378d849cf99326c6349d8ff454e8c2529b0a202e560313176281802
email-auth.tsx https://github.com/simstudioai/sim/pull/6220/files#diff-f0fc19ad636a2a6ad9c368fc0be7967bed935d0a901b48f3c422e4d83aa99a45
password-auth.tsx https://github.com/simstudioai/sim/pull/6220/files#diff-72538251665b6021e9b81c05c8629ac55552037670bea6438e5ad9da0b425e8a
header.tsx https://github.com/simstudioai/sim/pull/6220/files#diff-37efe050da3b4380eddf57d85403f50bfb9a8fd6e1ee18d112e88cc41a501b58
input.tsx https://github.com/simstudioai/sim/pull/6220/files#diff-82a6e576ff6d0c1847a3667f363fe6b3b7718a75ebf2d4527403727b1afded6a
loading-state.tsx https://github.com/simstudioai/sim/pull/6220/files#diff-01a5863fa13bb09193c3747a3b2028a52e588d41ddbe7a8b1da5961eb996d854
message-container.tsx https://github.com/simstudioai/sim/pull/6220/files#diff-fe111c2b800d802c0e9272562ead33f7e0202b1a552fde4ba26293d850f8848a
file-download.tsx https://github.com/simstudioai/sim/pull/6220/files#diff-37fbe2c856a50e4020cbcd4c4002561ed384f3234a2a098c7ca1f25cd6fce847
markdown-renderer.tsx https://github.com/simstudioai/sim/pull/6220/files#diff-d1ae688ec9579daed61822e7335aab6854478fb387a5880f560dd7306183bdd8
message.tsx https://github.com/simstudioai/sim/pull/6220/files#diff-4661412e12b16093f1ccb848f41a31f873cc489d56a5c478064a10a944c4c670
constants.ts https://github.com/simstudioai/sim/pull/6220/files#diff-3f88af339c3ec6ffe87ddc6e02d7dda89d085d732b6a0400e2ae1343b40ac66a
route.ts https://github.com/simstudioai/sim/pull/6220/files#diff-ccc69fabd0836100fb492649dc1fa5f9cc064e8803d32c5f4f39d79531f08ec2
chats.ts https://github.com/simstudioai/sim/pull/6220/files#diff-d675fb4a077e1484d5b87d6921423b53eaa1a2ea7acbbdb5b04ac442d2d7db9c
use-speech-to-text.ts https://github.com/simstudioai/sim/pull/6220/files#diff-d4adf4899a91f6e26cba5844ac93d8663a3b24ac97d7245423b4dc197352fc69
route-helpers.ts https://github.com/simstudioai/sim/pull/6220/files#diff-c0645b76bcee0874af772d08c3c6b6078c94b86d2eb26c0370e35b2d26240c18
apps/sim/app/(interfaces)/chat/[identifier]/chat.tsxhttps://github.com/simstudioai/sim/pull/6220/files#diff-fae318707f9a158c797e4f84f75bff8d0db61f29ba25ca13b69398045f6cd56a
View file https://github.com/simstudioai/sim/blob/0f1f509ffade6650694b1bf0332ece068e62d736/apps/sim/app/(interfaces)/chat/%5Bidentifier%5D/chat.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6220/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6220/files#diff-fae318707f9a158c797e4f84f75bff8d0db61f29ba25ca13b69398045f6cd56a
https://github.com/simstudioai/sim/pull/6220/files#diff-fae318707f9a158c797e4f84f75bff8d0db61f29ba25ca13b69398045f6cd56a
https://github.com/simstudioai/sim/pull/6220/files#diff-fae318707f9a158c797e4f84f75bff8d0db61f29ba25ca13b69398045f6cd56a
https://github.com/simstudioai/sim/pull/6220/files#diff-fae318707f9a158c797e4f84f75bff8d0db61f29ba25ca13b69398045f6cd56a
https://github.com/simstudioai/sim/pull/6220/files#diff-fae318707f9a158c797e4f84f75bff8d0db61f29ba25ca13b69398045f6cd56a
https://github.com/simstudioai/sim/pull/6220/files#diff-fae318707f9a158c797e4f84f75bff8d0db61f29ba25ca13b69398045f6cd56a
https://github.com/simstudioai/sim/pull/6220/files#diff-fae318707f9a158c797e4f84f75bff8d0db61f29ba25ca13b69398045f6cd56a
https://github.com/simstudioai/sim/pull/6220/files#diff-fae318707f9a158c797e4f84f75bff8d0db61f29ba25ca13b69398045f6cd56a
https://github.com/simstudioai/sim/pull/6220/files#diff-fae318707f9a158c797e4f84f75bff8d0db61f29ba25ca13b69398045f6cd56a
apps/sim/app/(interfaces)/chat/[identifier]/loading.tsxhttps://github.com/simstudioai/sim/pull/6220/files#diff-0c0af9bf4378d849cf99326c6349d8ff454e8c2529b0a202e560313176281802
View file https://github.com/simstudioai/sim/blob/0f1f509ffade6650694b1bf0332ece068e62d736/apps/sim/app/(interfaces)/chat/%5Bidentifier%5D/loading.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6220/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6220/files#diff-0c0af9bf4378d849cf99326c6349d8ff454e8c2529b0a202e560313176281802
https://github.com/simstudioai/sim/pull/6220/files#diff-0c0af9bf4378d849cf99326c6349d8ff454e8c2529b0a202e560313176281802
apps/sim/app/(interfaces)/chat/components/auth/email/email-auth.tsxhttps://github.com/simstudioai/sim/pull/6220/files#diff-f0fc19ad636a2a6ad9c368fc0be7967bed935d0a901b48f3c422e4d83aa99a45
View file https://github.com/simstudioai/sim/blob/0f1f509ffade6650694b1bf0332ece068e62d736/apps/sim/app/(interfaces)/chat/components/auth/email/email-auth.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6220/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6220/files#diff-f0fc19ad636a2a6ad9c368fc0be7967bed935d0a901b48f3c422e4d83aa99a45
https://github.com/simstudioai/sim/pull/6220/files#diff-f0fc19ad636a2a6ad9c368fc0be7967bed935d0a901b48f3c422e4d83aa99a45
https://github.com/simstudioai/sim/pull/6220/files#diff-f0fc19ad636a2a6ad9c368fc0be7967bed935d0a901b48f3c422e4d83aa99a45
https://github.com/simstudioai/sim/pull/6220/files#diff-f0fc19ad636a2a6ad9c368fc0be7967bed935d0a901b48f3c422e4d83aa99a45
https://github.com/simstudioai/sim/pull/6220/files#diff-f0fc19ad636a2a6ad9c368fc0be7967bed935d0a901b48f3c422e4d83aa99a45
https://github.com/simstudioai/sim/pull/6220/files#diff-f0fc19ad636a2a6ad9c368fc0be7967bed935d0a901b48f3c422e4d83aa99a45
apps/sim/app/(interfaces)/chat/components/auth/password/password-auth.tsxhttps://github.com/simstudioai/sim/pull/6220/files#diff-72538251665b6021e9b81c05c8629ac55552037670bea6438e5ad9da0b425e8a
View file https://github.com/simstudioai/sim/blob/0f1f509ffade6650694b1bf0332ece068e62d736/apps/sim/app/(interfaces)/chat/components/auth/password/password-auth.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6220/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6220/files#diff-72538251665b6021e9b81c05c8629ac55552037670bea6438e5ad9da0b425e8a
https://github.com/simstudioai/sim/pull/6220/files#diff-72538251665b6021e9b81c05c8629ac55552037670bea6438e5ad9da0b425e8a
https://github.com/simstudioai/sim/pull/6220/files#diff-72538251665b6021e9b81c05c8629ac55552037670bea6438e5ad9da0b425e8a
https://github.com/simstudioai/sim/pull/6220/files#diff-72538251665b6021e9b81c05c8629ac55552037670bea6438e5ad9da0b425e8a
https://github.com/simstudioai/sim/pull/6220/files#diff-72538251665b6021e9b81c05c8629ac55552037670bea6438e5ad9da0b425e8a
https://github.com/simstudioai/sim/pull/6220/files#diff-72538251665b6021e9b81c05c8629ac55552037670bea6438e5ad9da0b425e8a
apps/sim/app/(interfaces)/chat/components/header/header.tsxhttps://github.com/simstudioai/sim/pull/6220/files#diff-37efe050da3b4380eddf57d85403f50bfb9a8fd6e1ee18d112e88cc41a501b58
View file https://github.com/simstudioai/sim/blob/0f1f509ffade6650694b1bf0332ece068e62d736/apps/sim/app/(interfaces)/chat/components/header/header.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/6220/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/6220/files#diff-37efe050da3b4380eddf57d85403f50bfb9a8fd6e1ee18d112e88cc41a501b58
https://github.com/simstudioai/sim/pull/6220/files#diff-37efe050da3b4380eddf57d85403f50bfb9a8fd6e1ee18d112e88cc41a501b58
Please reload this pagehttps://github.com/simstudioai/sim/pull/6220/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/6220/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.