From 0b4162de5fed55d2c92968837176aac873d0f9a6 Mon Sep 17 00:00:00 2001 From: ilia Date: Wed, 5 Aug 2026 10:33:29 -0400 Subject: [PATCH 1/3] Fix favorite sign-in copy and pale text-secondary contrast. Logged-out favorite/report share a reason-aware SignInRequiredDialog so favorites no longer show report messaging. Replace misplaced text-secondary (light wash token) with foreground/primary on labels, auth, and menus. --- ROADMAP.md | 5 ++ e2e/README.md | 1 + e2e/tests/viewer.favorite-signin.spec.ts | 35 ++++++++ viewer-frontend/app/HomePageContent.tsx | 4 +- viewer-frontend/app/error.tsx | 2 +- viewer-frontend/app/login/page.tsx | 8 +- viewer-frontend/app/register/page.tsx | 10 +-- viewer-frontend/app/reset-password/page.tsx | 10 +-- viewer-frontend/app/upload/UploadContent.tsx | 4 +- .../app/upload/UploadPageClient.tsx | 2 +- .../components/ForgotPasswordDialog.tsx | 2 +- viewer-frontend/components/Header.tsx | 8 +- viewer-frontend/components/LoginDialog.tsx | 12 +-- viewer-frontend/components/PhotoGrid.tsx | 74 ++++++---------- .../components/PhotoViewerClient.tsx | 72 +++++----------- viewer-frontend/components/RegisterDialog.tsx | 14 +-- .../components/SignInRequiredDialog.tsx | 85 +++++++++++++++++++ viewer-frontend/components/UserMenu.tsx | 8 +- 18 files changed, 215 insertions(+), 141 deletions(-) create mode 100644 e2e/tests/viewer.favorite-signin.spec.ts create mode 100644 viewer-frontend/components/SignInRequiredDialog.tsx diff --git a/ROADMAP.md b/ROADMAP.md index 8021826..8011596 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -98,6 +98,11 @@ Living plan for product quality, auth/email reliability, and automation. - [x] **Core Web Vitals budget** — LCP + CLS gates on home gallery (`viewer.web-vitals.spec.ts`, `web-vitals-budgets.ts`) - [x] **Unify `/` and `/search`** — `/search` redirects to `/?…` with full query string (`peopleMode`, `tagsMode`, etc.) +#### UX polish (2026-08) + +- [x] **Favorite sign-in copy** — logged-out heart opens favorites messaging (not report) via `SignInRequiredDialog` +- [x] **Text contrast** — replace misplaced `text-secondary` (pale wash token) with `text-foreground` / `text-primary` on labels, auth dialogs, menus + ## Later - [x] Proper DEV deploy (`next start` + CI image) instead of long-lived `next dev` — `scripts/deploy-viewer.sh`, `ecosystem.config.js.example` uses `next start -p 3001` diff --git a/e2e/README.md b/e2e/README.md index 08d2d52..388b736 100644 --- a/e2e/README.md +++ b/e2e/README.md @@ -70,6 +70,7 @@ not enabled in this CI job yet. 23. Core Web Vitals budget (`viewer.web-vitals.spec.ts`, `web-vitals-budgets.ts`): LCP + CLS gates on anonymous home gallery load 24. Admin review pages smoke (`admin.review-pages.spec.ts`): FastAPI admin login on `punimtagadmindev` → Identify, Auto-Match, Approve Identified load 25. `/search` legacy URLs redirect to `/` with query string preserved (incl. `peopleMode` / `tagsMode`) +26. Logged-out favorite (`viewer.favorite-signin.spec.ts`): Sign In Required dialog uses favorites copy, not report copy See repo root [`ROADMAP.md`](../ROADMAP.md) for gaps and next steps. diff --git a/e2e/tests/viewer.favorite-signin.spec.ts b/e2e/tests/viewer.favorite-signin.spec.ts new file mode 100644 index 0000000..67c3cb3 --- /dev/null +++ b/e2e/tests/viewer.favorite-signin.spec.ts @@ -0,0 +1,35 @@ +import { test, expect } from '../fixtures'; + +test.describe('favorite sign-in copy @smoke', () => { + test('logged-out favorite opens sign-in dialog with favorites messaging', async ({ + page, + playkitConfig, + }) => { + await page.goto(`${playkitConfig.baseUrl}/`); + await expect( + page.getByRole('button', { name: /Sign in/i }).or(page.getByLabel('Account menu')).first(), + ).toBeVisible({ timeout: 20_000 }); + + // Prefer grid heart; fall back to opening a photo then using the viewer heart. + const gridFavorite = page.getByRole('button', { name: 'Add to favorites' }).first(); + if (await gridFavorite.isVisible().catch(() => false)) { + await gridFavorite.click({ force: true }); + } else { + const photoButton = page.locator('main .aspect-square button').first(); + await expect(photoButton).toBeVisible({ timeout: 15_000 }); + await photoButton.click(); + await expect(page.getByRole('dialog', { name: /Photo viewer/i })).toBeVisible({ + timeout: 15_000, + }); + await page + .getByRole('dialog', { name: /Photo viewer/i }) + .getByRole('button', { name: 'Add to favorites' }) + .click(); + } + + const signInDialog = page.getByRole('dialog').filter({ hasText: 'Sign In Required' }); + await expect(signInDialog).toBeVisible({ timeout: 10_000 }); + await expect(signInDialog).toContainText(/save favorites|favorite photos/i); + await expect(signInDialog).not.toContainText(/report photos/i); + }); +}); diff --git a/viewer-frontend/app/HomePageContent.tsx b/viewer-frontend/app/HomePageContent.tsx index 9fb5846..dd2a00f 100644 --- a/viewer-frontend/app/HomePageContent.tsx +++ b/viewer-frontend/app/HomePageContent.tsx @@ -1094,7 +1094,7 @@ export function HomePageContent({ initialPhotos, people, tags }: HomePageContent
@@ -271,7 +271,7 @@ export function LoginDialog({