Skip to content
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

Remove free text search on contextURL #8503

Merged
merged 1 commit into from
Mar 2, 2022
Merged

Remove free text search on contextURL #8503

merged 1 commit into from
Mar 2, 2022

Conversation

laushinka
Copy link
Contributor

@laushinka laushinka commented Mar 1, 2022

Description

This change disables the free text search, and encourages searching on workspace IDs.
It's a minimum change for now - there will be follow-up tasks to improve the search[1][2].
It also includes drive-by changes of removing whitespace from searches[1].

Screenshot 2022-03-02 at 00 54 02

Related Issue(s)

Fixes #8453
Fixes #8454

How to test

  1. Go to https://lm-search-ws-8453.staging.gitpod-dev.com/admin/workspaces
  2. Search part of a contextURL - it should not work.

Release Notes

Free text search on workspace admin dashboard is not enabled anymore.

Documentation

@laushinka laushinka requested a review from geropl March 1, 2022 12:52
@codecov
Copy link

codecov bot commented Mar 1, 2022

Codecov Report

Merging #8503 (8992b7c) into main (a4dbc1a) will decrease coverage by 21.64%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #8503       +/-   ##
===========================================
- Coverage   32.82%   11.17%   -21.65%     
===========================================
  Files          33       18       -15     
  Lines        4753      993     -3760     
===========================================
- Hits         1560      111     -1449     
+ Misses       3075      880     -2195     
+ Partials      118        2      -116     
Flag Coverage Δ
components-gitpod-cli-app 11.17% <ø> (ø)
components-local-app-app-darwin-amd64 ?
components-local-app-app-darwin-arm64 ?
components-local-app-app-linux-amd64 ?
components-local-app-app-linux-arm64 ?
components-local-app-app-windows-386 ?
components-local-app-app-windows-amd64 ?
components-local-app-app-windows-arm64 ?
components-ws-manager-app ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
components/ws-manager/pkg/manager/annotations.go
...s/ws-manager/pkg/manager/internal/grpcpool/pool.go
components/ws-manager/pkg/manager/manager.go
components/ws-manager/pkg/clock/clock.go
components/ws-manager/pkg/manager/create.go
components/local-app/pkg/auth/auth.go
components/ws-manager/pkg/manager/manager_ee.go
components/ws-manager/pkg/manager/probe.go
...omponents/ws-manager/pkg/manager/pod_controller.go
components/ws-manager/pkg/manager/imagespec.go
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a4dbc1a...8992b7c. Read the comment docs.

@@ -104,7 +96,9 @@ export function WorkspaceSearch(props: Props) {
<path fillRule="evenodd" clipRule="evenodd" d="M6 2a4 4 0 100 8 4 4 0 000-8zM0 6a6 6 0 1110.89 3.477l4.817 4.816a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 010 6z" fill="#A8A29E" />
</svg>
</div>
<input type="search" placeholder="Search Workspaces" onKeyDown={(ke) => ke.key === 'Enter' && search() } onChange={(v) => { setQueryTerm(v.target.value) }} />
<input type="search" placeholder="Search Workspace IDs or Instance IDs" style={{width: "20rem"}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Shall we go with one of these here based on #8453 (comment)? Cc @geropl

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

workspaceId 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@geropl Like this?
Screenshot 2022-03-02 at 10 14 29

@laushinka laushinka force-pushed the lm/search-ws-8453 branch from 59f531c to 8992b7c Compare March 1, 2022 23:37
@laushinka laushinka marked this pull request as ready for review March 1, 2022 23:44
@laushinka laushinka requested a review from a team March 1, 2022 23:44
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Mar 1, 2022
@laushinka
Copy link
Contributor Author

laushinka commented Mar 1, 2022

Thank you for taking a look @geropl @gtsiolis 🙏🏽 It's now ready for actual review (not a draft anymore).

@laushinka laushinka requested a review from gtsiolis March 1, 2022 23:53
@gtsiolis
Copy link
Contributor

gtsiolis commented Mar 2, 2022

Looking at this now! 👀

Copy link
Contributor

@gtsiolis gtsiolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @laushinka!

Regarding the input placeholder question in #8503 (comment):

I think @geropl was only suggesting to go with the workspaceId option instead of the instanceId as described in #8453 (comment) but sounds ok to keep the friendlier placeholder.

@@ -104,7 +96,9 @@ export function WorkspaceSearch(props: Props) {
<path fillRule="evenodd" clipRule="evenodd" d="M6 2a4 4 0 100 8 4 4 0 000-8zM0 6a6 6 0 1110.89 3.477l4.817 4.816a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 010 6z" fill="#A8A29E" />
</svg>
</div>
<input type="search" placeholder="Search Workspaces" onKeyDown={(ke) => ke.key === 'Enter' && search() } onChange={(v) => { setQueryTerm(v.target.value) }} />
<input type="search" placeholder="Search Workspace IDs"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thought: I still think that long-term using more descriptive placeholders like Search by name as described in the last point in #8453 (comment) could be better. The ID, besides being a technical term, it's known within the team building the product but could be scary or ignored by users. We also scarcely reference the term workspace or instance ID in our docs.

suggestion: However, let's go with the current change as this looks obviously good and helpful and improve this if needed in a future iteration. ✔️

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also scarcely reference the term workspace or instance ID in our docs.

Initially I thought that Admins surely know that those are workspace IDs, but I realize that that was my biased assumption and the fact that we don't reference the term ID anywhere makes me see your point.
Let's see how this goes - especially when self-hosted users give us feedback, and yes we can improve this anytime. 🙏🏽

<input type="search" placeholder="Search Workspaces" onKeyDown={(ke) => ke.key === 'Enter' && search() } onChange={(v) => { setQueryTerm(v.target.value) }} />
<input type="search" placeholder="Search Workspace IDs"
onKeyDown={(ke) => ke.key === 'Enter' && search() }
onChange={(v) => { setQueryTerm((v.target.value).trim()) }} />
</div>
<button disabled={searching} onClick={search}>Search</button>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Although out of the scope of the changes in this PR, what do you think of dropping this search button here and other pages within the admin dashboard?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thinking When there is no button, would the expectation be that the search result gets updated with every key change? Or would the user be expected to hit Enter?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thought: There are cases where searching or filtering on key change is valid and useful like projects or members which usually are a finite and small data set. However, it sounds optimal to not search on key change when filtering large datasets like instance users, workspaces, etc but require enter to perform the search. 💭

Thinking out loud, we added the search button back in #3723 because we require the enter key to perform a search here but seems harmless to drop the button. Your call, feel free to move this discussion in a follow up issue. 🏓

Copy link
Member

@geropl geropl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM and tested: works and looks nice! 👍

@roboquat roboquat merged commit 31efabc into main Mar 2, 2022
@roboquat roboquat deleted the lm/search-ws-8453 branch March 2, 2022 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note size/M team: webapp Issue belongs to the WebApp team
Projects
None yet
4 participants