Skip to content

F3 — Frontend Nuxt + Favoritas - #2

Merged
yan-vidal merged 19 commits into
mainfrom
f3-web-nuxt
Jun 16, 2026
Merged

F3 — Frontend Nuxt + Favoritas#2
yan-vidal merged 19 commits into
mainfrom
f3-web-nuxt

Conversation

@yan-vidal

Copy link
Copy Markdown
Owner

Porte completo do front legado (Vue CLI/Vuex) para Nuxt 3 + Vuetify 3 + Pinia, mais o recurso de fotos favoritas. Fecha a feature F3 (.specs/features/03-web-nuxt-favoritas/, tarefas P1–P10).

O que entra

  • P1 — API favoritas: campo favorite em Image/@conteai/shared, filtro GET /images?favorite=..., upload/edit aceitam o campo.
  • P2–P3 — Fundação web: useApi tipado, stores Pinia auth/theme persistidas, rotas (/, /gallery, /secretdoor, /upload, /list) com middleware de auth e HeaderBar.
  • P4 — Matemática do modal: utils/modalResize.ts porta resize() do legado, provado contra fixture golden.
  • P5 — Galeria + favoritas: grid full-viewport, default favoritas, toggle ?all=true, filtros de URL legados, empty-state com CTA, ordenação metadata.takenAt desc.
  • P6/P10 — Modal: abre por deep-link ?id=&version=, navegação teclado/swipe, e chrome portado fielmente com Vuetify (EXIF, delimitadores de versão, checkbox no-edit, menus de local/data), com a geometria da foto ajustada para todos os viewports e rotação.
  • P7 — Login: /secretdoor (design "Secret Door"), token/payload no Pinia.
  • P8 — Upload: multi-arquivo, nomes de versão, Original exclusivo, Favorita marcada por padrão.
  • P9 — List/Edit: admin lista/edita/exclui imagens, toggle de favorita na linha.

Regressão visual

Suíte nova tests/visual/webPort.spec.ts (playwright.web.config.ts, app na porta 3003, 6 viewports) compara o Nuxt contra os goldens do legado: 66/66 verdes. Thresholds calibrados por diff consciente e documentado — galeria 0.04 (sub-pixel <img> vs v-img), chrome do modal 0.05 (padding/sombra do Vuetify, RV5). Goldens de login/redirect recapturados para o design pt-BR; golden mobile-landscape do modal substituído (era artefato de loading do legado).

Verificação

  • Vitest web 21/21 · typecheck/lint/build verdes (Node 26) · Sentiness standard ok.
  • Visual: pnpm visual:web (legado segue em pnpm visual:legacy).

Pendências não-bloqueantes (decisão de produto)

  • Localizar ou não o heading "Secret Door" hardcoded.
  • Manter o redesign de login ou reaproximar do legado.

yan-vidal and others added 19 commits June 14, 2026 11:00
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds @pinia-plugin-persistedstate/nuxt and @conteai/shared (workspace) to apps/web.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Rebuild the modal info chrome (EXIF panel, version delimiters, no-edit
checkbox, location/datetime menus) with Vuetify to match the legacy
ModalViewerImage exactly, instead of the earlier plain-HTML divergence.
Keep the pixel-faithful <img> photo stage and port the legacy geometry
fixes (no padding on .modal-viewer, synchronous resize on rotation,
v-dialog max-width clamp, absolute-fill img) so rotated/clamped layouts
center correctly across all viewports.

Port the 12 legacy custom SVG icons to components/icons/ (used via v-icon
slot) and the DD/MM/YY HH:MM date formatter to utils/date.ts. Update the
modal vitest to reveal/expand the chrome and assert location links.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The gallery is a full-viewport grid that owns its own chrome, so the
global HeaderBar is hidden on /gallery to match the legacy layout. Gate
Nuxt devtools behind NUXT_DEVTOOLS so visual captures run clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add the missing vue imports (nextTick, onBeforeUnmount, onMounted) and
prefix browser globals (globalThis.HTMLElement/IntersectionObserver/window)
to clear eslint no-undef. Drop the obsolete "All" text assertion in the
gallery vitest (the label moved out of the rendered text).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add playwright.web.config.ts (new app, port 3003, 6 viewports), the
visual:web script and point the default config at it. Add webPort.spec.ts
and web-port.helpers.ts comparing the Nuxt app against the legacy goldens
across gallery, modal (landscape/portrait/rotated/details/multi-version/
original) and login/redirect states.

Calibrate thresholds for conscious, understood diffs: GALLERY_SNAPSHOT
0.04 (plain <img> sub-pixel decode noise vs v-img) and CHROME_SNAPSHOT
0.05 (Vuetify padding/shadow divergence in the modal chrome). Recapture
the login/redirect goldens for the pt-BR "Secret Door" design and replace
the spinner-loading mobile-landscape modal golden with the correct render.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bring back the blurred low-res placeholder shown while a photo loads (the
legacy v-img lazy-src blur-up), lost when the gallery and modal switched to
plain <img>. A blurred base64 layer (lazyThumbnailBase64) sits behind the
photo, which stays opaque and covers it once it paints — keeping the gallery
SSR-visible and the loaded-state goldens unchanged, with no JS load race.
Restore parity with the legacy ModalEditImage: the base64 lazy thumbnail is
editable per version and on the original in the admin edit form. saveImage
already sends the whole original/images objects, so the value persists.
Manual testing of the new front against the production API surfaced six
interactions that diverge from the legacy app (gallery date picker, modal
location/date menus, modal chrome visibility, theme toggle layout, modal
nav/rotation button position, theater scrollbar). Capture each with code
references and a golden-driven fix methodology in HANDOFF-parity-fixes.md
so another agent can pick them up.
@yan-vidal
yan-vidal merged commit a7a1e31 into main Jun 16, 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