-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open start workspace in modal from projects list #15914
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
started the job as gitpod-build-bmh-allow-users-to-close-15696.2 because the annotations in the pull request description changed |
/werft run 👍 started the job as gitpod-build-bmh-allow-users-to-close-15696.3 |
@@ -31,7 +31,7 @@ export default function RepositoryFinder(props: RepositoryFinderProps) { | |||
setSuggestedContextURLs(urls); | |||
saveSearchData(urls); | |||
}); | |||
}, [suggestedContextURLs]); | |||
}, []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this effect updates suggestedContextURLs
, having it as a dep caused it to constantly run as soon as it calls setSuggestedContextURLs
@@ -17,6 +17,8 @@ export interface StartWorkspaceModalProps { | |||
ide?: string; | |||
workspaceClass?: string; | |||
contextUrl?: string; | |||
// If contextUrl is provided, setting `allowContextUrlChange` to true will allow it to be changed still | |||
allowContextUrlChange?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't want to change existing behavior for when the start workspace ui locks that context url, so adding this option felt like the safest approach.
Thanks @selfcontained |
href: gitpodHostUrl | ||
.withContext(`${branch.url}`, { showOptions: true }) | ||
.toString(), | ||
onClick: () => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like the preserving of context here!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM, and trust @jldec test. ✔️
Description
This adjusts the Start Workspace UI from the Projects list page and Branches page to open in a modal vs. redirecting to a new page. This allows the modal to be closed, and avoids losing your context of what you were doing when you opened it.
While in here, I also noticed the RepositoryFinder component was continuously making calls to
getSuggestedContextURLs
due to auseEffect()
dep that it mutate, so I corrected that was well.I added an option to the StartWorkspaceModal to allow the
contextUrl
to be changed even if passed in, as locking it felt unnecessary here, although we do default it to the project's url.Related Issue(s)
Fixes #15696
How to test
New Workspace...
Release Notes
Documentation
Build Options:
Experimental feature to run the build with GitHub Actions (and not in Werft).
If enabled this will build
install/preview
Valid options are
all
,workspace
,webapp
,ide
,jetbrains
,vscode
,ssh