console icon indicating copy to clipboard operation
console copied to clipboard

frontend: allow searching schemas by schemaID in schema list

Open rikimaru0345 opened this issue 1 year ago • 22 comments

https://github.com/redpanda-data/console/assets/28133019/865d4e61-031c-4345-bdc3-9eb9b45da5ad

rikimaru0345 avatar Feb 29 '24 14:02 rikimaru0345

still needs tests

rikimaru0345 avatar Feb 29 '24 14:02 rikimaru0345

I think we should adapt the place holder value for the search bar to make clear that:

  1. You can also filter by schema id
  2. That when using numbers in the search we are also matching against schema IDs and not necessarily only against the subject name

As you can see in this example the subjects can also contain numbers (e.g. 1 would be a subject). If you type a schema id 1 it may show subjects that contain schemas with id 1 or also subjects that contain 1 as part of the name

@micheleRP @ivpanda For suggestisons how to make that clearer. If reasonable only by text change to avoid additional work :D

weeco avatar Mar 04 '24 15:03 weeco

As you can see in this example the subjects can also contain numbers (e.g. 1 would be a subject). If you type a schema id 1 it may show subjects that contain schemas with id 1 or also subjects that contain 1 as part of the name

I think what needs to be conveyed is too long for placeholder text. @ivpanda: Could we do a tooltip on the search box with something like: Enter search term/regex. Results for schema IDs include subjects with that number in their name.

Or we could put page help text above the search box?

micheleRP avatar Mar 04 '24 19:03 micheleRP

@rikimaru0345 there seems to be a problem with the initial state when loading the page https://www.loom.com/share/951224015bd3465d86d43918f904ef90

jvorcak avatar Mar 05 '24 08:03 jvorcak

In addition to the tooltip near the search bar I could imagine adding a hint that is always shown when the search is performed with a positive integer (i.e. a valid schema id). It could explain how the results are shown:

3 Results (should be shown by default once that is fixed)

When you enter a number in the search box, we attempt to match it against both subject names and schema IDs. If the number matches a schema ID exactly, we'll display all subjects referencing that schema in the search results.

Maybe as a placeholder just "Enter subejct name or schema ID"? I think we do not necessarily to point out the regex option, but could mention that in the tooltip near the search box. Not sure how a tooltip near a search input would look like though.

weeco avatar Mar 05 '24 11:03 weeco

I'll add a tooltip to the search box to clarify what the options for search are. Will post a screenshot once it's done

rikimaru0345 avatar Mar 05 '24 12:03 rikimaru0345

image

rikimaru0345 avatar Mar 05 '24 13:03 rikimaru0345

@rikimaru0345 there seems to be a problem with the initial state when loading the page https://www.loom.com/share/951224015bd3465d86d43918f904ef90

fixed In the latest commits

rikimaru0345 avatar Mar 05 '24 13:03 rikimaru0345

I tried a few things here— let me know what you think of these approaches. I tried not to add a label and help text because we don't do that anywhere else in the app for this filter box.

Informational text after searching a number

image image

This feels fine but not ideal; it'll push the results table down and then we'll also have to think through if we want to show any text for any other instances (regex, subject name, etc).

Sidebar for help

There's precedent here because we use this same drawer for helping users with choosing CIDRs:

searching

No matter what, the placeholder inside the box before a user starts typing should be Filter by subject name or schema ID...

Do any of these feel like an improvement? Or do they all feel like they don't quite hit the mark?

ivpanda avatar Mar 05 '24 17:03 ivpanda

No matter what, the placeholder inside the box before a user starts typing should be Filter by subject name or schema ID...

ok

Do any of these feel like an improvement?

I feel the best is the last one, along with the little info icon in the text you used other images

rikimaru0345 avatar Mar 05 '24 20:03 rikimaru0345

@weeco What do you think?

@micheleRP, in case you want to make suggestions, this is the text I have in the sidebar:

Filtering schemas There are two ways to filter schemas, and they work a little differently.

Numbers When you enter a positive number in the search box, we attempt to match it against both subject names and schema IDs. If the number matches a schema ID exactly, we'll display all subjects referencing that schema in the search results.

Name or regex When searching for a subject name or using a regex, only the subject name is checked.

I don't think there is any documentation we'll want to link to here, so I can remove that.

ivpanda avatar Mar 05 '24 20:03 ivpanda

Also, to be clear, I was proposing one OR the other here— not the info icon and the sidebar, but only one of the two.

ivpanda avatar Mar 05 '24 20:03 ivpanda

done

https://github.com/redpanda-data/console/assets/28133019/374bd127-feef-46ae-a037-b4da51c3d754

rikimaru0345 avatar Mar 05 '24 20:03 rikimaru0345

I recommend changing the text to not be about number, but instead about what they want to search for. So what fields you can search on, that it supports regex, and how to search for schema id. Just an idea.

mo-redpanda avatar Mar 05 '24 20:03 mo-redpanda

Follow-ups:

Text:

Filtering schemas There are two ways to filter schemas, and they work a little differently.

Schema ID To find a schema by ID, enter its number in this box. If the number matches a schema ID exactly, we'll display all subjects referencing that schema in the search results.

Subject name To focus the filtering on a subject name, filter either by that specific name or a regex.

Help placement

Putting the link next to the box itself rather than below it:

image

ivpanda avatar Mar 05 '24 21:03 ivpanda

I think right next to the box we usually show the number of found results from that search. This will cause issues or further shifting

weeco avatar Mar 05 '24 21:03 weeco

Oh. I didn't see that in the text. If that is the case, then I can make the call based on how it looks while it's being used, or just leave it below the box.

ivpanda avatar Mar 05 '24 22:03 ivpanda

I think right next to the box we usually show the number of found results from that search. This will cause issues or further shifting

For this page, we don't do that yet. I can easily add it though.

As for layout shifting, I think that is not a problem, we can just put the number of results into the input box...

image

rikimaru0345 avatar Mar 05 '24 23:03 rikimaru0345

suggested text:

Subject name: To search subject names, enter that specific name or a regex. Schema ID: If a number matches a schema ID, the results include all subjects referencing that schema.

micheleRP avatar Mar 05 '24 23:03 micheleRP

OR:

Subject name: Enter a term or a regex to search subject names. Schema ID: Enter a number to search schema IDs. Results include all subjects referencing that schema.

micheleRP avatar Mar 06 '24 00:03 micheleRP

As for layout shifting, I think that is not a problem, we can just put the number of results into the input box...

@rikimaru0345 I like the screenshot you showed and I'd like to see that. +1 to @micheleRP 's second text suggestion.

ivpanda avatar Mar 06 '24 21:03 ivpanda

The text suggestion has been applied in the previous commit 👍

rikimaru0345 avatar Mar 07 '24 15:03 rikimaru0345