feat: Extend version toggle to support runs routes#2478
Open
morgan-wowk wants to merge 1 commit into
Open
Conversation
🎩 PreviewA preview build has been created at: |
2259173 to
a84efb5
Compare
The EditorVersionToggle is already mounted in both run views' headers (legacy via DefaultAppMenu, v2 via AppMenuActions in RunViewMenuBar), but it only recognized /editor and /editor-v2 paths, so it never rendered on /runs and /runs-v2. Generalize the toggle to swap between any v1/v2 route-base pair, preserving the rest of the path (run id and subgraph execution id), so users can move between the new and legacy run views the same way they do for the editor.
a84efb5 to
7de5507
Compare
EditorVersionToggle to support runs routes and add tests
EditorVersionToggle to support runs routes and add tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Show the editor/legacy switcher on the run view pages of both versions. Previously the switcher only appeared on the editor routes (
/editorand/editor-v2).The
EditorVersionToggleis already mounted in both run views' headers — legacy viaDefaultAppMenu, and V2 viaAppMenuActionsinsideRunViewMenuBar— but it only recognized/editorand/editor-v2paths, so it rendered nothing on/runsand/runs-v2, leaving no way to move between the new and legacy run views.This generalizes the toggle to swap between any v1/v2 route-base pair (
/editor↔/editor-v2,/runs↔/runs-v2), preserving the rest of the path — the run id and optional subgraph execution id. No new UI and no changes to the run-view pages were needed; the existing shared component now lights up on run routes too.Related Issue and Pull requests
Type of Change
Checklist
Screenshots (if applicable)
Test Instructions
v2_editorflag enabled, open a run in the legacy run view (/runs/:id) — the switcher (sparkles icon, "Switch to new editor") now appears in the top bar and navigates to/runs-v2/:id./runs-v2/:id), the switcher ("Switch to legacy editor") navigates back to/runs/:id./editor,/editor-v2) behave exactly as before.Additional Comments
Added
EditorVersionToggle.test.tsx(8 cases: flag-disabled, route with no counterpart, and both switch directions for editor / run / run-with-subgraph).tsc --noEmitandeslintare clean.