tommaso 86a901d598 feat(theme): reduce Aspetto to a color-scheme preset, drop the token editor
The per-token editor (accent, button background, button text, font,
radius, max width, custom CSS) let a merchant produce an unreadable or
inaccessible form: the accent token only drives the keyboard focus ring,
so a light accent hid it; button background/text had no contrast guard;
custom CSS was arbitrary CSS injected into the page. Per the merchant's
call, the appearance is now a fixed, accessible design with a single
choice: light (default), dark, or auto.

- Settings "Aspetto" tab: keep only the Schema colore select; remove the
  color fields, ColorField, the hex/int/font validators and their state.
- proxy loadTheme: read only themeScheme; stop applying the other tokens.
- Preview iframe made non-interactive (sandbox="allow-scripts", inert,
  tabIndex -1, pointer-events:none) with scrolling moved to the wrapper,
  since it demonstrates a fixed design and must not look clickable.

The token columns stay in the schema, unread, so the customization
surface can be re-exposed later without a migration. theme.ts (the
engine) is untouched.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mv83a29B4eFv5ixoj6PoE1
2026-07-10 18:04:56 +02:00

Pizeta Recesso — App Shopify per la funzione di recesso

App Shopify riutilizzabile che rende un negozio conforme alla funzione elettronica di recesso ("pulsante di recesso") obbligatoria — Art. 54-bis Codice del Consumo (D.Lgs 209/2025, recepimento Dir. UE 2023/2673), in vigore per i contratti conclusi dal 19 giugno 2026.

Contesto e requisiti legali: vedi PLAN.md e ANALISI-REQUISITI-LEGALI.md.

Struttura cartelle

pizeta-recesso-app/            ← repo git (docs + codice insieme)
├─ PLAN.md                     piano multi-agente + decisioni bloccate
├─ ANALISI-REQUISITI-LEGALI.md base legale verificata
├─ README.md                   questo file
└─ app/                        app Shopify (template ufficiale Remix, TypeScript)
   ├─ app/routes/              route Remix (admin embedded + webhook)
   ├─ prisma/schema.prisma     modello dati Postgres (multi-tenant per-shop)
   ├─ extensions/              theme app extension (storefront) — in arrivo
   ├─ shopify.app.toml         config app (scopes, api_version pinnata, webhook)
   ├─ fly.toml                 deployment Fly (app "recesso-custom")
   ├─ Dockerfile               build produzione
   └─ .env.example             template variabili d'ambiente

Prerequisiti

  • Node ≥ 20.19 (vedi app/package.jsonengines)
  • Shopify CLI (npm i -g @shopify/cli)
  • Fly CLI (flyctl) per il deployment
  • Un Postgres raggiungibile (Fly Postgres o Supabase) per DATABASE_URL

Setup sviluppo

cd app
npm install

# 1. Collega la registrazione app "Legal Return PCRT" (scrive client_id nel toml)
shopify app config link

# 2. Configura le env (mai committare .env)
cp .env.example .env      # poi compila i valori

# 3. Provisiona il DB e applica lo schema Prisma
#    (imposta prima DATABASE_URL nel .env)
npx prisma migrate dev --name init

# 4. Avvia il dev server — SOLO sullo store usa-e-getta pcrt-reso-test
shopify app dev --store pcrt-reso-test

⚠️ Landmine — mai shopify app dev su store da trasferire

shopify app dev (draft app) contro un development store disabilita in modo irreversibile il trasferimento di quello store (PLAN §0-bis). Usare shopify app dev / draft SOLO su pcrt-reso-test. Mai su pizeta-pharma-2 o su store destinati al cliente. L'app finita, installata via link custom, non ha questo problema.

Strategia due ambienti (custom vs public)

Una sola base di codice public-grade, distribuita Custom ora e Public in futuro (PLAN §0-ter). Gli ambienti sono isolati per costruzione:

Ambiente Distribuzione Fly app DB
Sviluppo/test draft (app dev) locale
Custom LIVE Custom install link recesso-custom dedicato
Public (poi) Public + review recesso-public dedicato

Registrazioni Partner distinte + Fly app distinte + DB distinti → un deploy della public non può impattare gli store live sulla custom. Regole anti-rottura: migrazioni DB solo additive/backward-compatible, theme extension versionate, API version pinnata (bump solo dopo test su pcrt-reso-test).

Deployment (Fly)

I segreti si impostano con fly secrets (mai nel repo):

cd app
fly secrets set \
  DATABASE_URL="postgresql://..." \
  SHOPIFY_API_KEY="..." \
  SHOPIFY_API_SECRET="..." \
  SHOPIFY_APP_URL="https://recesso-custom.fly.dev"
fly deploy
Description
No description provided
Readme 490 KiB
Languages
TypeScript 93.8%
Liquid 2.6%
CSS 1.8%
JavaScript 1.6%
Dockerfile 0.2%