Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simply opening a phyloreference marks it as modified #263

Open
hlapp opened this issue Sep 21, 2022 · 5 comments · May be fixed by #333 or #314
Open

Simply opening a phyloreference marks it as modified #263

hlapp opened this issue Sep 21, 2022 · 5 comments · May be fixed by #333 or #314
Assignees
Labels
bug testing Issues relating to improving automated tested of the Curation Tool user interface Issues involving the user interface. Suggests that further iteration might be necessary.
Milestone

Comments

@hlapp
Copy link
Member

hlapp commented Sep 21, 2022

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.

@hlapp hlapp added bug user interface Issues involving the user interface. Suggests that further iteration might be necessary. labels Sep 21, 2022
@hlapp hlapp added this to the Klados v1.0 milestone Sep 21, 2022
@hlapp
Copy link
Member Author

hlapp commented Sep 23, 2022

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.

@gaurav gaurav self-assigned this Oct 4, 2022
@gaurav
Copy link
Member

gaurav commented Oct 5, 2022

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.)

@gaurav
Copy link
Member

gaurav commented Nov 2, 2022

Principle of least surprise says that ideally the Specifier should not fill in a value on the behalf of the user.

@gaurav
Copy link
Member

gaurav commented Aug 30, 2023

May have to defer it.

@gaurav gaurav added the testing Issues relating to improving automated tested of the Curation Tool label Oct 11, 2023
@gaurav
Copy link
Member

gaurav commented Oct 11, 2023

Actually, it might be possible to fix this by improving the comparison we do here:

if (isEqual(result, this.remoteSpecifier)) return;

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.

areTUnitsIdentical: () => (tunit1, tunit2) => {
return areTUnitsIdentical(tunit1, tunit2);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug testing Issues relating to improving automated tested of the Curation Tool user interface Issues involving the user interface. Suggests that further iteration might be necessary.
Projects
None yet
2 participants