forge
Explore
Log in

Don't you dare go Hollow

💄 tighten dashboard and navigation layout

Browse files at this commit

cb8e4ff70d61bc444c0a2f85f69bccb6c61d73e3Burak BoduroğluParent: 7c6d289
  • style
    • 💄 tighten dashboard and navigation layout
Show full message
style: 💄 tighten dashboard and navigation layout

- remove the role summary panel from the dashboard

- keep dashboard greeting and guide action above KPI cards

- move notes and events after the report card in sidebar navigation

- remove the add-exam action from the exams page header

- make normal page headers more compact while keeping dashboard compact unchanged

- reshape notes page into a full-width create form with a wider notes grid
src/components/layout/page-header.tsxmodified+4 -4
@@ -42,17 +42,17 @@ export function PageHeader(
42 "relative flex flex-col sm:flex-row sm:items-center sm:justify-between",42 "relative flex flex-col sm:flex-row sm:items-center sm:justify-between",
43 props.compact43 props.compact
44 ? "gap-3 px-4 py-3 sm:px-5 sm:py-3.5"44 ? "gap-3 px-4 py-3 sm:px-5 sm:py-3.5"
45- : "gap-4 p-6 sm:items-end sm:p-8",45+ : "gap-3 px-4 py-4 sm:items-end sm:px-5 sm:py-5",
46 )}46 )}
47 >47 >
48- <div class={cn("min-w-0", props.compact ? "space-y-0.5" : "max-w-2xl space-y-1.5")}>48+ <div class={cn("min-w-0", props.compact ? "space-y-0.5" : "max-w-2xl space-y-1")}>
49 <Show when={props.eyebrow && !props.compact}>49 <Show when={props.eyebrow && !props.compact}>
50 <p class="text-xs font-medium text-muted-foreground">{props.eyebrow}</p>50 <p class="text-xs font-medium text-muted-foreground">{props.eyebrow}</p>
51 </Show>51 </Show>
52 <h152 <h1
53 class={cn(53 class={cn(
54 "font-display font-semibold tracking-tight",54 "font-display font-semibold tracking-tight",
55- props.compact ? "text-lg sm:text-xl" : "text-2xl sm:text-3xl",55+ props.compact ? "text-lg sm:text-xl" : "text-xl sm:text-2xl",
56 )}56 )}
57 >57 >
58 {props.title}58 {props.title}
@@ -61,7 +61,7 @@ export function PageHeader(
61 <p61 <p
62 class={cn(62 class={cn(
63 "text-muted-foreground",63 "text-muted-foreground",
64- props.compact ? "text-xs sm:text-sm" : "text-sm sm:text-base",64+ props.compact ? "text-xs sm:text-sm" : "text-sm",
65 )}65 )}
66 >66 >
67 {props.description}67 {props.description}
src/components/layout/side-nav.tsxmodified+2 -3
@@ -26,11 +26,11 @@ type NavItem = {
26 26
27 const MAIN_ITEMS: NavItem[] = [27 const MAIN_ITEMS: NavItem[] = [
28 { to: "/", labelKey: "nav.home", Icon: IconHome, exact: true },28 { to: "/", labelKey: "nav.home", Icon: IconHome, exact: true },
29- { to: "/notes", labelKey: "nav.notes", Icon: IconNote },
30- { to: "/events", labelKey: "nav.events", Icon: IconCalendar },
31 { to: "/courses", labelKey: "nav.courses", Icon: IconBook },29 { to: "/courses", labelKey: "nav.courses", Icon: IconBook },
32 { to: "/exams", labelKey: "nav.exams", Icon: IconExam },30 { to: "/exams", labelKey: "nav.exams", Icon: IconExam },
33 { to: "/marks", labelKey: "nav.marks", Icon: IconChart },31 { to: "/marks", labelKey: "nav.marks", Icon: IconChart },
32+ { to: "/notes", labelKey: "nav.notes", Icon: IconNote },
33+ { to: "/events", labelKey: "nav.events", Icon: IconCalendar },
34 { to: "/admin/users", labelKey: "nav.users", Icon: IconUsers, adminOnly: true },34 { to: "/admin/users", labelKey: "nav.users", Icon: IconUsers, adminOnly: true },
35 ];35 ];
36 36
@@ -119,7 +119,6 @@ export function SideNav(props: { onNavigate?: () => void; collapsed?: boolean })
119 </For>119 </For>
120 </div>120 </div>
121 121
122- {/* Guide sits just above the sidebar footer */}
123 <div class="mt-auto border-t border-border px-2 pb-1 pt-2">122 <div class="mt-auto border-t border-border px-2 pb-1 pt-2">
124 <NavLink item={GUIDE_ITEM} collapsed={props.collapsed} onNavigate={props.onNavigate} />123 <NavLink item={GUIDE_ITEM} collapsed={props.collapsed} onNavigate={props.onNavigate} />
125 </div>124 </div>
src/components/notes/note-list.tsxmodified+1 -1
@@ -17,7 +17,7 @@ export function NoteList(props: {
17 </div>17 </div>
18 }18 }
19 >19 >
20- <ul class="grid gap-4 sm:grid-cols-2 xl:grid-cols-2">20+ <ul class="grid gap-4 sm:grid-cols-2 xl:grid-cols-3">
21 <For each={props.notes}>21 <For each={props.notes}>
22 {(note) => (22 {(note) => (
23 <li class="animate-fade-up">23 <li class="animate-fade-up">
src/pages/dashboard-page.tsxmodified+0 -4
@@ -8,7 +8,6 @@ import { formatApiError } from "@/api/client";
8 import type { Event, Exam, Note } from "@/api/types";8 import type { Event, Exam, Note } from "@/api/types";
9 import { RouteGuard } from "@/components/layout/route-guard";9 import { RouteGuard } from "@/components/layout/route-guard";
10 import { PageHeader } from "@/components/layout/page-header";10 import { PageHeader } from "@/components/layout/page-header";
11-import { RoleHomePanel } from "@/components/dashboard/role-home-panel";
12 import { Alert } from "@/components/ui/alert";11 import { Alert } from "@/components/ui/alert";
13 import { Badge } from "@/components/ui/badge";12 import { Badge } from "@/components/ui/badge";
14 import { Button } from "@/components/ui/button";13 import { Button } from "@/components/ui/button";
@@ -64,7 +63,6 @@ function DashboardContent() {
64 63
65 return (64 return (
66 <div class="space-y-5">65 <div class="space-y-5">
67- {/* Compact greeting + guide */}
68 <PageHeader66 <PageHeader
69 compact67 compact
70 accent="mint"68 accent="mint"
@@ -79,8 +77,6 @@ function DashboardContent() {
79 }77 }
80 />78 />
81 79
82- <RoleHomePanel role={user().role} />
83-
84 <Show when={resourceError()}>80 <Show when={resourceError()}>
85 {(msg) => <Alert variant="destructive">{msg()}</Alert>}81 {(msg) => <Alert variant="destructive">{msg()}</Alert>}
86 </Show>82 </Show>
src/pages/exams-page.tsxmodified+0 -8
@@ -8,7 +8,6 @@ import { PageHeader } from "@/components/layout/page-header";
8 import { CollapsibleHelp } from "@/components/ui/collapsible-help";8 import { CollapsibleHelp } from "@/components/ui/collapsible-help";
9 import { Alert } from "@/components/ui/alert";9 import { Alert } from "@/components/ui/alert";
10 import { Badge } from "@/components/ui/badge";10 import { Badge } from "@/components/ui/badge";
11-import { Button } from "@/components/ui/button";
12 import { formatApiError } from "@/api/client";11 import { formatApiError } from "@/api/client";
13 import { IconChevronRight } from "@/components/ui/icons";12 import { IconChevronRight } from "@/components/ui/icons";
14 import { PageSpinner } from "@/components/ui/page-spinner";13 import { PageSpinner } from "@/components/ui/page-spinner";
@@ -66,13 +65,6 @@ function ExamsContent() {
66 eyebrow={t("nav.exams")}65 eyebrow={t("nav.exams")}
67 title={t("exams.title")}66 title={t("exams.title")}
68 description={t("exams.subtitle")}67 description={t("exams.subtitle")}
69- actions={
70- canCreate() ? (
71- <Link to="/courses">
72- <Button>{t("courses.addExam")}</Button>
73- </Link>
74- ) : undefined
75- }
76 />68 />
77 69
78 <CollapsibleHelp title={t("exams.helpTitle")}>70 <CollapsibleHelp title={t("exams.helpTitle")}>
src/pages/notes-page.tsxmodified+4 -4
@@ -47,9 +47,9 @@ function NotesContent() {
47 47
48 <CollapsibleHelp title={t("notes.helpTitle")}>{t("notes.helpBody")}</CollapsibleHelp>48 <CollapsibleHelp title={t("notes.helpTitle")}>{t("notes.helpBody")}</CollapsibleHelp>
49 49
50- <div class="grid gap-6 lg:grid-cols-[minmax(0,22rem)_1fr]">50+ <div class="space-y-5">
51- <section class="surface-card h-fit p-5 lg:sticky lg:top-24">51+ <section class="surface-card p-4 sm:p-5">
52- <h2 class="mb-4 font-display text-lg font-semibold">{t("notes.new")}</h2>52+ <h2 class="mb-3 font-display text-lg font-semibold">{t("notes.new")}</h2>
53 <NoteForm53 <NoteForm
54 submitLabel={t("common.create")}54 submitLabel={t("common.create")}
55 onSubmit={(values) =>55 onSubmit={(values) =>
@@ -64,7 +64,7 @@ function NotesContent() {
64 {error() && <p class="mt-3 text-sm text-destructive">{error()}</p>}64 {error() && <p class="mt-3 text-sm text-destructive">{error()}</p>}
65 </section>65 </section>
66 66
67- <section>67+ <section class="min-w-0">
68 <Suspense fallback={<PageSpinner />}>68 <Suspense fallback={<PageSpinner />}>
69 <Show when={notes.error}>69 <Show when={notes.error}>
70 <Alert variant="destructive">{formatApiError(notes.error)}</Alert>70 <Alert variant="destructive">{formatApiError(notes.error)}</Alert>