## Summary - route the context-bar `Switch workspace` link to the canonical chooser flow instead of workspace management - add focused regression coverage for topbar switching, management separation, and chooser redirect semantics - add Spec 121 artifacts (`spec`, `plan`, `research`, `data-model`, `contracts`, `quickstart`, `tasks`, checklist) ## Validation - `vendor/bin/sail artisan test --compact tests/Feature/Monitoring/HeaderContextBarTest.php tests/Feature/Workspaces/WorkspaceSwitchUserMenuTest.php tests/Feature/Workspaces/ChooseWorkspacePageTest.php tests/Feature/Workspaces/WorkspaceNavigationHubTest.php tests/Feature/Workspaces/EnsureWorkspaceSelectedMiddlewareTest.php tests/Feature/Workspaces/ChooseWorkspaceRedirectsToChooseTenantTest.php` - `vendor/bin/sail bin pint --dirty --format agent` ## Notes - base branch: `dev` - branch: `121-workspace-switch-fix` Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #147
1.7 KiB
1.7 KiB
Route Contract: Workspace Switch Semantic Fix
Feature: 121-workspace-switch-fix | Date: 2026-03-07
Intent-level contract
Switch workspace
- Surface: admin and tenant-panel context bar
- Label:
Switch workspace - Canonical target:
ChooseWorkspace::getUrl(panel: 'admin').'?choose=1' - Meaning: enter the explicit workspace chooser flow
- User-menu duplication: not allowed
Manage workspaces
- Surface: existing administrative navigation / chooser management affordance
- Canonical target: workspace management resource index
- Meaning: create, view, and edit workspace records
Before / After
Before
Context bar "Switch workspace"
-> /admin/workspaces
-> lands on workspace management CRUD index
After
Context bar "Switch workspace"
-> /admin/choose-workspace?choose=1
-> lands on chooser flow
Invariants
- Workspace chooser remains the canonical manual-switch surface.
?choose=1remains the explicit forced-chooser signal for intentional switching.- The top-right user menu must not expose a duplicate workspace-switch shortcut.
- Workspace management remains separately reachable and semantically distinct.
- Choosing a workspace continues to use existing
WorkspaceIntendedUrl/WorkspaceRedirectResolverbehavior. - No new routes, middleware rules, or authorization rules are introduced.
Verification expectations
- Response rendering for a real admin page containing the context bar must show the chooser target.
- Filament user-menu evaluation must not register a
switch-workspaceitem. - Existing chooser behavior tests remain green.
- Workspace management navigation remains reachable through its existing destination.