From d7b054c0d03db65275df4a3ede7c3b2af8380248 Mon Sep 17 00:00:00 2001 From: Leonardo Salas Date: Wed, 17 Jun 2026 17:58:49 -0600 Subject: [PATCH] feat: dashboard sidebar and clearer engine identity Reworks the dashboard around a left sidebar that holds a larger TexSet wordmark, the New document action, and section links. The top header is gone. Project and template cards now wear their engine's color: a colored stripe along the top and a bolder badge (green for LaTeX, blue for Typst later), so the document type reads at a glance. Pinned projects get their own "Pinned" group above the rest, an accent ring, and a filled pin button, so they're easy to spot. --- src/app/page.tsx | 25 ++---- src/components/dashboard/NewProjectButton.tsx | 3 +- src/components/dashboard/ProjectCard.tsx | 34 ++++----- src/components/dashboard/ProjectsGallery.tsx | 76 +++++++++++-------- src/components/dashboard/Sidebar.tsx | 31 ++++++++ src/components/dashboard/TemplateGrid.tsx | 5 +- 6 files changed, 107 insertions(+), 67 deletions(-) create mode 100644 src/components/dashboard/Sidebar.tsx diff --git a/src/app/page.tsx b/src/app/page.tsx index 4d4bca2..7675302 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,6 +1,6 @@ import { listProjects } from "@/lib/projects"; import { templates } from "@/lib/templates"; -import { NewProjectButton } from "@/components/dashboard/NewProjectButton"; +import { Sidebar } from "@/components/dashboard/Sidebar"; import { TemplateGrid } from "@/components/dashboard/TemplateGrid"; import { ProjectsGallery } from "@/components/dashboard/ProjectsGallery"; @@ -18,26 +18,17 @@ export default function DashboardPage() { })); return ( -
-
-
- TexSet -
-
+
+ -
-
-

New document

- -
- -
-

Templates

+
+
+

Templates

-
-

My projects

+
+

My Projects

diff --git a/src/components/dashboard/NewProjectButton.tsx b/src/components/dashboard/NewProjectButton.tsx index cdb4873..03f4db8 100644 --- a/src/components/dashboard/NewProjectButton.tsx +++ b/src/components/dashboard/NewProjectButton.tsx @@ -13,8 +13,9 @@ export function NewProjectButton() { icon={Plus} loading={pending === "blank"} onClick={() => create({}, "blank")} + className="w-full" > - Blank document + New document ); } diff --git a/src/components/dashboard/ProjectCard.tsx b/src/components/dashboard/ProjectCard.tsx index 052090b..7e0f722 100644 --- a/src/components/dashboard/ProjectCard.tsx +++ b/src/components/dashboard/ProjectCard.tsx @@ -19,21 +19,22 @@ export function ProjectCard({ onTogglePin, onDelete, }: ProjectCardProps) { + // data-engine sets the accent (green for LaTeX, blue for Typst) for everything + // tinted in this card: the top stripe, the badge, and the pinned ring return ( -
+
+
-
- {project.pinned && ( - - )} - {project.name} -
+ {project.name}

Edited {formatRelativeTime(project.updatedAt)}

@@ -41,10 +42,7 @@ export function ProjectCard({ Created {formatDate(project.createdAt)} - + {engines[project.engine].name}
@@ -52,27 +50,29 @@ export function ProjectCard({ {/* actions sit over the card; preventDefault keeps the link from firing */} -
+
+ return ( +
+ {pinned.length > 0 && ( +
+
+ + Pinned +
+
+ {pinned.map(card)} +
+
)} +
+ {pinned.length > 0 && rest.length > 0 && ( +
Recent
+ )} +
+ {visibleRest.map(card)} +
+ {rest.length > PAGE_SIZE && ( + + )} +
+ {pendingDelete && ( setPendingDelete(null)} /> )} - +
); } diff --git a/src/components/dashboard/Sidebar.tsx b/src/components/dashboard/Sidebar.tsx new file mode 100644 index 0000000..394d5c2 --- /dev/null +++ b/src/components/dashboard/Sidebar.tsx @@ -0,0 +1,31 @@ +import { NewProjectButton } from "./NewProjectButton"; + +// Left navigation for the dashboard. Holds the brand, the primary action, and +// jumps to the page sections. Roomy enough to grow an engine filter and a theme +// toggle later. +export function Sidebar() { + return ( + + ); +} diff --git a/src/components/dashboard/TemplateGrid.tsx b/src/components/dashboard/TemplateGrid.tsx index be7ab88..d8bc022 100644 --- a/src/components/dashboard/TemplateGrid.tsx +++ b/src/components/dashboard/TemplateGrid.tsx @@ -39,9 +39,10 @@ export function TemplateGrid({ templates }: { templates: TemplateCard[] }) { data-engine={template.engine} onClick={() => create({ templateId: template.id }, template.id)} disabled={isPending} - className="group flex flex-col items-start gap-3 rounded-xl border border-border bg-surface p-4 text-left shadow-soft transition hover:-translate-y-0.5 hover:shadow-lift disabled:opacity-60" + className="group relative flex flex-col items-start gap-3 overflow-hidden rounded-xl border border-border bg-surface p-4 pt-5 text-left shadow-soft transition hover:-translate-y-0.5 hover:shadow-lift disabled:opacity-60" > - + + {isPending ? ( ) : (