Dev Diary 27/11/2024

It’s been a bit of a frustrating day from a development point of view.

Following up on more Performer Custom Field feedback, I’ve been adding some validation for custom field names: disallowing leading and trailing whitespace, and adding a reasonable field length limit of 64 characters.

In my previous post, I mentioned a usability issue with the existing UI design for custom field data entry. I’ve spent the better part of today attempting to address it.

This is the initial view for custom fields now:

Entering field/value pair will no longer require clicking on the + button to persist the data. The + button is only enabled if the last field/value represents a valid value, and invalid field names won’t be included when submitting changes.

The difficulty that I’m having is around persisting the data. The custom fields are stored in a map of field to value, and this map is updated on a blur event - that is whenever the user unfocuses from one of the fields. Currently I have the custom fields component storing the “new” field/value pair as a separate local state variable, in addition to sending the new field/value pairs up the tree to the performer state - provided that the field name is valid and not a duplicate. This last bit is required to ensure that the new field value data is included when the user clicks submit, and therefore doesn’t need to click a button to persist the new data. This gets particularly problematic when changing the field name around, as it needs to remove the old field/value pair and replace it with the new field name. Right now I’ve mostly got it working correctly, except in the case where the user changes the field name from a valid one to an invalid one. In this case, it’s adding the old valid field value pair to the list.

If that paragraph above sounds confusing as hell, I don’t blame you. In my opinion, UI development does a great job of humbling you. I think I’ve spent a greater proportion of my time banging my head on small UI issues than any other part of stash.

I’m taking a break with the hope that a fresh, clear head tomorrow will help to better resolve this.

4 Likes