Repository navigation
Conversation
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.
closes #1116
Summary
Adds an accessible public scan completeness preview for the emergency QR profile (issue #1116). It shows the owner exactly which field categories an anonymous scanner will see — before they publish or change the profile.
What changed (all additive, no existing behaviour touched)
src/utils/emergencyProfilePreview.ts— pure, dependency-free helperbuildCompletenessPreview(profile)that reuses the existing, testedprojectEmergencyProfileprivacy projection. Each of the five field categories (medical notes, contacts, emergency vet, poison control, custom message) is reported withvisible(enabled and populated),hasContent, andvisibleOnMobile/visibleOnDesktop(the public scan is responsive, so the visible set is identical on both viewports).src/components/EmergencyProfile/EmergencyProfileCompletenessPreview.tsx— a keyboard- and screen-reader-friendly panel (<section>+ real<ul>list, per-row status text that does not rely on colour alone) summarising which fields are shown vs hidden, and calling out when data exists but is still set private.emergencyProfilePreview.test.ts(primary flow, empty/denied/null, all-public boundary, per-itemisPublicoverride on contacts) andEmergencyProfileCompletenessPreview.test.tsx(render + jest-axe accessibility, no violations).Mounting (for review)
The component is self-contained and ready to drop into the owner view of
src/pages/pets/[id]/emergency.tsx, e.g. inside the ownermainpanel:Verification
jest(ts-jest): 20/20 passing across the 3 relevant suites, including the pre-existingemergencyProjection.test.ts(unchanged) — zero regression.tsc --noEmit: no type errors in the added files.visibilityflags; this PR only surfaces them.