feat(scanner): implement 15 mobile UX polish recommendations (R1-R15)#953
feat(scanner): implement 15 mobile UX polish recommendations (R1-R15)#953ericsocrat merged 1 commit intomainfrom
Conversation
R1: Replace native <select> with CategoryPicker pill grid R2: Add ContributorBadge to submission success state R3: Add sticky bottom submit button with safe-area padding R4: Add character counter to notes field R5: Add submission guidelines to submissions list page R6: Lazy-show date dividers in scan history R7: Add not-found indicator to scan history ScanRow R8: Add filter buttons (All/Found/Not Found) to history R9: Add pull-to-refresh to scan history (PullToRefresh) R10: Switch scan hub layout to 2x2 action grid R11: Add breadcrumbs to all scanner sub-pages R12: Add EmptyStateIllustration to submissions empty state R13: Unify score → TryVit Score display in scan history R14: Add press-scale to tappable elements via globals.css R15: Add GS1 country hint badge to submit page Includes full i18n (en/de/pl), 55 new scan page tests, updated CategoryPicker expand/collapse tests. 5826 tests pass, 0 TypeScript errors, 0 lint errors.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Bundle Size Report
✅ Bundle size is within acceptable limits. |
There was a problem hiding this comment.
Pull request overview
Implements a set of mobile UX polish updates across the scanner flow (scan hub, history, submit, submissions), aligning the UI with post-audit recommendations and standardizing newer UI primitives (CategoryPicker, EmptyStateIllustration, PullToRefresh, TryVit Score display).
Changes:
- Replace category
<select>with a pill-basedCategoryPicker(with expand/collapse) and update tests/i18n accordingly. - Improve scan history UX (pull-to-refresh wrapper, date section dividers, filters, and unified TryVit Score badge rendering).
- Improve submit flow UX (sticky bottom submit bar, success state before redirect, additional hints/disclaimer placement) with corresponding test updates.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/styles/globals.css | Adds shake keyframes/animation token for scanner UI feedback. |
| frontend/src/components/scan/ScanResultView.tsx | Exports FadeSlideIn and updates not-found UI to use EmptyStateIllustration + shake animation. |
| frontend/src/components/scan/CategoryPicker.tsx | Adds collapse/expand behavior and press interaction styling for category pills. |
| frontend/src/components/scan/CategoryPicker.test.tsx | Extends coverage for active press styling and expand/collapse behavior via module mocking. |
| frontend/src/app/app/scan/submit/page.tsx | Adds sticky bottom submit bar, success banner + delayed redirect, and form id wiring for external submit button. |
| frontend/src/app/app/scan/submit/page.test.tsx | Updates mocks/assertions for i18n keys and accounts for delayed redirect behavior. |
| frontend/src/app/app/scan/submissions/page.tsx | Removes “back to scanner” link in favor of the updated navigation/breadcrumb UX. |
| frontend/src/app/app/scan/submissions/page.test.tsx | Updates i18n expectations and mocks for new empty state/breadcrumb elements. |
| frontend/src/app/app/scan/page.tsx | Wraps camera error state in FadeSlideIn and tweaks viewfinder/torch button transitions. |
| frontend/src/app/app/scan/history/page.tsx | Wraps page in PullToRefresh, adds date grouping sections, and displays TryVit Score badge in rows. |
| frontend/src/app/app/scan/history/page.test.tsx | Updates i18n expectations and mocks for pull-to-refresh, empty states, and score utils. |
| frontend/messages/en.json | Adds scan history date-group labels + categoryPicker toggle strings. |
| frontend/messages/de.json | Adds scan history date-group labels + categoryPicker toggle strings. |
| frontend/messages/pl.json | Adds scan history date-group labels + categoryPicker toggle strings. |
| aria-hidden="true" | ||
| /> | ||
| <div className="mb-2 flex animate-shake justify-center"> | ||
| <EmptyStateIllustration type="no-results" titleKey="scan.notFound" /> |
| <button | ||
| type="button" | ||
| onClick={() => setExpanded((v) => !v)} | ||
| className="inline-flex items-center gap-1 rounded-full border border-dashed border-border px-3 py-1.5 text-sm text-foreground-muted transition-all duration-150 hover:border-brand/40 hover:text-foreground-secondary active:scale-95" | ||
| > |
| onSuccess: () => { | ||
| showToast({ type: "success", messageKey: "submit.successToast" }); | ||
| void eventBus.emit({ type: "product.submitted", payload: { ean } }); | ||
| router.push("/app/scan/submissions"); | ||
| setShowSuccess(true); | ||
| setTimeout(() => router.push("/app/scan/submissions"), 1500); | ||
| }, |
| await waitFor(() => { | ||
| expect(mockPush).toHaveBeenCalledWith("/app/scan/submissions"); | ||
| }, { timeout: 3000 }); |
| <div className="fixed inset-x-0 bottom-0 z-30 border-t border-border/50 bg-background/80 px-4 pb-[env(safe-area-inset-bottom,8px)] pt-3 backdrop-blur-lg md:sticky md:bottom-auto md:border-t-0 md:bg-transparent md:px-0 md:pb-0 md:pt-0 md:backdrop-blur-none"> | ||
| {showSuccess ? ( | ||
| <div className="flex items-center justify-center gap-2 py-3 text-score-green-text animate-fade-in-up"> | ||
| <CheckCircle size={20} /> |
Summary
Implements all 15 mobile UX polish recommendations from the post-audit review, elevating the scanner module from 9.1/10 toward a perfect score.
Changes (R1–R15)
<select>withCategoryPickerpill gridCategoryPicker.tsx,submit/page.tsxContributorBadgeto submission success statesubmit/page.tsxsubmit/page.tsxsubmit/page.tsxsubmissions/page.tsxhistory/page.tsxScanRowhistory/page.tsxhistory/page.tsxhistory/page.tsxscan/page.tsxhistory/,submit/,submissions/EmptyStateIllustrationon submissions empty statesubmissions/page.tsxhistory/page.tsx,ScanResultView.tsxpress-scaleutility class for tappable elementsglobals.csssubmit/page.tsxi18n
All new user-visible strings added to
en.json,de.json, andpl.json(scan., submit., submissions., categoryPicker.).Tests
history/page.test.tsx(17),submit/page.test.tsx(24),submissions/page.test.tsx(14)CategoryPicker.test.tsx— expand/collapse suite (13 tests, 4 new)Verification
14 files changed, +477 / -173 lines