fix: consolidate tenant creation + harden selection flows #131

Merged
ahmido merged 12 commits from 107-workspace-chooser into dev 2026-02-22 19:54:26 +00:00

12 Commits

Author SHA1 Message Date
Ahmed Darrazi
0856aeaa72 fix: consolidate tenant creation + harden selection flows 2026-02-22 20:51:50 +01:00
Ahmed Darrazi
88ba8a14d8 ui: enterprise redesign for managed-tenants landing page 2026-02-22 19:43:08 +01:00
Ahmed Darrazi
9fd8cdef83 fix: stop panel widgets on managed-tenants landing 2026-02-22 18:29:58 +01:00
Ahmed Darrazi
797728a243 fix: use simple layout for ManagedTenantsLanding to prevent Livewire update 404s
The full panel layout renders DatabaseNotifications (lazy-loaded) and
BulkOperationProgress (polling), whose Livewire update requests fail
with 404 due to persistent middleware route-binding issues on this
manually-routed page.

Switch to simple layout matching ChooseWorkspace/ChooseTenant/NoAccess
pattern — appropriate for this transitional/landing page.

Add test verifying Livewire updates succeed on managed-tenants page.
2026-02-22 18:20:05 +01:00
Ahmed Darrazi
9b02cc4041 style(107): enterprise redesign of workspace chooser UI
- Replace flat div cards with semantic <button> elements
- Add workspace icon (building-office-2) per card
- Add role-specific icons (shield, cog, wrench, eye)
- Use primary color scheme for 'Last used' highlight (was amber)
- Add loading spinner overlay on workspace selection
- Add hover arrow indicator + shadow elevation on hover
- Add focus ring for keyboard accessibility
- Better empty state with icon + actionable copy
- Proper dark mode support throughout
- Responsive grid (1→2→3 columns)
- Manage workspaces link with cog icon
2026-02-22 17:27:54 +01:00
Ahmed Darrazi
051db1842d feat(107): implement Workspace Chooser v1 — all 40 tasks complete
Spec 107: Workspace Chooser v1 (Enterprise) + In-App Switch Entry Point

## Core changes
- Refactor EnsureWorkspaceSelected middleware: 7-step algorithm with
  auto-resume (single membership + last_workspace_id), stale session
  detection, ?choose=1 forced chooser, workspace-optional path bypass
- Create WorkspaceRedirectResolver for DRY tenant-count branching
  (0→managed-tenants, 1→tenant-dashboard, >1→choose-tenant)
- Add WorkspaceAutoSelected + WorkspaceSelected audit enum cases
- Rewrite ChooseWorkspace page: role badges, tenant counts,
  wire:click selection, audit logging, WorkspaceRedirectResolver
- Add 'Switch workspace' user menu item in AdminPanelProvider
- Rewrite SwitchWorkspaceController with audit + resolver
- Replace inline tenant branching in routes/web.php with resolver

## New test files (6)
- WorkspaceRedirectResolverTest (5 tests
Spec 107: Workspace Chooser v1 (Enterprise) + In-App Switch Entry Point

## Core changes
- Refactor EnsureWorkspaceSelected middleware: 7-step algorithmst
## Core changes
- Refactor EnsureWorkspaceSelected middleware: 7-stepes - Refactor Ensng  auto-resume (single membership + last_workspace_id), stale sessioid  detection, ?choose=1 forced chooser, w (security invariant preserve- Create WorkspaceRedirectResolver for DRY tenant-count branching

  (0→managed-tenants, 1→tenant-dashboapped (8163 assertions)
2026-02-22 17:19:19 +01:00
Ahmed Darrazi
169a6a1198 fix: resolve N1-N3 consistency findings (plan structure + T034 audit count + quickstart audit note) 2026-02-22 15:28:48 +01:00
Ahmed Darrazi
d67e2c84bc fix: resolve 5 consistency issues from project analysis (F1–F7)
F1: Replace 'EnsureActiveWorkspace' with 'EnsureWorkspaceSelected' in spec (3 occurrences) — aligns with R1 decision
F2: Add audit logging to SwitchWorkspaceController (T036) + context_bar reason — closes FR-005 gap
F3: Remove stale WorkspaceContext.php MODIFY from plan project structure
F4/F5: Add WorkspaceRedirectResolver.php + 2 missing test files to plan project structure
F6: Add single-workspace sub-case (EC3) note to T030
F7: Add archived workspace scenario (EC2) note to T024
2026-02-22 15:18:26 +01:00
Ahmed Darrazi
d27cfec5cb tasks: workspace chooser v1 — 40 tasks across 6 user stories + foundation + polish 2026-02-22 15:00:23 +01:00
Ahmed Darrazi
dd4fb6071f plan: workspace chooser v1 — research, data-model, contracts, quickstart 2026-02-22 14:53:24 +01:00
Ahmed Darrazi
1f2ee8c8a3 spec: add clarifications (redirect branching + session multi-tab) 2026-02-22 14:44:54 +01:00
Ahmed Darrazi
4b285104da spec: 107 — Workspace Chooser v1 (Enterprise) + In-App Switch Entry Point 2026-02-22 14:29:20 +01:00