Persist new workspace contextURL on org change #17209
Merged
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
This PR aims to maintain the context url from the new workspace page even as the org changes.
As the context url changes, this gets set in the url hash now, and the org switcher links have a special case to handle if we're on the
/new
route so that state from the url is maintained.Considerations
I would have liked a solution that didn't require a special case for the org switching urls, but considering other approaches of trying to track the state of the new workspace page, and persist/reload it in the right places, this felt simpler. I also opted to not try and maintain the other values on that form (the ide and ws class). We could explore tracking those as well (as query params maybe?) in a followup.
Related Issue(s)
Fixes WEB-120
How to test
Preview Env: https://bmh-keep-c7205484caf.preview.gitpod-dev.com/new/#https://github.com/gitpod-io/gitpod
Risk
Low risk. This page is only enabled internally, and is unlikely to break existing behavior on the create new workspace page.
Release Notes
Documentation
Build Options:
Run the build with werft instead of GHA
Run Leeway with
--dont-test
Publish Options
Installer Options
Add desired feature flags to the end of the line above, space separated
Preview Environment Options:
If enabled this will build
install/preview
If enabled this will create the environment on GCE infra
Valid options are
all
,workspace
,webapp
,ide
,jetbrains
,vscode
,ssh
/hold