bytechefhq / bytechefhq/bytechef
Switching environments in the workflow editor no longer redirects to deployments
- Dominant language
- Java
- Stars
- 1k
- Forks
- 170
- Avg merge
- 11h 25m
- Merged PRs (30d)
- 115
Description
## Problem
When the workflow editor is open (`/automation/projects/:projectId/project-workflows/:projectWorkflowId`) and the user switches the environment from **Development** to **Staging** or **Production**, the editor stays open. Projects and their workflow editors only exist in Development, so the user should be redirected to the **Project Deployments** page (`/automation/deployments`). The same applies to the embedded integration editor, which should redirect to `/embedded/configurations`.
This is a regression — it used to work.
## Cause
Commit 33f0d82bc1e (PR #5602, *Move the environment selector into the app sidebar header*) removed the environment submenu from the avatar dropdown in `AppSidebarFooter`, and with it `handleEnvironmentValueChange`, which navigated to `/projects` / `/deployments` (or `/integrations` / `/configurations`) after a switch. The new `EnvironmentSelect` in `AppSidebar` only updates the environment store. The `projects` route loader's redirect runs only on navigation, so a store change never re-evaluates it.
## Expected
Switching away from Development while on a Development-only page (projects, workflow editor, integrations, integration editor) redirects to the environment-scoped deployments/configurations page. Environment-aware pages (connections, executions, …) stay where they are.
Contributor guide
Assessment
This issue has not been assessed yet.