ultisuite-client/fixtures/email-preview/README.md
R3D347HR4Y 8a02c10ba3 Add environment configuration and update email view components
- Created a .cursorignore file to manage local environment files.
- Updated .env.example to reflect changes in the public app URL.
- Modified the gmail workspace configuration to include the drive-suite path.
- Enhanced email view components to support attachment handling and fallback for plain text bodies.
- Improved user experience by updating attachment display logic and integrating inline attachment support.
2026-06-04 00:12:43 +02:00

40 lines
1.7 KiB
Markdown

# Fixtures aperçu mail (contraste / dark mode)
HTML minimaux qui reproduisent les conflits courants quand le **contenu distant** est autorisé en **mode sombre**.
## Utilisation
1. `pnpm dev` — ouvrir un mail dont le corps ressemble à un fixture (ou coller le HTML en mock).
2. Activer « afficher le contenu distant », thème dark.
3. Console navigateur :
- `[email-preview:contrast-repaired]` — surfaces corrigées (dark + contenu distant **autorisé**)
- `[email-preview:low-contrast]` — problèmes restants après correction (dev)
| Mode | Tail CSS fin de body | Repair runtime |
|------|----------------------|----------------|
| Dark + distant **bloqué** | Texte clair forcé | `dark-only` |
| Dark + distant **autorisé** | Texte clair + exception zones `[data-ultimail-light-surface]` | `light-surface` si fond clair **réel** (pas canvas blanc supposé) |
Le canvas par défaut pour fond transparent est **sombre** (fond app), pas blanc — évite les faux `lightSurfaces` sur mails type signature Cloudflare.
Forcer les logs hors `development` :
```bash
NEXT_PUBLIC_EMAIL_PREVIEW_CONTRAST_DEBUG=1 pnpm dev
```
## Fichiers
| Fichier | Scénario |
|---------|----------|
| `external-stylesheet-wins.html` | `<style>` après le wrapper Ultimail : texte blanc sur fond blanc |
| `inline-white-on-light.html` | `color:#fff` + `background:#f5f5f5` inline (sans prétraitement distant) |
| `dark-newsletter-on-transparent.html` | Newsletter fond clair + texte clair ; `bgcolor` partiellement neutralisé |
| `mixed-light-and-dark-sections.html` | Section gradient claire + bloc `#0b1e3d` (bunny.net-like) |
## Tests unitaires (math contraste)
```bash
pnpm test:email-preview-contrast
```