Feat: Add a new user pref to display synonym counts in taxon tree - #8437
Conversation
|
Warning One or more dependencies are approaching or past End-of-Life. |
|
Warning Review limit reachedNext included review available in 7 seconds. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (10)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughTaxon tree statistics can now include counts for synonymized determinations. New preferences select synonym display and the Taxon query field. Tree rendering, empty-node handling, localization, and formatting tests support the new counts. ChangesTaxon synonym count support
Sequence Diagram(s)sequenceDiagram
participant Tree
participant tree_stats
participant get_tree_stats
participant get_synonym_counts
Tree->>tree_stats: Request taxon stats with includeSynonymCount=true
tree_stats->>get_tree_stats: Pass include_synonym_count=true
get_tree_stats->>get_synonym_counts: Aggregate synonym counts by child subtree
get_synonym_counts-->>get_tree_stats: Return counts keyed by child ID
get_tree_stats-->>Tree: Return statistics with synonym counts
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
grantfitzsimmons
left a comment
There was a problem hiding this comment.
I made one minor tweak to improve legibility for the caption that shows when you hover over the counts:
I think the implementation is well-reasoned! Although I wish users could search by either preferred or legal name without configuring preferences, I believe this resolves most issues with a simple preference switch.
- Verify that the preferences appear
- Verify that the counts are accurate to what they claim
- Verify that the search preference is respected
g1rly-c0d3r
left a comment
There was a problem hiding this comment.
Testing instructions
- Verify that the counts are unchanged from the existing behavior: synonyms used as determinations for collection objects are not included.
- Verify that, where applicable, the counts now include a third element showing the count of collection objects for which synonyms are used as determinations.
Once checked, nodes now have an additional count for synonyms.
kwhuber
left a comment
There was a problem hiding this comment.
Testing instructions
- Verify that the counts are unchanged from the existing behavior: synonyms used as determinations for collection objects are not included.
- Verify that, where applicable, the counts now include a third element showing the count of collection objects for which synonyms are used as determinations.
Fixes #3724
Checklist
self-explanatory (or properly documented)
specify7/specifyweb/specify/management/commands/run_key_migration_functions.py
Line 50 in ea04665
Testing instructions
Open the Taxon Tree Viewer.
Verify that the counts are unchanged from the existing behavior: synonyms used as determinations for collection objects are not included.
Go to User Preferences.
Enable the Show counts for synonymized nodes preference in the Taxon Tree section.
Open the Taxon Tree Viewer.
Verify that, where applicable, the counts now include a third element showing the count of collection objects for which synonyms are used as determinations.
Summary by CodeRabbit