You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, after a user finishes a fish freshness scan, they are sent to the analysis dashboard to see their results (freshness index, grade, species info, and biomarker breakdown). We have plans for PDF generation, but mobile users get a lot out of native, quick-sharing options to let others (like vendors or family) know about the freshness rating via apps like WhatsApp, Telegram, or email.
This issue proposes adding a mobile-friendly "Share Scan" action button that utilizes the native browser Web Share API (with fallback for unsupported browsers/devices).
Proposed Solution
Button Addition & Styling:
In src/pages/AnalysisDashboard.tsx, add a "Share Scan" button next to existing action buttons (e.g., "New Scan").
Use an appropriate share icon from lucide-react (e.g., <Share2 className="w-4 h-4" />).
Style it using the codebase design system tokens in src/index.css (e.g., glassmorphism styles, hover scaling, monospace labels).
Sharing Handler Logic:
Check if navigator.share is supported by the user's browser.
If supported: Trigger the native share dialog with:
title: "FreshScan AI - Fish Freshness Report"
text: "I just scanned a fish ([Species Name]) using FreshScan AI. Freshness Index: [Score]% (Grade [Grade]). Check the detailed report here!"
url: Current page URL (window.location.href).
If unsupported (desktop/fallback): Copy the formatted text string + the URL to the user's clipboard and trigger a success Toast notification (e.g., "Link and report copied to clipboard!").
Tasks & Checklists
Add the "Share Scan" button to src/pages/AnalysisDashboard.tsx matching design specs.
Implement conditional check for navigator.share.
Implement clipboard fallback mechanism for desktop browsers.
Ensure the component imports are clean and run npm run lint and npm run build to verify there are no errors.
Description
Currently, after a user finishes a fish freshness scan, they are sent to the analysis dashboard to see their results (freshness index, grade, species info, and biomarker breakdown). We have plans for PDF generation, but mobile users get a lot out of native, quick-sharing options to let others (like vendors or family) know about the freshness rating via apps like WhatsApp, Telegram, or email.
This issue proposes adding a mobile-friendly "Share Scan" action button that utilizes the native browser Web Share API (with fallback for unsupported browsers/devices).
Proposed Solution
src/pages/AnalysisDashboard.tsx, add a "Share Scan" button next to existing action buttons (e.g., "New Scan").lucide-react(e.g.,<Share2 className="w-4 h-4" />).src/index.css(e.g., glassmorphism styles, hover scaling, monospace labels).navigator.shareis supported by the user's browser.title: "FreshScan AI - Fish Freshness Report"text: "I just scanned a fish ([Species Name]) using FreshScan AI. Freshness Index: [Score]% (Grade [Grade]). Check the detailed report here!"url: Current page URL (window.location.href).Tasks & Checklists
src/pages/AnalysisDashboard.tsxmatching design specs.navigator.share.npm run lintandnpm run buildto verify there are no errors.Files to Modify
src/pages/AnalysisDashboard.tsx