bpmn-io / properties-panel

Library for creating bpmn-io properties panels.
MIT License
28 stars 20 forks source link

Support list re-ordering #378

Open Skaiir opened 1 month ago

Skaiir commented 1 month ago

Is your feature request related to a problem? Please describe.

There are plenty of cases where it is relevant to define a set of specifically ordered items. For example a list of fallback values in order of priority. Yes, this can be handled via adding another 'priority' item in the list, but this is less than ideal UX and it would be nice to have a native properties panel solution for this.

Describe the solution you'd like

Ideally, I would like to be able to configure my list with a 'sortable' or 'canReorder' boolean, which when active, would show little up and down arrows to move an element up or down one. This is probably enough, I wouldn't expect to support any sort of drag and drop functionality as this becomes to much to implement, and too visually noisy.

I think this keeps the scope small while fixing the one current pain of ordering which cannot be fixed without modifying the schema (or if you don't have access to it, delete and re-add everything in the order you want).

Describe alternatives you've considered

As mentioned, defining the order via another field in the items, but it's not ideal.

Additional context

Discussion: https://camunda.slack.com/archives/C0693F1NFK5/p1723017247141529 Relevant epic: https://github.com/camunda/product-hub/issues/1761

Skaiir commented 1 month ago

@nikku If you think this makes sense, we can provide a simple design proposal and a PR relatively promptly. This would be opt in, so it wouldn't affect any existing implementations.

Skaiir commented 1 month ago

For our particular use case, it's about re-ordering options in form dropdowns, which isn't technically crucial but a nice to have. There certainly are more scenarios where this is more of a requirement such as priority lists.

barmac commented 3 weeks ago

Thanks! I think it makes sense. Even if we don't prioritize BPMN implementation, it should still significantly reduce the effort when you provide the core implementation.