KaotoIO / kaoto

The UI of the Kaoto project
https://kaoto.io
Apache License 2.0
36 stars 28 forks source link

Add new array elements at the top #1102

Open lordrip opened 6 months ago

lordrip commented 6 months ago

Please describe the feature that you want to propose

When adding a new array element, for instance, a new header in the setHeaders processor, it would be better to place the newly created header field at the top.

This needs to be tackled at https://github.com/KaotoIO/uniforms-patternfly side.

Here's where the new item gets concatenated: https://github.com/KaotoIO/uniforms-patternfly/blob/12b726c10c1b458613850c8de3251324cfafc8b1/src/ListAddField.tsx#L51C42-L51C106

apupier commented 6 months ago

I do not understand why adding at the top. I usually expect that new elements in array are added at the end. Can you clarify in which case it is better to add it at the top/beginning?

lordrip commented 6 months ago

Let's say we have the following structure:

Title | Add button

When adding a new element, if it appears at the end, this means scrolling down and up to create a new item, configuring it and then going to the top to add a new one. For instance with setHeaders EIP

apupier commented 6 months ago

I would expect a scroll bar for the list of item itself, so that the title and add button are always visible

lordrip commented 6 months ago

Another alternative could be to have an "Add new" button at the bottom of the newly created element.