feat(pgx): My Medications — Phase 1 (#25)#34
Merged
Conversation
…ase 1) - useMyMedications hook: add/remove/clear with localStorage persistence, drug name normalization (strips brand names, deduplicates) - extractAllDrugNames: parses pgx-drugs.yaml drug strings into searchable list of generic names, brand names, and full strings - MedicationInput component: autocomplete with keyboard nav, pill chips, clear all — CSS classes instead of inline styles - PGxPanel: "Your Medications" pinned section shows matched drug cards with enzyme context at the top; "My medications" filter chip appears when meds are set - 16 new tests (508 total, all passing) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The my-meds filter hid the pinned section AND filtered enzyme sections, resulting in a blank page. Now pinned cards are always visible, enzyme sections hide when my-meds is active, and an empty state handles missing data. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…e 2) When a drug spans multiple enzymes (e.g., atorvastatin via CYP3A4 + SLCO1B1), the pinned "Your Medications" section now groups them under one heading with color-coded enzyme badges per impact level. Single-enzyme drugs still show the simple "via ENZYME · alleles" label. Also fixes blank page when my-meds filter was active (pinned cards now always render, enzyme sections hidden when filtering by medications). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
New files
MedicationInput.tsx— autocomplete with keyboard nav, click-outside dismissuseMyMedications.ts— hook withnormalizeDrugName, localStorage sync, dedupmedications.css— CSS classes for input, pills, pinned section (no inline styles)extractAllDrugNamesadded tousePGxData.ts— parses drug strings from configTest plan
vitest run)Closes phase 1 of #25
🤖 Generated with Claude Code