fix(slack): open page details in the Work Object flexpane

Merged
SA
2mo ago
+96-53

Problem

Tapping an unfurled Superset page in Slack opens the Work Object flexpane with "Couldn't find this item". The entity_details_requested handler only resolved task URLs; #7817 added page unfurls but never taught the flexpane about pages, so page URLs fell through to not_found.

Fix

processEntityDetails now dispatches on the entity URL:

  • Task — unchanged (createTaskFlexpaneObject).
  • Page — resolved through pagePreview for the Slack user who opened the flexpane:
    • public page → the page Work Object (thumbnail, description, creator, updated)
    • non-public, viewer not linked → user_auth_required with the existing connect URL
    • viewer can't read it / page gone → not_found

The page panel shows the same fields as the unfurl card.

Validation

  • bun run lint, apps/api typecheck, apps/api tests (218 pass) — green locally.
  • Not yet verified in Slack: needs a deploy, then tap a public page, a team page as a linked user, and a team page as an unlinked user.

Summary by cubic

Tapping an unfurled Superset page in Slack now opens the Work Object flexpane instead of showing "Couldn't find this item".

The entity_details_requested handler previously only resolved task URLs, so page URLs fell through to not_found. Page URLs are now resolved through pagePreview for the Slack user who opened the flexpane.

  • Public pages open for anyone; non-public pages require the viewer to have linked a Superset account, and Slack prompts them to connect until they do.
  • Missing or unreadable pages still return not_found.

Summary by CodeRabbit

  • New Features
    • Slack link previews now display relevant details for tasks and pages that are available to the linked account.
    • For pages that require authorization, Slack provides a link to authorize access.
  • Bug Fixes
    • Missing tasks, missing pages, and unrecognized links now receive a not-found response with an appropriate message.