Skip to content

feat: add workspace-scoped private chats#142

Merged
ibourgeois merged 2 commits intomainfrom
codex/feat-134-workspace-chats
Mar 27, 2026
Merged

feat: add workspace-scoped private chats#142
ibourgeois merged 2 commits intomainfrom
codex/feat-134-workspace-chats

Conversation

@ibourgeois
Copy link
Copy Markdown
Contributor

Summary

  • add private workspace-scoped chat persistence with durable messages and participants
  • wire active chat selection and message posting into the desktop shell
  • keep chats private to their parent workspace and out of the shared workspace graph

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.php

Closes #134

Copilot AI review requested due to automatic review settings March 27, 2026 15:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 WorkspaceChatManager and ViewerIdentityResolver.
  • 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.

@ibourgeois ibourgeois merged commit 5f4b899 into main Mar 27, 2026
2 checks passed
@ibourgeois ibourgeois deleted the codex/feat-134-workspace-chats branch March 27, 2026 15:16
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.

feat: add private chat persistence scoped to a workspace

2 participants