Skip to content

fix: resolve demo gaps, copy accuracy, handout qr, and attribution currency - #28

Merged
arsalan-arshad merged 3 commits into
mainfrom
feat/demo-gaps-and-accuracy-fixes
Nov 9, 2026
Merged

arsalan-arshad merged 3 commits into
mainfrom
feat/demo-gaps-and-accuracy-fixes

Conversation

@arsalan-arshad

Copy link
Copy Markdown
Owner

Summary

Resolves 7 gaps identified during the end-to-end dev store demo recording between README/guide claims and live app behavior, followed by Liquid injection security hardening and App Bridge resource picker integration:

  1. Printable Handout with QR Code (?handout=1):

    • The route now invokes renderHandoutHtml from handout.js, rendering practice branding, intro note, item usage notes, shop handoutText, footer disclaimer, and inline SVG QR code pointing to the absolute storefront share URL (https://${shop}/apps/protocols/${token}).
    • Embedded print CSS (@media print, US Letter / A4 page sizing, @page { size: auto; margin: 12mm; }, page break protections) with user-initiated "Print" button.
    • Enforces cross-shop isolation: returns 404 for a token belonging to another shop (tested); behaviour for archived protocols not changed.
    • Security Hardening: Neutralizes Liquid delimiters ({, }, %) using escapeHtml imported from proxy.js ({, }, %) across all dynamic fields, eliminating template injection risks when rendered as application/liquid.
    • Standards Mode: Injected <meta name="robots" content="noindex, nofollow"> into <head> so the document starts cleanly with {% layout none %}\n<!DOCTYPE html> without triggering quirks mode.
  2. Storefront Clipboard Copy ("Copy Link"):

    • Intercepts clicks on protocol and starter template cards (.portal-copy-link-btn) to copy the absolute share URL via navigator.clipboard.writeText with transparent fallback to hidden textarea document.execCommand('copy').
    • Displays momentary "Copied!" visual confirmation; preserves valid href as fallback.
  3. Starter Template Modal & Native Resource Picker:

    • Moved search error notification (#admin-starter-search-message) into normal document flow (position: static; margin-top: 0.75rem;), eliminating overlay blockage of the "Advanced: Enter Variant GID directly" toggle.
    • Auto-opens #admin-starter-advanced-details whenever catalog search is unavailable.
    • Clearing search input clears the error; Cancel and X buttons close the modal and reset state.
    • Integrated native App Bridge v4 product picker via window.shopify.resourcePicker({ type: 'product', multiple: true }) and otherwise shows the manual-GID message.
    • Hardened selection handler: strictly accepts only gid://shopify/ProductVariant/... GIDs (rejects product GIDs), handles user cancellation, and displays an in-flow warning if a selected product has no selectable variants.
  4. Copy Accuracy & Zero Health Claims:

    • Removed all instances of "healthcare providers", "patients", "treat", "cure", and health outcome wording.
    • Replaced with neutral professional phrasing ("professionals such as stylists, trainers, therapists, clinics").
    • Scrubbed all "commission" and "payout" claims; reworded features accurately to "aggregate attribution reports" and "CSV export of attributed orders by practice and protocol".
  5. Navigation Path & Authentic Customer Flow:

    • Updated menu navigation instructions in "How to Use" guide from legacy Online Store > Navigation (/admin/menus) to modern Shopify Admin Content > Menus (https://admin.shopify.com/store/${shopHandle}/content/menus).
    • Deep link button uses App Bridge / target="_top" for reliable iframe navigation.
    • Reworded "generates a printable PDF" to print-ready HTML page (browser print or save as PDF).
    • Accurately documented Shopify Customer Account login flow and returning practitioner request flow.
  6. Attribution Currency Clarity:

    • Displayed ISO currency code alongside all monetary figures across KPI cards, attribution tables, and RFC 4180 CSV exports.
    • Clarified metric semantics: "Net line-item revenue in store currency, excludes shipping and taxes".
    • Cleaned up KPI metric title to Attributed Revenue without duplicate currency code.
  7. Regression Guard Test Coverage:

    • Added unit and integration tests across test/handout.test.js, test/routes.test.js, test/portal.test.js, and test/admin.test.js.
    • Total test suite: 590 passing unit tests across 132 suites (zero failures).

Unverified Live Checklist (To Be Tested on Live Dev Store After Merge/Deploy)

  • Storefront printable handout with inline SVG QR code (?handout=1).
  • Browser clipboard copy behavior on protocol and starter template cards (Copy Link).
  • Native App Bridge shopify.resourcePicker behavior inside the embedded admin iframe without read_products scope (docs do not specify whether read_products is required for merchant-facing App Bridge picker).
  • Embedded Admin guide deep link to Shopify Admin Content > Menus (/content/menus).

Scope and Privacy Integrity

  • Scopes remain strictly read_orders. No new scopes added.
  • Zero shopper PII logged or stored.
  • Clean-room compliant: zero client names or specifics.

@arsalan-arshad
arsalan-arshad merged commit 3eb1e10 into main Nov 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant