From 309c25bc0626620a4b8c2b5dcfce83cb09d66c43 Mon Sep 17 00:00:00 2001 From: MechaCat02 Date: Sun, 24 May 2026 22:50:28 +0200 Subject: [PATCH] =?UTF-8?q?feat(frontend):=20UX=20review=20followups=20?= =?UTF-8?q?=E2=80=94=20primitives=20+=20a11y/UX=20fixes=20across=204=20pas?= =?UTF-8?q?ses?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New shared primitives: - Toaster + toast-store, ConfirmSheet, Modal, focusTrap action, pullToRefresh action, avatarPalette + initials helper, Skeleton, HeartBurst, haptics, export-status store with onClearAuth hook Critical UX/a11y: - Replaced window.confirm with branded ConfirmSheet - Focus management + Escape on every modal (PIN, Lightbox, Onboarding, ContextSheet, data-mode sheet, leave-confirm, HTML guide, host/admin ban + PIN-display modals) - Sheet backdrops are real buttons with aria-label - Silent ApiError catches now surface via global Toaster Major polish: - Dark-mode parity on HashtagChips + avatars (shared palette) - Conditional Export tab in BottomNav (badge dot when ZIP ready) - Back chevrons on /recover (history-aware) and /export - Upload composer discard confirmation when content is staged - Camera segmented Photo/Video shutter - PIN auto-submit on 4th digit, paste-flash-free (controlled input) - Welcome-back toast on /feed after PIN recovery Minor: - Skeleton states on feed; pull-to-refresh with live drag indicator - Haptics on like / capture / submit / PIN-copy / onboarding complete - Comment 500-char counter; quota "Fast voll" / "Limit erreicht" labels - Onboarding pip ≥24px tap targets; long-press hint step - overscroll-behavior lock on while feed mounted - teardownExportStatus wired via onClearAuth (covers 401 + explicit logout) - ConfirmSheet per-instance titleId; Modal requires titleId or ariaLabel Tests (7 new Playwright specs): - 01-auth/pin-auto-submit, 01-auth/back-chevron - 03-feed/confirm-sheet-delete, 03-feed/toast-on-failure - 09-mobile/focus-trap, 09-mobile/sheet-escape, 09-mobile/upload-cancel-confirm FOLLOWUPS.md captures the deferred AT inert containment work with acceptance criteria + implementation sketches. Co-Authored-By: Claude Opus 4.7 (1M context) --- FOLLOWUPS.md | 53 ++++++ e2e/specs/01-auth/back-chevron.spec.ts | 28 +++ e2e/specs/01-auth/pin-auto-submit.spec.ts | 44 +++++ .../03-feed/confirm-sheet-delete.spec.ts | 62 ++++++ e2e/specs/03-feed/toast-on-failure.spec.ts | 53 ++++++ e2e/specs/09-mobile/focus-trap.spec.ts | 54 ++++++ e2e/specs/09-mobile/sheet-escape.spec.ts | 37 ++++ .../09-mobile/upload-cancel-confirm.spec.ts | 42 ++++ frontend/src/lib/actions/focus-trap.ts | 84 ++++++++ frontend/src/lib/actions/pull-to-refresh.ts | 82 ++++++++ frontend/src/lib/auth.ts | 16 ++ frontend/src/lib/avatar.ts | 28 +++ frontend/src/lib/components/BottomNav.svelte | 32 ++++ .../src/lib/components/CameraCapture.svelte | 100 ++++++---- .../src/lib/components/ConfirmSheet.svelte | 95 +++++++++ .../src/lib/components/ContextSheet.svelte | 54 +++++- .../src/lib/components/FeedListCard.svelte | 78 +++++--- .../src/lib/components/HashtagChips.svelte | 6 +- frontend/src/lib/components/HeartBurst.svelte | 32 ++++ .../src/lib/components/LightboxModal.svelte | 109 +++++------ frontend/src/lib/components/Modal.svelte | 56 ++++++ .../src/lib/components/OnboardingGuide.svelte | 50 +++-- frontend/src/lib/components/Skeleton.svelte | 27 +++ frontend/src/lib/components/Toaster.svelte | 37 ++++ frontend/src/lib/export-status-store.ts | 62 ++++++ frontend/src/lib/haptics.ts | 7 + frontend/src/lib/toast-store.ts | 40 ++++ frontend/src/routes/+layout.svelte | 11 +- frontend/src/routes/account/+page.svelte | 126 ++++++------ frontend/src/routes/admin/+page.svelte | 153 +++++++-------- frontend/src/routes/export/+page.svelte | 59 ++++-- frontend/src/routes/feed/+page.svelte | 159 ++++++++++++++-- frontend/src/routes/host/+page.svelte | 180 ++++++++---------- frontend/src/routes/join/+page.svelte | 47 ++++- frontend/src/routes/recover/+page.svelte | 50 ++++- frontend/src/routes/upload/+page.svelte | 31 +++ 36 files changed, 1751 insertions(+), 433 deletions(-) create mode 100644 FOLLOWUPS.md create mode 100644 e2e/specs/01-auth/back-chevron.spec.ts create mode 100644 e2e/specs/01-auth/pin-auto-submit.spec.ts create mode 100644 e2e/specs/03-feed/confirm-sheet-delete.spec.ts create mode 100644 e2e/specs/03-feed/toast-on-failure.spec.ts create mode 100644 e2e/specs/09-mobile/focus-trap.spec.ts create mode 100644 e2e/specs/09-mobile/sheet-escape.spec.ts create mode 100644 e2e/specs/09-mobile/upload-cancel-confirm.spec.ts create mode 100644 frontend/src/lib/actions/focus-trap.ts create mode 100644 frontend/src/lib/actions/pull-to-refresh.ts create mode 100644 frontend/src/lib/avatar.ts create mode 100644 frontend/src/lib/components/ConfirmSheet.svelte create mode 100644 frontend/src/lib/components/HeartBurst.svelte create mode 100644 frontend/src/lib/components/Modal.svelte create mode 100644 frontend/src/lib/components/Skeleton.svelte create mode 100644 frontend/src/lib/components/Toaster.svelte create mode 100644 frontend/src/lib/export-status-store.ts create mode 100644 frontend/src/lib/haptics.ts create mode 100644 frontend/src/lib/toast-store.ts diff --git a/FOLLOWUPS.md b/FOLLOWUPS.md new file mode 100644 index 0000000..d268f06 --- /dev/null +++ b/FOLLOWUPS.md @@ -0,0 +1,53 @@ +# Follow-ups + +Tracked work that was deferred during the multi-round UI/UX review pass. +Each item has a clear acceptance criterion so a future pass can land it +without re-deriving the context. + +## A11y — assistive-tech containment inside modals + +**Problem.** Open modals (LightboxModal, ConfirmSheet, Modal, OnboardingGuide, +join PIN modal, account data-mode sheet, export HTML guide) trap keyboard Tab +via `focusTrap`, but VoiceOver rotor / TalkBack arrow-key navigation can still +escape into the page content behind the dialog. Screen-reader users hear the +wrong context. + +**Why deferred.** A naive sibling-walk that sets `inert` on direct children of +the modal's parent silences the global `` (`aria-live="polite"` region +mounted in `+layout.svelte`) and the `` while a modal is open — +breaking toast announcements and the visible nav state. SvelteKit has no +built-in portal mechanism, so dialogs render inside the route tree alongside +the Toaster. + +**Acceptance criterion.** With any modal open: +- VoiceOver rotor (iOS Safari) and TalkBack swipe navigation (Android Chrome) + cannot leave the dialog subtree. +- Toasts that fire while a modal is open are still announced. +- Nested modals (e.g. ConfirmSheet opened from inside ContextSheet) maintain + correct containment when the inner closes. + +**Sketch of an approach.** One of: +1. **Portal pattern.** Render dialogs into a dedicated `