Skip to content

Fixes #38853 - Change import of AutocompleteInput#91

Merged
adamruzicka merged 1 commit intotheforeman:masterfrom
Lukshio:autocomplete_input_import
Jan 26, 2026
Merged

Fixes #38853 - Change import of AutocompleteInput#91
adamruzicka merged 1 commit intotheforeman:masterfrom
Lukshio:autocomplete_input_import

Conversation

@Lukshio
Copy link
Contributor

@Lukshio Lukshio commented Oct 22, 2025

Derived from: #89
Depends on: theforeman/foreman#10734

@Lukshio Lukshio self-assigned this Oct 22, 2025
@Lukshio Lukshio removed their assignment Oct 22, 2025
@Lukshio Lukshio changed the title Fixes #38853 - Change usage of AutocompleteInput Fixes #38853 - Change import of AutocompleteInput Oct 22, 2025
@Lukshio
Copy link
Contributor Author

Lukshio commented Oct 22, 2025

Tests are failing because required component is not merged yet

name="ssl_ca_certs"
value={inputValues.ssl_ca_certs}
type="textarea"
label={__('X509 Certification Authorities')}
Copy link
Member

Choose a reason for hiding this comment

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

Typo: Certificate, not Certification

Copy link
Contributor Author

@Lukshio Lukshio Oct 23, 2025

Choose a reason for hiding this comment

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

Thanks! I didn't notice, I just copied the old values :)

Fixed in original PR: #89

@Lukshio Lukshio force-pushed the autocomplete_input_import branch from 3697706 to fa6ecbe Compare October 30, 2025 15:52
@pondrejk
Copy link

Checking with stream + packit with this PR and the Foreman one.
There is an e2e UI test for webhooks in robottelo, I'll be running it against this, will report with results.
For now, just some comments (I'm on firefox):

I think the label spacing could confuse people to think that the labels belong to the fields above not below if you catch my drift. Also the spacing seems to be inconsistent, here Target URL has more space above it than other labels
image

I'm confused by the behavior of the validation icons for all the inputs, you can get red when searching non existent on first try:
image
then do a successful search and try again with non-matched string, you get green
image
Also empty field doesn't get icon on a first visit, but try searching and then delete the text and the icon remains for the empty field
image

Also not sure if the icon makes sense for fields like name? Is there really any real-time validation going on? The icon also gets displayed for the HTTP method picker where you really can't make a wrong pick, can you? Well, maybe if typing some nonsense in, but then the icon is still green. Here I'd say a basic dropdown without search would do.
image

I see there is an url validation in place, but again, the warning is not cleaned up when text is deleted
image

So maybe we could get rid of these validation icons altogether in places where no real validation is in place, if that's configurable in the component. Or maybe we could add those validations if thats possible.

On a more general note, if an item selection is mandatory and it is to be selected from a defined set of items it is imho a design flaw to allow users to leave the field empty or type nonsense to it -- no blaming you, I know this pattern existed in the old UI, but maybe this is an opportunity to make it less confusing. Searching through patternfy for best practices, I guess we could turn these fields into single select filters with search capability if there is a longer list of options, something like

image

taken from https://www.patternfly.org/patterns/filters/design-guidelines/#filter-types

Copy link

@pondrejk pondrejk left a comment

Choose a reason for hiding this comment

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

made some comments on UI, downstream test result tba

@pondrejk
Copy link

pondrejk commented Nov 26, 2025

I have run pytest tests/foreman/ui/test_webhook.py -k test_positive_end_to_end from robottelo, getting the selenium locator error, the test passes on latest stream, so the automation adjustment is needed to react to these changes. I'll go on to do it once this PR is finalized. I think we should add "breaks robottelo" tag, I don't have rights to do that

@adamruzicka adamruzicka added the breaks-robottelo Can be set via comment: /label breaks-robottelo label Nov 26, 2025
@Lukshio Lukshio force-pushed the autocomplete_input_import branch from fa6ecbe to 569d5e7 Compare November 26, 2025 09:50
@Lukshio
Copy link
Contributor Author

Lukshio commented Nov 26, 2025

Hi, thank you for the review @pondrejk

Spacing between inputs fixed by var(--pf-v5-c-form--GridGap)
The validation inputs:

@pondrejk
Copy link

thanks, I know packit was down, looking at the rpm build task it is queued for 2 days which is suspicious :) I'll try to rebuild with the comment but I suspect I might not have rights to do it

@pondrejk
Copy link

/packit build

@packit-as-a-service
Copy link

Account pondrejk has no write access nor is author of PR!

@adamruzicka
Copy link
Contributor

/packit build

@pondrejk
Copy link

pondrejk commented Nov 28, 2025

@Lukshio thanks for the updates, couple of points came to mind:

  • some placeholder would be nice to make people aware that the field is actually a search field, old UI had "Start typing to search", I'd say it should stay
image
  • when I type something invalid to the search, then change focus from the field, the field is cleared out (or switched to the previous selection if it's not the initial try), which is I guess what we want. But then when I roll down the menu I still see the message related to the previous search, not the valid options for selection:
image

Interestingly, the patternfly typeahead you shared behaves the same, which is I think is a bug on their side. Though when I look at the pf5 version of that template, the behavior is correct there https://v5-archive.patternfly.org/components/menus/select/react-templates/typeahead/ -- so I think we should aim for this

  • I still think it is wrong to show validation symbols for fields that are not validated or not mandatory, for example the HTTP Headers fields wants a specific structure, we don't validate it, but we make it seem like we do
image

Otherwise it looks nice, so I'll go on to adjust ds automation for this, nice work

@pondrejk
Copy link

pondrejk commented Nov 28, 2025

working on downstream tests, I wonder if we can create some unique ids for the fields, in latest version I see id=typeahead-select-input 3 times for the first tab

@Lukshio
Copy link
Contributor Author

Lukshio commented Nov 29, 2025

@pondrejk Sure, I will add the unique IDs, fix the validations, and add placeholders. I will make all the changes after approve from @adamruzicka in parent PR and then rebase it here.

@Lukshio Lukshio force-pushed the autocomplete_input_import branch from 569d5e7 to 00da227 Compare December 8, 2025 15:19
@pondrejk
Copy link

pondrejk commented Dec 9, 2025

Hi @Lukshio thanks for the improved UI, I have no further comments about the looks, but I see some functional issues with the searchable dropdowns -- when I check the dropdown after selecting some value or the value is preselected (for example http method) I can only pick the selected option
image

Sometimes (maybe on the first pass) I can see all options, but just clicking outside of the box reduces the list back to the selected one.

So the only way to change value is by clearing the field and typing the new value, but even after clicking the new value in the list, the selection moves back to the original value.

I got some surprising full page refreshes while working with the form, though I can't reproduce them regularly, not sure if it could be related to your changes, mentioning it just in case, maybe it'll sound familar

Confirming the unique IDs are there, thank you for that

@adamruzicka
Copy link
Contributor

Needs a rebase now

@Lukshio Lukshio force-pushed the autocomplete_input_import branch from 00da227 to 17200ac Compare January 22, 2026 15:11
@Lukshio
Copy link
Contributor Author

Lukshio commented Jan 22, 2026

@adamruzicka rebased, but it needs to be merged after this one theforeman/foreman#10734

@adamruzicka
Copy link
Contributor

Now this is a reasonably sized PR :)

Could you please bump required foreman version in engine.rb?

@Lukshio Lukshio force-pushed the autocomplete_input_import branch from 17200ac to 696d880 Compare January 23, 2026 11:49
@Lukshio
Copy link
Contributor Author

Lukshio commented Jan 23, 2026

Now this is a reasonably sized PR :)

Could you please bump required foreman version in engine.rb?

Updated to 3.17

@adamruzicka
Copy link
Contributor

Updated to 3.17

That's not enough, is it? If the foreman part was merged a couple of days ago into what will eventually be 3.18?

@Lukshio
Copy link
Contributor Author

Lukshio commented Jan 23, 2026

Updated to 3.17

That's not enough, is it? If the foreman part was merged a couple of days ago into what will eventually be 3.18?

That's good point, edited

@Lukshio Lukshio force-pushed the autocomplete_input_import branch from 696d880 to 0e23e9f Compare January 23, 2026 14:01
Copy link
Contributor

@adamruzicka adamruzicka left a comment

Choose a reason for hiding this comment

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

LGTM

@adamruzicka adamruzicka merged commit 2550cd7 into theforeman:master Jan 26, 2026
12 checks passed
@adamruzicka
Copy link
Contributor

Thank you @Lukshio !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaks-robottelo Can be set via comment: /label breaks-robottelo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants