yiekheng 551021a2c7 feat(uploads): reject HEIC/HEIF/AVIF; sidebar brand → dashboard link; activity tabs scroll
Three small follow-ups:

1. HEIC/HEIF/AVIF uploads now rejected at the door
   ----------------------------------------------------
   Symptom: an iPhone-shot image uploaded fine but came through on
   WhatsApp without a thumbnail. Bot logs:

       failed to obtain extra info
       heif: Error while loading plugin: Support for this compression
       format has not been built in

   Cause: the bot container's Sharp ships without a HEIF/AVIF
   decoder, so the thumbnail-extraction step Baileys runs throws and
   the message is sent without a preview.

   Fix: the upload validator (`validateForWhatsApp`) now rejects the
   HEIF family before the file ever reaches the action body. Error
   message: "Images are not supported, please re-upload images".

   New tests in `lib/whatsapp-media.test.ts`:
   - `isUnsupportedImageMime` recognises image/heic, image/heif,
     image/heic-sequence, image/avif (case-insensitive).
   - `isUnsupportedImageMime` does NOT flag jpeg/png/webp/gif.
   - `validateForWhatsApp` rejects a HEIC upload regardless of size,
     even below the 5 MB image cap.

2. Desktop sidebar brand is now a link to /
   ----------------------------------------------------
   The mobile header brand pill was already a link to /; the desktop
   sidebar version was a static <div>, so clicking the "cm WhatsApp
   Bot" header in the sidebar did nothing. Wrapped in <Link href="/">
   with `aria-label="Go to dashboard"` and a hover background to
   make the affordance obvious.

3. Activity tab strip switched from full-width to scrollable
   ----------------------------------------------------
   The activity page has six tabs (All / Success / Partial / Failed
   / Skipped / Archived) — packing them into a `w-full` row at h-8
   left every label squeezed to ~50px on mobile. Wrapped the
   <TabsList> in an `overflow-x-auto` scroller (with negative
   horizontal margins so the strip extends to the page edges and the
   first/last tabs aren't clipped) so each tab keeps a comfortable
   touch target on phones; on desktop the row fits naturally and no
   scroll bar appears.

   Reminders page kept its full-width layout — only 4 tabs there,
   they don't crowd.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-10 12:54:30 +08:00
..