feat(inbox): show a slack card inside its channel #199
All Vouch review confidence checks passed
Residual risk 0.31 = Change Risk (0.43) × (1 − Review Confidence (0.27)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 371 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 52% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.354
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #199"
general
weight: 0.35
github-actions[bot]
What changed and why
A Slack card showed the one message it was about, alone in a tall empty card. It now reads like the channel it came from (plan 074):
1. A channel post or thread (
<channel>:<ts>): the channel's 5 messages before the thread, the thread with its replies indented under its first message, and the 5 messages after it.2. A DM: its latest messages, the same way.
3. Drawn with the chat's own Slack-style rows: a face and name on the first of a run, day pills,
@channel/@here/@everyonemarked, "n replies" on a message with its own thread, and Slack's red New line before the first unread message. The card opens on that line, else on its own message.New reader:
mod/slack-view.ts(slackChannelView), used only for the card (OutsideThreadscardView). New optionalOutsideMessagefields:avatar,in_thread,unread,replies,more_after, so an older paired Mac still draws its cards.Decisions for review
1. Messages after the thread: Slack's
conversations.historygives the newest first, so the read pages back at most 3 pages of 100 to reach the 5 right after. Past that it shows none and says "more messages in the channel since" rather than messages from long after.2. Cost: opening a card takes 4 to 6 Slack calls instead of 1, only on open; a rate limit is waited out as before. People are remembered per account across reads.
3. Unread: replies use the thread's
last_read(on the first message fromconversations.replies), falling back to the channel's fromconversations.info; the person's own messages are never unread.4. A hand-off still sends the thread alone; email cards keep their mail rows; the phone keeps its rows and gets the extra messages.
5. The card's day pill is not sticky, so it never sits over a message.
Tests
test/slack-view.test.ts: the before/thread/after window, paging a busy channel and giving up past three pages, people asked once per account, own messages never unread, runs/day pills/New line,@channelmarking and the reply indent.test/outside-threads.test.ts: a Slack card prefers the channel view and passes the new fields through; mail does not.Checked by hand
Rendered with made-up messages (a throwaway preview page, removed), dark and light:
!Slack card in its channel, dark
!Slack DM card, light
Not checked against a real workspace: the thread
last_readand Slack's paging order come from Slack's docs and a fake built to them.Checks
npm run format:check && npm run lint && npm run typecheck && npm test && npm run test:node && npm run build:app && npm run build:mod && npm run smoke, all passing.🤖 Generated with Claude Code