-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[server][dashboard] Improve 'New Workspace' modal #7715
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
This comment has been minimized.
This comment has been minimized.
282795a
to
f45eef3
Compare
6c07882
to
0651cb2
Compare
@@ -51,7 +51,7 @@ export default function Modal(props: { | |||
return ( | |||
<div className="fixed top-0 left-0 bg-black bg-opacity-70 z-50 w-screen h-screen"> | |||
<div className="w-screen h-screen align-middle" style={{display: 'table-cell'}}> | |||
<div className={"relative bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-800 rounded-xl p-6 max-w-lg mx-auto text-left text-gray-600 " + (props.className || '')} onClick={e => e.stopPropagation()}> | |||
<div className={"relative bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-800 rounded-xl p-6 max-w-lg mx-auto text-left " + (props.className || '')} onClick={e => e.stopPropagation()}> |
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.
This was making all text in all modals text-gray-600
by default, which was impractical.
I've removed it and checked several Modals, but I hope I haven't missed any side effects of this fix.
0651cb2
to
a0d9bb8
Compare
Alright, I think the current state is pretty cool. ✨
@gtsiolis @jldec Could you please take a look? 🙏 Cool things to try:
|
Looking at this now! 👀 |
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.
Looks great, @jankeromnes! 🔮
Added some first round review comments below with some non-blocking questions. 🥊
Approving to unblock merging but holding in case we could tackle any of the comments below and since someone else could take a closer look at the code changes.
/hold
</div> | ||
<div className="mt-3 flex flex-col space-y-2 h-64 overflow-y-auto" id="search-results"> | ||
{searchResults.slice(0, MAX_DISPLAYED_ITEMS).map((result, index) => | ||
<a className={`px-4 py-3 rounded-xl` + (result === selectedSearchResult ? ' bg-gray-600 text-gray-50 dark:bg-gray-700' : '')} href={`/#${result}`} key={`search-result-${index}`} onMouseEnter={() => setSelectedSearchResult(result)}> |
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.
suggestion: It would be probably good to add some right margin here to avoid squashing the highlighted reasult entry with the visible scrollbar. What do you think?
<a className={`px-4 py-3 rounded-xl` + (result === selectedSearchResult ? ' bg-gray-600 text-gray-50 dark:bg-gray-700' : '')} href={`/#${result}`} key={`search-result-${index}`} onMouseEnter={() => setSelectedSearchResult(result)}> | |
<a className={`px-4 py-3 rounded-xl mr-2` + (result === selectedSearchResult ? ' bg-gray-600 text-gray-50 dark:bg-gray-700' : '')} href={`/#${result}`} key={`search-result-${index}`} onMouseEnter={() => setSelectedSearchResult(result)}> |
BEFORE | AFTER |
---|---|
![]() |
![]() |
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.
Uh oh 😬 I'm not a big fan of either, and I think I'd prefer having the results be the same width as the input. I'll see if I can improve this somehow.
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.
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.
@gtsiolis Okay, I believe I've found an elegant fix for this 😁 I've simply made the scroll zone wider (negative X-margin) and compensated with some padding (positive X-padding). This doesn't require changing the size of other elements, and has the effect of "simply moving the scrollbar a bit to the right":
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.
Thanks for giving this a go, @jankeromnes!
suggestion: I think going with the simple inner right padding for now sounds better.
issue: Moving the scrollbar outside could make the user feel like they can scroll the through the whole modal inner elements, including title, text input, etc, not just the repository list. This also becomes more visible or an issue when always showing scrollbars, see screenshots below. This is also what I see! 👀
Light | Dark |
---|---|
![]() |
![]() |
thought: Keeping the scrollbar near the scrollbar area could help us
Regarding the scrollbar blindness issue we discussed a few days ago, here's a relevant thread[1] but unfortunately the original article has been removed. I could only find this partial screenshot[2]. 🌟
LGTM label has been added. Git tree hash: c63d3e13f3b4e80b6d013910e2fbd1b5d4ff4265
|
Would be great if it would propose the repositories I care about.
Try here. |
Exciting find, many thanks @svenefftinge! Actually this PR should already fetch all your GitHub repositories (either just You can test it by connecting GitLab and Bitbucket in Will add a GitHub App in the next deployment. However, I'll likely keep your query too, because it can probably find even more relevant results than what we already have. Thanks again! |
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.
Cool! I belive it would be better if suggestions are displayed already when you first open the dialog with an empty input. WDYT?
I also like this idea, and you can sort of simulate it by typing then removing a letter. (The order of the suggestions is currently alphabetical, which we could probably make more relevant.) We discussed this earlier today in our team meeting. Another option could be to have a helpful empty state, which explains what exactly is happening here / what you should do / where the results come from. But if we can immediately show a list of the most relevant suggestions, maybe we don't even need to "explain" the feature with an empty state (i.e. you just click on New Workspace, then you immediately see the repo you're interested in, and voilà, job done, no "learning" was required because the feature was intuitive). |
if (!provider) { | ||
return; | ||
} | ||
promises.push(this.getProviderRepositoriesForUser(ctx, { provider }).then(userRepos => { |
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 don't think reusing this method is a good idea as it limits the list of repos to the repos that have the app installed. Also fetches projects etc. IMHO this should be entirely about proposing great matches for a user, no matter an app is installed. We will grow out of what this method does pretty soon anyway.
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.
Good point, thanks. Added a TODO
comment as a first start.
a0d9bb8
to
ce6be68
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gtsiolis, jldec Associated issue: #7564 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
Thanks again @jankeromnes for pushing this through the finish line! 🏁
Cross-linking below one last round of comments related to UX that we could improve before merging this. Up for discussing more about these or leaving any of these for the next iteration and out of the scope of this PR if needed. Cc @jldec
d727b94
to
01ef76b
Compare
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.
Left two more minor comments regarding the keyboard shortcut inside the button label.
components/dashboard/src/workspaces/start-workspace-modal-context.tsx
Outdated
Show resolved
Hide resolved
components/dashboard/src/workspaces/start-workspace-modal-context.tsx
Outdated
Show resolved
Hide resolved
01ef76b
to
80e4025
Compare
Many thanks @gtsiolis for summarizing remaining concerns! Will address them or open follow-up issues. Removed the background page load ( ✅ ✅ ✅
|
…, keyboard navigation, and a new context URL suggestion API
80e4025
to
0eac52f
Compare
/unhold |
Okay, I think we've iterated enough here. 😅 Happy to iterate further with follow-up issues. 🚀 Could a kind team mate from @gitpod-io/engineering-webapp please approve this Pull Request again? 🙏 ( |
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.
Let's ship this!
Description
Improve the 'New Workspace' modal with a search input, keyboard navigation, and a new context URL suggestion API.
Related Issue(s)
Fixes #7564
How to test
New Workspace
(or hitCtrl/Cmd + O
from anywhere in the dashboard)*currently sources suggestions from:
Release Notes
Documentation
/uncc