-
Notifications
You must be signed in to change notification settings - Fork 0
Add alternate term names for facet terms #731
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
base: main
Are you sure you want to change the base?
Conversation
|
Initial plan looks blank. Everything ok? |
- Add alternateName field to Term interface - Create AlternateTermNamesProvider to load map from /fe-api/alternateTermNames.json - Update bindFacetTerms to populate alternateName from map - Update export forms to display alternateName when available - Add comprehensive tests for provider and facet term binding - All tests, linting, and type checking pass
a0c633b to
2ba6252
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds support for alternate display names for facet terms in the UI filtering system. Facet terms can now show user-friendly names (e.g., "Human" instead of "Homo sapiens") while maintaining original values for filtering operations. The alternate names are loaded from an optional JSON configuration file.
Key changes:
- Added
AlternateTermNamesProviderthat loads alternate names from/public/fe-api/alternateTermNames.jsononce on mount - Extended
Terminterface with optionalalternateNameproperty - Updated facet binding logic to populate alternate names and modified export forms to display them
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/hooks/useFileManifest/common/entities.ts |
Added optional alternateName property to Term interface |
src/providers/alternateTermNames/alternateTermNames.tsx |
Created provider to load and cache alternate term names from JSON file |
src/providers/alternateTermNames/useAlternateTermNames.ts |
Created hook to access alternate term names from context |
src/providers/alternateTermNames/utils.ts |
Added utility function to look up alternate names by facet and term |
src/hooks/useFileManifest/useFetchFilesFacets.ts |
Integrated alternate term names into facet fetching hook |
src/hooks/useFileManifest/common/utils.ts |
Updated facet binding functions to accept and propagate alternate term names |
src/components/Export/components/ExportForm/components/ExportSpeciesForm/exportSpeciesForm.tsx |
Updated to display alternate name if available |
src/components/Export/components/ExportForm/components/ExportFileSummaryForm/exportFileSummaryForm.tsx |
Updated to display alternate name if available |
tests/alternateTermNames.test.tsx |
Added comprehensive tests for provider, hook, and utility functions |
tests/bindFacetTerms.test.ts |
Added tests for alternate name population in facet binding |
docs/ALTERNATE_TERM_NAMES.md |
Added detailed documentation covering setup, behavior, and usage |
| * @param searchTermsBySearchKey - Selected search terms by search key. | ||
| * @param responseFacet - Response facet of the given facet name. | ||
| * @param alternateTermNames - Optional map of alternate term names. | ||
| * @returns something. |
Copilot
AI
Dec 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return description "something" is not descriptive. It should be updated to accurately describe what the function returns, such as "file facet with populated terms and selected state" or similar.
| * @returns something. | |
| * @returns File facet with populated terms and selected state. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in commit ded05c8. Updated the JSDoc return description to "File facet with populated terms and selected state."
|
@copilot please run prettier with the appropriate version to address the runcheck issues |
- Update buildFileFacet return description from 'something' to proper description - Apply prettier formatting to all files (docs and source) - All tests, linting, and type checking pass
alternateNamefield to Term interface/fe-api/alternateTermNames.jsonbindFacetTermsto populate alternateName from loaded mapOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.