describo / crate-builder-component

A VueJS UI component to build an RO-Crate
MIT License
6 stars 3 forks source link

Keep current tab when profile changes with compatible layout #74

Closed beepsoft closed 10 months ago

beepsoft commented 10 months ago

This is a suggestion for a small enhancement that is similar to how such change is handled for entities and keeping the current tab if resetTabOnEntityChange==false. In my app we change the profile frequently and would be great to keep the current selected between profile changes.

When the profile changes, previously we automatically reset the tab to "about" uncoditionally.

In this implementation we change to "about" if resetTabOnEntityChange==true or if the new profile doesn't have a layout matching the currently selected one. In this case we fall back to "about".

Here I used resetTabOnEntityChange but maybe we should introduce a resetTabOnProfileChange or have just one such flag to control any tab changes, eg. resetTabOnChange

marcolarosa commented 10 months ago

This is a great idea. Since we have properties for everything else I think it makes sense to add another property resetTabOnProfileChange to specifically target this behaviour. I'll merge this pull request and then add that property.