feat(minerals): add mineral family and expression system with UI components#5
Merged
feat(minerals): add mineral family and expression system with UI components#5
Conversation
- Add MineralFamily interface for normalized mineral data - Add MineralExpression interface for CDL variants - Add MineralFamilyWithExpressions combined type - Add family-based query functions: - getAllFamilies(), getFamilyById(), getFamilyWithExpressions() - getExpressionsForFamily(), getExpressionById() - getFamiliesBySystem(), searchFamilies() - findFamiliesByRI(), findFamiliesBySG() (eliminates duplicates) - getFamiliesWithSG(), getFamiliesWithDispersion() - getFamilyStats()
- FamilyCard: Gallery card for mineral families with expression count badges - ExpressionSelector: Horizontal scrollable selector for crystal forms - FamilyDetail: Full page layout for family detail with expression switching - Update exports in gallery and minerals index files
Switch RI and SG lookup functions from findMineralsByRI/findMineralsBySG to findFamiliesByRI/findFamiliesBySG. This prevents duplicate entries appearing in calculator results (e.g., fluorite, fluorite-octahedron, fluorite-twin now consolidate into single "Fluorite" entry). Add familyToGemRef converter to transform MineralFamily to GemReference.
|
🚀 Preview deployed to: https://379a2fd1.gemmology-dev.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MineralFamilyandMineralExpressionto represent mineral group relationshipsgetAllFamilies,getFamilyById,findFamiliesByRI,findFamiliesBySGFamilyCard,ExpressionSelector,FamilyDetailfor browsing mineral familiesChanges
Database Layer (
src/lib/db.ts)MineralFamilyinterface: groups minerals by family with RI/SG ranges, crystal system, hardnessMineralExpressioninterface: represents individual mineral expressions within a familyUI Components
FamilyCard: displays a mineral family with its expressions and key propertiesExpressionSelector: dropdown for selecting specific expressions within a familyFamilyDetail: detailed view of a mineral family with all expressions and propertiesCalculator Integration
useCalculatorDatahook to use family-based queriesTest plan
getAllFamilies()returns grouped mineral data