Skip to content

[FE Fix]: Correctly handle project changes from entity scoped pages#4498

Merged
bekossy merged 5 commits into
release/v0.100.9from
fe-fix/age-3790-switching-projects-keeps-evaluation-or-playground-in-url
Jun 1, 2026
Merged

[FE Fix]: Correctly handle project changes from entity scoped pages#4498
bekossy merged 5 commits into
release/v0.100.9from
fe-fix/age-3790-switching-projects-keeps-evaluation-or-playground-in-url

Conversation

@ardaerzin
Copy link
Copy Markdown
Contributor

Summary

fixes AGE-3790

Testing

QA follow-up

repro is described in ticket

Checklist

  • I have included a video or screen recording for UI changes, or marked Demo as N/A
  • Relevant tests pass locally
  • Relevant linting and formatting pass locally
  • I have signed the CLA, or I will sign it when the bot prompts me

Contributor Resources

…ects

Switching projects while on an entity-scoped page (evaluation, playground,
testset) kept the old entity id in the URL. Since that entity does not exist
in the target project, the user landed on an empty screen.

Preserve only the top-level section segment on project switch and drop nested
entity ids. All top-level sections have index pages, so the truncated path
always resolves. Logic extracted to a pure helper with regression tests.
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 29, 2026

AGE-3790

@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Jun 1, 2026 12:59pm

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 129196a1-5c1c-43fe-9264-8067533026b1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR extracts project-switch URL construction logic from ListOfProjects into a reusable buildProjectSwitchHref utility. The utility preserves the top-level page section while stripping entity-scoped routes and optionally carries forward the settings-page tab parameter. The refactored component now delegates URL building to this helper instead of inline logic.

Changes

Project-switch routing refactor

Layer / File(s) Summary
Core URL routing utility
web/oss/src/components/Sidebar/components/assets/projectSwitchHref.ts
New exported buildProjectSwitchHref function and BuildProjectSwitchHrefParams interface derive destination URLs by extracting the top-level route from the current path, defaulting to "apps", and appending tab query params only for settings pages.
URL routing utility tests
web/oss/src/components/Sidebar/components/assets/projectSwitchHref.test.ts
Vitest regression suite validates path rewrites across entity types (evaluations, testsets, apps/playground sub-routes), query-param stripping for non-settings pages, and settings-page tab parameter preservation with override logic.
Component integration
web/oss/src/components/Sidebar/components/ListOfProjects.tsx
navigateToProject imports and uses buildProjectSwitchHref instead of inline URL construction, passing workspace/project IDs, current path, and tab parameters.

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing project switching behavior from entity-scoped pages by properly handling URL structure.
Description check ✅ Passed The description is directly related to the changeset, referencing a specific linear ticket (AGE-3790) about switching projects keeping evaluation or playground in the URL.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 60.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fe-fix/age-3790-switching-projects-keeps-evaluation-or-playground-in-url

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ardaerzin ardaerzin marked this pull request as ready for review May 29, 2026 20:50
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working Frontend labels May 29, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Railway Preview Environment

Preview URL https://gateway-production-d261.up.railway.app/w
Project agenta-oss-pr-4498
Image tag pr-4498-7fc5248
Status Deployed
Railway logs Open logs
Workflow logs View workflow run
Updated at 2026-05-29T20:59:51.439Z

@ardaerzin ardaerzin self-assigned this May 31, 2026
@ardaerzin ardaerzin requested a review from bekossy May 31, 2026 18:09
@bekossy bekossy marked this pull request as draft June 1, 2026 09:13
@bekossy bekossy marked this pull request as ready for review June 1, 2026 09:16
@bekossy bekossy changed the base branch from main to release/v0.100.9 June 1, 2026 09:21
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jun 1, 2026
@bekossy bekossy merged commit f957b52 into release/v0.100.9 Jun 1, 2026
25 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Frontend lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants