🧭 shared breadcrumbs on every detail page
Browse files at this commita4ab2e9cc79a27713270542ddeacbb273201a626Parent: 2834536- feat
- 🧭 shared breadcrumbs on every detail page
14 changed files +154 -92
- src/components/layout/breadcrumbs.test.tsx +25 -0
- src/components/layout/breadcrumbs.tsx +49 -0
- src/i18n/messages.ts +3 -0
- src/pages/admin-user-detail-page.tsx +10 -8
- src/pages/bank-question-detail-page.tsx +6 -9
- src/pages/class-detail-page.tsx +4 -5
- src/pages/course-detail-page.tsx +7 -5
- src/pages/event-detail-page.tsx +15 -22
- src/pages/exam-detail-page.tsx +2 -5
- src/pages/homework-detail-page.tsx +6 -16
- src/pages/instance-detail-page.tsx +9 -8
- src/pages/meal-detail-page.tsx +11 -8
- src/pages/question-detail-page.tsx +4 -1
- src/pages/whiteboard-page.tsx +3 -5
src/components/layout/breadcrumbs.test.tsxadded+25 -0
| @@ -0,0 +1,25 @@ | |||
| 1 | +import { cleanup, render, screen } from "@solidjs/testing-library"; | ||
| 2 | +import type { JSX } from "solid-js"; | ||
| 3 | +import { afterEach, expect, test, vi } from "vitest"; | ||
| 4 | +import { Breadcrumbs } from "@/components/layout/breadcrumbs"; | ||
| 5 | +import { PreferencesProvider } from "@/stores/preferences-context"; | ||
| 6 | + | ||
| 7 | +vi.mock("@tanstack/solid-router", () => ({ | ||
| 8 | + Link: (props: { to: string; children: JSX.Element; class?: string }) => <a href={props.to} class={props.class}>{props.children}</a>, | ||
| 9 | +})); | ||
| 10 | + | ||
| 11 | +afterEach(cleanup); | ||
| 12 | + | ||
| 13 | +test("links every ancestor and marks the last crumb as the current page", () => { | ||
| 14 | + render(() => ( | ||
| 15 | + <PreferencesProvider> | ||
| 16 | + <Breadcrumbs items={[{ label: "Courses", to: "/courses" }, { label: "Algebra", to: "/courses/$id" }, { label: "9-A" }]} /> | ||
| 17 | + </PreferencesProvider> | ||
| 18 | + )); | ||
| 19 | + | ||
| 20 | + const nav = screen.getByRole("navigation"); | ||
| 21 | + expect(nav.getAttribute("aria-label")).toBeTruthy(); | ||
| 22 | + expect(screen.getAllByRole("link").map((link) => link.getAttribute("href"))).toEqual(["/courses", "/courses/$id"]); | ||
| 23 | + expect(screen.getByText("9-A").getAttribute("aria-current")).toBe("page"); | ||
| 24 | + expect(screen.getByText("Algebra").getAttribute("aria-current")).toBeNull(); | ||
| 25 | +}); | ||
src/components/layout/breadcrumbs.tsxadded+49 -0
| @@ -0,0 +1,49 @@ | |||
| 1 | +import { For, Show } from "solid-js"; | ||
| 2 | +import { Link } from "@tanstack/solid-router"; | ||
| 3 | +import { useT } from "@/stores/preferences-context"; | ||
| 4 | + | ||
| 5 | +export type Crumb = { | ||
| 6 | + label: string; | ||
| 7 | + /** Route path, e.g. `/exams` or `/courses/$id`. Omit for the current page. */ | ||
| 8 | + to?: string; | ||
| 9 | + params?: Record<string, string>; | ||
| 10 | + search?: Record<string, unknown>; | ||
| 11 | +}; | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * Hub → record trail above a detail page header. The last crumb is the | ||
| 15 | + * current page and is not a link. | ||
| 16 | + */ | ||
| 17 | +export function Breadcrumbs(props: { items: Crumb[] }) { | ||
| 18 | + const t = useT(); | ||
| 19 | + return ( | ||
| 20 | + <nav aria-label={t("common.breadcrumb")}> | ||
| 21 | + <ol class="detail-breadcrumb"> | ||
| 22 | + <For each={props.items}> | ||
| 23 | + {(item, index) => { | ||
| 24 | + const last = () => index() === props.items.length - 1; | ||
| 25 | + return ( | ||
| 26 | + <li class="flex min-w-0 items-center gap-1.5"> | ||
| 27 | + <Show | ||
| 28 | + when={item.to && !last()} | ||
| 29 | + fallback={ | ||
| 30 | + <span class="truncate text-foreground" aria-current={last() ? "page" : undefined}> | ||
| 31 | + {item.label} | ||
| 32 | + </span> | ||
| 33 | + } | ||
| 34 | + > | ||
| 35 | + <Link to={item.to as never} params={item.params as never} search={(item.search ?? {}) as never} class="truncate"> | ||
| 36 | + {item.label} | ||
| 37 | + </Link> | ||
| 38 | + </Show> | ||
| 39 | + <Show when={!last()}> | ||
| 40 | + <span aria-hidden="true">›</span> | ||
| 41 | + </Show> | ||
| 42 | + </li> | ||
| 43 | + ); | ||
| 44 | + }} | ||
| 45 | + </For> | ||
| 46 | + </ol> | ||
| 47 | + </nav> | ||
| 48 | + ); | ||
| 49 | +} | ||
src/i18n/messages.tsmodified+3 -0
| @@ -615,6 +615,7 @@ export type MessageKey = | |||
| 615 | | "common.deleted" | 615 | | "common.deleted" |
| 616 | | "common.saved" | 616 | | "common.saved" |
| 617 | | "common.loadAll" | 617 | | "common.loadAll" |
| 618 | + | "common.breadcrumb" | ||
| 618 | | "common.truncatedNotice" | 619 | | "common.truncatedNotice" |
| 619 | | "common.createItem" | 620 | | "common.createItem" |
| 620 | | "common.countItem" | 621 | | "common.countItem" |
| @@ -2746,6 +2747,7 @@ const en: Dict = { | |||
| 2746 | "common.deleted": "Deleted.", | 2747 | "common.deleted": "Deleted.", |
| 2747 | "common.saved": "Saved successfully.", | 2748 | "common.saved": "Saved successfully.", |
| 2748 | "common.loadAll": "Load all", | 2749 | "common.loadAll": "Load all", |
| 2750 | + "common.breadcrumb": "Breadcrumb", | ||
| 2749 | "common.truncatedNotice": "Showing the first {shown} of {total} records.", | 2751 | "common.truncatedNotice": "Showing the first {shown} of {total} records.", |
| 2750 | "common.createItem": "Create new {item}", | 2752 | "common.createItem": "Create new {item}", |
| 2751 | "common.countItem": "{count} {item}", | 2753 | "common.countItem": "{count} {item}", |
| @@ -4879,6 +4881,7 @@ const tr: Dict = { | |||
| 4879 | "common.deleted": "Silindi.", | 4881 | "common.deleted": "Silindi.", |
| 4880 | "common.saved": "Başarıyla kaydedildi.", | 4882 | "common.saved": "Başarıyla kaydedildi.", |
| 4881 | "common.loadAll": "Tümünü yükle", | 4883 | "common.loadAll": "Tümünü yükle", |
| 4884 | + "common.breadcrumb": "Sayfa konumu", | ||
| 4882 | "common.truncatedNotice": "{total} kayıttan ilk {shown} tanesi gösteriliyor.", | 4885 | "common.truncatedNotice": "{total} kayıttan ilk {shown} tanesi gösteriliyor.", |
| 4883 | "common.createItem": "Yeni {item} oluştur", | 4886 | "common.createItem": "Yeni {item} oluştur", |
| 4884 | "common.countItem": "{count} {item}", | 4887 | "common.countItem": "{count} {item}", |
src/pages/admin-user-detail-page.tsxmodified+10 -8
| @@ -6,6 +6,7 @@ import { getUserById, getUserProfile, patchUserProfile, patchUserRole } from "@/ | |||
| 6 | import { formatApiError, type Role } from "@/api/client"; | 6 | import { formatApiError, type Role } from "@/api/client"; |
| 7 | import type { MessageKey } from "@/i18n/messages"; | 7 | import type { MessageKey } from "@/i18n/messages"; |
| 8 | import { PageHeader } from "@/components/layout/page-header"; | 8 | import { PageHeader } from "@/components/layout/page-header"; |
| 9 | +import { Breadcrumbs } from "@/components/layout/breadcrumbs"; | ||
| 9 | import { RouteGuard } from "@/components/layout/route-guard"; | 10 | import { RouteGuard } from "@/components/layout/route-guard"; |
| 10 | import { ParentStudentsPanel } from "@/components/users/parent-students-panel"; | 11 | import { ParentStudentsPanel } from "@/components/users/parent-students-panel"; |
| 11 | import { ProfileForm } from "@/components/users/profile-form"; | 12 | import { ProfileForm } from "@/components/users/profile-form"; |
| @@ -13,7 +14,7 @@ import { Alert } from "@/components/ui/alert"; | |||
| 13 | import { Button } from "@/components/ui/button"; | 14 | import { Button } from "@/components/ui/button"; |
| 14 | import { ConfirmDialog } from "@/components/ui/confirm-dialog"; | 15 | import { ConfirmDialog } from "@/components/ui/confirm-dialog"; |
| 15 | import { DetailField } from "@/components/ui/detail-field"; | 16 | import { DetailField } from "@/components/ui/detail-field"; |
| 16 | -import { IconChevronLeft, IconEdit, IconExternalLink, IconUsers } from "@/components/ui/icons"; | 17 | +import { IconEdit, IconExternalLink, IconUsers } from "@/components/ui/icons"; |
| 17 | import { PageSpinner } from "@/components/ui/page-spinner"; | 18 | import { PageSpinner } from "@/components/ui/page-spinner"; |
| 18 | import { Select } from "@/components/ui/select"; | 19 | import { Select } from "@/components/ui/select"; |
| 19 | import { SidePanel } from "@/components/ui/side-panel"; | 20 | import { SidePanel } from "@/components/ui/side-panel"; |
| @@ -68,18 +69,18 @@ function AdminUserDetailContent() { | |||
| 68 | <Show when={error()}> | 69 | <Show when={error()}> |
| 69 | <Alert variant="destructive">{error()}</Alert> | 70 | <Alert variant="destructive">{error()}</Alert> |
| 70 | </Show> | 71 | </Show> |
| 72 | + <div class="space-y-2"> | ||
| 73 | + <Breadcrumbs | ||
| 74 | + items={[ | ||
| 75 | + { label: t("nav.users"), to: "/admin/users" }, | ||
| 76 | + { label: [current().name, current().surname].filter(Boolean).join(" ") || current().username }, | ||
| 77 | + ]} | ||
| 78 | + /> | ||
| 71 | <PageHeader | 79 | <PageHeader |
| 72 | - eyebrow={t("nav.users")} | ||
| 73 | title={[current().name, current().surname].filter(Boolean).join(" ") || current().username} | 80 | title={[current().name, current().surname].filter(Boolean).join(" ") || current().username} |
| 74 | description={`@${current().username}`} | 81 | description={`@${current().username}`} |
| 75 | actions={ | 82 | actions={ |
| 76 | <> | 83 | <> |
| 77 | - <Link to="/admin/users"> | ||
| 78 | - <Button variant="ghost" size="sm"> | ||
| 79 | - <IconChevronLeft class="h-4 w-4" /> | ||
| 80 | - {t("common.back")} | ||
| 81 | - </Button> | ||
| 82 | - </Link> | ||
| 83 | <Link to="/profile/$userId" params={{ userId: current().id }}> | 84 | <Link to="/profile/$userId" params={{ userId: current().id }}> |
| 84 | <Button variant="outline" size="sm"> | 85 | <Button variant="outline" size="sm"> |
| 85 | <IconExternalLink class="h-4 w-4" /> | 86 | <IconExternalLink class="h-4 w-4" /> |
| @@ -99,6 +100,7 @@ function AdminUserDetailContent() { | |||
| 99 | </> | 100 | </> |
| 100 | } | 101 | } |
| 101 | /> | 102 | /> |
| 103 | + </div> | ||
| 102 | 104 | ||
| 103 | <section class="data-shell grid gap-4 p-5 sm:grid-cols-2 lg:grid-cols-3"> | 105 | <section class="data-shell grid gap-4 p-5 sm:grid-cols-2 lg:grid-cols-3"> |
| 104 | <DetailField label={t("admin.username")} value={current().username} /> | 106 | <DetailField label={t("admin.username")} value={current().username} /> |
src/pages/bank-question-detail-page.tsxmodified+6 -9
| @@ -1,4 +1,4 @@ | |||
| 1 | -import { Link, useLocation, useNavigate, useParams } from "@tanstack/solid-router"; | 1 | +import { useLocation, useNavigate, useParams } from "@tanstack/solid-router"; |
| 2 | import { For, Show, Suspense, createMemo, createSignal } from "solid-js"; | 2 | import { For, Show, Suspense, createMemo, createSignal } from "solid-js"; |
| 3 | import { createResource } from "@/lib/create-resource"; | 3 | import { createResource } from "@/lib/create-resource"; |
| 4 | import { | 4 | import { |
| @@ -11,6 +11,7 @@ import { getCourses } from "@/api/courses"; | |||
| 11 | import { formatApiError } from "@/api/client"; | 11 | import { formatApiError } from "@/api/client"; |
| 12 | import { BankQuestionForm } from "@/components/exams/bank-question-form"; | 12 | import { BankQuestionForm } from "@/components/exams/bank-question-form"; |
| 13 | import { PageHeader } from "@/components/layout/page-header"; | 13 | import { PageHeader } from "@/components/layout/page-header"; |
| 14 | +import { Breadcrumbs } from "@/components/layout/breadcrumbs"; | ||
| 14 | import { RouteGuard } from "@/components/layout/route-guard"; | 15 | import { RouteGuard } from "@/components/layout/route-guard"; |
| 15 | import { Alert } from "@/components/ui/alert"; | 16 | import { Alert } from "@/components/ui/alert"; |
| 16 | import { Badge } from "@/components/ui/badge"; | 17 | import { Badge } from "@/components/ui/badge"; |
| @@ -18,7 +19,7 @@ import { Button } from "@/components/ui/button"; | |||
| 18 | import { ComingSoonValue } from "@/components/ui/coming-soon"; | 19 | import { ComingSoonValue } from "@/components/ui/coming-soon"; |
| 19 | import { ConfirmDialog } from "@/components/ui/confirm-dialog"; | 20 | import { ConfirmDialog } from "@/components/ui/confirm-dialog"; |
| 20 | import { DetailField } from "@/components/ui/detail-field"; | 21 | import { DetailField } from "@/components/ui/detail-field"; |
| 21 | -import { IconChevronLeft, IconEdit, IconTrash } from "@/components/ui/icons"; | 22 | +import { IconEdit, IconTrash } from "@/components/ui/icons"; |
| 22 | import { PageSpinner } from "@/components/ui/page-spinner"; | 23 | import { PageSpinner } from "@/components/ui/page-spinner"; |
| 23 | import { SidePanel } from "@/components/ui/side-panel"; | 24 | import { SidePanel } from "@/components/ui/side-panel"; |
| 24 | import { formatDate } from "@/lib/format"; | 25 | import { formatDate } from "@/lib/format"; |
| @@ -93,18 +94,13 @@ function BankQuestionDetailContent() { | |||
| 93 | <Show when={error()}> | 94 | <Show when={error()}> |
| 94 | <Alert variant="destructive">{error()}</Alert> | 95 | <Alert variant="destructive">{error()}</Alert> |
| 95 | </Show> | 96 | </Show> |
| 97 | + <div class="space-y-2"> | ||
| 98 | + <Breadcrumbs items={[{ label: t("bank.title"), to: "/question-bank" }, { label: current().text }]} /> | ||
| 96 | <PageHeader | 99 | <PageHeader |
| 97 | - eyebrow={t("bank.title")} | ||
| 98 | title={current().text} | 100 | title={current().text} |
| 99 | description={current().subject_name || t("bank.subtitle")} | 101 | description={current().subject_name || t("bank.subtitle")} |
| 100 | actions={ | 102 | actions={ |
| 101 | <> | 103 | <> |
| 102 | - <Link to="/question-bank"> | ||
| 103 | - <Button variant="ghost" size="sm"> | ||
| 104 | - <IconChevronLeft class="h-4 w-4" /> | ||
| 105 | - {t("common.back")} | ||
| 106 | - </Button> | ||
| 107 | - </Link> | ||
| 108 | <Show when={canEdit()}> | 104 | <Show when={canEdit()}> |
| 109 | <Button variant="outline" size="sm" class="rounded-lg" onClick={() => setEditing(true)}> | 105 | <Button variant="outline" size="sm" class="rounded-lg" onClick={() => setEditing(true)}> |
| 110 | <IconEdit class="h-4 w-4" /> | 106 | <IconEdit class="h-4 w-4" /> |
| @@ -118,6 +114,7 @@ function BankQuestionDetailContent() { | |||
| 118 | </> | 114 | </> |
| 119 | } | 115 | } |
| 120 | /> | 116 | /> |
| 117 | + </div> | ||
| 121 | 118 | ||
| 122 | <section class="data-shell space-y-5 p-5"> | 119 | <section class="data-shell space-y-5 p-5"> |
| 123 | <div class="grid gap-4 sm:grid-cols-2 lg:grid-cols-4"> | 120 | <div class="grid gap-4 sm:grid-cols-2 lg:grid-cols-4"> |
src/pages/class-detail-page.tsxmodified+4 -5
| @@ -1,6 +1,7 @@ | |||
| 1 | import { For, Show, Suspense, createEffect, createMemo, createSignal } from "solid-js"; | 1 | import { For, Show, Suspense, createEffect, createMemo, createSignal } from "solid-js"; |
| 2 | import { createResource } from "@/lib/create-resource"; | 2 | import { createResource } from "@/lib/create-resource"; |
| 3 | -import { Link, useLocation, useNavigate, useParams } from "@tanstack/solid-router"; | 3 | +import { useLocation, useNavigate, useParams } from "@tanstack/solid-router"; |
| 4 | +import { Breadcrumbs } from "@/components/layout/breadcrumbs"; | ||
| 4 | import type { ColumnDef } from "@tanstack/solid-table"; | 5 | import type { ColumnDef } from "@tanstack/solid-table"; |
| 5 | import { | 6 | import { |
| 6 | getClassById, | 7 | getClassById, |
| @@ -25,7 +26,7 @@ import { Badge } from "@/components/ui/badge"; | |||
| 25 | import { Button } from "@/components/ui/button"; | 26 | import { Button } from "@/components/ui/button"; |
| 26 | import { ConfirmDialog } from "@/components/ui/confirm-dialog"; | 27 | import { ConfirmDialog } from "@/components/ui/confirm-dialog"; |
| 27 | import { DataTable, DataTableSkeleton } from "@/components/ui/data-table"; | 28 | import { DataTable, DataTableSkeleton } from "@/components/ui/data-table"; |
| 28 | -import { IconChevronLeft, IconExternalLink, IconPlus, IconTrash } from "@/components/ui/icons"; | 29 | +import { IconExternalLink, IconPlus, IconTrash } from "@/components/ui/icons"; |
| 29 | import { Input } from "@/components/ui/input"; | 30 | import { Input } from "@/components/ui/input"; |
| 30 | import { Label } from "@/components/ui/label"; | 31 | import { Label } from "@/components/ui/label"; |
| 31 | import { PageSpinner } from "@/components/ui/page-spinner"; | 32 | import { PageSpinner } from "@/components/ui/page-spinner"; |
| @@ -234,9 +235,7 @@ function ClassDetailContent() { | |||
| 234 | > | 235 | > |
| 235 | {(c) => ( | 236 | {(c) => ( |
| 236 | <div class="space-y-5"> | 237 | <div class="space-y-5"> |
| 237 | - <Link to="/management/classes" class="inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground"> | 238 | + <Breadcrumbs items={[{ label: t("classGroups.title"), to: "/management/classes" }, { label: c().name }]} /> |
| 238 | - <IconChevronLeft class="h-4 w-4" />{t("classGroups.title")} | ||
| 239 | - </Link> | ||
| 240 | 239 | ||
| 241 | <header class="flex flex-wrap items-end justify-between gap-4 border-b border-border pb-5"> | 240 | <header class="flex flex-wrap items-end justify-between gap-4 border-b border-border pb-5"> |
| 242 | <div class="space-y-1"> | 241 | <div class="space-y-1"> |
src/pages/course-detail-page.tsxmodified+7 -5
| @@ -17,6 +17,7 @@ import { CourseNotesPanel } from "@/components/courses/course-notes-panel"; | |||
| 17 | import { CourseSubjectsPanel } from "@/components/courses/course-subjects-panel"; | 17 | import { CourseSubjectsPanel } from "@/components/courses/course-subjects-panel"; |
| 18 | import { RouteGuard } from "@/components/layout/route-guard"; | 18 | import { RouteGuard } from "@/components/layout/route-guard"; |
| 19 | import { PageHeader } from "@/components/layout/page-header"; | 19 | import { PageHeader } from "@/components/layout/page-header"; |
| 20 | +import { Breadcrumbs } from "@/components/layout/breadcrumbs"; | ||
| 20 | import { Alert } from "@/components/ui/alert"; | 21 | import { Alert } from "@/components/ui/alert"; |
| 21 | import { Badge } from "@/components/ui/badge"; | 22 | import { Badge } from "@/components/ui/badge"; |
| 22 | import { Button } from "@/components/ui/button"; | 23 | import { Button } from "@/components/ui/button"; |
| @@ -260,11 +261,12 @@ function CourseDetailContent() { | |||
| 260 | <Show when={canViewCourse()} fallback={<Alert variant="destructive">{t("common.accessDenied")}</Alert>}> | 261 | <Show when={canViewCourse()} fallback={<Alert variant="destructive">{t("common.accessDenied")}</Alert>}> |
| 261 | <div class="mx-auto w-full max-w-[1440px] space-y-4"> | 262 | <div class="mx-auto w-full max-w-[1440px] space-y-4"> |
| 262 | <div class="space-y-1.5"> | 263 | <div class="space-y-1.5"> |
| 263 | - <nav class="detail-breadcrumb"> | 264 | + <Breadcrumbs |
| 264 | - <Link to="/courses" search={courseListSearch(c().kind)}>{courseKindLabel(c().kind)}</Link> | 265 | + items={[ |
| 265 | - <span aria-hidden>›</span> | 266 | + { label: courseKindLabel(c().kind), to: "/courses", search: courseListSearch(c().kind) }, |
| 266 | - <span class="text-foreground">{c().title}</span> | 267 | + { label: c().title }, |
| 267 | - </nav> | 268 | + ]} |
| 269 | + /> | ||
| 268 | <PageHeader | 270 | <PageHeader |
| 269 | title={c().title} | 271 | title={c().title} |
| 270 | description={c().description || "—"} | 272 | description={c().description || "—"} |
src/pages/event-detail-page.tsxmodified+15 -22
| @@ -1,4 +1,4 @@ | |||
| 1 | -import { Link, useLocation, useNavigate, useParams } from "@tanstack/solid-router"; | 1 | +import { useLocation, useNavigate, useParams } from "@tanstack/solid-router"; |
| 2 | import type { ColumnDef } from "@tanstack/solid-table"; | 2 | import type { ColumnDef } from "@tanstack/solid-table"; |
| 3 | import { Show, Suspense, createMemo, createSignal } from "solid-js"; | 3 | import { Show, Suspense, createMemo, createSignal } from "solid-js"; |
| 4 | import { createResource } from "@/lib/create-resource"; | 4 | import { createResource } from "@/lib/create-resource"; |
| @@ -19,13 +19,14 @@ import { AttendanceTable } from "@/components/events/attendance-table"; | |||
| 19 | import { EventForm } from "@/components/events/event-form"; | 19 | import { EventForm } from "@/components/events/event-form"; |
| 20 | import { RouteGuard } from "@/components/layout/route-guard"; | 20 | import { RouteGuard } from "@/components/layout/route-guard"; |
| 21 | import { PageHeader } from "@/components/layout/page-header"; | 21 | import { PageHeader } from "@/components/layout/page-header"; |
| 22 | +import { Breadcrumbs } from "@/components/layout/breadcrumbs"; | ||
| 22 | import { Alert } from "@/components/ui/alert"; | 23 | import { Alert } from "@/components/ui/alert"; |
| 23 | import { Badge } from "@/components/ui/badge"; | 24 | import { Badge } from "@/components/ui/badge"; |
| 24 | import { Button } from "@/components/ui/button"; | 25 | import { Button } from "@/components/ui/button"; |
| 25 | import { ConfirmDialog } from "@/components/ui/confirm-dialog"; | 26 | import { ConfirmDialog } from "@/components/ui/confirm-dialog"; |
| 26 | import { DataTable, DataTableSkeleton } from "@/components/ui/data-table"; | 27 | import { DataTable, DataTableSkeleton } from "@/components/ui/data-table"; |
| 27 | import { EmptyState } from "@/components/ui/empty-state"; | 28 | import { EmptyState } from "@/components/ui/empty-state"; |
| 28 | -import { IconChevronLeft, IconEdit, IconTrash } from "@/components/ui/icons"; | 29 | +import { IconEdit, IconTrash } from "@/components/ui/icons"; |
| 29 | import { PageSpinner } from "@/components/ui/page-spinner"; | 30 | import { PageSpinner } from "@/components/ui/page-spinner"; |
| 30 | import { SidePanel } from "@/components/ui/side-panel"; | 31 | import { SidePanel } from "@/components/ui/side-panel"; |
| 31 | import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; | 32 | import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; |
| @@ -167,31 +168,23 @@ function EventDetailContent() { | |||
| 167 | {(ev) => ( | 168 | {(ev) => ( |
| 168 | <div class="space-y-6"> | 169 | <div class="space-y-6"> |
| 169 | <div class="space-y-2"> | 170 | <div class="space-y-2"> |
| 171 | + <Breadcrumbs items={[{ label: t("events.title"), to: "/events" }, { label: ev().title }]} /> | ||
| 170 | <PageHeader | 172 | <PageHeader |
| 171 | - eyebrow={t("events.title")} | ||
| 172 | title={ev().title} | 173 | title={ev().title} |
| 173 | description={ev().description || "—"} | 174 | description={ev().description || "—"} |
| 174 | actions={ | 175 | actions={ |
| 175 | - <div class="detail-action-group"> | 176 | + canManage() ? ( |
| 176 | - <Link to="/events"> | 177 | + <div class="detail-action-group"> |
| 177 | - <Button variant="ghost" size="sm" class="w-full rounded-xl sm:w-auto"> | 178 | + <Button type="button" variant="outline" size="sm" class="flex-1 rounded-xl sm:flex-none" onClick={() => setEditing(true)}> |
| 178 | - <IconChevronLeft class="h-4 w-4" /> | 179 | + <IconEdit class="h-4 w-4" /> |
| 179 | - {t("common.back")} | 180 | + {t("common.edit")} |
| 180 | </Button> | 181 | </Button> |
| 181 | - </Link> | 182 | + <Button type="button" variant="destructive" size="sm" class="flex-1 rounded-xl sm:flex-none" disabled={pending()} onClick={() => setDeleteOpen(true)}> |
| 182 | - <Show when={canManage()}> | 183 | + <IconTrash class="h-4 w-4" /> |
| 183 | - <div class="detail-action-divider"> | 184 | + {t("common.delete")} |
| 184 | - <Button type="button" variant="outline" size="sm" class="flex-1 rounded-xl sm:flex-none" onClick={() => setEditing(true)}> | 185 | + </Button> |
| 185 | - <IconEdit class="h-4 w-4" /> | 186 | + </div> |
| 186 | - {t("common.edit")} | 187 | + ) : undefined |
| 187 | - </Button> | ||
| 188 | - <Button type="button" variant="destructive" size="sm" class="flex-1 rounded-xl sm:flex-none" disabled={pending()} onClick={() => setDeleteOpen(true)}> | ||
| 189 | - <IconTrash class="h-4 w-4" /> | ||
| 190 | - {t("common.delete")} | ||
| 191 | - </Button> | ||
| 192 | - </div> | ||
| 193 | - </Show> | ||
| 194 | - </div> | ||
| 195 | } | 188 | } |
| 196 | /> | 189 | /> |
| 197 | <div class="grid gap-3 text-sm sm:grid-cols-3"> | 190 | <div class="grid gap-3 text-sm sm:grid-cols-3"> |
src/pages/exam-detail-page.tsxmodified+2 -5
| @@ -23,6 +23,7 @@ import { ExamResultBadge } from "@/components/exams/exam-result-badge"; | |||
| 23 | import { GradeForm } from "@/components/exams/grade-form"; | 23 | import { GradeForm } from "@/components/exams/grade-form"; |
| 24 | import { RouteGuard } from "@/components/layout/route-guard"; | 24 | import { RouteGuard } from "@/components/layout/route-guard"; |
| 25 | import { PageHeader } from "@/components/layout/page-header"; | 25 | import { PageHeader } from "@/components/layout/page-header"; |
| 26 | +import { Breadcrumbs } from "@/components/layout/breadcrumbs"; | ||
| 26 | import { Alert } from "@/components/ui/alert"; | 27 | import { Alert } from "@/components/ui/alert"; |
| 27 | import { Badge } from "@/components/ui/badge"; | 28 | import { Badge } from "@/components/ui/badge"; |
| 28 | import { Button } from "@/components/ui/button"; | 29 | import { Button } from "@/components/ui/button"; |
| @@ -392,11 +393,7 @@ function ExamDetailContent() { | |||
| 392 | <Show when={canViewExam()} fallback={<Alert variant="destructive">{t("common.accessDenied")}</Alert>}> | 393 | <Show when={canViewExam()} fallback={<Alert variant="destructive">{t("common.accessDenied")}</Alert>}> |
| 393 | <div class="mx-auto w-full max-w-[1100px] space-y-6"> | 394 | <div class="mx-auto w-full max-w-[1100px] space-y-6"> |
| 394 | <div class="sticky top-14 z-10 -mx-4 space-y-2 bg-surface-overlay px-4 pb-1 sm:-mx-6 sm:px-6 lg:-mx-8 lg:px-8"> | 395 | <div class="sticky top-14 z-10 -mx-4 space-y-2 bg-surface-overlay px-4 pb-1 sm:-mx-6 sm:px-6 lg:-mx-8 lg:px-8"> |
| 395 | - <nav class="detail-breadcrumb"> | 396 | + <Breadcrumbs items={[{ label: t("exams.title"), to: "/exams" }, { label: ex().title }]} /> |
| 396 | - <Link to="/exams">{t("exams.title")}</Link> | ||
| 397 | - <span aria-hidden>›</span> | ||
| 398 | - <span class="text-foreground">{ex().title}</span> | ||
| 399 | - </nav> | ||
| 400 | <PageHeader | 397 | <PageHeader |
| 401 | title={ex().title} | 398 | title={ex().title} |
| 402 | description={ex().description || "—"} | 399 | description={ex().description || "—"} |
src/pages/homework-detail-page.tsxmodified+6 -16
| @@ -1,4 +1,4 @@ | |||
| 1 | -import { Link, useLocation } from "@tanstack/solid-router"; | 1 | +import { useLocation } from "@tanstack/solid-router"; |
| 2 | import { Show, Suspense, createMemo } from "solid-js"; | 2 | import { Show, Suspense, createMemo } from "solid-js"; |
| 3 | import { createResource } from "@/lib/create-resource"; | 3 | import { createResource } from "@/lib/create-resource"; |
| 4 | import { getCourseById } from "@/api/courses"; | 4 | import { getCourseById } from "@/api/courses"; |
| @@ -9,11 +9,10 @@ import { getSubjectById } from "@/api/subjects"; | |||
| 9 | import { HomeworkSubmissionPanel } from "@/components/homework/homework-submission-panel"; | 9 | import { HomeworkSubmissionPanel } from "@/components/homework/homework-submission-panel"; |
| 10 | import { HomeworkSubmissionsPanel } from "@/components/homework/homework-submissions-panel"; | 10 | import { HomeworkSubmissionsPanel } from "@/components/homework/homework-submissions-panel"; |
| 11 | import { PageHeader } from "@/components/layout/page-header"; | 11 | import { PageHeader } from "@/components/layout/page-header"; |
| 12 | +import { Breadcrumbs } from "@/components/layout/breadcrumbs"; | ||
| 12 | import { RouteGuard } from "@/components/layout/route-guard"; | 13 | import { RouteGuard } from "@/components/layout/route-guard"; |
| 13 | import { Alert } from "@/components/ui/alert"; | 14 | import { Alert } from "@/components/ui/alert"; |
| 14 | import { Badge } from "@/components/ui/badge"; | 15 | import { Badge } from "@/components/ui/badge"; |
| 15 | -import { Button } from "@/components/ui/button"; | ||
| 16 | -import { IconChevronLeft } from "@/components/ui/icons"; | ||
| 17 | import { PageSpinner } from "@/components/ui/page-spinner"; | 16 | import { PageSpinner } from "@/components/ui/page-spinner"; |
| 18 | import { formatDateTime } from "@/lib/format"; | 17 | import { formatDateTime } from "@/lib/format"; |
| 19 | import { hasMinRole } from "@/lib/roles"; | 18 | import { hasMinRole } from "@/lib/roles"; |
| @@ -52,19 +51,10 @@ export default function HomeworkDetailPage() { | |||
| 52 | > | 51 | > |
| 53 | {(item) => ( | 52 | {(item) => ( |
| 54 | <div class="space-y-6"> | 53 | <div class="space-y-6"> |
| 55 | - <PageHeader | 54 | + <div class="space-y-2"> |
| 56 | - eyebrow={t("homework.item")} | 55 | + <Breadcrumbs items={[{ label: t("homework.title"), to: "/homework" }, { label: item().title }]} /> |
| 57 | - title={item().title} | 56 | + <PageHeader title={item().title} description={item().description || undefined} /> |
| 58 | - description={item().description || undefined} | 57 | + </div> |
| 59 | - actions={ | ||
| 60 | - <Link to="/homework"> | ||
| 61 | - <Button type="button" variant="ghost" size="sm" class="rounded-lg"> | ||
| 62 | - <IconChevronLeft class="h-4 w-4" /> | ||
| 63 | - {t("common.back")} | ||
| 64 | - </Button> | ||
| 65 | - </Link> | ||
| 66 | - } | ||
| 67 | - /> | ||
| 68 | <div class="grid gap-3 text-sm sm:grid-cols-2 lg:grid-cols-4"> | 58 | <div class="grid gap-3 text-sm sm:grid-cols-2 lg:grid-cols-4"> |
| 69 | <div class="rounded-xl border border-border-line bg-surface-base px-4 py-4"> | 59 | <div class="rounded-xl border border-border-line bg-surface-base px-4 py-4"> |
| 70 | <p class="text-xs font-medium uppercase tracking-[0.08em] text-text-subtle">{t("nav.courses")}</p> | 60 | <p class="text-xs font-medium uppercase tracking-[0.08em] text-text-subtle">{t("nav.courses")}</p> |
src/pages/instance-detail-page.tsxmodified+9 -8
| @@ -1,6 +1,6 @@ | |||
| 1 | import { Show, Suspense, createEffect, createMemo, createSignal } from "solid-js"; | 1 | import { Show, Suspense, createEffect, createMemo, createSignal } from "solid-js"; |
| 2 | import { createResource } from "@/lib/create-resource"; | 2 | import { createResource } from "@/lib/create-resource"; |
| 3 | -import { Link, useLocation, useNavigate, useParams } from "@tanstack/solid-router"; | 3 | +import { useLocation, useNavigate, useParams } from "@tanstack/solid-router"; |
| 4 | import type { ColumnDef } from "@tanstack/solid-table"; | 4 | import type { ColumnDef } from "@tanstack/solid-table"; |
| 5 | import { getClassById } from "@/api/classes"; | 5 | import { getClassById } from "@/api/classes"; |
| 6 | import { getCourseById } from "@/api/courses"; | 6 | import { getCourseById } from "@/api/courses"; |
| @@ -25,6 +25,7 @@ import { CourseHomeworkPanel } from "@/components/homework/course-homework-panel | |||
| 25 | import { CourseSessionsPanel } from "@/components/sessions/course-sessions-panel"; | 25 | import { CourseSessionsPanel } from "@/components/sessions/course-sessions-panel"; |
| 26 | import { RouteGuard } from "@/components/layout/route-guard"; | 26 | import { RouteGuard } from "@/components/layout/route-guard"; |
| 27 | import { PageHeader } from "@/components/layout/page-header"; | 27 | import { PageHeader } from "@/components/layout/page-header"; |
| 28 | +import { Breadcrumbs } from "@/components/layout/breadcrumbs"; | ||
| 28 | import { Alert } from "@/components/ui/alert"; | 29 | import { Alert } from "@/components/ui/alert"; |
| 29 | import { Badge } from "@/components/ui/badge"; | 30 | import { Badge } from "@/components/ui/badge"; |
| 30 | import { Button } from "@/components/ui/button"; | 31 | import { Button } from "@/components/ui/button"; |
| @@ -260,13 +261,13 @@ function InstanceDetailContent() { | |||
| 260 | {(inst) => ( | 261 | {(inst) => ( |
| 261 | <div class="mx-auto w-full max-w-[1440px] space-y-4"> | 262 | <div class="mx-auto w-full max-w-[1440px] space-y-4"> |
| 262 | <div class="space-y-1.5"> | 263 | <div class="space-y-1.5"> |
| 263 | - <nav class="detail-breadcrumb"> | 264 | + <Breadcrumbs |
| 264 | - <Link to="/courses" search={{} as never}>{t("courses.title")}</Link> | 265 | + items={[ |
| 265 | - <span aria-hidden>›</span> | 266 | + { label: t("courses.title"), to: "/courses" }, |
| 266 | - <Link to="/courses/$id" params={{ id: inst().course }}>{course.latest?.title ?? "…"}</Link> | 267 | + { label: course.latest?.title ?? "…", to: "/courses/$id", params: { id: inst().course } }, |
| 267 | - <span aria-hidden>›</span> | 268 | + { label: klass.latest?.name ?? t("instances.title") }, |
| 268 | - <span class="text-foreground">{klass.latest?.name ?? t("instances.title")}</span> | 269 | + ]} |
| 269 | - </nav> | 270 | + /> |
| 270 | <PageHeader | 271 | <PageHeader |
| 271 | title={`${course.latest?.title ?? ""} — ${klass.latest?.name ?? ""}`.replace(/^ — | — $/, "")} | 272 | title={`${course.latest?.title ?? ""} — ${klass.latest?.name ?? ""}`.replace(/^ — | — $/, "")} |
| 272 | description={t("instances.selectSectionHelp")} | 273 | description={t("instances.selectSectionHelp")} |
src/pages/meal-detail-page.tsxmodified+11 -8
| @@ -1,6 +1,6 @@ | |||
| 1 | import { For, Show, Suspense, createEffect, createMemo, createSignal } from "solid-js"; | 1 | import { For, Show, Suspense, createEffect, createMemo, createSignal } from "solid-js"; |
| 2 | import { createResource } from "@/lib/create-resource"; | 2 | import { createResource } from "@/lib/create-resource"; |
| 3 | -import { Link, useLocation, useNavigate, useParams } from "@tanstack/solid-router"; | 3 | +import { useLocation, useNavigate, useParams } from "@tanstack/solid-router"; |
| 4 | import { getLimits } from "@/api/limits"; | 4 | import { getLimits } from "@/api/limits"; |
| 5 | import { | 5 | import { |
| 6 | deleteMealBookingById, | 6 | deleteMealBookingById, |
| @@ -29,6 +29,7 @@ import { getSettings } from "@/api/settings"; | |||
| 29 | import { getTime } from "@/api/time"; | 29 | import { getTime } from "@/api/time"; |
| 30 | import { formatApiError, type MealAttendance, type MealBooking, type MealDish, type PersonRef } from "@/api/client"; | 30 | import { formatApiError, type MealAttendance, type MealBooking, type MealDish, type PersonRef } from "@/api/client"; |
| 31 | import { PageHeader } from "@/components/layout/page-header"; | 31 | import { PageHeader } from "@/components/layout/page-header"; |
| 32 | +import { Breadcrumbs } from "@/components/layout/breadcrumbs"; | ||
| 32 | import { RouteGuard } from "@/components/layout/route-guard"; | 33 | import { RouteGuard } from "@/components/layout/route-guard"; |
| 33 | import { Alert } from "@/components/ui/alert"; | 34 | import { Alert } from "@/components/ui/alert"; |
| 34 | import { Badge } from "@/components/ui/badge"; | 35 | import { Badge } from "@/components/ui/badge"; |
| @@ -36,7 +37,7 @@ import { Button } from "@/components/ui/button"; | |||
| 36 | import { ConfirmDialog } from "@/components/ui/confirm-dialog"; | 37 | import { ConfirmDialog } from "@/components/ui/confirm-dialog"; |
| 37 | import { EmptyState } from "@/components/ui/empty-state"; | 38 | import { EmptyState } from "@/components/ui/empty-state"; |
| 38 | import { ErrorAlert } from "@/components/ui/error-alert"; | 39 | import { ErrorAlert } from "@/components/ui/error-alert"; |
| 39 | -import { IconAlert, IconChevronLeft, IconEdit, IconPlus, IconTrash } from "@/components/ui/icons"; | 40 | +import { IconAlert, IconEdit, IconPlus, IconTrash } from "@/components/ui/icons"; |
| 40 | import { Input } from "@/components/ui/input"; | 41 | import { Input } from "@/components/ui/input"; |
| 41 | import { Label } from "@/components/ui/label"; | 42 | import { Label } from "@/components/ui/label"; |
| 42 | import { PageSpinner } from "@/components/ui/page-spinner"; | 43 | import { PageSpinner } from "@/components/ui/page-spinner"; |
| @@ -184,12 +185,14 @@ function MealDetailContent() { | |||
| 184 | <Show when={menu()?.id === id() ? menu() : undefined} fallback={<Show when={menu.error} fallback={<PageSpinner />}><ErrorAlert message={formatApiError(menu.error)} onRetry={() => void refetchMenu()} /></Show>}> | 185 | <Show when={menu()?.id === id() ? menu() : undefined} fallback={<Show when={menu.error} fallback={<PageSpinner />}><ErrorAlert message={formatApiError(menu.error)} onRetry={() => void refetchMenu()} /></Show>}> |
| 185 | {(current) => ( | 186 | {(current) => ( |
| 186 | <div class="space-y-5"> | 187 | <div class="space-y-5"> |
| 187 | - <PageHeader | 188 | + <div class="space-y-2"> |
| 188 | - eyebrow={`${current().date} · ${current().slot}`} | 189 | + <Breadcrumbs items={[{ label: t("meals.title"), to: "/meals" }, { label: `${current().date} · ${current().slot}` }]} /> |
| 189 | - title={t("meals.menu")} | 190 | + <PageHeader |
| 190 | - description={t("meals.detailHelp")} | 191 | + title={t("meals.menu")} |
| 191 | - actions={<div class="detail-action-group"><Link to="/meals"><Button variant="ghost" size="sm"><IconChevronLeft class="h-4 w-4" />{t("common.back")}</Button></Link><Show when={canManage()}><Button variant="outline" size="sm" onClick={() => { setCapacity(current().capacity == null ? "" : String(current().capacity)); setShowMenuEdit(true); }}><IconEdit class="h-4 w-4" />{t("common.edit")}</Button><Button variant="destructive" size="sm" onClick={() => setDeleteMenuOpen(true)}><IconTrash class="h-4 w-4" />{t("common.delete")}</Button></Show></div>} | 192 | + description={t("meals.detailHelp")} |
| 192 | - /> | 193 | + actions={canManage() ? <div class="detail-action-group"><Button variant="outline" size="sm" onClick={() => { setCapacity(current().capacity == null ? "" : String(current().capacity)); setShowMenuEdit(true); }}><IconEdit class="h-4 w-4" />{t("common.edit")}</Button><Button variant="destructive" size="sm" onClick={() => setDeleteMenuOpen(true)}><IconTrash class="h-4 w-4" />{t("common.delete")}</Button></div> : undefined} |
| 194 | + /> | ||
| 195 | + </div> | ||
| 193 | <Show when={limits.error}><ErrorAlert message={formatApiError(limits.error)} onRetry={() => void refetchLimits()} /></Show> | 196 | <Show when={limits.error}><ErrorAlert message={formatApiError(limits.error)} onRetry={() => void refetchLimits()} /></Show> |
| 194 | <Show when={error()}><Alert variant="destructive">{error()}</Alert></Show> | 197 | <Show when={error()}><Alert variant="destructive">{error()}</Alert></Show> |
| 195 | <Show when={success()}><Alert variant="success">{success()}</Alert></Show> | 198 | <Show when={success()}><Alert variant="success">{success()}</Alert></Show> |
src/pages/question-detail-page.tsxmodified+4 -1
| @@ -1,6 +1,7 @@ | |||
| 1 | import { For, Show, Suspense, createSignal, lazy } from "solid-js"; | 1 | import { For, Show, Suspense, createSignal, lazy } from "solid-js"; |
| 2 | import { createResource } from "@/lib/create-resource"; | 2 | import { createResource } from "@/lib/create-resource"; |
| 3 | import { useParams, useRouter } from "@tanstack/solid-router"; | 3 | import { useParams, useRouter } from "@tanstack/solid-router"; |
| 4 | +import { Breadcrumbs } from "@/components/layout/breadcrumbs"; | ||
| 4 | import { getQuestionById, deleteQuestionById, postQuestionApprove, getQuestionImageUrl, getQuestionImageBlob, postQuestionImage, deleteQuestionImage } from "@/api/shared"; | 5 | import { getQuestionById, deleteQuestionById, postQuestionApprove, getQuestionImageUrl, getQuestionImageBlob, postQuestionImage, deleteQuestionImage } from "@/api/shared"; |
| 5 | import { getSolutions, postSolution, patchSolutionById, deleteSolutionById, getSolutionImageUrl, getSolutionImageBlob, postSolutionImage, deleteSolutionImage } from "@/api/shared"; | 6 | import { getSolutions, postSolution, patchSolutionById, deleteSolutionById, getSolutionImageUrl, getSolutionImageBlob, postSolutionImage, deleteSolutionImage } from "@/api/shared"; |
| 6 | import { getSettings } from "@/api/settings"; | 7 | import { getSettings } from "@/api/settings"; |
| @@ -119,7 +120,9 @@ function QuestionDetailContent() { | |||
| 119 | <> | 120 | <> |
| 120 | <div class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between"> | 121 | <div class="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between"> |
| 121 | <div> | 122 | <div> |
| 122 | - <Button variant="link" class="px-0 h-auto text-muted-foreground mb-2" onClick={() => router.history.back()}>← {t("common.back")}</Button> | 123 | + <div class="mb-2"> |
| 124 | + <Breadcrumbs items={[{ label: t("questions.title"), to: "/questions" }, { label: q().title }]} /> | ||
| 125 | + </div> | ||
| 123 | <h1 class="text-2xl font-semibold ">{q().title}</h1> | 126 | <h1 class="text-2xl font-semibold ">{q().title}</h1> |
| 124 | <div class="mt-2 flex items-center gap-2 text-sm text-muted-foreground"> | 127 | <div class="mt-2 flex items-center gap-2 text-sm text-muted-foreground"> |
| 125 | <span>{personLabel(q().asker)}</span> | 128 | <span>{personLabel(q().asker)}</span> |
src/pages/whiteboard-page.tsxmodified+3 -5
| @@ -17,13 +17,14 @@ import { WhiteboardRoom, type BoardLiveState } from "@/components/whiteboard/whi | |||
| 17 | import { BoardSettingsPanel } from "@/components/whiteboard/board-settings-panel"; | 17 | import { BoardSettingsPanel } from "@/components/whiteboard/board-settings-panel"; |
| 18 | import { RouteGuard } from "@/components/layout/route-guard"; | 18 | import { RouteGuard } from "@/components/layout/route-guard"; |
| 19 | import { PageHeader } from "@/components/layout/page-header"; | 19 | import { PageHeader } from "@/components/layout/page-header"; |
| 20 | +import { Breadcrumbs } from "@/components/layout/breadcrumbs"; | ||
| 20 | import { Alert } from "@/components/ui/alert"; | 21 | import { Alert } from "@/components/ui/alert"; |
| 21 | import { Badge } from "@/components/ui/badge"; | 22 | import { Badge } from "@/components/ui/badge"; |
| 22 | import { Button } from "@/components/ui/button"; | 23 | import { Button } from "@/components/ui/button"; |
| 23 | import { ConfirmDialog } from "@/components/ui/confirm-dialog"; | 24 | import { ConfirmDialog } from "@/components/ui/confirm-dialog"; |
| 24 | import { DrawingPlayback } from "@/components/ui/drawing-playback"; | 25 | import { DrawingPlayback } from "@/components/ui/drawing-playback"; |
| 25 | import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from "@/components/ui/dropdown-menu"; | 26 | import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from "@/components/ui/dropdown-menu"; |
| 26 | -import { IconChevronLeft, IconDotsVertical, IconEraser, IconLock, IconTrash, IconX } from "@/components/ui/icons"; | 27 | +import { IconDotsVertical, IconEraser, IconLock, IconTrash, IconX } from "@/components/ui/icons"; |
| 27 | import { PageSpinner } from "@/components/ui/page-spinner"; | 28 | import { PageSpinner } from "@/components/ui/page-spinner"; |
| 28 | import { SidePanel } from "@/components/ui/side-panel"; | 29 | import { SidePanel } from "@/components/ui/side-panel"; |
| 29 | import { reassembleStrokes } from "@/lib/board-stroke-codec"; | 30 | import { reassembleStrokes } from "@/lib/board-stroke-codec"; |
| @@ -218,15 +219,12 @@ function WhiteboardContent() { | |||
| 218 | > | 219 | > |
| 219 | {(b) => ( | 220 | {(b) => ( |
| 220 | <div class="space-y-4"> | 221 | <div class="space-y-4"> |
| 222 | + <Breadcrumbs items={[{ label: t("whiteboard.title"), to: "/whiteboards" }, { label: boardTitle() }]} /> | ||
| 221 | <PageHeader | 223 | <PageHeader |
| 222 | compact | 224 | compact |
| 223 | title={boardTitle()} | 225 | title={boardTitle()} |
| 224 | actions={ | 226 | actions={ |
| 225 | <div class="flex flex-wrap items-center gap-2"> | 227 | <div class="flex flex-wrap items-center gap-2"> |
| 226 | - <Button type="button" variant="ghost" size="sm" onClick={() => navigate({ to: "/whiteboards" })}> | ||
| 227 | - <IconChevronLeft class="h-4 w-4" /> | ||
| 228 | - {t("common.back")} | ||
| 229 | - </Button> | ||
| 230 | <Button type="button" variant="outline" size="sm" class="rounded-lg" onClick={() => setHistoryOpen(true)}> | 228 | <Button type="button" variant="outline" size="sm" class="rounded-lg" onClick={() => setHistoryOpen(true)}> |
| 231 | {t("whiteboard.history")} | 229 | {t("whiteboard.history")} |
| 232 | </Button> | 230 | </Button> |