René's URL Explorer Experiment


Title: fix(desktop): reopen a chat on the browser tab the user left it on by waleedlatif1 · Pull Request #7793 · simstudioai/sim · GitHub

Open Graph Title: fix(desktop): reopen a chat on the browser tab the user left it on by waleedlatif1 · Pull Request #7793 · simstudioai/sim

X Title: fix(desktop): reopen a chat on the browser tab the user left it on by waleedlatif1 · Pull Request #7793 · simstudioai/sim

Description: Summary Reopening a chat landed on the strip's last browser tab instead of the one the user left it on, because the strip treated its own fallback as a selection and pushed it to the desktop app. Which resource the panel shows is now a pure rule: an explicit selection wins while it is on screen, otherwise the last resource, except that a browser or terminal last resource defers to the tab the desktop app is currently showing. That tab is what the desktop remembers per chat, and it survives relaunch. Nothing is written back into the selection, so the arrival order of the tab list and the chat history can no longer decide what a chat opens on. A native tab switch still claims the selection as the user's, measured against the tab the desktop app was showing rather than the one the strip shows, since with no explicit selection those are now the same tab. Closing the shown tab moves to a neighbour of its own kind, so the strip and the desktop app agree on what comes next instead of the strip falling back to its last tab. Why it is a pure rule rather than a write An earlier revision adopted the remembered tab by writing it into the selection from an effect, gated on the chat history having loaded. An instrumented Electron run with the history held back 2.5s showed the strip on the wrong page for 2164ms before it corrected. Deriving the value instead removes the gate, the passive setter and the effect, and the same run now shows the remembered page immediately. Testing Unit: 887 tests across the chat surface, including a dedicated suite for the resolver. Every guard in the change was mutation-tested in both directions; two tests that originally passed with their guard deleted were rewritten until they failed. Full apps/sim suite: 3,543 files, 50,872 tests, zero failures. Type-check across all workspaces, lint, 46 audits, migration safety and docs manifest all pass. Instrumented Electron runs against a local build, sampling the strip's selected tab every 8ms plus a mutation observer, covering: reopening a chat, reopening with the chat history delayed 2.5s, clicking between pages, opening a page, and closing the shown page. No perceptible wrong-tab window in any case. Opening a page shows the previous last page for a single frame (5-15ms) while the new page is still being projected; everything else is clean. Known limits (unchanged by this PR) A chat that also holds a stored file or workflow opens on that stored resource, not on the browser tab the user left on. Nothing records which kind of resource was last shown. With both browser and terminal tabs, only the kind of the last resource is consulted. Type of Change Bug fix 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) 🤖 Generated with Claude Code https://claude.ai/code/session_0139YonWmiZUnPMTHoH4PtAJ

Open Graph Description: Summary Reopening a chat landed on the strip's last browser tab instead of the one the user left it on, because the strip treated its own fallback as a selection and pushed it to the desktop a...

X Description: Summary Reopening a chat landed on the strip's last browser tab instead of the one the user left it on, because the strip treated its own fallback as a selection and pushed it to the deskt...

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

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:46594dec-8136-28d4-bb42-c5061d199d31
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9384:8BAE:31C7B4:464B86:6AFB7149
html-safe-noncefad91d2a0ae13ed21e32708a62f1a57b7f2f9e57883f5ed5939db973bbd4c40c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Mzg0OjhCQUU6MzFDN0I0OjQ2NEI4Njo2QUZCNzE0OSIsInZpc2l0b3JfaWQiOiI1NzEzNzIzNTQ4MzI5ODAwMDA5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmace261338d54256efb02eb1b69054985b1311a6b90534e4a6575c88ffadf77b7d3
hovercard-subject-tagpull_request:4510604060
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/7793/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 Reopening a chat landed on the strip's last browser tab instead of the one the user left it on, because the strip treated its own fallback as a selection and pushed it to the desktop a...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None0e29e7974fdda2feeaf5c891efd4b23b0734b23480232b62c7bdef13f40b5b48
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
release2e8872b770cc4d5d0cc1f2026afab747a268e2ce
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/7793/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F7793%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%2F7793%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/7793/files
Reloadhttps://github.com/simstudioai/sim/pull/7793/files
Reloadhttps://github.com/simstudioai/sim/pull/7793/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests198 (198)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
fix/browser-tab-restore-on-chat-switchhttps://github.com/simstudioai/sim/tree/fix/browser-tab-restore-on-chat-switch
Conversation 23 https://github.com/simstudioai/sim/pull/7793
Commits 8 https://github.com/simstudioai/sim/pull/7793/commits
Checks 33 https://github.com/simstudioai/sim/pull/7793/checks
Files changed https://github.com/simstudioai/sim/pull/7793/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7793/files
fix(desktop): reopen a chat on the browser tab the user left it on https://github.com/simstudioai/sim/pull/7793/files#top
Show all changes 8 commits https://github.com/simstudioai/sim/pull/7793/files
c84a151 fix(desktop): reopen a chat on the browser tab the user left it on waleedlatif1 Sep 12, 2026 https://github.com/simstudioai/sim/pull/7793/commits/c84a151d581319e2c3c97c3e1d194dc4b8c48aa9
81e0abf fix(desktop): adopt the remembered tab without claiming the user's se… waleedlatif1 Sep 12, 2026 https://github.com/simstudioai/sim/pull/7793/commits/81e0abfdbbabed0221e730b42afea4e078228737
3435157 fix(desktop): show a selected tab that arrives after the tab list waleedlatif1 Sep 12, 2026 https://github.com/simstudioai/sim/pull/7793/commits/3435157cffc9637f50620ddb65c48252d8103abb
6eba8d2 Merge remote-tracking branch 'origin/staging' into fix/browser-tab-re… waleedlatif1 Sep 12, 2026 https://github.com/simstudioai/sim/pull/7793/commits/6eba8d2c224763fe77f487755d399011166e1d13
7943024 refactor(desktop): align the two tab-adoption paths and drop dead plu… waleedlatif1 Sep 12, 2026 https://github.com/simstudioai/sim/pull/7793/commits/7943024cddd8d226b56c5c13a4b36f04f08215bb
f3e4e12 test(desktop): give the tab-resource hosts the shared options interface waleedlatif1 Sep 12, 2026 https://github.com/simstudioai/sim/pull/7793/commits/f3e4e12e9cc42f2f2efb8bace6a57d318a0abd9f
e6b5d28 fix(desktop): resolve the shown tab instead of writing it back waleedlatif1 Sep 13, 2026 https://github.com/simstudioai/sim/pull/7793/commits/e6b5d28514e8a06ba5c3cf3cd28c29e09310f651
776b276 Merge remote-tracking branch 'origin/staging' into fix/browser-tab-re… waleedlatif1 Sep 13, 2026 https://github.com/simstudioai/sim/pull/7793/commits/776b2762982435272eb1187893a9e731c6d22128
Clear filters https://github.com/simstudioai/sim/pull/7793/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7793/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7793/files
resource-tabs.tsx https://github.com/simstudioai/sim/pull/7793/files#diff-3100bbc514f6d0cde18752fc6c6fc7a201c93cee56d5ac3733f477f04144cfbc
home.tsx https://github.com/simstudioai/sim/pull/7793/files#diff-eb66b9102ddc0010fd22549f03941b3c32eecdcef27b7ee4efc52a84e1c3ba83
use-browser-tab-resources.test.tsx https://github.com/simstudioai/sim/pull/7793/files#diff-c62765e15e548c01fc641187b85c06effa10e0817da65da06e20ca90d37e18cf
use-browser-tab-resources.ts https://github.com/simstudioai/sim/pull/7793/files#diff-55ec428c90b2f3485714655d7eb6056e80ac053c386a116385ad54833a63ae30
use-chat.ts https://github.com/simstudioai/sim/pull/7793/files#diff-1a0584ccf9cc4bacd55ce19aeeea8d807c39f36c365fa5b6638587aad38c700d
use-desktop-tab-resources.ts https://github.com/simstudioai/sim/pull/7793/files#diff-0ee3705d45123d8214a53be622cbdc45198e21436805968ce77a9255bad620bf
use-terminal-tab-resources.test.tsx https://github.com/simstudioai/sim/pull/7793/files#diff-b109aa044be3150b560e9e7fb1a5cd9ec3e489674708605bdc757f3eb70136f0
use-terminal-tab-resources.ts https://github.com/simstudioai/sim/pull/7793/files#diff-4644439197967a320ff4e3e8c7e968debcb912ab55dda7656846bfcc12c3dcb9
resource-view-policy.test.ts https://github.com/simstudioai/sim/pull/7793/files#diff-540ec7f015ec90393f1d517450f741b7cb4ed6f7de8f89d78504c21e519aecb9
resource-view-policy.ts https://github.com/simstudioai/sim/pull/7793/files#diff-1ef9364344dfea16a28459727eca7d0a8037ecfe46ec2c60bb34f3e8626a546e
.../[workspaceId]/home/components/mothership-view/components/resource-tabs/resource-tabs.tsxhttps://github.com/simstudioai/sim/pull/7793/files#diff-3100bbc514f6d0cde18752fc6c6fc7a201c93cee56d5ac3733f477f04144cfbc
View file https://github.com/simstudioai/sim/blob/776b2762982435272eb1187893a9e731c6d22128/apps/sim/app/workspace/%5BworkspaceId%5D/home/components/mothership-view/components/resource-tabs/resource-tabs.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7793/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7793/files#diff-3100bbc514f6d0cde18752fc6c6fc7a201c93cee56d5ac3733f477f04144cfbc
https://github.com/simstudioai/sim/pull/7793/files#diff-3100bbc514f6d0cde18752fc6c6fc7a201c93cee56d5ac3733f477f04144cfbc
https://github.com/simstudioai/sim/pull/7793/files#diff-3100bbc514f6d0cde18752fc6c6fc7a201c93cee56d5ac3733f477f04144cfbc
https://github.com/simstudioai/sim/pull/7793/files#diff-3100bbc514f6d0cde18752fc6c6fc7a201c93cee56d5ac3733f477f04144cfbc
apps/sim/app/workspace/[workspaceId]/home/home.tsxhttps://github.com/simstudioai/sim/pull/7793/files#diff-eb66b9102ddc0010fd22549f03941b3c32eecdcef27b7ee4efc52a84e1c3ba83
View file https://github.com/simstudioai/sim/blob/776b2762982435272eb1187893a9e731c6d22128/apps/sim/app/workspace/%5BworkspaceId%5D/home/home.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7793/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7793/files#diff-eb66b9102ddc0010fd22549f03941b3c32eecdcef27b7ee4efc52a84e1c3ba83
https://github.com/simstudioai/sim/pull/7793/files#diff-eb66b9102ddc0010fd22549f03941b3c32eecdcef27b7ee4efc52a84e1c3ba83
https://github.com/simstudioai/sim/pull/7793/files#diff-eb66b9102ddc0010fd22549f03941b3c32eecdcef27b7ee4efc52a84e1c3ba83
https://github.com/simstudioai/sim/pull/7793/files#diff-eb66b9102ddc0010fd22549f03941b3c32eecdcef27b7ee4efc52a84e1c3ba83
https://github.com/simstudioai/sim/pull/7793/files#diff-eb66b9102ddc0010fd22549f03941b3c32eecdcef27b7ee4efc52a84e1c3ba83
apps/sim/app/workspace/[workspaceId]/home/hooks/use-browser-tab-resources.test.tsxhttps://github.com/simstudioai/sim/pull/7793/files#diff-c62765e15e548c01fc641187b85c06effa10e0817da65da06e20ca90d37e18cf
View file https://github.com/simstudioai/sim/blob/776b2762982435272eb1187893a9e731c6d22128/apps/sim/app/workspace/%5BworkspaceId%5D/home/hooks/use-browser-tab-resources.test.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7793/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7793/files#diff-c62765e15e548c01fc641187b85c06effa10e0817da65da06e20ca90d37e18cf
https://github.com/simstudioai/sim/pull/7793/files#diff-c62765e15e548c01fc641187b85c06effa10e0817da65da06e20ca90d37e18cf
https://github.com/simstudioai/sim/pull/7793/files#diff-c62765e15e548c01fc641187b85c06effa10e0817da65da06e20ca90d37e18cf
https://github.com/simstudioai/sim/pull/7793/files#diff-c62765e15e548c01fc641187b85c06effa10e0817da65da06e20ca90d37e18cf
https://github.com/simstudioai/sim/pull/7793/files#diff-c62765e15e548c01fc641187b85c06effa10e0817da65da06e20ca90d37e18cf
https://github.com/simstudioai/sim/pull/7793/files#diff-c62765e15e548c01fc641187b85c06effa10e0817da65da06e20ca90d37e18cf
https://github.com/simstudioai/sim/pull/7793/files#diff-c62765e15e548c01fc641187b85c06effa10e0817da65da06e20ca90d37e18cf
https://github.com/simstudioai/sim/pull/7793/files#diff-c62765e15e548c01fc641187b85c06effa10e0817da65da06e20ca90d37e18cf
https://github.com/simstudioai/sim/pull/7793/files#diff-c62765e15e548c01fc641187b85c06effa10e0817da65da06e20ca90d37e18cf
apps/sim/app/workspace/[workspaceId]/home/hooks/use-browser-tab-resources.tshttps://github.com/simstudioai/sim/pull/7793/files#diff-55ec428c90b2f3485714655d7eb6056e80ac053c386a116385ad54833a63ae30
View file https://github.com/simstudioai/sim/blob/776b2762982435272eb1187893a9e731c6d22128/apps/sim/app/workspace/%5BworkspaceId%5D/home/hooks/use-browser-tab-resources.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7793/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7793/files#diff-55ec428c90b2f3485714655d7eb6056e80ac053c386a116385ad54833a63ae30
https://github.com/simstudioai/sim/pull/7793/files#diff-55ec428c90b2f3485714655d7eb6056e80ac053c386a116385ad54833a63ae30
https://github.com/simstudioai/sim/pull/7793/files#diff-55ec428c90b2f3485714655d7eb6056e80ac053c386a116385ad54833a63ae30
https://github.com/simstudioai/sim/pull/7793/files#diff-55ec428c90b2f3485714655d7eb6056e80ac053c386a116385ad54833a63ae30
https://github.com/simstudioai/sim/pull/7793/files#diff-55ec428c90b2f3485714655d7eb6056e80ac053c386a116385ad54833a63ae30
Please reload this pagehttps://github.com/simstudioai/sim/pull/7793/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7793/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.