diff --git a/src/components/layout/app-shell.tsx b/src/components/layout/app-shell.tsx index 3776e4a..b316663 100644 --- a/src/components/layout/app-shell.tsx +++ b/src/components/layout/app-shell.tsx @@ -13,7 +13,6 @@ import { ShellMessagesButton } from "@/components/layout/shell-messages-button"; import { MobileNavSheet } from "@/components/layout/mobile-nav-sheet"; import { SideNav } from "@/components/layout/side-nav"; import { SidebarAccount } from "@/components/layout/sidebar-account"; -import { Button } from "@/components/ui/button"; import { IconChevronLeft, IconPanelLeft, IconSearch, IconSparkles } from "@/components/ui/icons"; import { Toaster } from "@/components/ui/toast"; import { useAuth } from "@/stores/auth-context"; @@ -64,8 +63,8 @@ export function AppShell(props: ParentProps) { >
{t("app.name")} -
@@ -102,6 +90,27 @@ export function AppShell(props: ParentProps) {
+ + {/* Collapse toggle sits under the account chip, pinned to the sidebar + foot, so the logo header keeps the same 45px height as the topbar. */} +
+ +
diff --git a/src/components/layout/nav-items.test.ts b/src/components/layout/nav-items.test.ts index dbf44ac..81ad668 100644 --- a/src/components/layout/nav-items.test.ts +++ b/src/components/layout/nav-items.test.ts @@ -16,96 +16,77 @@ test("invalid role destinations stay hidden", () => { expect(visibleNavItems("parent").map((item) => item.to)).not.toContain("/management/staff-work"); }); -test("admin's sidebar keeps the Figma Operasyon / Yapay zekâ / Kurum tree plus every backed page", () => { +test("admin's sidebar splits into short labelled sections with the soon shelf last", () => { expect( visibleNavGroups("admin").map((group) => ({ id: group.id, items: group.items.map((item) => item.id), })), ).toEqual([ - { - id: "operations", - items: [ - "students-roster", - "teachers-roster", - "class-groups", - "courses", - "terms", - "schedule", - "events", - "student-attendance", - "student-marks", - "student-pomodoros", - "homework", - "exams", - "question-bank", - "questions", - "notes", - "whiteboards", - "appointments", - "mock-exams", - "optical-reading", - "payments-collection", - ], - }, - { id: "ai", items: ["hezarfen-zeka", "celebi", "sound-studio"] }, - { - id: "institution", - items: ["reports", "license-modules", "users", "data-protection", "school-meals", "staff-work", "work", "settings"], - }, + { id: "school", items: ["students-roster", "teachers-roster", "class-groups", "terms", "schedule"] }, + { id: "teaching", items: ["courses", "homework", "exams", "question-bank", "questions", "notes", "whiteboards"] }, + { id: "tracking", items: ["student-attendance", "student-marks", "student-pomodoros"] }, + { id: "services", items: ["events", "appointments", "school-meals"] }, + { id: "institution", items: ["payments-collection", "staff-work", "work", "users", "license-modules", "settings"] }, + { id: "ai", items: ["celebi"] }, + { id: "soon", items: ["mock-exams", "optical-reading", "reports", "data-protection", "hezarfen-zeka", "sound-studio"] }, ]); }); test("manager sees the same admin tree minus the admin-only entries", () => { - const institution = visibleNavGroups("manager").find((group) => group.id === "institution"); - expect(institution?.items.map((item) => item.id)).toEqual(["reports", "school-meals", "staff-work", "work", "settings"]); - expect(institution?.items.map((item) => item.id)).not.toContain("license-modules"); - expect(institution?.items.map((item) => item.id)).not.toContain("users"); - expect(institution?.items.map((item) => item.id)).not.toContain("data-protection"); + const groups = visibleNavGroups("manager"); + const institution = groups.find((group) => group.id === "institution"); + expect(institution?.items.map((item) => item.id)).toEqual(["payments-collection", "staff-work", "work", "settings"]); + const ids = groups.flatMap((group) => group.items.map((item) => item.id)); + expect(ids).not.toContain("license-modules"); + expect(ids).not.toContain("users"); + expect(ids).not.toContain("data-protection"); }); -test("teacher's sidebar keeps the Figma Sınıfım / Yapay zekâ / Diğer tree plus every backed page", () => { +test("teacher's sidebar splits into short labelled sections with the soon shelf last", () => { expect( visibleNavGroups("teacher").map((group) => ({ id: group.id, items: group.items.map((item) => item.id), })), ).toEqual([ - { - id: "my-classroom", - items: [ - "my-classes", - "my-schedule", - "courses", - "student-attendance", - "student-marks", - "student-pomodoros", - "homework", - "exams", - "question-bank", - "questions", - "notes", - "whiteboards", - ], - }, - { id: "ai", items: ["student-analysis", "pending-approvals", "question-generation", "sound-studio"] }, + { id: "my-classroom", items: ["my-classes", "my-schedule", "courses"] }, + { id: "tracking", items: ["student-attendance", "student-marks", "student-pomodoros"] }, + { id: "teaching", items: ["homework", "exams", "question-bank", "questions", "notes", "whiteboards"] }, { id: "other", items: ["parent-communication", "appointments", "events", "meals", "work", "settings-teacher"] }, + { id: "soon", items: ["student-analysis", "pending-approvals", "question-generation", "sound-studio"] }, ]); }); -test("student's sidebar keeps the Figma Çalışma / Yapay zekâ / Diğer tree plus every backed page", () => { +test("student's sidebar splits into short labelled sections with the soon shelf last", () => { expect( visibleNavGroups("student").map((group) => ({ id: group.id, items: group.items.map((item) => item.id), })), ).toEqual([ - { id: "study", items: ["study-plan", "topic-mastery", "exam-results", "my-homework", "courses", "notes", "questions", "whiteboards", "pomodoro"] }, - { id: "ai", items: ["celebi", "sound-studio"] }, + { id: "study", items: ["topic-mastery", "exam-results", "my-homework", "pomodoro"] }, + { id: "teaching", items: ["courses", "notes", "questions", "whiteboards"] }, + { id: "ai", items: ["celebi"] }, { id: "other", items: ["calendar", "events", "messages", "appointments", "meals", "settings-student"] }, + { id: "soon", items: ["study-plan", "sound-studio"] }, ]); }); +test("every soon entry sits in the folded soon shelf and nowhere else", () => { + for (const role of ["student", "parent", "teacher", "manager", "admin"] as const) { + for (const group of visibleNavGroups(role)) { + const soon = group.items.filter((item) => item.soon); + if (group.id === "soon") { + expect(group.defaultFolded).toBe(true); + expect(soon).toHaveLength(group.items.length); + } else { + expect(soon).toHaveLength(0); + } + } + } +}); + test("parent's sidebar keeps the Figma Öğrencim / Kurum tree plus every backed page", () => { expect( visibleNavGroups("parent").map((group) => ({ diff --git a/src/components/layout/nav-items.ts b/src/components/layout/nav-items.ts index 329b19c..9e79508 100644 --- a/src/components/layout/nav-items.ts +++ b/src/components/layout/nav-items.ts @@ -58,6 +58,8 @@ export type NavGroup = { labelKey: MessageKey; Icon: Component<{ class?: string }>; items: NavItem[]; + /** Starts folded in the sidebar until the viewer opens it (the "yakında" shelf). */ + defaultFolded?: boolean; }; export const HOME_ITEM: NavItem = { @@ -88,45 +90,61 @@ function settingsAction(id: string): NavItem { return { id, to: "", labelKey: "nav.settings", Icon: IconSettings, action: "profile" }; } -// Admin and manager share one Figma information architecture (Operasyon / -// Yapay zekâ / Kurum) — manager just qualifies for fewer of its items, via -// the same minRole gates the rest of this file already uses. +// Every role's tree is short, labelled sections that stay open (Fintables +// style) instead of a few accordions hiding 20 entries each. Entries without a +// backend yet all move to one trailing "Yakında" section, folded by default, so +// they stay visible without crowding the live pages. +function soonGroup(items: NavItem[]): NavGroup { + return { id: "soon", labelKey: "nav.soon", Icon: IconTarget, items, defaultFolded: true }; +} + +// Admin and manager share one tree — manager just qualifies for fewer of its +// items, via the same minRole gates the rest of this file already uses. const ADMIN_GROUPS: NavGroup[] = [ { - id: "operations", - labelKey: "nav.group.operations", + id: "school", + labelKey: "nav.group.school", Icon: IconSchool, items: [ { id: "students-roster", to: "/management/students", labelKey: "nav.studentsRoster", Icon: IconUsers, minRole: "manager" }, { id: "teachers-roster", to: "/management/teachers", labelKey: "nav.teachersRoster", Icon: IconChalkboardTeacher, minRole: "manager" }, { id: "class-groups", to: "/management/classes", labelKey: "nav.classGroups", Icon: IconSchool, minRole: "teacher" }, - { id: "courses", to: "/courses", labelKey: "nav.courses", Icon: IconBook, module: "courses" }, { id: "terms", to: "/management/terms", labelKey: "nav.terms", Icon: IconCalendar, minRole: "manager" }, { id: "schedule", to: "/calendar", labelKey: "nav.schedule", Icon: IconCalendarDays, minRole: "manager" }, - { id: "events", to: "/events", labelKey: "nav.events", Icon: IconCalendarDays, module: "events" }, - { id: "student-attendance", to: "/management/student-attendance", labelKey: "nav.attendance", Icon: IconClipboardCheck, minRole: "teacher", module: "attendance" }, - { id: "student-marks", to: "/management/student-marks", labelKey: "nav.studentMarks", Icon: IconChart, minRole: "teacher", module: "marks" }, - { id: "student-pomodoros", to: "/management/pomodoros", labelKey: "nav.studentPomodoro", Icon: IconClock, minRole: "teacher", module: "pomodoro" }, + ], + }, + { + id: "teaching", + labelKey: "nav.group.teaching", + Icon: IconBook, + items: [ + { id: "courses", to: "/courses", labelKey: "nav.courses", Icon: IconBook, module: "courses" }, { id: "homework", to: "/homework", labelKey: "nav.homework", Icon: IconHomework, module: "homework" }, { id: "exams", to: "/exams", labelKey: "nav.exams", Icon: IconExam, minRole: "teacher", module: "exams" }, { id: "question-bank", to: "/question-bank", labelKey: "nav.questionBank", Icon: IconArchive, minRole: "teacher", module: "bank_questions" }, { id: "questions", to: "/questions", labelKey: "nav.questions", Icon: IconHelpCircle, module: "questions" }, { id: "notes", to: "/notes", labelKey: "nav.notes", Icon: IconNote, module: "notes" }, { id: "whiteboards", to: "/whiteboards", labelKey: "nav.whiteboards", Icon: IconEdit, module: "boards" }, - { id: "appointments", to: "/appointments", labelKey: "nav.appointments", Icon: IconClock, module: "appointments" }, - { id: "mock-exams", to: "/coming-soon/deneme-sinavlari", labelKey: "nav.mockExams", Icon: IconTarget, soon: true, minRole: "manager" }, - { id: "optical-reading", to: "/coming-soon/optik-okuma", labelKey: "nav.opticalReading", Icon: IconScan, soon: true, minRole: "manager" }, - { id: "payments-collection", to: "/management/payments", labelKey: "nav.payments", Icon: IconReportAnalytics, minRole: "manager", module: "payments" }, ], }, { - id: "ai", - labelKey: "nav.group.ai", - Icon: IconSparkles, + id: "tracking", + labelKey: "nav.group.tracking", + Icon: IconClipboardCheck, items: [ - { id: "hezarfen-zeka", to: "/coming-soon/hezarfen-zeka", labelKey: "nav.hezarfenZeka", Icon: IconBotSquare, soon: true, minRole: "manager" }, - CELEBI_ITEM, - SOUND_STUDIO_ITEM, + { id: "student-attendance", to: "/management/student-attendance", labelKey: "nav.attendance", Icon: IconClipboardCheck, minRole: "teacher", module: "attendance" }, + { id: "student-marks", to: "/management/student-marks", labelKey: "nav.studentMarks", Icon: IconChart, minRole: "teacher", module: "marks" }, + { id: "student-pomodoros", to: "/management/pomodoros", labelKey: "nav.studentPomodoro", Icon: IconClock, minRole: "teacher", module: "pomodoro" }, + ], + }, + { + id: "services", + labelKey: "nav.group.services", + Icon: IconCalendarDays, + items: [ + { id: "events", to: "/events", labelKey: "nav.events", Icon: IconCalendarDays, module: "events" }, + { id: "appointments", to: "/appointments", labelKey: "nav.appointments", Icon: IconClock, module: "appointments" }, + { id: "school-meals", to: "/meals", labelKey: "nav.schoolMeals", Icon: IconUtensils, minRole: "manager", module: "meals" }, ], }, { @@ -134,16 +152,28 @@ const ADMIN_GROUPS: NavGroup[] = [ labelKey: "nav.group.institution", Icon: IconUserCog, items: [ - { id: "reports", to: "/coming-soon/raporlar", labelKey: "nav.reports", Icon: IconChartPie, soon: true, minRole: "manager" }, - { id: "license-modules", to: "/management/modules", labelKey: "nav.licenseModules", Icon: IconPackage, minRole: "admin" }, - { id: "users", to: "/admin/users", labelKey: "nav.users", Icon: IconUserCog, minRole: "admin" }, - { id: "data-protection", to: "/coming-soon/kvkk-denetim", labelKey: "nav.dataProtection", Icon: IconShieldCheck, soon: true, minRole: "admin" }, - { id: "school-meals", to: "/meals", labelKey: "nav.schoolMeals", Icon: IconUtensils, minRole: "manager", module: "meals" }, + { id: "payments-collection", to: "/management/payments", labelKey: "nav.payments", Icon: IconReportAnalytics, minRole: "manager", module: "payments" }, { id: "staff-work", to: "/management/staff-work", labelKey: "nav.staffWork", Icon: IconBriefcase, minRole: "manager", module: "work" }, { id: "work", to: "/work", labelKey: "nav.work", Icon: IconClock, minRole: "teacher", module: "work" }, + { id: "users", to: "/admin/users", labelKey: "nav.users", Icon: IconUserCog, minRole: "admin" }, + { id: "license-modules", to: "/management/modules", labelKey: "nav.licenseModules", Icon: IconPackage, minRole: "admin" }, { id: "settings", to: "/management/settings", labelKey: "nav.settings", Icon: IconSettings, minRole: "manager" }, ], }, + { + id: "ai", + labelKey: "nav.group.ai", + Icon: IconSparkles, + items: [CELEBI_ITEM], + }, + soonGroup([ + { id: "mock-exams", to: "/coming-soon/deneme-sinavlari", labelKey: "nav.mockExams", Icon: IconTarget, soon: true, minRole: "manager" }, + { id: "optical-reading", to: "/coming-soon/optik-okuma", labelKey: "nav.opticalReading", Icon: IconScan, soon: true, minRole: "manager" }, + { id: "reports", to: "/coming-soon/raporlar", labelKey: "nav.reports", Icon: IconChartPie, soon: true, minRole: "manager" }, + { id: "data-protection", to: "/coming-soon/kvkk-denetim", labelKey: "nav.dataProtection", Icon: IconShieldCheck, soon: true, minRole: "admin" }, + { id: "hezarfen-zeka", to: "/coming-soon/hezarfen-zeka", labelKey: "nav.hezarfenZeka", Icon: IconBotSquare, soon: true, minRole: "manager" }, + SOUND_STUDIO_ITEM, + ]), ]; const TEACHER_GROUPS: NavGroup[] = [ @@ -155,9 +185,23 @@ const TEACHER_GROUPS: NavGroup[] = [ { id: "my-classes", to: "/management/classes", labelKey: "nav.myClasses", Icon: IconSchool }, { id: "my-schedule", to: "/calendar", labelKey: "nav.mySchedule", Icon: IconCalendarDays }, { id: "courses", to: "/courses", labelKey: "nav.courses", Icon: IconBook, module: "courses" }, + ], + }, + { + id: "tracking", + labelKey: "nav.group.tracking", + Icon: IconClipboardCheck, + items: [ { id: "student-attendance", to: "/management/student-attendance", labelKey: "nav.attendance", Icon: IconClipboardCheck, module: "attendance" }, { id: "student-marks", to: "/management/student-marks", labelKey: "nav.studentMarks", Icon: IconChart, module: "marks" }, { id: "student-pomodoros", to: "/management/pomodoros", labelKey: "nav.studentPomodoro", Icon: IconClock, module: "pomodoro" }, + ], + }, + { + id: "teaching", + labelKey: "nav.group.teaching", + Icon: IconBook, + items: [ { id: "homework", to: "/homework", labelKey: "nav.homework", Icon: IconHomework, module: "homework" }, { id: "exams", to: "/exams", labelKey: "nav.exams", Icon: IconExam, module: "exams" }, { id: "question-bank", to: "/question-bank", labelKey: "nav.questionBank", Icon: IconArchive, module: "bank_questions" }, @@ -166,17 +210,6 @@ const TEACHER_GROUPS: NavGroup[] = [ { id: "whiteboards", to: "/whiteboards", labelKey: "nav.whiteboards", Icon: IconEdit, module: "boards" }, ], }, - { - id: "ai", - labelKey: "nav.group.ai", - Icon: IconSparkles, - items: [ - { id: "student-analysis", to: "/coming-soon/ogrenci-analizi", labelKey: "nav.studentAnalysis", Icon: IconChart, soon: true }, - { id: "pending-approvals", to: "/coming-soon/bekleyen-onaylar", labelKey: "nav.pendingApprovals", Icon: IconHelpCircle, soon: true }, - { id: "question-generation", to: "/coming-soon/soru-uretimi", labelKey: "nav.questionGeneration", Icon: IconEdit, soon: true }, - SOUND_STUDIO_ITEM, - ], - }, { id: "other", labelKey: "nav.group.other", @@ -190,6 +223,12 @@ const TEACHER_GROUPS: NavGroup[] = [ settingsAction("settings-teacher"), ], }, + soonGroup([ + { id: "student-analysis", to: "/coming-soon/ogrenci-analizi", labelKey: "nav.studentAnalysis", Icon: IconChart, soon: true }, + { id: "pending-approvals", to: "/coming-soon/bekleyen-onaylar", labelKey: "nav.pendingApprovals", Icon: IconHelpCircle, soon: true }, + { id: "question-generation", to: "/coming-soon/soru-uretimi", labelKey: "nav.questionGeneration", Icon: IconEdit, soon: true }, + SOUND_STUDIO_ITEM, + ]), ]; const STUDENT_GROUPS: NavGroup[] = [ @@ -198,22 +237,28 @@ const STUDENT_GROUPS: NavGroup[] = [ labelKey: "nav.group.study", Icon: IconSchool, items: [ - { id: "study-plan", to: "/coming-soon/calisma-programim", labelKey: "nav.studyPlan", Icon: IconClock, soon: true }, { id: "topic-mastery", to: "/marks", labelKey: "nav.topicMastery", Icon: IconChart, exactRole: "student", module: "marks" }, { id: "exam-results", to: "/exams", labelKey: "nav.examResults", Icon: IconExam, module: "exams" }, { id: "my-homework", to: "/homework", labelKey: "nav.myHomework", Icon: IconHomework, module: "homework" }, + { id: "pomodoro", to: "/pomodoro", labelKey: "nav.pomodoro", Icon: IconClock, exactRole: "student", module: "pomodoro" }, + ], + }, + { + id: "teaching", + labelKey: "nav.group.teaching", + Icon: IconBook, + items: [ { id: "courses", to: "/courses", labelKey: "nav.courses", Icon: IconBook, module: "courses" }, { id: "notes", to: "/notes", labelKey: "nav.notes", Icon: IconNote, module: "notes" }, { id: "questions", to: "/questions", labelKey: "nav.questions", Icon: IconHelpCircle, module: "questions" }, { id: "whiteboards", to: "/whiteboards", labelKey: "nav.whiteboards", Icon: IconEdit, module: "boards" }, - { id: "pomodoro", to: "/pomodoro", labelKey: "nav.pomodoro", Icon: IconClock, exactRole: "student", module: "pomodoro" }, ], }, { id: "ai", labelKey: "nav.group.ai", Icon: IconSparkles, - items: [CELEBI_ITEM, SOUND_STUDIO_ITEM], + items: [CELEBI_ITEM], }, { id: "other", @@ -228,6 +273,10 @@ const STUDENT_GROUPS: NavGroup[] = [ settingsAction("settings-student"), ], }, + soonGroup([ + { id: "study-plan", to: "/coming-soon/calisma-programim", labelKey: "nav.studyPlan", Icon: IconClock, soon: true }, + SOUND_STUDIO_ITEM, + ]), ]; const PARENT_GROUPS: NavGroup[] = [ diff --git a/src/components/layout/side-nav.tsx b/src/components/layout/side-nav.tsx index 437445b..7cb6127 100644 --- a/src/components/layout/side-nav.tsx +++ b/src/components/layout/side-nav.tsx @@ -1,6 +1,6 @@ -import { For, Show } from "solid-js"; +import { For, Show, createSignal } from "solid-js"; import { Link, useNavigate, useRouterState } from "@tanstack/solid-router"; -import { HOME_ITEM, routeNavItem, visibleNavGroups, type NavItem } from "@/components/layout/nav-items"; +import { HOME_ITEM, routeNavItem, visibleNavGroups, type NavGroup, type NavItem } from "@/components/layout/nav-items"; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from "@/components/ui/dropdown-menu"; import { IconChevronRight } from "@/components/ui/icons"; import { cn } from "@/lib/cn"; @@ -9,6 +9,17 @@ import { useModules } from "@/stores/modules-context"; import { useShellFeed } from "@/stores/shell-feed-context"; import { useT } from "@/stores/preferences-context"; +const FOLDED_KEY = "hezarfen.navFolded"; + +function readFolded(): Record { + try { + const parsed: unknown = JSON.parse(localStorage.getItem(FOLDED_KEY) ?? "{}"); + return parsed && typeof parsed === "object" ? (parsed as Record) : {}; + } catch { + return {}; + } +} + export function SideNav(props: { onNavigate?: () => void; collapsed?: boolean; @@ -28,6 +39,18 @@ export function SideNav(props: { const unread = () => feed.unreadMessages().total; const badgeFor = (item: NavItem) => (item.id === "messages" ? unread() : 0); + const [folded, setFolded] = createSignal>(readFolded()); + const isFolded = (group: NavGroup) => folded()[group.id] ?? group.defaultFolded ?? false; + const toggleGroup = (group: NavGroup) => { + const next = { ...folded(), [group.id]: !isFolded(group) }; + setFolded(next); + try { + localStorage.setItem(FOLDED_KEY, JSON.stringify(next)); + } catch { + // Private mode / quota: folding still works for this session. + } + }; + const runAction = (item: NavItem) => { props.onNavigate?.(); if (item.action === "celebi") props.onOpenCelebi?.(); @@ -64,22 +87,22 @@ export function SideNav(props: { {(group) => { const active = () => group.items.some((item) => current()?.id === item.id); + // The section holding the current page never folds away under the viewer. + const open = () => active() || !isFolded(group); const renderLinks = () => (
{(item: NavItem) => { const itemActive = () => current()?.id === item.id; const linkClass = cn( - // Active submenu item: bold foreground text + a bright segment over - // the group's left guide line (no filled pill). - "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", + "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", itemActive() - ? "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" - : "font-medium text-muted-foreground hover:bg-muted/70 hover:text-foreground", + ? "bg-primary/10 text-primary" + : "text-muted-foreground hover:bg-muted/70 hover:text-foreground", ); const content = ( <> - + {t(item.labelKey)} @@ -115,21 +138,23 @@ export function SideNav(props: { - + -
{renderLinks()}
- + + + {renderLinks()} + } > diff --git a/src/i18n/messages.ts b/src/i18n/messages.ts index 0a7f7bf..357e073 100644 --- a/src/i18n/messages.ts +++ b/src/i18n/messages.ts @@ -315,6 +315,8 @@ export type MessageKey = | "nav.group.study" | "nav.group.other" | "nav.group.myStudent" + | "nav.group.teaching" + | "nav.group.tracking" | "nav.studentsRoster" | "nav.teachersRoster" | "nav.schedule" @@ -1449,6 +1451,7 @@ export type MessageKey = | "settings.empty" | "settings.maxFileSize" | "settings.maxFileSizeHelp" + | "whiteboard.participantCount" | "settings.maxFileSizeInvalid" | "settings.mealSlotNameInvalid" | "settings.aiPolicy" @@ -2192,6 +2195,8 @@ const en: Dict = { "nav.group.study": "Study", "nav.group.other": "Other", "nav.group.myStudent": "My student", + "nav.group.teaching": "Teaching & content", + "nav.group.tracking": "Student tracking", "nav.studentsRoster": "Students", "nav.teachersRoster": "Teachers", "nav.schedule": "Class schedule", @@ -3397,7 +3402,8 @@ const en: Dict = { "settings.unsaved": "Unsaved changes", "settings.empty": "No rows yet.", "settings.maxFileSize": "Max note file size", - "settings.maxFileSizeHelp": "Per-file upload cap for note attachments, in MiB. Backend accepts 0.001-25 MiB.", + "settings.maxFileSizeHelp": "Per-file upload cap for note attachments, in MiB. Allowed range: 0.001–25 MiB.", + "whiteboard.participantCount": "Participants: {count}", "settings.maxFileSizeInvalid": "Enter a valid file size.", "settings.mealSlotNameInvalid": "A meal slot name can't contain / \\ ? # or %.", "settings.aiPolicy": "AI policy", @@ -4057,6 +4063,8 @@ const tr: Dict = { "nav.group.study": "Çalışma", "nav.group.other": "Diğer", "nav.group.myStudent": "Öğrencim", + "nav.group.teaching": "Eğitim ve içerik", + "nav.group.tracking": "Öğrenci takibi", "nav.studentsRoster": "Öğrenciler", "nav.teachersRoster": "Öğretmenler", "nav.schedule": "Ders programı", @@ -5262,7 +5270,8 @@ const tr: Dict = { "settings.unsaved": "Kaydedilmemiş değişiklikler", "settings.empty": "Henüz satır yok.", "settings.maxFileSize": "Not dosyası boyut sınırı", - "settings.maxFileSizeHelp": "Not ekleri için dosya başına yükleme sınırı, MiB cinsinden. Backend 0.001-25 MiB kabul eder.", + "settings.maxFileSizeHelp": "Not ekleri için dosya başına yükleme sınırı, MiB cinsinden. İzin verilen aralık: 0,001–25 MiB.", + "whiteboard.participantCount": "Katılımcı: {count}", "settings.maxFileSizeInvalid": "Geçerli bir dosya boyutu gir.", "settings.mealSlotNameInvalid": "Öğün adı / \\ ? # veya % içeremez.", "settings.aiPolicy": "Yapay zekâ politikası", diff --git a/src/lib/exam-labels.ts b/src/lib/exam-labels.ts index cf7a064..932e378 100644 --- a/src/lib/exam-labels.ts +++ b/src/lib/exam-labels.ts @@ -12,6 +12,10 @@ const EXAM_KIND_LABELS: Record = { oral: "exams.kind.oral", }; +export function isKnownExamKind(kind: string): kind is KnownExamKind { + return kind in EXAM_KIND_LABELS; +} + export function examKindLabel(kind: string, t: T): string { return kind in EXAM_KIND_LABELS ? t(EXAM_KIND_LABELS[kind as KnownExamKind]) : kind; } diff --git a/src/pages/courses-page.tsx b/src/pages/courses-page.tsx index 4af1dd7..59bda9c 100644 --- a/src/pages/courses-page.tsx +++ b/src/pages/courses-page.tsx @@ -201,7 +201,7 @@ function CoursesContent() { > 0} - fallback={} + fallback={} >
diff --git a/src/pages/guide-page.tsx b/src/pages/guide-page.tsx index f132663..1ccb151 100644 --- a/src/pages/guide-page.tsx +++ b/src/pages/guide-page.tsx @@ -85,7 +85,7 @@ function GuideContent() { return (
- +
diff --git a/src/pages/meals-page.tsx b/src/pages/meals-page.tsx index 221996d..bc999b9 100644 --- a/src/pages/meals-page.tsx +++ b/src/pages/meals-page.tsx @@ -88,7 +88,7 @@ function MealsContent() { return (
- } /> + } />
void refetchLimits()} /> diff --git a/src/pages/my-students-page.tsx b/src/pages/my-students-page.tsx index a3a5cbf..1c06b30 100644 --- a/src/pages/my-students-page.tsx +++ b/src/pages/my-students-page.tsx @@ -69,7 +69,7 @@ function MyStudentsContent() { return (
- +
}> diff --git a/src/pages/notes-page.tsx b/src/pages/notes-page.tsx index 20d18a9..5bbc540 100644 --- a/src/pages/notes-page.tsx +++ b/src/pages/notes-page.tsx @@ -76,7 +76,6 @@ function NotesContent() {
diff --git a/src/pages/payments-page.tsx b/src/pages/payments-page.tsx index ac287fd..df11852 100644 --- a/src/pages/payments-page.tsx +++ b/src/pages/payments-page.tsx @@ -577,7 +577,6 @@ function PaymentsContent() { return (
diff --git a/src/pages/questions-page.tsx b/src/pages/questions-page.tsx index ab63d89..42ecf24 100644 --- a/src/pages/questions-page.tsx +++ b/src/pages/questions-page.tsx @@ -78,7 +78,6 @@ function QuestionsContent() { return (
{(item, index) => (
- - setExamKinds((rows) => - rows.map((row, i) => (i === index ? { ...row, name: e.currentTarget.value } : row)), - ) + {/* Built-in kinds are keys other records point at: show their + localized name and keep the key fixed; only custom kinds are renamed. */} + + {examKindLabel(item().name, t)} + } - /> + > + + setExamKinds((rows) => + rows.map((row, i) => (i === index ? { ...row, name: e.currentTarget.value } : row)), + ) + } + /> + {(pkg) => (
-

{pkg.package}

+

{packageLabel(pkg.package, t)}

{(name) => ( - {name} + {moduleLabel(name, t)} )} diff --git a/src/pages/terms-page.tsx b/src/pages/terms-page.tsx index 2b689ae..0918124 100644 --- a/src/pages/terms-page.tsx +++ b/src/pages/terms-page.tsx @@ -203,7 +203,6 @@ function TermsContent() {
void

- {t("whiteboard.createdAt")}: {props.createdLabel} · {props.board.participants.length + 1} {t("whiteboard.participants").toLowerCase()} + {t("whiteboard.createdAt")}: {props.createdLabel} · {t("whiteboard.participantCount", { count: props.board.participants.length + 1 })}

);