fix(slack,pages): render page unfurls and capture thumbnails at the Open Graph ratio

Merged
SA
2mo ago
+37-14

Why

After #7817 deployed, sharing a public page in Slack still showed a bare link. The API logs show both link_shared events handled with no error, the Slack team maps to the page's org, and the page is public, so chat.unfurl was called and answered ok. Slack only renders Work Object entity types the app has enabled under Work Object Previews; the manifest had slack#/entities/task only, so the content_item entity for pages was accepted and dropped. Enabling Content Item in the live app config made the unfurl render (verified in Slack 2026-09-24 2:42 PM PDT).

The rendered card was then very tall: the preview is our 1280×880 capture at full card width. The same capture feeds the pages grid, where it reads as near-square, and Facebook's card, where the top gets cropped.

What

  • manifest.json: synced with the live app config (it had grown the connectors callback redirect and app_level_token_rotation_enabled) plus slack#/entities/content_item in rich_previews.entity_types. The repo file is a copy; the live config was updated by hand.
  • page-work-object.ts: the preview image field carries type: "slack#/types/image", matching Slack's schema.
  • Thumbnails are captured at 1200×630, the 1.91:1 Open Graph ratio. The size is one shared constant (PAGE_THUMBNAIL_WIDTH/HEIGHT in @superset/shared/usercontent) used by the capture job, the web page's og:image dimensions, and the desktop grid tile ratio; the mobile workspace page list crops to the same ratio. Pages published before this keep their 1280×880 capture until republished; the grid crops those to the top.

Verification

  • bun test for page-work-object (5 pass); bun run typecheck in packages/shared, packages/trpc, apps/web, apps/api, apps/desktop: clean.
  • Slack unfurl verified live after the app-config change. The new capture size takes effect on the next publish after deploy; check with https://app.superset.sh/page/link-preview-check-qe3k4a republished.

Summary by CodeRabbit

  • New Features
    • Slack previews now display page thumbnails as images and recognize page content as a rich preview.
  • Improvements
    • Page thumbnails use consistent 1.91:1 dimensions across generated previews, sharing metadata, and page grids.
    • Updated the mobile workspace page cards to match the new thumbnail aspect ratio.