Skip to content

feat(objects): Resolve Slack message links as cards - #3308

Merged
BYK merged 6 commits into
mainfrom
feat/slack-message-link-cards
Nov 12, 2026
Merged

BYK merged 6 commits into
mainfrom
feat/slack-message-link-cards

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Problem

A Slack message permalink in a Conversation, an Inbox row, or a hover card shows as a bare link. #3286 added link types, but no link type claims Slack permalinks.

Fix

  • New object type message. Its label is "Message", its icon is the Octicon comment, and its facts are channel, author, and sentAt. The facts never hold the message text.
  • A core link type (Slack is still in core) with the filter { host: "*.slack.com", pathPattern: "/archives/*/*" }.
  • The card shows the channel (#name, "Direct message", or "Group message"), the author, the time, and a snippet of at most 280 characters. The title is the first 100 characters of the snippet.
  • Permission rule: the bot reads the message, and the viewer's linked Slack account must be able to see it. Junior has no Slack token for the viewer.
    • The link's workspace must be one where the viewer linked a Slack account. Junior compares the link host to the team.info domain of each linked team.
    • Public channel: shown to any viewer who has a linked account in that workspace.
    • Private channel, DM, or group DM: shown only when conversations.members lists the viewer. A channel with more than 5,000 members gets no card.
    • Any other case (no linked account, another workspace, not found, not a member) gets no card. The response is the same as for an unknown URL.
  • If the bot is not in a public channel, the card has no text and no author. Junior does not join a channel to make a card.
  • No new Slack scopes. The manifest already has channels:read, groups:read, im:read, and mpim:read.

Tests

  • tests/integration/api/objects.test.ts calls /api/objects with the real resolver and a fake Slack. It covers a public channel that the bot did not join, a member of a private channel (snippet and author), a non-member (no card, and the response does not show the channel), a viewer with no Slack account, and a link to another workspace. The test fails without the link type.
  • A new dashboard e2e test checks that a Slack link becomes a chip and a hover card.
  • Also ran pnpm typecheck, pnpm lint, the dashboard unit tests, and the full dashboard e2e (160 passed).

Screenshots (1440 wide)

Before After
Dark before dark after dark
Light before light after light

Before: a bare URL. After: a #proj-release chip, with a hover card for the message.

via @BYK.

--

View Session [Sentry]

sentry-junior Bot and others added 2 commits November 12, 2026 21:48
A Slack permalink in a Conversation, an Inbox row, or a hover card now
shows a message card: channel, author, time, and a short snippet.

The bot reads the message. The card shows only when the viewer's own
linked Slack account can see it: a public channel in that workspace, or a
private channel, DM, or group DM that lists the viewer as a member. Any
other link gets no card.

Co-Authored-By: BYK <[email protected]>
@vercel

vercel Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 12, 2026 10:56pm UTC

Request Review

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@blacksmith-sh

blacksmith-sh Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Found 2 test failures on Blacksmith runners:

Failures

Test View Logs
[chromium] › packages/junior-dashboard/e2e/
conversations.spec.ts:8:1 › records loaded conversation views
View Logs
packages/junior-dashboard/e2e/conversations.spec.ts/records loaded conversation views View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

A linked Slack workspace that removed Junior no longer stops the check of
the other linked workspaces. A link to a deleted message gets no card
without an error.

@BYK BYK left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we are recreating a bunch of helpers where we shouldn't be and being a bit sloppy with security and also parsing.

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

21 screenshot changes — 19 changed · 2 added · 0 removed

Review screenshots in Frameshift

Automation Run Details · Desktop
Automation Run Details · Desktop
Changed
Conversation Attachment · Desktop
Conversation Attachment · Desktop
Changed
Conversation Attachment · Mobile
Conversation Attachment · Mobile
Changed
Conversation Attachment Modal · Desktop
Conversation Attachment Modal · Desktop
Changed
Conversation Attachment Zoom · Desktop
Conversation Attachment Zoom · Desktop
Changed
Conversation Captured Memories Popover · Desktop
Conversation Captured Memories Popover · Desktop
Changed
Show 12 more changed screenshots
Conversation Child Agents · Desktop
Conversation Child Agents · Desktop
Changed
Conversation Details Watched Linked Work · Desktop
Conversation Details Watched Linked Work · Desktop
Changed
Conversation Long Transcript Touch · Mobile
Conversation Long Transcript Touch · Mobile
Changed
Conversation Object Links · Desktop
Conversation Object Links · Desktop
Changed
Conversation Object Links Light · Desktop
Conversation Object Links Light · Desktop
Changed
Conversation Resolved Object Links · Desktop
Conversation Resolved Object Links · Desktop
Changed
Conversation Resolved Object Links Light · Desktop
Conversation Resolved Object Links Light · Desktop
Changed
Conversation Task Line · Desktop
Conversation Task Line · Desktop
Changed
Memories · Mobile
Memories · Mobile
Changed
Push Notifications Tip · Desktop
Push Notifications Tip · Desktop
Changed
Push Notifications Tip On · Desktop
Push Notifications Tip On · Desktop
Changed
Settings Mcp · Desktop
Settings Mcp · Desktop
Changed

1 more changed screenshot in Frameshift.

Message link cards now use the shared public-channel check, the shared
user-mention pattern, and the Slack SDK mrkdwn parser for the snippet.
@BYK
BYK enabled auto-merge (squash) November 12, 2026 22:48

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 95a86e0. Configure here.

A thread that does not have the linked reply now gives no card.
@BYK
BYK merged commit b8001e0 into main Nov 12, 2026
45 checks passed
@BYK
BYK deleted the feat/slack-message-link-cards branch November 12, 2026 23:06
BYK pushed a commit that referenced this pull request Nov 12, 2026
…3314)

## Problem

Slack message link cards (#3308) resolve a public-channel message for
any viewer with a linked Slack account. A Slack guest sees only the
channels they are in. So a guest could read the snippet of a message in
a public channel that they cannot open in Slack. Warden found this on
#3308 after it merged.

## Fix

A public channel resolves without a membership check only when
`users.info` says that the viewer is a full workspace member
(`is_restricted` and `is_ultra_restricted` are both false). A guest, a
person that Slack does not describe, and any private channel, DM, or
group DM need channel membership, as before. `lookupSlackUser` now
returns `isGuest` when Slack sends both fields.

## Tests

`tests/integration/api/objects.test.ts`: a guest who is not in a public
channel gets no card, and the response does not contain the channel
name. A full member still gets the card. The test fails without the fix.
Also ran typecheck, lint, and the tests that use `users.info`.

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3Ab4ab1661aa9222ed540303a34bce2d99 -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3Ab4ab1661aa9222ed540303a34bce2d99)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Ab4ab1661aa9222ed540303a34bce2d99/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>

This branch was successfully deployed

1 active deployment
Preview – junior-docs — ae532812 Deployed Nov 12, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant