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
[Controls] Allow wildcard searching in options list #158427
[Controls] Allow wildcard searching in options list #158427
Conversation
57dc9ba
to
837eabc
Compare
d429419
to
abefc72
Compare
abefc72
to
4eb520b
Compare
256c251
to
2468414
Compare
90405c3
to
f7b6226
Compare
453524a
to
e4671ec
Compare
Very nice additions and fixes @Heenawter 👏, the new flyout makes much more sense, I love it. One question: would it make sense to somehow indicate in the main interface which search option is enabled? I'm thinking in final users that likely can't access the editing UI. Not a strong opinion either way because the behaviour is quite self-explanatory anyways. What do you think? |
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.
Hi! Copy LGTM, I left a few very minor copy suggestions on behalf of @elastic/ux-writers.
I've been wondering one thing though: since it's possible to choose between "starts with" and "contains", would it make sense to show which mode is enabled on the search field itself?
src/plugins/controls/public/control_group/control_group_strings.ts
Outdated
Show resolved
Hide resolved
src/plugins/controls/public/options_list/components/options_list_strings.ts
Show resolved
Hide resolved
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.
Hi! Copy LGTM, I left a few very minor copy suggestions on behalf of @elastic/ux-writers.
These are very, very good points. @andreadelrio, any idea how we might indicate which search method is being used in the UI? I looked at potentially using an icon, but I couldn't find any that feel like a good fit... Changing the placeholder for the search box seems like a good route, but I'm not really sure what would make the most sense for that - would |
@Heenawter, the placeholder for the search box sounds good to me. After years of using Jira at different companies, I got used to the way they do it So what you suggested sounds kind of natural to me: "Starts with" and "Contains". Not a fan of ellipsis in search fields but this is one case where it wouldn't bug me too much as those sound like starting a sentence "Starts with..." - "Contains..." No strong opinion here. |
@florent-leborgne Yes, I think I like changing the placeholder to Screen.Recording.2023-06-02.at.9.57.06.AM.mov@andreadelrio @jsanz @ThomThomson Thoughts on this? |
Oh yes the |
I think this works great! and it's an existing pattern in other apps. |
Very neat, compact, and totally "out of the way", nice!! 💯 |
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 is looking very clean. In addition to fixing the title bug, you've also fixed the issue where canceling out of the control form would give you a warning even if you had no changes. Nice!
Excellent functional and jest test additions. Tested this locally (thanks for fixing the expand width bug so quickly) and by looking through the code and everything LGTM! Left a couple small nits.
src/plugins/controls/common/control_group/control_group_panel_diff_system.ts
Show resolved
Hide resolved
src/plugins/controls/public/control_group/editor/control_editor.test.tsx
Outdated
Show resolved
Hide resolved
src/plugins/controls/public/control_group/editor/control_editor.test.tsx
Show resolved
Hide resolved
src/plugins/controls/public/options_list/components/options_list_popover_action_bar.tsx
Outdated
Show resolved
Hide resolved
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
Closes #157157
Closes #152921
Summary
The primary goal of this PR is to introduce an option for wildcard ("contains") searching to the options list control:
Screen.Recording.2023-05-29.at.8.41.46.AM.mov
New Flyout Design
However, since this required adding a radio group to the custom options list settings in the create/edit control flyout, I also made some changes to the flyout design in order to better accommodate this (we were previously using
EuiSwitch
components for the control-type-specific settings, which did not work in this case because I wanted to be able to add a tooltip to describe each search type):Note in the above GIFs that, since I was using an
EuiRadioGroup
for the search technique setting, I decided it made more sense + was more consistent for the "Allow multiple selections in dropdown" to also be converted to a radio group rather than a switch. The "Ignore timeout for results" setting is the only one that remained a switch in the new design:EuiSwitch
with Tooltip BugAs part of this redesign, I also fixed a very quick bug where, because the old
SwitchWithTooltip
was defined inside the largerOptionsListEditorOptions
component, any state update onOptionsListEditorOptions
would causeSwitchWithTooltip
to also be re-rendered - this caused the "slide" animation to be interrupted on click:Title Bug Fix
And, since I was making so many changes to the flyout code as part of refactoring the code (including the design changes above), I also fixed a bug with control titles where things weren't getting set properly. To test this, consider taking the following steps:
Label
input gets updated to the new field title:Flaky Test Runner
test/functional/apps/dashboard_elements/controls/options_list/options_list_suggestions.ts:
Checklist
For maintainers