feat: add hide/close DM support (Slack-style DM management)#157
feat: add hide/close DM support (Slack-style DM management)#157wesbillman merged 3 commits intomainfrom
Conversation
- Add hidden_at column to channel_members for per-user DM hiding
- Add POST /api/dms/{channel_id}/hide REST endpoint
- Filter hidden DMs from GET /api/channels response
- Clear hidden_at when re-opening a DM via POST /api/dms
- Add hide_dm MCP tool for agent access
- Add Tauri hide_dm command and React UI with close button on DM sidebar items
- Optimistic cache update for instant UI feedback
- Register hide_dm in MCP ALL_TOOLS (dms toolset) to fix toolset gating leak - Add validate_uuid guard to hide_dm MCP tool for consistent error handling - Replace nested button with SidebarMenuAction sibling (valid HTML) - Await mutation in handleHideDm before navigating (complete rollback) - Add hide_dm handler to e2e test bridge - Hide unread dot on hover when close button appears - Update MCP tool count assertions (42 → 43) in toolsets + e2e tests
|
Pushed a follow-up commit addressing review findings: MCP toolset gating — MCP input validation — Added the Nested button — The hide X button was rendered inside Optimistic rollback — Test coverage — Added All gates green: fmt, clippy (0 warnings), cargo test, tsc, biome check, file-size check, tauri check, 64/64 smoke e2e tests passing. Merged origin/main cleanly (one conflict in router.rs — our hide route alongside the new message edit + vote routes). This comment was written by goose. |
Summary
Add the ability to hide/close DMs from the sidebar, matching Slack's DM management UX. Users can close DMs they don't need visible, and re-open them by starting a new DM with the same person.
Changes
Schema
hidden_at TIMESTAMPTZcolumn tochannel_memberstableBackend (Rust)
sprout-db: Addhide_dm()andunhide_dm()functions;open_dm()auto-clearshidden_atsprout-db: Filter hidden DMs inget_accessible_channels()andlist_dms_for_user()sprout-relay: AddPOST /api/dms/{channel_id}/hideendpoint with auth, membership, and DM-type verificationsprout-mcp: Addhide_dmtool for agent accessFrontend (TypeScript/React)
hide_dmnative commandhideDm()TypeScript functionuseHideDmMutationwith optimistic cache update and rollbackHow it works
Design decisions
hidden_at: Persists across devices/sessions, one column, clean SQL filteringopen_dm()clearshidden_atautomaticallyTesting
cargo check✅cargo clippy✅ (zero warnings)cargo fmt✅tsc --noEmit✅ (zero errors)biome check✅ (no new warnings)check-file-sizes✅Follow-up (not blocking)
Files changed (16)