Please select the area the issue is related to
AI Workspace
Please select the aspect the issue is related to
Aspect/UI (Frontend layouts, components, styling)
Description
When a user is browsing at Project scope, several pages redirect them to the Org-level equivalent instead of staying in the current Project context. Confirmed via code audit — this is not a routing/architecture issue, it's five specific components that hardcode org-level navigation and never branch on currentProject.
Offending files: entire gateways/ module (GatewaysList.tsx, AddGateway.tsx, ViewGateway.tsx, EditGateway.tsx, GatewaysLayout.tsx) has no currentProject/useAppShell reference anywhere, every internal link/back-nav uses buildOrgPath only. serviceProvider/EditServiceProvider.tsx only destructures currentOrganization, never currentProject, so saving/cancelling a project-scoped provider edit always redirects to the org-level view (contrast with ServiceProviderNew.tsx, ServiceProviderOverview.tsx, ProvidersList.tsx, which correctly branch on scope). insights/Main.tsx (~line 127) does an unconditional buildOrgPath(...,'/gateways'). appShellMain.tsx (~line 190) has an onboarding check that navigates via buildOrgPath(currentOrganization, '/quickstart') with no branch on currentProject, ejecting a project-scoped user to the org-level quickstart wizard.
Fix pattern is mechanical and already used correctly elsewhere in the codebase: branch on currentProject ? buildProjectPath(...) : buildOrgPath(...).
Scope note: this issue is intentionally narrow, just the "bounces to the wrong scope" bug. The broader question of whether every page should be available at both Org and Project levels (e.g. a Project-picker step on org-level "Create New" flows) is a separate, larger design question tracked elsewhere.
Steps to Reproduce
- Sign in and navigate into a Project (Organizations > [Org] > Projects > [Project]).
-
- Open any Gateway page under that project, or edit an existing LLM/Service Provider, or trigger the onboarding quickstart check while project-scoped.
-
- Observe: the app redirects to the Org-level equivalent page instead of staying within the current Project scope.
Severity Level of the Issue
Severity/Major (Important functionality is broken. Should be prioritized. Doesn't need immediate attention)
Environment Details (with versions)
Reproduces in all environments (code-level issue, not environment-specific).
Please select the area the issue is related to
AI Workspace
Please select the aspect the issue is related to
Aspect/UI (Frontend layouts, components, styling)
Description
When a user is browsing at Project scope, several pages redirect them to the Org-level equivalent instead of staying in the current Project context. Confirmed via code audit — this is not a routing/architecture issue, it's five specific components that hardcode org-level navigation and never branch on
currentProject.Offending files: entire
gateways/module (GatewaysList.tsx,AddGateway.tsx,ViewGateway.tsx,EditGateway.tsx,GatewaysLayout.tsx) has nocurrentProject/useAppShellreference anywhere, every internal link/back-nav usesbuildOrgPathonly.serviceProvider/EditServiceProvider.tsxonly destructurescurrentOrganization, nevercurrentProject, so saving/cancelling a project-scoped provider edit always redirects to the org-level view (contrast withServiceProviderNew.tsx,ServiceProviderOverview.tsx,ProvidersList.tsx, which correctly branch on scope).insights/Main.tsx(~line 127) does an unconditionalbuildOrgPath(...,'/gateways').appShellMain.tsx(~line 190) has an onboarding check that navigates viabuildOrgPath(currentOrganization, '/quickstart')with no branch oncurrentProject, ejecting a project-scoped user to the org-level quickstart wizard.Fix pattern is mechanical and already used correctly elsewhere in the codebase: branch on
currentProject ? buildProjectPath(...) : buildOrgPath(...).Scope note: this issue is intentionally narrow, just the "bounces to the wrong scope" bug. The broader question of whether every page should be available at both Org and Project levels (e.g. a Project-picker step on org-level "Create New" flows) is a separate, larger design question tracked elsewhere.
Steps to Reproduce
Severity Level of the Issue
Severity/Major (Important functionality is broken. Should be prioritized. Doesn't need immediate attention)
Environment Details (with versions)
Reproduces in all environments (code-level issue, not environment-specific).