Open hlapp opened 2 years ago
This continues to be the case in deployment release/v0.4.0
. However, only the first phyloreference one clicks is marked as modified. Subsequently clicking other phyloreferences does not mark them as modified, too.
Thanks for reporting this! It looks like the Specifier component adds a label to every taxon concept when it is displayed if it doesn't already exist, which triggers the "this file has changed" code. I'll dig into this further and see if I can figure out why that's happening.
(There is a quick-and-dirty fix for this issue in branch fix-issue-263, which is that if you add an explicit label to every taxon concept in brochu_2003.json
, then it won't add labels anywhere. But I suppose we should fix this properly.)
Principle of least surprise says that ideally the Specifier should not fill in a value on the behalf of the user.
May have to defer it.
Actually, it might be possible to fix this by improving the comparison we do here:
i.e. if we normalize both taxonomic units before comparing them, then we should never update a specifier unless it has in fact changed significantly. Worth trying.
Update (2023nov8): This code should be used everywhere we need to compare two taxonomic units, but we will need similar code for every other type of object we need to compare in the ModifiedCard/ModifiedIcon.
At least in the deployed version (refs/tags/v0.3.1), when I open Brochu 2003 as the example file, then click on phyloreference Crocodylia, it immediately marks as modified, displaying the exclamation point marker and the "This phyloreference has been modified since being loaded! Use 'Save' to save your changes." banner.