fix(ux): popover collision padding, PWA manifest, webhook toasts, portal toast, dashboard error boundary, GDPR poll backoff, empty-state CTA

Grab-bag of UX gaps from audit-pass-#2 + #3. Each one is a small,
focused fix; bundled because they touch different surfaces.

- Popover: collisionPadding={16} + responsive
  w-[min(calc(100vw-2rem),18rem)] so popovers stop clipping past the
  viewport on iPhone 12 portrait.
- public/manifest.json (was missing) + manifest reference in
  layout.tsx — PWA installability now works; icons (192/512/512-
  maskable) were already present.
- Admin webhooks page: 4 silent `// ignore` catches in load/delete/
  toggle/regenerate replaced with toast.error / toast.success. Users
  no longer see a stale list with no feedback when an op fails.
- Portal document-download button: blocking alert() → toast.error().
- src/app/(dashboard)/error.tsx: branded error boundary with retry +
  back-to-dashboard, replacing Next.js's default uncaught-error UI.
- GDPR export modal: refetchInterval was a flat 5s while the modal was
  open. Switched to a function that only polls (every 15s) when a job
  is actually pending/building; settled exports stop polling entirely.
- client-yachts-tab empty state gains a CTA wired to the existing
  Add-yacht dialog, instead of just saying "No yachts".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Matt Ciaccio
2026-05-06 14:59:27 +02:00
parent f93de75bb5
commit c60cbf4014
8 changed files with 134 additions and 32 deletions

View File

@@ -49,7 +49,11 @@ export function ClientYachtsTab({ clientId: _clientId, yachts }: ClientYachtsTab
</div>
{yachts.length === 0 ? (
<EmptyState title="No yachts" description="No yachts owned by this client yet." />
<EmptyState
title="No yachts yet"
description="Track every yacht this client owns or charters here. Linked yachts pre-fill EOIs and surface in the recommender."
action={{ label: 'Add yacht', onClick: () => setCreateOpen(true) }}
/>
) : (
<div className="rounded-md border">
<Table>

View File

@@ -62,7 +62,15 @@ export function GdprExportButton({ clientId }: { clientId: string }) {
queryKey,
queryFn: () => apiFetch<ListResp>(`/api/v1/clients/${clientId}/gdpr-export`),
enabled: open && allowed,
refetchInterval: open && allowed ? 5_000 : false,
// Poll only when the user is watching AND a job is in flight. GDPR
// exports take ~30s; 15s is the rule-of-thumb minimum that doesn't
// burn CPU. When everything's already settled, stop polling.
refetchInterval: (q) => {
if (!open || !allowed) return false;
const rows = q.state.data?.data ?? [];
const hasInFlight = rows.some((r) => r.status === 'pending' || r.status === 'building');
return hasInFlight ? 15_000 : false;
},
});
const request = useMutation({