feat: add workspace-scoped private chats#142
Merged
ibourgeois merged 2 commits intomainfrom Mar 27, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds durable, workspace-scoped private chats (chats, participants, messages) and wires chat selection + message posting into the desktop shell while keeping this data out of the shared workspace graph.
Changes:
- Introduces workspace chat persistence (models, migrations, factories) including participants and durable messages.
- Adds chat/messaging controllers + form requests + routes, plus a
WorkspaceChatManagerandViewerIdentityResolver. - Updates the desktop shell (welcome view + tests) to show chats, activate chats, and post messages.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Feature/WorkspaceChatManagementTest.php | New feature tests covering active chat resolution, chat creation/activation, and message posting. |
| tests/Feature/InstanceConnectionManagementTest.php | Extends connection UI assertions to include active chat content. |
| tests/Feature/DesktopShellTest.php | Updates shell expectations to reflect private chats + durable messages. |
| routes/web.php | Adds POST routes for creating chats, activating chats, and posting messages. |
| resources/views/welcome.blade.php | Switches shell from mock conversation UI to real workspace chat rendering + forms. |
| database/migrations/2026_03_27_143427_add_active_chat_id_to_connection_workspaces_table.php | Adds active_chat_id to workspaces (FK for SQL, numeric for Surreal). |
| database/migrations/2026_03_27_143418_create_workspace_chats_table.php | Creates workspace_chats table with workspace scope + slug uniqueness (SQL). |
| database/migrations/2026_03_27_143418_create_workspace_chat_participants_table.php | Creates participants table with optional user_id + uniqueness (SQL). |
| database/migrations/2026_03_27_143418_create_workspace_chat_messages_table.php | Creates durable messages table scoped to a chat. |
| database/factories/WorkspaceChatFactory.php | Factory for workspace chats (group/direct). |
| database/factories/WorkspaceChatParticipantFactory.php | Factory for chat participants (human/agent). |
| database/factories/WorkspaceChatMessageFactory.php | Factory for chat messages. |
| app/Support/Connections/ViewerIdentityResolver.php | Extracts viewer identity derivation from connection/session context. |
| app/Support/Chats/WorkspaceChatManager.php | Centralizes chat list/active chat creation, chat creation, activation, and message creation. |
| app/Models/WorkspaceChat.php | New chat model + workspace/participants/messages relationships. |
| app/Models/WorkspaceChatParticipant.php | New participant model + chat/user relationships. |
| app/Models/WorkspaceChatMessage.php | New message model + chat relationship. |
| app/Models/Workspace.php | Adds active_chat_id, activeChat() and chats() relationships. |
| app/Http/Requests/StoreWorkspaceChatRequest.php | Validates chat creation input. |
| app/Http/Requests/StoreWorkspaceChatMessageRequest.php | Validates message posting input. |
| app/Http/Controllers/HomeController.php | Wires chat state into the shell view (active chat, links, participants, messages). |
| app/Http/Controllers/ChatController.php | Handles chat creation + activation from the shell. |
| app/Http/Controllers/ChatMessageController.php | Handles message posting into a workspace chat. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Testing
'/Users/ibourgeois/Library/Application Support/Herd/bin/php84' artisan test --compact tests/Feature/WorkspaceChatManagementTest.php tests/Feature/DesktopShellTest.php tests/Feature/InstanceConnectionManagementTest.php'/Users/ibourgeois/Library/Application Support/Herd/bin/php84' artisan test --compact tests/Feature/WorkspaceChatManagementTest.php tests/Feature/DesktopShellTest.php tests/Feature/DesktopUiFeatureFlagTest.php tests/Feature/WorkspaceManagementTest.php tests/Feature/SurrealSchemaDriverTest.phpCloses #134