patternfly / patternfly-design

Use this repo to file all new feature or design change requests for the PatternFly project
115 stars 105 forks source link

Request enhancement to add a searchable component to the editable label group #1233

Closed imjoyjean closed 1 year ago

imjoyjean commented 1 year ago

Requesting new features, enhancements, or design changes to PatternFly

FYI @mcarrano @mmenestr

nicolethoen commented 1 year ago

@imjoyjean

currently, the advanced search input comes with a 'has words' field by default which is meant to capture search terms that don't fit into an already defined attribute.

The way the design is currently implemented, your suggestion to add a new attribute would also create a input field in the advanced search box. Is this the sort of use case your intending?

Could the 'has words' field meet your needs as it's already written. It is possible to override the attribute name so that it's something closer to your use case rather than 'has words'.

imjoyjean commented 1 year ago

@nicolethoen Hi Nicole, yes, I was hoping a new attribute would create a new label/item in the field. I'm looking at this to use for the "Edit labels" interaction in OCP and ACM, so I don't think the 'has words' would fulfill the needs for that interaction.

image (4) image (5) image (6)
imjoyjean commented 1 year ago

Update: Chatted with @mmenestr and discovered that this may be more suitable to propose an enhancement to the label group instead. The enhancement would be to add a searchable component for the existing editable labels https://www.patternfly.org/v4/components/label-group/design-guidelines

Will edit the issue to reflect the discussion.

mmenestr commented 1 year ago

Note - we think that what you want to do might actually be possible already because the menu is part of a demo, it's not part of the actual label group "component". So, in theory, you should be able to switch out the regular non searchable menu, with a searchable menu! But we're going to confirm that with dev

nicolethoen commented 1 year ago

True! Here is a POC in a code sandbox! You can attach any type of menu onto the 'add label' button.

mcarrano commented 1 year ago

@imjoyjean let me know if this addresses your request. And if so, I will close this.

imjoyjean commented 1 year ago

@nicolethoen @mmenestr thank you for the comments! Seems like it can be done!

I was wondering, 1) once you click on "Add label", could it be beneficial for there be an automatic focus on the search box so I don't have to click on it? 2) After a user adds a label, the focus could automatically be on "Add label" again.

One of the complaints I've gotten when I was doing the designs for editing labels was that we wanted to make it much more efficient, hence a user could just type and hit enter or space to generate that label after typing it out.

nicolethoen commented 1 year ago

@imjoyjean yep! that's all possible and would be the job of the developer to implement. So the design should definitely include interaction details like you're calling out. I'd even add that clicking "add label" should open the menu and move focus in to the search input - but so should triggering the "add label" button via keyboard interaction (hitting enter or space).

mcarrano commented 1 year ago

@imjoyjean does this address your needs? If so, I'd like to close this issue out.