mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-03 08:53:36 +00:00
refactor(ui): simplify Dashboard view header
Remove back button and rename title from "Projects Overview" to "Dashboard" since the overview is now the main dashboard accessed via sidebar. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,6 @@
|
|||||||
* recent completions, and alerts. Quick navigation to any project or feature.
|
* recent completions, and alerts. Quick navigation to any project or feature.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { useNavigate } from '@tanstack/react-router';
|
|
||||||
import { useMultiProjectStatus } from '@/hooks/use-multi-project-status';
|
import { useMultiProjectStatus } from '@/hooks/use-multi-project-status';
|
||||||
import { isElectron } from '@/lib/electron';
|
import { isElectron } from '@/lib/electron';
|
||||||
import { isMac } from '@/lib/utils';
|
import { isMac } from '@/lib/utils';
|
||||||
@@ -25,17 +24,11 @@ import {
|
|||||||
Clock,
|
Clock,
|
||||||
Bot,
|
Bot,
|
||||||
Bell,
|
Bell,
|
||||||
ArrowLeft,
|
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
|
|
||||||
export function OverviewView() {
|
export function OverviewView() {
|
||||||
const navigate = useNavigate();
|
|
||||||
const { overview, isLoading, error, refresh } = useMultiProjectStatus(15000); // Refresh every 15s
|
const { overview, isLoading, error, refresh } = useMultiProjectStatus(15000); // Refresh every 15s
|
||||||
|
|
||||||
const handleBackToDashboard = () => {
|
|
||||||
navigate({ to: '/dashboard' });
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex-1 flex flex-col h-screen content-bg" data-testid="overview-view">
|
<div className="flex-1 flex flex-col h-screen content-bg" data-testid="overview-view">
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
@@ -49,15 +42,12 @@ export function OverviewView() {
|
|||||||
)}
|
)}
|
||||||
<div className="px-4 sm:px-8 py-4 flex items-center justify-between">
|
<div className="px-4 sm:px-8 py-4 flex items-center justify-between">
|
||||||
<div className="flex items-center gap-3 titlebar-no-drag">
|
<div className="flex items-center gap-3 titlebar-no-drag">
|
||||||
<Button variant="ghost" size="icon" onClick={handleBackToDashboard} className="h-8 w-8">
|
|
||||||
<ArrowLeft className="w-4 h-4" />
|
|
||||||
</Button>
|
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<div className="w-8 h-8 rounded-lg bg-brand-500/10 flex items-center justify-center">
|
<div className="w-8 h-8 rounded-lg bg-brand-500/10 flex items-center justify-center">
|
||||||
<LayoutDashboard className="w-4 h-4 text-brand-500" />
|
<LayoutDashboard className="w-4 h-4 text-brand-500" />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<h1 className="text-lg font-semibold text-foreground">Projects Overview</h1>
|
<h1 className="text-lg font-semibold text-foreground">Dashboard</h1>
|
||||||
<p className="text-xs text-muted-foreground">
|
<p className="text-xs text-muted-foreground">
|
||||||
{overview ? `${overview.aggregate.projectCounts.total} projects` : 'Loading...'}
|
{overview ? `${overview.aggregate.projectCounts.total} projects` : 'Loading...'}
|
||||||
</p>
|
</p>
|
||||||
@@ -222,9 +212,9 @@ export function OverviewView() {
|
|||||||
<p className="text-sm text-muted-foreground mb-4">
|
<p className="text-sm text-muted-foreground mb-4">
|
||||||
Create or open a project to get started
|
Create or open a project to get started
|
||||||
</p>
|
</p>
|
||||||
<Button variant="outline" onClick={handleBackToDashboard}>
|
<p className="text-sm text-muted-foreground">
|
||||||
Go to Dashboard
|
Use the sidebar to create or open a project
|
||||||
</Button>
|
</p>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
Reference in New Issue
Block a user