From 5d57b131ff39508741f4de3fa8f2a87a00af510f Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Tue, 16 Jun 2026 22:23:50 +0200 Subject: [PATCH] refactor(v5): rename Home to Dashboard and add coollabs brand styles Rename HomeController, Home page, and V5HomeProps type to Dashboard equivalents. Update route name from 'home' to 'dashboard'. Add coollabs brand color tokens to CSS theme and a 'coolify' button variant using those colors. Add Sheet UI component for slide-over panels. Update navbar with active-route detection and Sheet-based mobile drawer. Switch cluster action buttons to use the new 'coolify' variant. --- ...Controller.php => DashboardController.php} | 4 +- resources/css/v5/app.css | 9 +- resources/js/v5/Pages/Clusters.tsx | 8 +- .../js/v5/Pages/{Home.tsx => Dashboard.tsx} | 10 +-- resources/js/v5/components/app-navbar.tsx | 66 ++++++++++++-- resources/js/v5/components/ui/button.tsx | 2 + resources/js/v5/components/ui/sheet.tsx | 87 +++++++++++++++++++ resources/js/v5/types.ts | 2 +- routes/v5.php | 10 +-- .../V5/{HomeTest.php => DashboardTest.php} | 83 ++++++++++++++---- 10 files changed, 235 insertions(+), 46 deletions(-) rename app/Http/Controllers/V5/{HomeController.php => DashboardController.php} (99%) rename resources/js/v5/Pages/{Home.tsx => Dashboard.tsx} (86%) create mode 100644 resources/js/v5/components/ui/sheet.tsx rename tests/Feature/V5/{HomeTest.php => DashboardTest.php} (90%) diff --git a/app/Http/Controllers/V5/HomeController.php b/app/Http/Controllers/V5/DashboardController.php similarity index 99% rename from app/Http/Controllers/V5/HomeController.php rename to app/Http/Controllers/V5/DashboardController.php index f5fc3eb53..0e1c5a283 100644 --- a/app/Http/Controllers/V5/HomeController.php +++ b/app/Http/Controllers/V5/DashboardController.php @@ -16,7 +16,7 @@ use Illuminate\Validation\Rule; use Inertia\Inertia; use Inertia\Response; -class HomeController extends Controller +class DashboardController extends Controller { private const SELECTED_PROJECT_SESSION_KEY = 'v5.selectedProjectUuid'; @@ -28,7 +28,7 @@ class HomeController extends Controller $projects = $this->projects($currentTeam); [$selectedProject, $selectedEnvironment] = $this->selectedProjectAndEnvironment($request, $projects); - return Inertia::render('Home', [ + return Inertia::render('Dashboard', [ 'flux' => $fluxHealth->check(), 'projects' => $projects, 'selectedProjectUuid' => $selectedProject['uuid'] ?? null, diff --git a/resources/css/v5/app.css b/resources/css/v5/app.css index 84c33f859..1f85d6958 100644 --- a/resources/css/v5/app.css +++ b/resources/css/v5/app.css @@ -29,6 +29,11 @@ --color-destructive: var(--destructive); --color-destructive-foreground: var(--destructive-foreground); --color-warning: var(--warning); + --color-coollabs-50: #f5f0ff; + --color-coollabs: #6b16ed; + --color-coollabs-100: #7317ff; + --color-coollabs-200: #5a12c7; + --color-coollabs-300: #4a0fa3; --color-border: var(--border); --color-input: var(--input); --color-ring: var(--ring); @@ -76,7 +81,7 @@ --warning: #fcd452; --border: oklch(0.92 0.004 286.32); --input: oklch(0.92 0.004 286.32); - --ring: oklch(0.705 0.015 286.067); + --ring: var(--warning); --chart-1: oklch(0.871 0.006 286.286); --chart-2: oklch(0.552 0.016 285.938); --chart-3: oklch(0.442 0.017 285.786); @@ -112,7 +117,7 @@ --warning: #fcd452; --border: oklch(1 0 0 / 10%); --input: oklch(1 0 0 / 15%); - --ring: oklch(0.552 0.016 285.938); + --ring: var(--warning); --chart-1: oklch(0.871 0.006 286.286); --chart-2: oklch(0.552 0.016 285.938); --chart-3: oklch(0.442 0.017 285.786); diff --git a/resources/js/v5/Pages/Clusters.tsx b/resources/js/v5/Pages/Clusters.tsx index 291b140bc..26f5f9a4e 100644 --- a/resources/js/v5/Pages/Clusters.tsx +++ b/resources/js/v5/Pages/Clusters.tsx @@ -14,7 +14,7 @@ import { DialogTitle, } from '@/components/ui/dialog'; import { csrfToken } from '@/lib/csrf'; -import type { V5Cluster, V5HomeProps } from '@/types'; +import type { V5Cluster, V5DashboardProps } from '@/types'; type ClusterFormErrors = { name?: string[]; @@ -50,7 +50,7 @@ export default function Clusters({ projects = [], selectedProjectUuid = null, selectedEnvironmentUuid = null, -}: V5HomeProps) { +}: V5DashboardProps) { const [clusterList, setClusterList] = useState(clusters); const [selectedClusterId, setSelectedClusterId] = useState(clusters[0]?.id ?? ''); const [name, setName] = useState(''); @@ -134,7 +134,7 @@ export default function Clusters({ diff --git a/resources/js/v5/Pages/Home.tsx b/resources/js/v5/Pages/Dashboard.tsx similarity index 86% rename from resources/js/v5/Pages/Home.tsx rename to resources/js/v5/Pages/Dashboard.tsx index 8eb03c69f..ab0ee6f1e 100644 --- a/resources/js/v5/Pages/Home.tsx +++ b/resources/js/v5/Pages/Dashboard.tsx @@ -1,17 +1,17 @@ import { Head } from '@inertiajs/react'; import { AppNavbar } from '@/components/app-navbar'; -import type { V5HomeProps } from '@/types'; +import type { V5DashboardProps } from '@/types'; -export default function Home({ +export default function Dashboard({ flux, projects = [], selectedProjectUuid = null, selectedEnvironmentUuid = null, -}: V5HomeProps) { +}: V5DashboardProps) { return ( <> - +
-

Magic

+

Dashboard

This is where the magic happens.

diff --git a/resources/js/v5/components/app-navbar.tsx b/resources/js/v5/components/app-navbar.tsx index 45b04a129..1b205f9ed 100644 --- a/resources/js/v5/components/app-navbar.tsx +++ b/resources/js/v5/components/app-navbar.tsx @@ -1,9 +1,11 @@ -import { Link } from '@inertiajs/react'; +import { Link, usePage } from '@inertiajs/react'; import { useMemo, useState } from 'react'; import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'; +import { Sheet, SheetClose, SheetContent, SheetDescription, SheetHeader, SheetTitle, SheetTrigger } from '@/components/ui/sheet'; import { csrfToken } from '@/lib/csrf'; -import type { SelectItemOption, V5HomeProps, V5Project } from '@/types'; +import { cn } from '@/lib/utils'; +import type { SelectItemOption, V5DashboardProps, V5Project } from '@/types'; function persistSelection(projectUuid: string, environmentUuid: string): void { void fetch('/v5/selection', { @@ -21,7 +23,7 @@ function persistSelection(projectUuid: string, environmentUuid: string): void { }); } -type AppNavbarProps = V5HomeProps; +type AppNavbarProps = V5DashboardProps; export function AppNavbar({ flux, @@ -30,6 +32,7 @@ export function AppNavbar({ selectedProjectUuid = null, selectedEnvironmentUuid = null, }: AppNavbarProps) { + const { url } = usePage(); const firstProject = projects[0] ?? null; const [projectUuid, setProjectUuid] = useState(selectedProjectUuid ?? firstProject?.uuid ?? ''); const selectedProject = useMemo( @@ -73,26 +76,27 @@ export function AppNavbar({ label: environment.name, value: environment.uuid, })); + const isClustersPage = url.startsWith('/v5/clusters'); return (
-