Skip to content

feat(slack): interactive drill-downs and App Home tab - #595

Open
izadoesdev wants to merge 7 commits into
stagingfrom
izadoesdev/slack-interactive
Open

feat(slack): interactive drill-downs and App Home tab#595
izadoesdev wants to merge 7 commits into
stagingfrom
izadoesdev/slack-interactive

Conversation

@izadoesdev

@izadoesdev izadoesdev commented Aug 6, 2026

Copy link
Copy Markdown
Member

What

Agent-tailored drill-down buttons in Slack. After an analytics answer, the agent can offer 1-3 context-specific follow-up questions as buttons; clicking one runs the agent with that exact question in the same thread.

Builds on the native Block Kit work (#594).

How it works

  • Agent emits a suggested-actions component: {"type":"suggested-actions","actions":[{"label":"Break down by referrer","prompt":"break /pricing down by referrer"}]} (packages/ai prompt).
  • apps/slack renders it as an actions block of buttons carrying the prompt (action_id: agent_drilldown, value: <prompt>).
  • A block_actions handler (parseDrilldownRunhandleAgentRun) turns a click into a scoped thread follow-up run.
  • Also relaxes the outdated "No dashboard JSON" Slack rule — Slack now renders data-table/charts/lists natively (from feat(slack): native Block Kit output, feedback buttons, rotating status #594), so the agent is told to prefer them.

Testing

Open follow-up

The button click → agent run path is unit-tested on the parser but not yet confirmed with a real human click (needs a live thread). Same pattern as the feedback buttons. The agent actually emitting suggested-actions depends on the new prompt line and will show up in real conversations.


Summary by cubic

Adds agent-tailored drill-down buttons and a quick-start App Home in Slack, including quick-action dashboard links, to help users follow up and get started faster. Blocks external Slack Connect clicks, tightens payload typing, updates the analytics prompt to prefer native components, and collapses list renderers into one config.

  • New Features

    • Renders suggested-actions as Slack buttons in apps/slack; each carries the exact prompt (action_id: agent_drilldown).
    • Handles button clicks via parseDrilldownRun and runs the agent as a thread follow-up in the same channel.
    • Publishes a quick-start App Home tab with suggested prompts on app_home_opened (manifest + views.publish).
    • Adds App Home quick-action buttons that deep-link to the dashboard (Open dashboard, Investigations, Your websites).
  • Refactors

    • Collapses list renderers into a shared config-driven renderListTable with LIST_TABLES, and types the App Home view builder.

Written for commit 0840576. Summary will update on new commits.

Review in cubic

@cursor

cursor Bot commented Aug 6, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
databuddy-status Ready Ready Preview Aug 6, 2026 9:38pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
dashboard Skipped Skipped Aug 6, 2026 9:38pm
documentation Skipped Skipped Aug 6, 2026 9:38pm

@unkey-deploy

unkey-deploy Bot commented Aug 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Unkey Deploy

Name Status Preview Inspect Updated (UTC)
links (preview) Ready Visit Preview Inspect Aug 6, 2026 9:38pm

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 23210a26-711b-47d8-96ce-52f1f3864750

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds agent-generated Slack drill-down buttons and routes button clicks into same-thread agent runs, while updating the analytics prompt to encourage native Slack components.

  • Renders suggested-actions components as Block Kit buttons carrying an exact follow-up prompt.
  • Parses block_actions payloads into SlackAgentRun requests and registers the new action listener.
  • Adds focused rendering and payload-parser tests.

Confidence Score: 3/5

The PR is not safe to merge until drill-down clicks enforce the same Slack Connect and channel authorization boundaries as existing agent triggers.

The new callback allows a shared-channel participant to reach organization-scoped agent execution without the cross-team checks applied to ordinary Slack messages; the remaining typing issue is non-blocking.

Files Needing Attention: apps/slack/src/slack/listeners.ts, apps/slack/src/slack/drilldown.ts

Security Review

The new action callback bypasses the existing Slack Connect external-user and channel-readiness gates. An external participant in a shared channel can therefore run the agent using the installing workspace's organization context. How this was verified: The action handler was traced directly to handleAgentRun without the cross-team check present on ordinary thread follow-ups.

Important Files Changed

Filename Overview
apps/slack/src/slack/listeners.ts Registers the drill-down callback, but sends it directly into agent execution without the shared-channel authorization gates used by existing message routes.
apps/slack/src/slack/drilldown.ts Converts action payloads into thread follow-up runs correctly for the tested shape, but relies on unknown-based manual parsing.
apps/slack/src/slack/blocks.ts Adds bounded native button rendering for suggested actions; the action schema should use an explicit type.
packages/ai/src/ai/prompts/analytics.ts Documents the suggested-actions component and updates Slack output guidance without introducing a concrete prompt-rendering defect.

Sequence Diagram

sequenceDiagram
    participant U as Slack user
    participant S as Slack block_actions
    participant H as Drill-down handler
    participant A as Agent run handler
    participant O as Organization analytics
    U->>S: Click suggested follow-up
    S->>H: action, user, team, channel, thread
    Note over H: Parse prompt and run context
    H->>A: handleAgentRun
    A->>O: Resolve team and execute query
    O-->>A: Analytics response
    A-->>U: Reply in same Slack thread
Loading

Reviews (1): Last reviewed commit: "feat(ai): let the agent emit suggested-a..." | Re-trigger Greptile

Comment on lines +424 to +437
) {
app.action(
DRILLDOWN_ACTION_ID,
async ({ ack, action, body, client, logger }) => {
await ack();
const run = parseDrilldownRun(body, action);
if (!run) {
return;
}
const say: SlackSay = (message) =>
client.chat.postMessage({ channel: run.channelId, ...message });
const slackContext = createSlackConversationContext(client, run);
await threadQueue.markEngaged(run);
await handleAgentRun({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 security Shared-channel authorization bypass

When an external Slack Connect participant clicks a drill-down button, this handler calls handleAgentRun without the channel-readiness or cross-team-user checks used by ordinary thread follow-ups, causing analytics to execute under the installing workspace and return its data in the shared channel.

How this was verified: The new action handler reaches handleAgentRun directly, while the existing thread-follow-up route rejects users whose source team differs from the installed team.

Knowledge Base Used: Slack App

Comment on lines +11 to +14
export function parseDrilldownRun(
body: unknown,
action: unknown
): SlackAgentRun | null {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Untyped drill-down payloads

parseDrilldownRun accepts both payloads as unknown, and the renderer similarly casts actions to Record<string, unknown>, preventing the compiler from detecting Slack callback or suggested-action schema drift. Define explicit payload types for this new action flow.

Context Used: Basic guidelines for the project so vibe coders do... (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

…-home

feat(slack): App Home quick-start tab
@vercel
vercel Bot temporarily deployed to Preview – documentation August 6, 2026 19:02 Inactive
@vercel
vercel Bot temporarily deployed to Preview – dashboard August 6, 2026 19:02 Inactive
@izadoesdev izadoesdev changed the title feat(slack): agent-tailored drill-down buttons feat(slack): interactive drill-downs and App Home tab Aug 6, 2026
@vercel
vercel Bot temporarily deployed to Preview – dashboard August 6, 2026 21:38 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant