🧭 regroup sidebar into labelled sections and fix raw UI copy
Browse files at this commit9bd842056a1f213c183f8521de35eca229eccb99Parent: dc0a285- feat
- 🧭 regroup sidebar into labelled sections and fix raw UI copy
18 changed files +241 -158
- src/components/layout/app-shell.tsx +23 -14
- src/components/layout/nav-items.test.ts +39 -58
- src/components/layout/nav-items.ts +88 -39
- src/components/layout/side-nav.tsx +46 -21
- src/i18n/messages.ts +11 -2
- src/lib/exam-labels.ts +4 -0
- src/pages/courses-page.tsx +1 -1
- src/pages/guide-page.tsx +1 -1
- src/pages/meals-page.tsx +1 -1
- src/pages/my-students-page.tsx +1 -1
- src/pages/notes-page.tsx +0 -1
- src/pages/payment-statement-page.tsx +0 -1
- src/pages/payments-page.tsx +0 -1
- src/pages/pomodoro-page.tsx +0 -1
- src/pages/questions-page.tsx +0 -1
- src/pages/settings-page.tsx +25 -13
- src/pages/terms-page.tsx +0 -1
- src/pages/whiteboards-page.tsx +1 -1
src/components/layout/app-shell.tsxmodified+23 -14
| @@ -13,7 +13,6 @@ import { ShellMessagesButton } from "@/components/layout/shell-messages-button"; | ||
| 13 | 13 | import { MobileNavSheet } from "@/components/layout/mobile-nav-sheet"; |
| 14 | 14 | import { SideNav } from "@/components/layout/side-nav"; |
| 15 | 15 | import { SidebarAccount } from "@/components/layout/sidebar-account"; |
| 16 | -import { Button } from "@/components/ui/button"; | |
| 17 | 16 | import { IconChevronLeft, IconPanelLeft, IconSearch, IconSparkles } from "@/components/ui/icons"; |
| 18 | 17 | import { Toaster } from "@/components/ui/toast"; |
| 19 | 18 | import { useAuth } from "@/stores/auth-context"; |
| @@ -64,8 +63,8 @@ export function AppShell(props: ParentProps) { | ||
| 64 | 63 | > |
| 65 | 64 | <div |
| 66 | 65 | class={cn( |
| 67 | - "flex shrink-0 items-center gap-2 border-b border-border/70", | |
| 68 | - collapsed() ? "h-auto flex-col justify-center gap-1.5 px-2 py-2" : "h-[45px] px-3", | |
| 66 | + "flex h-[45px] shrink-0 items-center border-b border-border/70", | |
| 67 | + collapsed() ? "justify-center px-2" : "px-3", | |
| 69 | 68 | )} |
| 70 | 69 | > |
| 71 | 70 | <Link |
| @@ -80,17 +79,6 @@ export function AppShell(props: ParentProps) { | ||
| 80 | 79 | <span class="truncate text-base font-semibold tracking-tight text-foreground dark:text-white 2xl:text-lg">{t("app.name")}</span> |
| 81 | 80 | </Show> |
| 82 | 81 | </Link> |
| 83 | - <Button | |
| 84 | - type="button" | |
| 85 | - variant="ghost" | |
| 86 | - size="sm" | |
| 87 | - class="h-8 w-8 shrink-0 justify-center rounded-md px-0 text-muted-foreground hover:bg-secondary hover:text-foreground dark:text-white/70 dark:hover:bg-white/8 dark:hover:text-white" | |
| 88 | - aria-label={collapsed() ? t("nav.expand") : t("nav.collapse")} | |
| 89 | - title={collapsed() ? t("nav.expand") : t("nav.collapse")} | |
| 90 | - onClick={() => prefs.toggleSidebar()} | |
| 91 | - > | |
| 92 | - <IconPanelLeft class={cn("h-4 w-4 shrink-0 transition-transform duration-200", collapsed() && "scale-x-[-1]")} /> | |
| 93 | - </Button> | |
| 94 | 82 | </div> |
| 95 | 83 | |
| 96 | 84 | <div class="min-h-0 flex-1 overflow-y-auto overflow-x-hidden px-1.5 py-2.5"> |
| @@ -102,6 +90,27 @@ export function AppShell(props: ParentProps) { | ||
| 102 | 90 | </div> |
| 103 | 91 | |
| 104 | 92 | <SidebarAccount collapsed={collapsed()} onLogout={logout} /> |
| 93 | + | |
| 94 | + {/* Collapse toggle sits under the account chip, pinned to the sidebar | |
| 95 | + foot, so the logo header keeps the same 45px height as the topbar. */} | |
| 96 | + <div class="shrink-0 px-2 pb-2"> | |
| 97 | + <button | |
| 98 | + type="button" | |
| 99 | + class={cn( | |
| 100 | + "flex h-8 w-full items-center rounded-md text-[12px] font-medium text-muted-foreground outline-hidden transition-colors hover:bg-muted/70 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring dark:text-white/60 dark:hover:bg-white/8 dark:hover:text-white", | |
| 101 | + collapsed() ? "justify-center px-0" : "gap-2.5 px-2.5", | |
| 102 | + )} | |
| 103 | + aria-label={collapsed() ? t("nav.expand") : t("nav.collapse")} | |
| 104 | + aria-expanded={!collapsed()} | |
| 105 | + title={collapsed() ? t("nav.expand") : t("nav.collapse")} | |
| 106 | + onClick={() => prefs.toggleSidebar()} | |
| 107 | + > | |
| 108 | + <IconPanelLeft class={cn("h-4 w-4 shrink-0 transition-transform duration-200", collapsed() && "scale-x-[-1]")} /> | |
| 109 | + <Show when={!collapsed()}> | |
| 110 | + <span class="truncate">{t("nav.collapse")}</span> | |
| 111 | + </Show> | |
| 112 | + </button> | |
| 113 | + </div> | |
| 105 | 114 | </aside> |
| 106 | 115 | </Show> |
| 107 | 116 |
src/components/layout/nav-items.test.tsmodified+39 -58
| @@ -16,96 +16,77 @@ test("invalid role destinations stay hidden", () => { | ||
| 16 | 16 | expect(visibleNavItems("parent").map((item) => item.to)).not.toContain("/management/staff-work"); |
| 17 | 17 | }); |
| 18 | 18 | |
| 19 | -test("admin's sidebar keeps the Figma Operasyon / Yapay zekâ / Kurum tree plus every backed page", () => { | |
| 19 | +test("admin's sidebar splits into short labelled sections with the soon shelf last", () => { | |
| 20 | 20 | expect( |
| 21 | 21 | visibleNavGroups("admin").map((group) => ({ |
| 22 | 22 | id: group.id, |
| 23 | 23 | items: group.items.map((item) => item.id), |
| 24 | 24 | })), |
| 25 | 25 | ).toEqual([ |
| 26 | - { | |
| 27 | - id: "operations", | |
| 28 | - items: [ | |
| 29 | - "students-roster", | |
| 30 | - "teachers-roster", | |
| 31 | - "class-groups", | |
| 32 | - "courses", | |
| 33 | - "terms", | |
| 34 | - "schedule", | |
| 35 | - "events", | |
| 36 | - "student-attendance", | |
| 37 | - "student-marks", | |
| 38 | - "student-pomodoros", | |
| 39 | - "homework", | |
| 40 | - "exams", | |
| 41 | - "question-bank", | |
| 42 | - "questions", | |
| 43 | - "notes", | |
| 44 | - "whiteboards", | |
| 45 | - "appointments", | |
| 46 | - "mock-exams", | |
| 47 | - "optical-reading", | |
| 48 | - "payments-collection", | |
| 49 | - ], | |
| 50 | - }, | |
| 51 | - { id: "ai", items: ["hezarfen-zeka", "celebi", "sound-studio"] }, | |
| 52 | - { | |
| 53 | - id: "institution", | |
| 54 | - items: ["reports", "license-modules", "users", "data-protection", "school-meals", "staff-work", "work", "settings"], | |
| 55 | - }, | |
| 26 | + { id: "school", items: ["students-roster", "teachers-roster", "class-groups", "terms", "schedule"] }, | |
| 27 | + { id: "teaching", items: ["courses", "homework", "exams", "question-bank", "questions", "notes", "whiteboards"] }, | |
| 28 | + { id: "tracking", items: ["student-attendance", "student-marks", "student-pomodoros"] }, | |
| 29 | + { id: "services", items: ["events", "appointments", "school-meals"] }, | |
| 30 | + { id: "institution", items: ["payments-collection", "staff-work", "work", "users", "license-modules", "settings"] }, | |
| 31 | + { id: "ai", items: ["celebi"] }, | |
| 32 | + { id: "soon", items: ["mock-exams", "optical-reading", "reports", "data-protection", "hezarfen-zeka", "sound-studio"] }, | |
| 56 | 33 | ]); |
| 57 | 34 | }); |
| 58 | 35 | |
| 59 | 36 | test("manager sees the same admin tree minus the admin-only entries", () => { |
| 60 | - const institution = visibleNavGroups("manager").find((group) => group.id === "institution"); | |
| 61 | - expect(institution?.items.map((item) => item.id)).toEqual(["reports", "school-meals", "staff-work", "work", "settings"]); | |
| 62 | - expect(institution?.items.map((item) => item.id)).not.toContain("license-modules"); | |
| 63 | - expect(institution?.items.map((item) => item.id)).not.toContain("users"); | |
| 64 | - expect(institution?.items.map((item) => item.id)).not.toContain("data-protection"); | |
| 37 | + const groups = visibleNavGroups("manager"); | |
| 38 | + const institution = groups.find((group) => group.id === "institution"); | |
| 39 | + expect(institution?.items.map((item) => item.id)).toEqual(["payments-collection", "staff-work", "work", "settings"]); | |
| 40 | + const ids = groups.flatMap((group) => group.items.map((item) => item.id)); | |
| 41 | + expect(ids).not.toContain("license-modules"); | |
| 42 | + expect(ids).not.toContain("users"); | |
| 43 | + expect(ids).not.toContain("data-protection"); | |
| 65 | 44 | }); |
| 66 | 45 | |
| 67 | -test("teacher's sidebar keeps the Figma Sınıfım / Yapay zekâ / Diğer tree plus every backed page", () => { | |
| 46 | +test("teacher's sidebar splits into short labelled sections with the soon shelf last", () => { | |
| 68 | 47 | expect( |
| 69 | 48 | visibleNavGroups("teacher").map((group) => ({ |
| 70 | 49 | id: group.id, |
| 71 | 50 | items: group.items.map((item) => item.id), |
| 72 | 51 | })), |
| 73 | 52 | ).toEqual([ |
| 74 | - { | |
| 75 | - id: "my-classroom", | |
| 76 | - items: [ | |
| 77 | - "my-classes", | |
| 78 | - "my-schedule", | |
| 79 | - "courses", | |
| 80 | - "student-attendance", | |
| 81 | - "student-marks", | |
| 82 | - "student-pomodoros", | |
| 83 | - "homework", | |
| 84 | - "exams", | |
| 85 | - "question-bank", | |
| 86 | - "questions", | |
| 87 | - "notes", | |
| 88 | - "whiteboards", | |
| 89 | - ], | |
| 90 | - }, | |
| 91 | - { id: "ai", items: ["student-analysis", "pending-approvals", "question-generation", "sound-studio"] }, | |
| 53 | + { id: "my-classroom", items: ["my-classes", "my-schedule", "courses"] }, | |
| 54 | + { id: "tracking", items: ["student-attendance", "student-marks", "student-pomodoros"] }, | |
| 55 | + { id: "teaching", items: ["homework", "exams", "question-bank", "questions", "notes", "whiteboards"] }, | |
| 92 | 56 | { id: "other", items: ["parent-communication", "appointments", "events", "meals", "work", "settings-teacher"] }, |
| 57 | + { id: "soon", items: ["student-analysis", "pending-approvals", "question-generation", "sound-studio"] }, | |
| 93 | 58 | ]); |
| 94 | 59 | }); |
| 95 | 60 | |
| 96 | -test("student's sidebar keeps the Figma Çalışma / Yapay zekâ / Diğer tree plus every backed page", () => { | |
| 61 | +test("student's sidebar splits into short labelled sections with the soon shelf last", () => { | |
| 97 | 62 | expect( |
| 98 | 63 | visibleNavGroups("student").map((group) => ({ |
| 99 | 64 | id: group.id, |
| 100 | 65 | items: group.items.map((item) => item.id), |
| 101 | 66 | })), |
| 102 | 67 | ).toEqual([ |
| 103 | - { id: "study", items: ["study-plan", "topic-mastery", "exam-results", "my-homework", "courses", "notes", "questions", "whiteboards", "pomodoro"] }, | |
| 104 | - { id: "ai", items: ["celebi", "sound-studio"] }, | |
| 68 | + { id: "study", items: ["topic-mastery", "exam-results", "my-homework", "pomodoro"] }, | |
| 69 | + { id: "teaching", items: ["courses", "notes", "questions", "whiteboards"] }, | |
| 70 | + { id: "ai", items: ["celebi"] }, | |
| 105 | 71 | { id: "other", items: ["calendar", "events", "messages", "appointments", "meals", "settings-student"] }, |
| 72 | + { id: "soon", items: ["study-plan", "sound-studio"] }, | |
| 106 | 73 | ]); |
| 107 | 74 | }); |
| 108 | 75 | |
| 76 | +test("every soon entry sits in the folded soon shelf and nowhere else", () => { | |
| 77 | + for (const role of ["student", "parent", "teacher", "manager", "admin"] as const) { | |
| 78 | + for (const group of visibleNavGroups(role)) { | |
| 79 | + const soon = group.items.filter((item) => item.soon); | |
| 80 | + if (group.id === "soon") { | |
| 81 | + expect(group.defaultFolded).toBe(true); | |
| 82 | + expect(soon).toHaveLength(group.items.length); | |
| 83 | + } else { | |
| 84 | + expect(soon).toHaveLength(0); | |
| 85 | + } | |
| 86 | + } | |
| 87 | + } | |
| 88 | +}); | |
| 89 | + | |
| 109 | 90 | test("parent's sidebar keeps the Figma Öğrencim / Kurum tree plus every backed page", () => { |
| 110 | 91 | expect( |
| 111 | 92 | visibleNavGroups("parent").map((group) => ({ |
src/components/layout/nav-items.tsmodified+88 -39
| @@ -58,6 +58,8 @@ export type NavGroup = { | ||
| 58 | 58 | labelKey: MessageKey; |
| 59 | 59 | Icon: Component<{ class?: string }>; |
| 60 | 60 | items: NavItem[]; |
| 61 | + /** Starts folded in the sidebar until the viewer opens it (the "yakında" shelf). */ | |
| 62 | + defaultFolded?: boolean; | |
| 61 | 63 | }; |
| 62 | 64 | |
| 63 | 65 | export const HOME_ITEM: NavItem = { |
| @@ -88,45 +90,61 @@ function settingsAction(id: string): NavItem { | ||
| 88 | 90 | return { id, to: "", labelKey: "nav.settings", Icon: IconSettings, action: "profile" }; |
| 89 | 91 | } |
| 90 | 92 | |
| 91 | -// Admin and manager share one Figma information architecture (Operasyon / | |
| 92 | -// Yapay zekâ / Kurum) — manager just qualifies for fewer of its items, via | |
| 93 | -// the same minRole gates the rest of this file already uses. | |
| 93 | +// Every role's tree is short, labelled sections that stay open (Fintables | |
| 94 | +// style) instead of a few accordions hiding 20 entries each. Entries without a | |
| 95 | +// backend yet all move to one trailing "Yakında" section, folded by default, so | |
| 96 | +// they stay visible without crowding the live pages. | |
| 97 | +function soonGroup(items: NavItem[]): NavGroup { | |
| 98 | + return { id: "soon", labelKey: "nav.soon", Icon: IconTarget, items, defaultFolded: true }; | |
| 99 | +} | |
| 100 | + | |
| 101 | +// Admin and manager share one tree — manager just qualifies for fewer of its | |
| 102 | +// items, via the same minRole gates the rest of this file already uses. | |
| 94 | 103 | const ADMIN_GROUPS: NavGroup[] = [ |
| 95 | 104 | { |
| 96 | - id: "operations", | |
| 97 | - labelKey: "nav.group.operations", | |
| 105 | + id: "school", | |
| 106 | + labelKey: "nav.group.school", | |
| 98 | 107 | Icon: IconSchool, |
| 99 | 108 | items: [ |
| 100 | 109 | { id: "students-roster", to: "/management/students", labelKey: "nav.studentsRoster", Icon: IconUsers, minRole: "manager" }, |
| 101 | 110 | { id: "teachers-roster", to: "/management/teachers", labelKey: "nav.teachersRoster", Icon: IconChalkboardTeacher, minRole: "manager" }, |
| 102 | 111 | { id: "class-groups", to: "/management/classes", labelKey: "nav.classGroups", Icon: IconSchool, minRole: "teacher" }, |
| 103 | - { id: "courses", to: "/courses", labelKey: "nav.courses", Icon: IconBook, module: "courses" }, | |
| 104 | 112 | { id: "terms", to: "/management/terms", labelKey: "nav.terms", Icon: IconCalendar, minRole: "manager" }, |
| 105 | 113 | { id: "schedule", to: "/calendar", labelKey: "nav.schedule", Icon: IconCalendarDays, minRole: "manager" }, |
| 106 | - { id: "events", to: "/events", labelKey: "nav.events", Icon: IconCalendarDays, module: "events" }, | |
| 107 | - { id: "student-attendance", to: "/management/student-attendance", labelKey: "nav.attendance", Icon: IconClipboardCheck, minRole: "teacher", module: "attendance" }, | |
| 108 | - { id: "student-marks", to: "/management/student-marks", labelKey: "nav.studentMarks", Icon: IconChart, minRole: "teacher", module: "marks" }, | |
| 109 | - { id: "student-pomodoros", to: "/management/pomodoros", labelKey: "nav.studentPomodoro", Icon: IconClock, minRole: "teacher", module: "pomodoro" }, | |
| 114 | + ], | |
| 115 | + }, | |
| 116 | + { | |
| 117 | + id: "teaching", | |
| 118 | + labelKey: "nav.group.teaching", | |
| 119 | + Icon: IconBook, | |
| 120 | + items: [ | |
| 121 | + { id: "courses", to: "/courses", labelKey: "nav.courses", Icon: IconBook, module: "courses" }, | |
| 110 | 122 | { id: "homework", to: "/homework", labelKey: "nav.homework", Icon: IconHomework, module: "homework" }, |
| 111 | 123 | { id: "exams", to: "/exams", labelKey: "nav.exams", Icon: IconExam, minRole: "teacher", module: "exams" }, |
| 112 | 124 | { id: "question-bank", to: "/question-bank", labelKey: "nav.questionBank", Icon: IconArchive, minRole: "teacher", module: "bank_questions" }, |
| 113 | 125 | { id: "questions", to: "/questions", labelKey: "nav.questions", Icon: IconHelpCircle, module: "questions" }, |
| 114 | 126 | { id: "notes", to: "/notes", labelKey: "nav.notes", Icon: IconNote, module: "notes" }, |
| 115 | 127 | { id: "whiteboards", to: "/whiteboards", labelKey: "nav.whiteboards", Icon: IconEdit, module: "boards" }, |
| 116 | - { id: "appointments", to: "/appointments", labelKey: "nav.appointments", Icon: IconClock, module: "appointments" }, | |
| 117 | - { id: "mock-exams", to: "/coming-soon/deneme-sinavlari", labelKey: "nav.mockExams", Icon: IconTarget, soon: true, minRole: "manager" }, | |
| 118 | - { id: "optical-reading", to: "/coming-soon/optik-okuma", labelKey: "nav.opticalReading", Icon: IconScan, soon: true, minRole: "manager" }, | |
| 119 | - { id: "payments-collection", to: "/management/payments", labelKey: "nav.payments", Icon: IconReportAnalytics, minRole: "manager", module: "payments" }, | |
| 120 | 128 | ], |
| 121 | 129 | }, |
| 122 | 130 | { |
| 123 | - id: "ai", | |
| 124 | - labelKey: "nav.group.ai", | |
| 125 | - Icon: IconSparkles, | |
| 131 | + id: "tracking", | |
| 132 | + labelKey: "nav.group.tracking", | |
| 133 | + Icon: IconClipboardCheck, | |
| 126 | 134 | items: [ |
| 127 | - { id: "hezarfen-zeka", to: "/coming-soon/hezarfen-zeka", labelKey: "nav.hezarfenZeka", Icon: IconBotSquare, soon: true, minRole: "manager" }, | |
| 128 | - CELEBI_ITEM, | |
| 129 | - SOUND_STUDIO_ITEM, | |
| 135 | + { id: "student-attendance", to: "/management/student-attendance", labelKey: "nav.attendance", Icon: IconClipboardCheck, minRole: "teacher", module: "attendance" }, | |
| 136 | + { id: "student-marks", to: "/management/student-marks", labelKey: "nav.studentMarks", Icon: IconChart, minRole: "teacher", module: "marks" }, | |
| 137 | + { id: "student-pomodoros", to: "/management/pomodoros", labelKey: "nav.studentPomodoro", Icon: IconClock, minRole: "teacher", module: "pomodoro" }, | |
| 138 | + ], | |
| 139 | + }, | |
| 140 | + { | |
| 141 | + id: "services", | |
| 142 | + labelKey: "nav.group.services", | |
| 143 | + Icon: IconCalendarDays, | |
| 144 | + items: [ | |
| 145 | + { id: "events", to: "/events", labelKey: "nav.events", Icon: IconCalendarDays, module: "events" }, | |
| 146 | + { id: "appointments", to: "/appointments", labelKey: "nav.appointments", Icon: IconClock, module: "appointments" }, | |
| 147 | + { id: "school-meals", to: "/meals", labelKey: "nav.schoolMeals", Icon: IconUtensils, minRole: "manager", module: "meals" }, | |
| 130 | 148 | ], |
| 131 | 149 | }, |
| 132 | 150 | { |
| @@ -134,16 +152,28 @@ const ADMIN_GROUPS: NavGroup[] = [ | ||
| 134 | 152 | labelKey: "nav.group.institution", |
| 135 | 153 | Icon: IconUserCog, |
| 136 | 154 | items: [ |
| 137 | - { id: "reports", to: "/coming-soon/raporlar", labelKey: "nav.reports", Icon: IconChartPie, soon: true, minRole: "manager" }, | |
| 138 | - { id: "license-modules", to: "/management/modules", labelKey: "nav.licenseModules", Icon: IconPackage, minRole: "admin" }, | |
| 139 | - { id: "users", to: "/admin/users", labelKey: "nav.users", Icon: IconUserCog, minRole: "admin" }, | |
| 140 | - { id: "data-protection", to: "/coming-soon/kvkk-denetim", labelKey: "nav.dataProtection", Icon: IconShieldCheck, soon: true, minRole: "admin" }, | |
| 141 | - { id: "school-meals", to: "/meals", labelKey: "nav.schoolMeals", Icon: IconUtensils, minRole: "manager", module: "meals" }, | |
| 155 | + { id: "payments-collection", to: "/management/payments", labelKey: "nav.payments", Icon: IconReportAnalytics, minRole: "manager", module: "payments" }, | |
| 142 | 156 | { id: "staff-work", to: "/management/staff-work", labelKey: "nav.staffWork", Icon: IconBriefcase, minRole: "manager", module: "work" }, |
| 143 | 157 | { id: "work", to: "/work", labelKey: "nav.work", Icon: IconClock, minRole: "teacher", module: "work" }, |
| 158 | + { id: "users", to: "/admin/users", labelKey: "nav.users", Icon: IconUserCog, minRole: "admin" }, | |
| 159 | + { id: "license-modules", to: "/management/modules", labelKey: "nav.licenseModules", Icon: IconPackage, minRole: "admin" }, | |
| 144 | 160 | { id: "settings", to: "/management/settings", labelKey: "nav.settings", Icon: IconSettings, minRole: "manager" }, |
| 145 | 161 | ], |
| 146 | 162 | }, |
| 163 | + { | |
| 164 | + id: "ai", | |
| 165 | + labelKey: "nav.group.ai", | |
| 166 | + Icon: IconSparkles, | |
| 167 | + items: [CELEBI_ITEM], | |
| 168 | + }, | |
| 169 | + soonGroup([ | |
| 170 | + { id: "mock-exams", to: "/coming-soon/deneme-sinavlari", labelKey: "nav.mockExams", Icon: IconTarget, soon: true, minRole: "manager" }, | |
| 171 | + { id: "optical-reading", to: "/coming-soon/optik-okuma", labelKey: "nav.opticalReading", Icon: IconScan, soon: true, minRole: "manager" }, | |
| 172 | + { id: "reports", to: "/coming-soon/raporlar", labelKey: "nav.reports", Icon: IconChartPie, soon: true, minRole: "manager" }, | |
| 173 | + { id: "data-protection", to: "/coming-soon/kvkk-denetim", labelKey: "nav.dataProtection", Icon: IconShieldCheck, soon: true, minRole: "admin" }, | |
| 174 | + { id: "hezarfen-zeka", to: "/coming-soon/hezarfen-zeka", labelKey: "nav.hezarfenZeka", Icon: IconBotSquare, soon: true, minRole: "manager" }, | |
| 175 | + SOUND_STUDIO_ITEM, | |
| 176 | + ]), | |
| 147 | 177 | ]; |
| 148 | 178 | |
| 149 | 179 | const TEACHER_GROUPS: NavGroup[] = [ |
| @@ -155,9 +185,23 @@ const TEACHER_GROUPS: NavGroup[] = [ | ||
| 155 | 185 | { id: "my-classes", to: "/management/classes", labelKey: "nav.myClasses", Icon: IconSchool }, |
| 156 | 186 | { id: "my-schedule", to: "/calendar", labelKey: "nav.mySchedule", Icon: IconCalendarDays }, |
| 157 | 187 | { id: "courses", to: "/courses", labelKey: "nav.courses", Icon: IconBook, module: "courses" }, |
| 188 | + ], | |
| 189 | + }, | |
| 190 | + { | |
| 191 | + id: "tracking", | |
| 192 | + labelKey: "nav.group.tracking", | |
| 193 | + Icon: IconClipboardCheck, | |
| 194 | + items: [ | |
| 158 | 195 | { id: "student-attendance", to: "/management/student-attendance", labelKey: "nav.attendance", Icon: IconClipboardCheck, module: "attendance" }, |
| 159 | 196 | { id: "student-marks", to: "/management/student-marks", labelKey: "nav.studentMarks", Icon: IconChart, module: "marks" }, |
| 160 | 197 | { id: "student-pomodoros", to: "/management/pomodoros", labelKey: "nav.studentPomodoro", Icon: IconClock, module: "pomodoro" }, |
| 198 | + ], | |
| 199 | + }, | |
| 200 | + { | |
| 201 | + id: "teaching", | |
| 202 | + labelKey: "nav.group.teaching", | |
| 203 | + Icon: IconBook, | |
| 204 | + items: [ | |
| 161 | 205 | { id: "homework", to: "/homework", labelKey: "nav.homework", Icon: IconHomework, module: "homework" }, |
| 162 | 206 | { id: "exams", to: "/exams", labelKey: "nav.exams", Icon: IconExam, module: "exams" }, |
| 163 | 207 | { id: "question-bank", to: "/question-bank", labelKey: "nav.questionBank", Icon: IconArchive, module: "bank_questions" }, |
| @@ -166,17 +210,6 @@ const TEACHER_GROUPS: NavGroup[] = [ | ||
| 166 | 210 | { id: "whiteboards", to: "/whiteboards", labelKey: "nav.whiteboards", Icon: IconEdit, module: "boards" }, |
| 167 | 211 | ], |
| 168 | 212 | }, |
| 169 | - { | |
| 170 | - id: "ai", | |
| 171 | - labelKey: "nav.group.ai", | |
| 172 | - Icon: IconSparkles, | |
| 173 | - items: [ | |
| 174 | - { id: "student-analysis", to: "/coming-soon/ogrenci-analizi", labelKey: "nav.studentAnalysis", Icon: IconChart, soon: true }, | |
| 175 | - { id: "pending-approvals", to: "/coming-soon/bekleyen-onaylar", labelKey: "nav.pendingApprovals", Icon: IconHelpCircle, soon: true }, | |
| 176 | - { id: "question-generation", to: "/coming-soon/soru-uretimi", labelKey: "nav.questionGeneration", Icon: IconEdit, soon: true }, | |
| 177 | - SOUND_STUDIO_ITEM, | |
| 178 | - ], | |
| 179 | - }, | |
| 180 | 213 | { |
| 181 | 214 | id: "other", |
| 182 | 215 | labelKey: "nav.group.other", |
| @@ -190,6 +223,12 @@ const TEACHER_GROUPS: NavGroup[] = [ | ||
| 190 | 223 | settingsAction("settings-teacher"), |
| 191 | 224 | ], |
| 192 | 225 | }, |
| 226 | + soonGroup([ | |
| 227 | + { id: "student-analysis", to: "/coming-soon/ogrenci-analizi", labelKey: "nav.studentAnalysis", Icon: IconChart, soon: true }, | |
| 228 | + { id: "pending-approvals", to: "/coming-soon/bekleyen-onaylar", labelKey: "nav.pendingApprovals", Icon: IconHelpCircle, soon: true }, | |
| 229 | + { id: "question-generation", to: "/coming-soon/soru-uretimi", labelKey: "nav.questionGeneration", Icon: IconEdit, soon: true }, | |
| 230 | + SOUND_STUDIO_ITEM, | |
| 231 | + ]), | |
| 193 | 232 | ]; |
| 194 | 233 | |
| 195 | 234 | const STUDENT_GROUPS: NavGroup[] = [ |
| @@ -198,22 +237,28 @@ const STUDENT_GROUPS: NavGroup[] = [ | ||
| 198 | 237 | labelKey: "nav.group.study", |
| 199 | 238 | Icon: IconSchool, |
| 200 | 239 | items: [ |
| 201 | - { id: "study-plan", to: "/coming-soon/calisma-programim", labelKey: "nav.studyPlan", Icon: IconClock, soon: true }, | |
| 202 | 240 | { id: "topic-mastery", to: "/marks", labelKey: "nav.topicMastery", Icon: IconChart, exactRole: "student", module: "marks" }, |
| 203 | 241 | { id: "exam-results", to: "/exams", labelKey: "nav.examResults", Icon: IconExam, module: "exams" }, |
| 204 | 242 | { id: "my-homework", to: "/homework", labelKey: "nav.myHomework", Icon: IconHomework, module: "homework" }, |
| 243 | + { id: "pomodoro", to: "/pomodoro", labelKey: "nav.pomodoro", Icon: IconClock, exactRole: "student", module: "pomodoro" }, | |
| 244 | + ], | |
| 245 | + }, | |
| 246 | + { | |
| 247 | + id: "teaching", | |
| 248 | + labelKey: "nav.group.teaching", | |
| 249 | + Icon: IconBook, | |
| 250 | + items: [ | |
| 205 | 251 | { id: "courses", to: "/courses", labelKey: "nav.courses", Icon: IconBook, module: "courses" }, |
| 206 | 252 | { id: "notes", to: "/notes", labelKey: "nav.notes", Icon: IconNote, module: "notes" }, |
| 207 | 253 | { id: "questions", to: "/questions", labelKey: "nav.questions", Icon: IconHelpCircle, module: "questions" }, |
| 208 | 254 | { id: "whiteboards", to: "/whiteboards", labelKey: "nav.whiteboards", Icon: IconEdit, module: "boards" }, |
| 209 | - { id: "pomodoro", to: "/pomodoro", labelKey: "nav.pomodoro", Icon: IconClock, exactRole: "student", module: "pomodoro" }, | |
| 210 | 255 | ], |
| 211 | 256 | }, |
| 212 | 257 | { |
| 213 | 258 | id: "ai", |
| 214 | 259 | labelKey: "nav.group.ai", |
| 215 | 260 | Icon: IconSparkles, |
| 216 | - items: [CELEBI_ITEM, SOUND_STUDIO_ITEM], | |
| 261 | + items: [CELEBI_ITEM], | |
| 217 | 262 | }, |
| 218 | 263 | { |
| 219 | 264 | id: "other", |
| @@ -228,6 +273,10 @@ const STUDENT_GROUPS: NavGroup[] = [ | ||
| 228 | 273 | settingsAction("settings-student"), |
| 229 | 274 | ], |
| 230 | 275 | }, |
| 276 | + soonGroup([ | |
| 277 | + { id: "study-plan", to: "/coming-soon/calisma-programim", labelKey: "nav.studyPlan", Icon: IconClock, soon: true }, | |
| 278 | + SOUND_STUDIO_ITEM, | |
| 279 | + ]), | |
| 231 | 280 | ]; |
| 232 | 281 | |
| 233 | 282 | const PARENT_GROUPS: NavGroup[] = [ |
src/components/layout/side-nav.tsxmodified+46 -21
| @@ -1,6 +1,6 @@ | ||
| 1 | -import { For, Show } from "solid-js"; | |
| 1 | +import { For, Show, createSignal } from "solid-js"; | |
| 2 | 2 | import { Link, useNavigate, useRouterState } from "@tanstack/solid-router"; |
| 3 | -import { HOME_ITEM, routeNavItem, visibleNavGroups, type NavItem } from "@/components/layout/nav-items"; | |
| 3 | +import { HOME_ITEM, routeNavItem, visibleNavGroups, type NavGroup, type NavItem } from "@/components/layout/nav-items"; | |
| 4 | 4 | import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from "@/components/ui/dropdown-menu"; |
| 5 | 5 | import { IconChevronRight } from "@/components/ui/icons"; |
| 6 | 6 | import { cn } from "@/lib/cn"; |
| @@ -9,6 +9,17 @@ import { useModules } from "@/stores/modules-context"; | ||
| 9 | 9 | import { useShellFeed } from "@/stores/shell-feed-context"; |
| 10 | 10 | import { useT } from "@/stores/preferences-context"; |
| 11 | 11 | |
| 12 | +const FOLDED_KEY = "hezarfen.navFolded"; | |
| 13 | + | |
| 14 | +function readFolded(): Record<string, boolean> { | |
| 15 | + try { | |
| 16 | + const parsed: unknown = JSON.parse(localStorage.getItem(FOLDED_KEY) ?? "{}"); | |
| 17 | + return parsed && typeof parsed === "object" ? (parsed as Record<string, boolean>) : {}; | |
| 18 | + } catch { | |
| 19 | + return {}; | |
| 20 | + } | |
| 21 | +} | |
| 22 | + | |
| 12 | 23 | export function SideNav(props: { |
| 13 | 24 | onNavigate?: () => void; |
| 14 | 25 | collapsed?: boolean; |
| @@ -28,6 +39,18 @@ export function SideNav(props: { | ||
| 28 | 39 | const unread = () => feed.unreadMessages().total; |
| 29 | 40 | const badgeFor = (item: NavItem) => (item.id === "messages" ? unread() : 0); |
| 30 | 41 | |
| 42 | + const [folded, setFolded] = createSignal<Record<string, boolean>>(readFolded()); | |
| 43 | + const isFolded = (group: NavGroup) => folded()[group.id] ?? group.defaultFolded ?? false; | |
| 44 | + const toggleGroup = (group: NavGroup) => { | |
| 45 | + const next = { ...folded(), [group.id]: !isFolded(group) }; | |
| 46 | + setFolded(next); | |
| 47 | + try { | |
| 48 | + localStorage.setItem(FOLDED_KEY, JSON.stringify(next)); | |
| 49 | + } catch { | |
| 50 | + // Private mode / quota: folding still works for this session. | |
| 51 | + } | |
| 52 | + }; | |
| 53 | + | |
| 31 | 54 | const runAction = (item: NavItem) => { |
| 32 | 55 | props.onNavigate?.(); |
| 33 | 56 | if (item.action === "celebi") props.onOpenCelebi?.(); |
| @@ -64,22 +87,22 @@ export function SideNav(props: { | ||
| 64 | 87 | <For each={groups()}> |
| 65 | 88 | {(group) => { |
| 66 | 89 | const active = () => group.items.some((item) => current()?.id === item.id); |
| 90 | + // The section holding the current page never folds away under the viewer. | |
| 91 | + const open = () => active() || !isFolded(group); | |
| 67 | 92 | const renderLinks = () => ( |
| 68 | 93 | <div class="grid gap-px"> |
| 69 | 94 | <For each={group.items}> |
| 70 | 95 | {(item: NavItem) => { |
| 71 | 96 | const itemActive = () => current()?.id === item.id; |
| 72 | 97 | const linkClass = cn( |
| 73 | - // Active submenu item: bold foreground text + a bright segment over | |
| 74 | - // the group's left guide line (no filled pill). | |
| 75 | - "relative flex h-[30px] items-center gap-2.5 rounded-md px-2.5 text-[13px] outline-hidden transition-colors focus-visible:ring-2 focus-visible:ring-ring", | |
| 98 | + "relative flex h-[30px] items-center gap-3 rounded-lg px-3 text-[13px] font-medium outline-hidden transition-colors focus-visible:ring-2 focus-visible:ring-ring", | |
| 76 | 99 | itemActive() |
| 77 | - ? "font-semibold text-foreground before:absolute before:-left-[9px] before:top-1 before:bottom-1 before:w-0.5 before:rounded-full before:bg-foreground" | |
| 78 | - : "font-medium text-muted-foreground hover:bg-muted/70 hover:text-foreground", | |
| 100 | + ? "bg-primary/10 text-primary" | |
| 101 | + : "text-muted-foreground hover:bg-muted/70 hover:text-foreground", | |
| 79 | 102 | ); |
| 80 | 103 | const content = ( |
| 81 | 104 | <> |
| 82 | - <item.Icon class="h-4 w-4 shrink-0 opacity-80" /> | |
| 105 | + <item.Icon class="h-4 w-4 shrink-0" /> | |
| 83 | 106 | <span class="truncate">{t(item.labelKey)}</span> |
| 84 | 107 | <Show when={item.soon}> |
| 85 | 108 | <span class="ml-auto shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-muted-foreground"> |
| @@ -115,21 +138,23 @@ export function SideNav(props: { | ||
| 115 | 138 | <Show |
| 116 | 139 | when={props.collapsed} |
| 117 | 140 | fallback={ |
| 118 | - <details class="group/nav" open={active()}> | |
| 119 | - <summary | |
| 120 | - class={cn( | |
| 121 | - "flex h-[34px] cursor-pointer list-none items-center gap-3 rounded-lg px-3 text-[13px] font-medium outline-hidden transition-colors focus-visible:ring-2 focus-visible:ring-ring [&::-webkit-details-marker]:hidden", | |
| 122 | - active() | |
| 123 | - ? "bg-muted/70 text-foreground" | |
| 124 | - : "text-muted-foreground hover:bg-muted/70 hover:text-foreground", | |
| 125 | - )} | |
| 141 | + <section class="mt-2 first:mt-0"> | |
| 142 | + <button | |
| 143 | + type="button" | |
| 144 | + onClick={() => toggleGroup(group)} | |
| 145 | + aria-expanded={open()} | |
| 146 | + class="group/section flex h-7 w-full items-center gap-1.5 rounded-md px-3 text-left text-[11px] font-semibold tracking-wide text-muted-foreground/80 outline-hidden transition-colors hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring" | |
| 126 | 147 | > |
| 127 | - <group.Icon class="h-4 w-4 shrink-0" /> | |
| 128 | 148 | <span class="truncate">{t(group.labelKey)}</span> |
| 129 | - <IconChevronRight class="ml-auto h-3.5 w-3.5 shrink-0 opacity-60 transition-transform duration-200 group-open/nav:rotate-90" /> | |
| 130 | - </summary> | |
| 131 | - <div class="mt-0.5 ml-[1.15rem] border-l border-border/70 pl-2">{renderLinks()}</div> | |
| 132 | - </details> | |
| 149 | + <IconChevronRight | |
| 150 | + class={cn( | |
| 151 | + "ml-auto h-3 w-3 shrink-0 transition-[transform,opacity] duration-200", | |
| 152 | + open() ? "rotate-90 opacity-0 group-hover/section:opacity-60 group-focus-visible/section:opacity-60" : "opacity-60", | |
| 153 | + )} | |
| 154 | + /> | |
| 155 | + </button> | |
| 156 | + <Show when={open()}>{renderLinks()}</Show> | |
| 157 | + </section> | |
| 133 | 158 | } |
| 134 | 159 | > |
| 135 | 160 | <DropdownMenu placement="right-start" gutter={8}> |
src/i18n/messages.tsmodified+11 -2
| @@ -315,6 +315,8 @@ export type MessageKey = | ||
| 315 | 315 | | "nav.group.study" |
| 316 | 316 | | "nav.group.other" |
| 317 | 317 | | "nav.group.myStudent" |
| 318 | + | "nav.group.teaching" | |
| 319 | + | "nav.group.tracking" | |
| 318 | 320 | | "nav.studentsRoster" |
| 319 | 321 | | "nav.teachersRoster" |
| 320 | 322 | | "nav.schedule" |
| @@ -1449,6 +1451,7 @@ export type MessageKey = | ||
| 1449 | 1451 | | "settings.empty" |
| 1450 | 1452 | | "settings.maxFileSize" |
| 1451 | 1453 | | "settings.maxFileSizeHelp" |
| 1454 | + | "whiteboard.participantCount" | |
| 1452 | 1455 | | "settings.maxFileSizeInvalid" |
| 1453 | 1456 | | "settings.mealSlotNameInvalid" |
| 1454 | 1457 | | "settings.aiPolicy" |
| @@ -2192,6 +2195,8 @@ const en: Dict = { | ||
| 2192 | 2195 | "nav.group.study": "Study", |
| 2193 | 2196 | "nav.group.other": "Other", |
| 2194 | 2197 | "nav.group.myStudent": "My student", |
| 2198 | + "nav.group.teaching": "Teaching & content", | |
| 2199 | + "nav.group.tracking": "Student tracking", | |
| 2195 | 2200 | "nav.studentsRoster": "Students", |
| 2196 | 2201 | "nav.teachersRoster": "Teachers", |
| 2197 | 2202 | "nav.schedule": "Class schedule", |
| @@ -3397,7 +3402,8 @@ const en: Dict = { | ||
| 3397 | 3402 | "settings.unsaved": "Unsaved changes", |
| 3398 | 3403 | "settings.empty": "No rows yet.", |
| 3399 | 3404 | "settings.maxFileSize": "Max note file size", |
| 3400 | - "settings.maxFileSizeHelp": "Per-file upload cap for note attachments, in MiB. Backend accepts 0.001-25 MiB.", | |
| 3405 | + "settings.maxFileSizeHelp": "Per-file upload cap for note attachments, in MiB. Allowed range: 0.001–25 MiB.", | |
| 3406 | + "whiteboard.participantCount": "Participants: {count}", | |
| 3401 | 3407 | "settings.maxFileSizeInvalid": "Enter a valid file size.", |
| 3402 | 3408 | "settings.mealSlotNameInvalid": "A meal slot name can't contain / \\ ? # or %.", |
| 3403 | 3409 | "settings.aiPolicy": "AI policy", |
| @@ -4057,6 +4063,8 @@ const tr: Dict = { | ||
| 4057 | 4063 | "nav.group.study": "Çalışma", |
| 4058 | 4064 | "nav.group.other": "Diğer", |
| 4059 | 4065 | "nav.group.myStudent": "Öğrencim", |
| 4066 | + "nav.group.teaching": "Eğitim ve içerik", | |
| 4067 | + "nav.group.tracking": "Öğrenci takibi", | |
| 4060 | 4068 | "nav.studentsRoster": "Öğrenciler", |
| 4061 | 4069 | "nav.teachersRoster": "Öğretmenler", |
| 4062 | 4070 | "nav.schedule": "Ders programı", |
| @@ -5262,7 +5270,8 @@ const tr: Dict = { | ||
| 5262 | 5270 | "settings.unsaved": "Kaydedilmemiş değişiklikler", |
| 5263 | 5271 | "settings.empty": "Henüz satır yok.", |
| 5264 | 5272 | "settings.maxFileSize": "Not dosyası boyut sınırı", |
| 5265 | - "settings.maxFileSizeHelp": "Not ekleri için dosya başına yükleme sınırı, MiB cinsinden. Backend 0.001-25 MiB kabul eder.", | |
| 5273 | + "settings.maxFileSizeHelp": "Not ekleri için dosya başına yükleme sınırı, MiB cinsinden. İzin verilen aralık: 0,001–25 MiB.", | |
| 5274 | + "whiteboard.participantCount": "Katılımcı: {count}", | |
| 5266 | 5275 | "settings.maxFileSizeInvalid": "Geçerli bir dosya boyutu gir.", |
| 5267 | 5276 | "settings.mealSlotNameInvalid": "Öğün adı / \\ ? # veya % içeremez.", |
| 5268 | 5277 | "settings.aiPolicy": "Yapay zekâ politikası", |
src/lib/exam-labels.tsmodified+4 -0
| @@ -12,6 +12,10 @@ const EXAM_KIND_LABELS: Record<KnownExamKind, MessageKey> = { | ||
| 12 | 12 | oral: "exams.kind.oral", |
| 13 | 13 | }; |
| 14 | 14 | |
| 15 | +export function isKnownExamKind(kind: string): kind is KnownExamKind { | |
| 16 | + return kind in EXAM_KIND_LABELS; | |
| 17 | +} | |
| 18 | + | |
| 15 | 19 | export function examKindLabel(kind: string, t: T): string { |
| 16 | 20 | return kind in EXAM_KIND_LABELS ? t(EXAM_KIND_LABELS[kind as KnownExamKind]) : kind; |
| 17 | 21 | } |
src/pages/courses-page.tsxmodified+1 -1
| @@ -201,7 +201,7 @@ function CoursesContent() { | ||
| 201 | 201 | > |
| 202 | 202 | <Show |
| 203 | 203 | when={filteredCourses().length > 0} |
| 204 | - fallback={<EmptyState kind="courses" title={t("courses.empty", { item: kindLabel() })} />} | |
| 204 | + fallback={<EmptyState kind="courses" title={t("courses.empty", { item: kindInSentence() })} />} | |
| 205 | 205 | > |
| 206 | 206 | <div class={list.loading ? "grid grid-cols-1 gap-3 opacity-60 transition-opacity sm:grid-cols-2 xl:grid-cols-3" : "grid grid-cols-1 gap-3 transition-opacity sm:grid-cols-2 xl:grid-cols-3"}> |
| 207 | 207 | <For each={visibleCourses()}> |
src/pages/guide-page.tsxmodified+1 -1
| @@ -85,7 +85,7 @@ function GuideContent() { | ||
| 85 | 85 | |
| 86 | 86 | return ( |
| 87 | 87 | <div class="space-y-6"> |
| 88 | - <PageHeader eyebrow={t("nav.guide")} title={t("guide.title")} description={t("guide.subtitle")} /> | |
| 88 | + <PageHeader title={t("guide.title")} description={t("guide.subtitle")} /> | |
| 89 | 89 | |
| 90 | 90 | <section class="data-shell space-y-4 border-sky-500/15 bg-sky-500/2.5 p-6"> |
| 91 | 91 | <div> |
src/pages/meals-page.tsxmodified+1 -1
| @@ -88,7 +88,7 @@ function MealsContent() { | ||
| 88 | 88 | |
| 89 | 89 | return ( |
| 90 | 90 | <div class="space-y-5"> |
| 91 | - <PageHeader eyebrow={t("nav.group.community")} title={t("meals.title")} description={t("meals.subtitle")} actions={<Show when={canManage()}><Button size="sm" class="min-w-[7.5rem] rounded-lg" onClick={() => { setNewSlot(settings()?.meal_slots[0]?.name ?? ""); setShowCreate(true); }}><IconPlus class="h-4 w-4" />{t("meals.publish")}</Button></Show>} /> | |
| 91 | + <PageHeader title={t("meals.title")} description={t("meals.subtitle")} actions={<Show when={canManage()}><Button size="sm" class="min-w-[7.5rem] rounded-lg" onClick={() => { setNewSlot(settings()?.meal_slots[0]?.name ?? ""); setShowCreate(true); }}><IconPlus class="h-4 w-4" />{t("meals.publish")}</Button></Show>} /> | |
| 92 | 92 | <SidePanel open={showCreate()} onOpenChange={setShowCreate} title={t("meals.publish")} description={t("meals.publishHelp")}> |
| 93 | 93 | <form class="space-y-4" onSubmit={publish}> |
| 94 | 94 | <Show when={limits.error}><ErrorAlert message={formatApiError(limits.error)} onRetry={() => void refetchLimits()} /></Show> |
src/pages/my-students-page.tsxmodified+1 -1
| @@ -69,7 +69,7 @@ function MyStudentsContent() { | ||
| 69 | 69 | return ( |
| 70 | 70 | <div class="space-y-6"> |
| 71 | 71 | <div class="space-y-2"> |
| 72 | - <PageHeader eyebrow={t("nav.group.students")} title={t("nav.children")} description={t("parents.subtitle")} /> | |
| 72 | + <PageHeader title={t("nav.children")} description={t("parents.subtitle")} /> | |
| 73 | 73 | </div> |
| 74 | 74 | |
| 75 | 75 | <Suspense fallback={<PageSpinner />}> |
src/pages/notes-page.tsxmodified+0 -1
| @@ -76,7 +76,6 @@ function NotesContent() { | ||
| 76 | 76 | <div class="space-y-6"> |
| 77 | 77 | <div class="space-y-2"> |
| 78 | 78 | <PageHeader |
| 79 | - eyebrow={t("nav.notes")} | |
| 80 | 79 | title={t("notes.title")} |
| 81 | 80 | description={t("notes.subtitle")} |
| 82 | 81 | actions={ |
src/pages/payment-statement-page.tsxmodified+0 -1
| @@ -119,7 +119,6 @@ function StatementContent() { | ||
| 119 | 119 | return ( |
| 120 | 120 | <div class="space-y-6"> |
| 121 | 121 | <PageHeader |
| 122 | - eyebrow={t("nav.paymentStatement")} | |
| 123 | 122 | title={t("payments.statementTitle")} |
| 124 | 123 | description={t("payments.statementSubtitle")} |
| 125 | 124 | /> |
src/pages/payments-page.tsxmodified+0 -1
| @@ -577,7 +577,6 @@ function PaymentsContent() { | ||
| 577 | 577 | return ( |
| 578 | 578 | <div class="space-y-6"> |
| 579 | 579 | <PageHeader |
| 580 | - eyebrow={t("nav.school")} | |
| 581 | 580 | title={t("payments.title")} |
| 582 | 581 | description={t("payments.subtitle")} |
| 583 | 582 | actions={ |
src/pages/pomodoro-page.tsxmodified+0 -1
| @@ -179,7 +179,6 @@ function PomodoroContent() { | ||
| 179 | 179 | return ( |
| 180 | 180 | <div class="space-y-6"> |
| 181 | 181 | <PageHeader |
| 182 | - eyebrow={t("nav.pomodoro")} | |
| 183 | 182 | title={t("pomodoro.title")} |
| 184 | 183 | description={t("pomodoro.subtitle")} |
| 185 | 184 | /> |
src/pages/questions-page.tsxmodified+0 -1
| @@ -78,7 +78,6 @@ function QuestionsContent() { | ||
| 78 | 78 | return ( |
| 79 | 79 | <div class="space-y-6"> |
| 80 | 80 | <PageHeader |
| 81 | - eyebrow={t("nav.group.community")} | |
| 82 | 81 | title={t("pool.title")} |
| 83 | 82 | description={t("pool.subtitle")} |
| 84 | 83 | actions={ |
src/pages/settings-page.tsxmodified+25 -13
| @@ -16,6 +16,8 @@ import { Input } from "@/components/ui/input"; | ||
| 16 | 16 | import { Label } from "@/components/ui/label"; |
| 17 | 17 | import { PageSpinner } from "@/components/ui/page-spinner"; |
| 18 | 18 | import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; |
| 19 | +import { examKindLabel, isKnownExamKind } from "@/lib/exam-labels"; | |
| 20 | +import { moduleLabel, packageLabel } from "@/lib/module-labels"; | |
| 19 | 21 | import { getAttendanceStatusMeta } from "@/lib/attendance-status"; |
| 20 | 22 | import { cn } from "@/lib/cn"; |
| 21 | 23 | import { dirtySettingsPatch, minuteToUtcTime, utcTimeToMinute } from "@/lib/meals"; |
| @@ -158,7 +160,6 @@ function SettingsContent() { | ||
| 158 | 160 | return ( |
| 159 | 161 | <div class="space-y-6"> |
| 160 | 162 | <PageHeader |
| 161 | - eyebrow={t("nav.admin")} | |
| 162 | 163 | title={t("settings.title")} |
| 163 | 164 | description={t("settings.subtitle")} |
| 164 | 165 | actions={ |
| @@ -230,17 +231,28 @@ function SettingsContent() { | ||
| 230 | 231 | <Index each={examKinds()}> |
| 231 | 232 | {(item, index) => ( |
| 232 | 233 | <div class="grid grid-cols-[minmax(0,1fr)_4.5rem_2.25rem] items-center gap-2 rounded-lg border border-border/60 bg-card px-2 py-1.5 shadow-2xs"> |
| 233 | - <Input | |
| 234 | - aria-label={t("settings.name")} | |
| 235 | - class="h-9 rounded-md border-0 bg-transparent shadow-none focus-visible:ring-1" | |
| 236 | - value={item().name} | |
| 237 | - placeholder={t("settings.name")} | |
| 238 | - onInput={(e) => | |
| 239 | - setExamKinds((rows) => | |
| 240 | - rows.map((row, i) => (i === index ? { ...row, name: e.currentTarget.value } : row)), | |
| 241 | - ) | |
| 234 | + {/* Built-in kinds are keys other records point at: show their | |
| 235 | + localized name and keep the key fixed; only custom kinds are renamed. */} | |
| 236 | + <Show | |
| 237 | + when={!isKnownExamKind(item().name)} | |
| 238 | + fallback={ | |
| 239 | + <span class="flex h-9 min-w-0 items-center px-3 text-sm" title={item().name}> | |
| 240 | + <span class="truncate">{examKindLabel(item().name, t)}</span> | |
| 241 | + </span> | |
| 242 | 242 | } |
| 243 | - /> | |
| 243 | + > | |
| 244 | + <Input | |
| 245 | + aria-label={t("settings.name")} | |
| 246 | + class="h-9 rounded-md border-0 bg-transparent shadow-none focus-visible:ring-1" | |
| 247 | + value={item().name} | |
| 248 | + placeholder={t("settings.name")} | |
| 249 | + onInput={(e) => | |
| 250 | + setExamKinds((rows) => | |
| 251 | + rows.map((row, i) => (i === index ? { ...row, name: e.currentTarget.value } : row)), | |
| 252 | + ) | |
| 253 | + } | |
| 254 | + /> | |
| 255 | + </Show> | |
| 244 | 256 | <Input |
| 245 | 257 | aria-label={t("settings.weight")} |
| 246 | 258 | class="h-9 rounded-md border-0 bg-muted/40 text-center font-mono shadow-none focus-visible:ring-1" |
| @@ -608,12 +620,12 @@ function SettingsContent() { | ||
| 608 | 620 | <For each={info().catalog.packages}> |
| 609 | 621 | {(pkg) => ( |
| 610 | 622 | <div class="space-y-1.5"> |
| 611 | - <h3 class="text-sm font-medium capitalize">{pkg.package}</h3> | |
| 623 | + <h3 class="text-sm font-medium">{packageLabel(pkg.package, t)}</h3> | |
| 612 | 624 | <div class="flex flex-wrap gap-1.5"> |
| 613 | 625 | <For each={pkg.modules}> |
| 614 | 626 | {(name) => ( |
| 615 | 627 | <Badge variant={info().mine.enabled.includes(name) ? "secondary" : "outline"} class="rounded-full"> |
| 616 | - {name} | |
| 628 | + {moduleLabel(name, t)} | |
| 617 | 629 | </Badge> |
| 618 | 630 | )} |
| 619 | 631 | </For> |
src/pages/terms-page.tsxmodified+0 -1
| @@ -203,7 +203,6 @@ function TermsContent() { | ||
| 203 | 203 | <div class="space-y-6"> |
| 204 | 204 | <div class="space-y-2"> |
| 205 | 205 | <PageHeader |
| 206 | - eyebrow={t("nav.admin")} | |
| 207 | 206 | title={t("terms.title")} |
| 208 | 207 | description={t("terms.subtitle")} |
| 209 | 208 | actions={ |
src/pages/whiteboards-page.tsxmodified+1 -1
| @@ -147,7 +147,7 @@ function BoardCard(props: { board: Board; isCreator: boolean; onOpen: () => void | ||
| 147 | 147 | </div> |
| 148 | 148 | </div> |
| 149 | 149 | <p class="text-xs text-text-subtle"> |
| 150 | - {t("whiteboard.createdAt")}: {props.createdLabel} · {props.board.participants.length + 1} {t("whiteboard.participants").toLowerCase()} | |
| 150 | + {t("whiteboard.createdAt")}: {props.createdLabel} · {t("whiteboard.participantCount", { count: props.board.participants.length + 1 })} | |
| 151 | 151 | </p> |
| 152 | 152 | </button> |
| 153 | 153 | ); |