Dm routing improvements #101
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Comprehensive DM routing overhaul replacing modal-based direct messaging with inline DM conversations and agent invites.
Architectural Changes
New Components
DirectMessageView.tsx(164 lines) - Inline DM conversation view with agent invite toggleshooks/useDirectMessage.ts(141 lines) - DM logic hook handling participant derivation, message filtering, and deduplicationRemoved Components
DirectMessageModal.tsx(329 lines deleted) - Replaced by inline DM flowMajor Updates
App.tsx(+230 lines) - Integrated inline DM view, agent selection state, DM send handlingSidebar.tsx(+98 lines) - Human/agent channel routing, DM indicatorsMessageList.tsx(+8 lines) - Skip channel filtering for pre-filtered DM viewsNew Features
dm:alice:bob:agent1format with sorted participant namesBug Fix (This Session)
Bug: Agent responses misrouted from group DM to private DM
Root Cause: When
currentUserNameis null (local mode), "Dashboard" was not added to the participants set, causing all messages from/to Dashboard to be filtered out.Fix: Add Dashboard fallback when
currentUserNameis nullTest Coverage (36 Tests)
Comprehensive test suite in
useDirectMessage.test.ts(838 lines):Validations
✅ Local Mode: Dashboard fallback activates correctly
✅ Cloud Mode: GitHub username used, Dashboard fallback never triggers
✅ Team Architecture: Current fix is DM-specific and compatible with future team channels
Files Changed (36 files, +2684/-455 lines)
Core DM Changes:
src/dashboard/react-components/DirectMessageView.tsx(new)src/dashboard/react-components/DirectMessageModal.tsx(deleted)src/dashboard/react-components/hooks/useDirectMessage.ts(new)src/dashboard/react-components/hooks/useDirectMessage.test.ts(new)src/dashboard/react-components/App.tsx(major updates)src/dashboard/react-components/layout/Sidebar.tsx(updates)src/dashboard/react-components/MessageList.tsx(minor)Supporting Changes:
deploy/workspace/gh-relay(new - auth wrapper)src/dashboard/app/cloud/link/page.tsx(new)src/dashboard/lib/api.ts(updates)Confidence: 90%
🤖 Generated with Claude Code