feat: add connection-scoped workspaces#139
Merged
ibourgeois merged 2 commits intomainfrom Mar 27, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds durable, connection-scoped workspaces and wires them into the desktop shell so each saved connection can persist and switch its own active workspace.
Changes:
- Introduces
workspacespersistence (model, factory, migrations) andactive_workspace_idoninstance_connections. - Adds workspace create + activate endpoints and updates the home shell to resolve/render the active workspace per connection.
- Updates UI and feature tests to reflect the new workspaces navigation/state (and splits Surreal “preview workspace” into
SurrealWorkspace).
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Feature/WorkspaceManagementTest.php | New feature coverage for workspace creation, activation, and per-connection active workspace persistence. |
| tests/Feature/SurrealWorkspaceModelTest.php | Updates Surreal-backed preview workspace test to use SurrealWorkspace / workspace_previews. |
| tests/Feature/InstanceConnectionManagementTest.php | Adjusts expectations to show active workspace name + # general room placeholder. |
| tests/Feature/DesktopUiFeatureFlagTest.php | Updates shell assertions to match the new workspace-driven UI. |
| tests/Feature/DesktopShellTest.php | Seeds workspaces and validates new “Workspaces” section + active workspace display. |
| routes/web.php | Registers workspaces.store and workspaces.activate routes under auth. |
| resources/views/welcome.blade.php | Replaces placeholder shell “Favorites” with “Workspaces” list + create workspace modal; updates active header/input copy. |
| resources/views/components/desktop/nav-item.blade.php | Adds form-backed action support for POST-based nav items (used for workspace activation). |
| database/migrations/2026_03_27_063640_create_workspaces_table.php | Creates workspaces table (with driver-conditional FK behavior). |
| database/migrations/2026_03_27_063705_add_active_workspace_id_to_instance_connections_table.php | Adds active_workspace_id (with FK for non-surreal drivers). |
| database/factories/WorkspaceFactory.php | Factory for generating workspaces tied to an instance connection. |
| app/Support/Connections/InstanceConnectionManager.php | Adds workspace listing/creation/activation + default workspace resolution. |
| app/Models/Workspace.php | Converts Workspace to an Eloquent model related to InstanceConnection. |
| app/Models/SurrealWorkspace.php | New Surreal-backed model for desktop preview records (workspace_previews). |
| app/Models/InstanceConnection.php | Adds workspaces() and activeWorkspace() relationships + fillable active_workspace_id. |
| app/Http/Requests/StoreWorkspaceRequest.php | Validates workspace creation input. |
| app/Http/Controllers/WorkspaceController.php | Implements workspace create and activate actions with ownership checks. |
| app/Http/Controllers/HomeController.php | Resolves active workspace + workspace links for the shell; uses SurrealWorkspace::desktopPreview() for Surreal preview seeding. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
database/migrations/2026_03_27_063640_create_workspaces_table.php
Outdated
Show resolved
Hide resolved
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
Closes #133
Fixes #140