fix(admin): clarify legacy null-country submissions in review UI#947
Merged
ericsocrat merged 1 commit intomainfrom Mar 17, 2026
Merged
fix(admin): clarify legacy null-country submissions in review UI#947ericsocrat merged 1 commit intomainfrom
ericsocrat merged 1 commit intomainfrom
Conversation
- Add nullLabel prop to CountryChip for null-country fallback rendering - Show 'No country' chip with muted styling for legacy submissions - Add legacy help text: 'Submitted before country tracking was added' - Add GS1 informational hint for null-country with known GS1 barcode - Add 'No country' filter option in country dropdown (__none__ sentinel) - Use effectiveCountry variable to simplify GS1 mismatch logic - Add 3 new admin i18n keys to en/pl/de locales - Update 1 existing test + add 6 new tests (63/63 passing)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Bundle Size Report
✅ Bundle size is within acceptable limits. |
There was a problem hiding this comment.
Pull request overview
Adds explicit UX for legacy submissions that have no scan/suggested country, so admins can still see a meaningful “no country” indicator and related GS1 context in the submissions review UI.
Changes:
- Extend
CountryChipwith anullLabelprop to render a fallback chip whencountryisnull. - Update admin submissions page to display fallback country chip + legacy info/GS1 hints when country is missing, and add a “No country” filter option.
- Add/adjust tests and i18n strings for the new UI paths.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/components/common/CountryChip.tsx | Adds nullLabel rendering path when country is null. |
| frontend/src/components/common/CountryChip.test.tsx | Tests fallback chip behavior for null-country with nullLabel. |
| frontend/src/app/app/admin/submissions/page.tsx | Uses fallback chip + adds legacy null-country help text/GS1 hint + adds “No country” filter option. |
| frontend/src/app/app/admin/submissions/page.test.tsx | Updates mocks/tests to cover null-country chip and new filter option behavior. |
| frontend/messages/en.json | Adds admin translations for null-country labels/hints. |
| frontend/messages/pl.json | Adds admin translations for null-country labels/hints. |
| frontend/messages/de.json | Adds admin translations for null-country labels/hints. |
Comment on lines
284
to
288
| {c.code} | ||
| </option> | ||
| ))} | ||
| <option value="__none__">{t("admin.noCountry")}</option> | ||
| </select> |
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.
Problem
Production smoke test after epic #920 deployment revealed 3 legacy submissions (Coca-Cola, Kellogg's Krave, PG Tips — all from Feb 2026) with zero country context in the admin review UI. Both
scan_countryandsuggested_countryare NULL for these rows because they were submitted before country tracking was added in epic #920.Root cause: Missing feature / scope gap — NOT a regression. Epic #920 correctly implemented country-aware features for new submissions only. No fallback UX was designed for pre-existing null-country rows.
Changes
CountryChip.tsx
nullLabel?: stringprop — backward compatible (existing callers unaffected)countryis null ANDnullLabelis provided → renders muted chip withFallbackFlag+ label textcountryis null AND nonullLabel→ still returns null (existing behavior preserved)Admin Submissions Page (page.tsx)
effectiveCountryvariable (replaces inlinesuggested_country ?? scan_country)nullLabel={t("admin.noCountry")}→ shows "No country" chip for legacy rows__none__sentinel value in country dropdowneffectiveCountryvariablei18n (3 locales)
admin.noCountry/admin.noCountryHint/admin.gs1InfoHintto en.json, pl.json, de.jsonTests
data-null-countryattribute)__none__, mismatch badges suppressed for null-country, CountryChipnullLabelrenderingHard Rules Followed
Verification
New/Updated Tests
CountryChip.test.tsx— 1 new test (nullLabel rendering)page.test.tsx— 1 modified + 5 new tests (legacy UX coverage)File Impact
7 files changed, +206 / -35 lines
Follow-Up (Not in Scope)
Backend
api_admin_get_submissionsdoes not yet handle the__none__sentinel for NULL-country filtering. The frontend sends it correctly; backend handling can be added as a separate issue.