frontend: allow searching schemas by schemaID in schema list
https://github.com/redpanda-data/console/assets/28133019/865d4e61-031c-4345-bdc3-9eb9b45da5ad
still needs tests
I think we should adapt the place holder value for the search bar to make clear that:
- You can also filter by schema id
- 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
As you can see in this example the subjects can also contain numbers (e.g.
1would be a subject). If you type a schema id1it may show subjects that contain schemas with id 1 or also subjects that contain1as 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?
@rikimaru0345 there seems to be a problem with the initial state when loading the page https://www.loom.com/share/951224015bd3465d86d43918f904ef90
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.
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 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
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
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:
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?
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
@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.
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.
done
https://github.com/redpanda-data/console/assets/28133019/374bd127-feef-46ae-a037-b4da51c3d754
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.
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:
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
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.
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...
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.
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.
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.
The text suggestion has been applied in the previous commit 👍