René's URL Explorer Experiment


Title: feat(webapp): stay on the same page when switching project or organization by claude[bot] · Pull Request #4585 · triggerdotdev/trigger.dev · GitHub

Open Graph Title: feat(webapp): stay on the same page when switching project or organization by claude[bot] · Pull Request #4585 · triggerdotdev/trigger.dev

X Title: feat(webapp): stay on the same page when switching project or organization by claude[bot] · Pull Request #4585 · triggerdotdev/trigger.dev

Description: Requested by Eric Allam · Slack thread Before: you're on the API keys page in project X, you switch to project Y in the sidebar, and you land on project Y's Tasks page. Same for switching organization. Every switch threw away the page you were looking at. After: you land on project Y's API keys page. Switching organization does the same thing, one project down. Pages that name a single thing — a run, a batch, a queue, a schedule, a deploy, a session, an error group — can't exist in another project, so those take you to the matching list page instead (a run page takes you to Runs). The environment is still chosen exactly as it is today: nothing tries to guess it in the browser. Testing New apps/webapp/app/utils/pageSwitching.test.ts (35 tests). It reads the compiled Remix route manifest, so the portable-page list can't silently drift from the routes: every environment page that names no resource survives an environment switch — the same pages the old slug swap kept the two branch lists are the only pages an environment switch keeps and a project switch drops the pages gated per organization — Logs, Query and the queue metrics dashboard — travel with an environment or project switch but not an organization switch, and that list is derived from the route sources so a new gated page cannot be missed every portable page points at a route that exists every one of the 19 environment routes that takes a resource id truncates to a list page, with the id gone portable pages resolve to themselves, so switching twice lands in the same place every rejection case: leading slash, //, absolute URL, .., percent-encoded traversal, javascript:, unknown page — each falls back to Tasks rather than being sanitised into something Manual: switch project and organization from API keys, project settings, a run page, and a queue page. pnpm run typecheck --filter webapp passes. The rest of the webapp suite needs Docker for testcontainers, which wasn't available here; all colocated pure unit tests under app/utils/ pass (15 files, 150 tests). Changelog Switching project or organization in the sidebar keeps you on the same page instead of sending you back to Tasks. Pages for a specific run, deploy or other single item open the matching list instead. How The switcher links already pointed at /orgs/:org/projects/:project and /orgs/:org, whose _index loaders resolve the best environment (and, for the organization, the best project) and redirect. So the page travels as a search param on those links, and each loader appends it to the path it already builds: app/utils/pageSwitching.ts — one pure module. environmentPortablePage(suffix) and projectPortablePage(suffix) walk up the suffix until they find an entry in an allowlist of portable pages, and answer with the environment root if they find none. The result is therefore always a literal from that closed set, which is what makes it safe to concatenate into a redirect target; there is no regex sanitising. The allowlist is built from the landing pages already listed in deeplinkPages.ts plus the handful of nested pages that file doesn't know about, so this isn't a new URL-shape table. app/hooks/useEnvironmentSwitcher.ts — usePageSwitcher() derives the current page by slicing the environment layout route match's pathname off the current pathname, so there's no route table on the client either. The query string and hash are dropped on a project or organization switch, since filters encode task slugs and ids scoped to the project you're leaving. Both _index loaders re-validate the page through the same function before using it. Two things worth a look: The environment switcher's truncation gap is fixed as a side effect. It had a hand-written switch covering runs/:runParam, deployments/:deploymentParam and schedules/:scheduleParam; the other 16 id-bearing routes carried their id straight into the new environment (e.g. queues/:queueParam, batches/:batchParam, errors/:fingerprint, sessions/:sessionParam). All three switchers now share one truncation, and the test asserts it covers every such route in the manifest. Portability turned out to be two properties, not one. Preview branches and dev branches render under any environment slug of their project — both loaders pass a hardcoded environment type and the project slug and never read envParam — so an environment switch keeps them, exactly as swapping the slug did before. A project or organization switch still falls back to Tasks, since the project you land in may have no preview branches. A test locks the environment half: every id-free page below an environment has to survive an environment switch. Screenshots n/a — no visual change; only where the switcher links point. 💯

Open Graph Description: Requested by Eric Allam · Slack thread Before: you're on the API keys page in project X, you switch to project Y in the sidebar, and you land on project Y's Tasks page. Same for switching o...

X Description: Requested by Eric Allam · Slack thread Before: you're on the API keys page in project X, you switch to project Y in the sidebar, and you land on project Y's Tasks page. Same for swi...

Opengraph URL: https://github.com/triggerdotdev/trigger.dev/pull/4585

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:ac5ec7ab-f808-0710-3adf-d39b12ba9b90
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE2AE:1F5CA2:6C1D95:9F2181:6AFAF398
html-safe-nonceb32ab6a49e722799dad3c55b58b10db9a1ca72788bdb07beeb61869e6180f341
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMkFFOjFGNUNBMjo2QzFEOTU6OUYyMTgxOjZBRkFGMzk4IiwidmlzaXRvcl9pZCI6IjI4MTM5Mzc4NTY4NzM2OTAwMDgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac3ddf3302001ce79bc3686ab47072e31b5bede2016dcc687b185cffdacbd40fdd
hovercard-subject-tagpull_request:4261472873
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/triggerdotdev/trigger.dev/pull/4585/files
twitter:imagehttps://avatars.githubusercontent.com/in/1236702?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/in/1236702?s=400&v=4
og:image:altRequested by Eric Allam · Slack thread Before: you're on the API keys page in project X, you switch to project Y in the sidebar, and you land on project Y's Tasks page. Same for switching o...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None0178036d8230524a18422872393ab7e708443ae4c2047f758560a2db870c1913
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/triggerdotdev/trigger.dev git https://github.com/triggerdotdev/trigger.dev.git
octolytics-dimension-user_id95297378
octolytics-dimension-user_logintriggerdotdev
octolytics-dimension-repository_id572570113
octolytics-dimension-repository_nwotriggerdotdev/trigger.dev
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id572570113
octolytics-dimension-repository_network_root_nwotriggerdotdev/trigger.dev
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
releasea85e96a83bed7871993e6b1ffda24105928eee17
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/triggerdotdev/trigger.dev/pull/4585/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F4585%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%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F4585%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=triggerdotdev%2Ftrigger.dev
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/4585/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/4585/files
Reloadhttps://github.com/triggerdotdev/trigger.dev/pull/4585/files
triggerdotdevhttps://github.com/triggerdotdev
trigger.devhttps://github.com/triggerdotdev/trigger.dev
Codehttps://github.com/triggerdotdev/trigger.dev
Issues203 (203)https://github.com/triggerdotdev/trigger.dev/issues
Pull requests67 (67)https://github.com/triggerdotdev/trigger.dev/pulls
Discussionshttps://github.com/triggerdotdev/trigger.dev/discussions
Actionshttps://github.com/triggerdotdev/trigger.dev/actions
Projectshttps://github.com/triggerdotdev/trigger.dev/projects
Security and quality39 (39)https://github.com/triggerdotdev/trigger.dev/security
Insightshttps://github.com/triggerdotdev/trigger.dev/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2Fnew%2Fchoose
ericallamhttps://github.com/ericallam
mainhttps://github.com/triggerdotdev/trigger.dev/tree/main
claude/preserve-page-on-project-switchhttps://github.com/triggerdotdev/trigger.dev/tree/claude/preserve-page-on-project-switch
Conversation 35 https://github.com/triggerdotdev/trigger.dev/pull/4585
Commits 8 https://github.com/triggerdotdev/trigger.dev/pull/4585/commits
Checks 50 https://github.com/triggerdotdev/trigger.dev/pull/4585/checks
Files changed https://github.com/triggerdotdev/trigger.dev/pull/4585/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4585/files
feat(webapp): stay on the same page when switching project or organization https://github.com/triggerdotdev/trigger.dev/pull/4585/files#top
Show all changes 8 commits https://github.com/triggerdotdev/trigger.dev/pull/4585/files
e40e837 feat(webapp): stay on the same page when switching project or organiz… claude Aug 12, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4585/commits/e40e837e2fc371abfed7bb15d718f21569832fa2
5746dd8 fix(webapp): keep the branch lists on an environment switch claude Aug 12, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4585/commits/5746dd8e54dfb03283eec286049ce94054cb6460
5a292da fix(webapp): drop the organization-gated pages on an organization switch claude Aug 12, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4585/commits/5a292da720efd936d899937cdfe76c8d75dbda54
d386ac4 fix(webapp): keep the queue metrics dashboard on an environment switch claude Aug 12, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4585/commits/d386ac496bd69a561033fdeb0e8bac619feb749d
2d2c417 test(webapp): check the portable page list against the built-in dashb… claude Aug 12, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4585/commits/2d2c417191dc0e1a686d6e7098f9c6406375bce5
e0719bb fix(webapp): match the environment path on a segment boundary claude Aug 12, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4585/commits/e0719bb18a3ad5bfec0582dda16b8ea650ae582a
00174eb fix(webapp): keep a task, agent or prompt page on an environment switch claude Aug 12, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4585/commits/00174eb4fab4944eacf3ed11185493d437f90dfb
ed4461d fix(webapp): carry the pages a switch can still open claude Aug 12, 2026 https://github.com/triggerdotdev/trigger.dev/pull/4585/commits/ed4461d7060f8edf20a0a872f989c653a74a2c33
Clear filters https://github.com/triggerdotdev/trigger.dev/pull/4585/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4585/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4585/files
keep-page-when-switching-project.md https://github.com/triggerdotdev/trigger.dev/pull/4585/files#diff-c79f56348f6e99be1e9a8d43864f5276da2b5e00ea8e3bc9ba855b71fb83daa6
SideMenu.tsx https://github.com/triggerdotdev/trigger.dev/pull/4585/files#diff-ac1f1bec2109472327892b222b7ef51e6202ae570d3661d56c8bb736e20f8150
useEnvironmentSwitcher.ts https://github.com/triggerdotdev/trigger.dev/pull/4585/files#diff-92b7bf5e7d6c0573e87373c24ae7c43536c566531491bb25bd88013937eacede
route.tsx https://github.com/triggerdotdev/trigger.dev/pull/4585/files#diff-b65c6918a88c874914bff3ba52c76df7281a9d3f1f023ec4dd84fa11bb48692c
route.tsx https://github.com/triggerdotdev/trigger.dev/pull/4585/files#diff-b96a1c3728a280f96f747a32796a0f898523e5584725ab7f51821f16a384c6d3
pageSwitching.test.ts https://github.com/triggerdotdev/trigger.dev/pull/4585/files#diff-f0f6eca599194057ce95efd2e9348e5d44207c43f93f98c50d0c259551d57149
pageSwitching.ts https://github.com/triggerdotdev/trigger.dev/pull/4585/files#diff-df8c54c589b2a7f5533e44f4e1a9837393376c62edff6693b4a530e7d62a8ac9
.server-changes/keep-page-when-switching-project.mdhttps://github.com/triggerdotdev/trigger.dev/pull/4585/files#diff-c79f56348f6e99be1e9a8d43864f5276da2b5e00ea8e3bc9ba855b71fb83daa6
View file https://github.com/triggerdotdev/trigger.dev/blob/ed4461d7060f8edf20a0a872f989c653a74a2c33/.server-changes/keep-page-when-switching-project.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/4585/{{ revealButtonHref }}
apps/webapp/app/components/navigation/SideMenu.tsxhttps://github.com/triggerdotdev/trigger.dev/pull/4585/files#diff-ac1f1bec2109472327892b222b7ef51e6202ae570d3661d56c8bb736e20f8150
View file https://github.com/triggerdotdev/trigger.dev/blob/ed4461d7060f8edf20a0a872f989c653a74a2c33/apps/webapp/app/components/navigation/SideMenu.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/4585/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/4585/files#diff-ac1f1bec2109472327892b222b7ef51e6202ae570d3661d56c8bb736e20f8150
https://github.com/triggerdotdev/trigger.dev/pull/4585/files#diff-ac1f1bec2109472327892b222b7ef51e6202ae570d3661d56c8bb736e20f8150
https://github.com/triggerdotdev/trigger.dev/pull/4585/files#diff-ac1f1bec2109472327892b222b7ef51e6202ae570d3661d56c8bb736e20f8150
https://github.com/triggerdotdev/trigger.dev/pull/4585/files#diff-ac1f1bec2109472327892b222b7ef51e6202ae570d3661d56c8bb736e20f8150
https://github.com/triggerdotdev/trigger.dev/pull/4585/files#diff-ac1f1bec2109472327892b222b7ef51e6202ae570d3661d56c8bb736e20f8150
https://github.com/triggerdotdev/trigger.dev/pull/4585/files#diff-ac1f1bec2109472327892b222b7ef51e6202ae570d3661d56c8bb736e20f8150
https://github.com/triggerdotdev/trigger.dev/pull/4585/files#diff-ac1f1bec2109472327892b222b7ef51e6202ae570d3661d56c8bb736e20f8150
https://github.com/triggerdotdev/trigger.dev/pull/4585/files#diff-ac1f1bec2109472327892b222b7ef51e6202ae570d3661d56c8bb736e20f8150
https://github.com/triggerdotdev/trigger.dev/pull/4585/files#diff-ac1f1bec2109472327892b222b7ef51e6202ae570d3661d56c8bb736e20f8150
https://github.com/triggerdotdev/trigger.dev/pull/4585/files#diff-ac1f1bec2109472327892b222b7ef51e6202ae570d3661d56c8bb736e20f8150
https://github.com/triggerdotdev/trigger.dev/pull/4585/files#diff-ac1f1bec2109472327892b222b7ef51e6202ae570d3661d56c8bb736e20f8150
https://github.com/triggerdotdev/trigger.dev/pull/4585/files#diff-ac1f1bec2109472327892b222b7ef51e6202ae570d3661d56c8bb736e20f8150
apps/webapp/app/hooks/useEnvironmentSwitcher.tshttps://github.com/triggerdotdev/trigger.dev/pull/4585/files#diff-92b7bf5e7d6c0573e87373c24ae7c43536c566531491bb25bd88013937eacede
View file https://github.com/triggerdotdev/trigger.dev/blob/ed4461d7060f8edf20a0a872f989c653a74a2c33/apps/webapp/app/hooks/useEnvironmentSwitcher.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/4585/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/4585/files#diff-92b7bf5e7d6c0573e87373c24ae7c43536c566531491bb25bd88013937eacede
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4585/files
apps/webapp/app/routes/_app.orgs.$organizationSlug._index/route.tsxhttps://github.com/triggerdotdev/trigger.dev/pull/4585/files#diff-b65c6918a88c874914bff3ba52c76df7281a9d3f1f023ec4dd84fa11bb48692c
View file https://github.com/triggerdotdev/trigger.dev/blob/ed4461d7060f8edf20a0a872f989c653a74a2c33/apps/webapp/app/routes/_app.orgs.%24organizationSlug._index/route.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/4585/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/4585/files#diff-b65c6918a88c874914bff3ba52c76df7281a9d3f1f023ec4dd84fa11bb48692c
https://github.com/triggerdotdev/trigger.dev/pull/4585/files#diff-b65c6918a88c874914bff3ba52c76df7281a9d3f1f023ec4dd84fa11bb48692c
https://github.com/triggerdotdev/trigger.dev/pull/4585/files#diff-b65c6918a88c874914bff3ba52c76df7281a9d3f1f023ec4dd84fa11bb48692c
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam._index/route.tsxhttps://github.com/triggerdotdev/trigger.dev/pull/4585/files#diff-b96a1c3728a280f96f747a32796a0f898523e5584725ab7f51821f16a384c6d3
View file https://github.com/triggerdotdev/trigger.dev/blob/ed4461d7060f8edf20a0a872f989c653a74a2c33/apps/webapp/app/routes/_app.orgs.%24organizationSlug.projects.%24projectParam._index/route.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/triggerdotdev/trigger.dev/pull/4585/{{ revealButtonHref }}
https://github.com/triggerdotdev/trigger.dev/pull/4585/files#diff-b96a1c3728a280f96f747a32796a0f898523e5584725ab7f51821f16a384c6d3
https://github.com/triggerdotdev/trigger.dev/pull/4585/files#diff-b96a1c3728a280f96f747a32796a0f898523e5584725ab7f51821f16a384c6d3
https://github.com/triggerdotdev/trigger.dev/pull/4585/files#diff-b96a1c3728a280f96f747a32796a0f898523e5584725ab7f51821f16a384c6d3
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4585/files
Please reload this pagehttps://github.com/triggerdotdev/trigger.dev/pull/4585/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.