forge
Explore
Log in

Don't you dare go Hollow

🧭 regroup sidebar into labelled sections and fix raw UI copy

Browse files at this commit

9bd842056a1f213c183f8521de35eca229eccb99Burak BoduroğluParent: dc0a285
  • feat
    • 🧭 regroup sidebar into labelled sections and fix raw UI copy
Show full message
feat: 🧭 regroup sidebar into labelled sections and fix raw UI copy
- split the 20-item Operasyon accordion into short, always-open sections
  (Okul yönetimi, Eğitim ve içerik, Öğrenci takibi, Okul hizmetleri, Kurum,
  Yapay zekâ); fold state persists, active section never folds
- move every "yakında" entry into one trailing Yakında section, folded
- move the collapse toggle under the account chip; logo header stays 45px
- localize module packages/names and built-in exam kinds in Settings
- fix "Henüz Dersler yok", "1 katılımcılar" and "Backend" in user copy
- drop list-page eyebrows that repeated the title or named removed groups
src/components/layout/app-shell.tsxmodified+23 -14
@@ -13,7 +13,6 @@ import { ShellMessagesButton } from "@/components/layout/shell-messages-button";
1313 import { MobileNavSheet } from "@/components/layout/mobile-nav-sheet";
1414 import { SideNav } from "@/components/layout/side-nav";
1515 import { SidebarAccount } from "@/components/layout/sidebar-account";
16-import { Button } from "@/components/ui/button";
1716 import { IconChevronLeft, IconPanelLeft, IconSearch, IconSparkles } from "@/components/ui/icons";
1817 import { Toaster } from "@/components/ui/toast";
1918 import { useAuth } from "@/stores/auth-context";
@@ -64,8 +63,8 @@ export function AppShell(props: ParentProps) {
6463 >
6564 <div
6665 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",
6968 )}
7069 >
7170 <Link
@@ -80,17 +79,6 @@ export function AppShell(props: ParentProps) {
8079 <span class="truncate text-base font-semibold tracking-tight text-foreground dark:text-white 2xl:text-lg">{t("app.name")}</span>
8180 </Show>
8281 </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>
9482 </div>
9583
9684 <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) {
10290 </div>
10391
10492 <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>
105114 </aside>
106115 </Show>
107116
src/components/layout/nav-items.test.tsmodified+39 -58
@@ -16,96 +16,77 @@ test("invalid role destinations stay hidden", () => {
1616 expect(visibleNavItems("parent").map((item) => item.to)).not.toContain("/management/staff-work");
1717 });
1818
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", () => {
2020 expect(
2121 visibleNavGroups("admin").map((group) => ({
2222 id: group.id,
2323 items: group.items.map((item) => item.id),
2424 })),
2525 ).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"] },
5633 ]);
5734 });
5835
5936 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");
6544 });
6645
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", () => {
6847 expect(
6948 visibleNavGroups("teacher").map((group) => ({
7049 id: group.id,
7150 items: group.items.map((item) => item.id),
7251 })),
7352 ).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"] },
9256 { id: "other", items: ["parent-communication", "appointments", "events", "meals", "work", "settings-teacher"] },
57+ { id: "soon", items: ["student-analysis", "pending-approvals", "question-generation", "sound-studio"] },
9358 ]);
9459 });
9560
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", () => {
9762 expect(
9863 visibleNavGroups("student").map((group) => ({
9964 id: group.id,
10065 items: group.items.map((item) => item.id),
10166 })),
10267 ).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"] },
10571 { id: "other", items: ["calendar", "events", "messages", "appointments", "meals", "settings-student"] },
72+ { id: "soon", items: ["study-plan", "sound-studio"] },
10673 ]);
10774 });
10875
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+
10990 test("parent's sidebar keeps the Figma Öğrencim / Kurum tree plus every backed page", () => {
11091 expect(
11192 visibleNavGroups("parent").map((group) => ({
src/components/layout/nav-items.tsmodified+88 -39
@@ -58,6 +58,8 @@ export type NavGroup = {
5858 labelKey: MessageKey;
5959 Icon: Component<{ class?: string }>;
6060 items: NavItem[];
61+ /** Starts folded in the sidebar until the viewer opens it (the "yakında" shelf). */
62+ defaultFolded?: boolean;
6163 };
6264
6365 export const HOME_ITEM: NavItem = {
@@ -88,45 +90,61 @@ function settingsAction(id: string): NavItem {
8890 return { id, to: "", labelKey: "nav.settings", Icon: IconSettings, action: "profile" };
8991 }
9092
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.
94103 const ADMIN_GROUPS: NavGroup[] = [
95104 {
96- id: "operations",
97- labelKey: "nav.group.operations",
105+ id: "school",
106+ labelKey: "nav.group.school",
98107 Icon: IconSchool,
99108 items: [
100109 { id: "students-roster", to: "/management/students", labelKey: "nav.studentsRoster", Icon: IconUsers, minRole: "manager" },
101110 { id: "teachers-roster", to: "/management/teachers", labelKey: "nav.teachersRoster", Icon: IconChalkboardTeacher, minRole: "manager" },
102111 { 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" },
104112 { id: "terms", to: "/management/terms", labelKey: "nav.terms", Icon: IconCalendar, minRole: "manager" },
105113 { 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" },
110122 { id: "homework", to: "/homework", labelKey: "nav.homework", Icon: IconHomework, module: "homework" },
111123 { id: "exams", to: "/exams", labelKey: "nav.exams", Icon: IconExam, minRole: "teacher", module: "exams" },
112124 { id: "question-bank", to: "/question-bank", labelKey: "nav.questionBank", Icon: IconArchive, minRole: "teacher", module: "bank_questions" },
113125 { id: "questions", to: "/questions", labelKey: "nav.questions", Icon: IconHelpCircle, module: "questions" },
114126 { id: "notes", to: "/notes", labelKey: "nav.notes", Icon: IconNote, module: "notes" },
115127 { 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" },
120128 ],
121129 },
122130 {
123- id: "ai",
124- labelKey: "nav.group.ai",
125- Icon: IconSparkles,
131+ id: "tracking",
132+ labelKey: "nav.group.tracking",
133+ Icon: IconClipboardCheck,
126134 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" },
130148 ],
131149 },
132150 {
@@ -134,16 +152,28 @@ const ADMIN_GROUPS: NavGroup[] = [
134152 labelKey: "nav.group.institution",
135153 Icon: IconUserCog,
136154 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" },
142156 { id: "staff-work", to: "/management/staff-work", labelKey: "nav.staffWork", Icon: IconBriefcase, minRole: "manager", module: "work" },
143157 { 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" },
144160 { id: "settings", to: "/management/settings", labelKey: "nav.settings", Icon: IconSettings, minRole: "manager" },
145161 ],
146162 },
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+ ]),
147177 ];
148178
149179 const TEACHER_GROUPS: NavGroup[] = [
@@ -155,9 +185,23 @@ const TEACHER_GROUPS: NavGroup[] = [
155185 { id: "my-classes", to: "/management/classes", labelKey: "nav.myClasses", Icon: IconSchool },
156186 { id: "my-schedule", to: "/calendar", labelKey: "nav.mySchedule", Icon: IconCalendarDays },
157187 { 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: [
158195 { id: "student-attendance", to: "/management/student-attendance", labelKey: "nav.attendance", Icon: IconClipboardCheck, module: "attendance" },
159196 { id: "student-marks", to: "/management/student-marks", labelKey: "nav.studentMarks", Icon: IconChart, module: "marks" },
160197 { 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: [
161205 { id: "homework", to: "/homework", labelKey: "nav.homework", Icon: IconHomework, module: "homework" },
162206 { id: "exams", to: "/exams", labelKey: "nav.exams", Icon: IconExam, module: "exams" },
163207 { id: "question-bank", to: "/question-bank", labelKey: "nav.questionBank", Icon: IconArchive, module: "bank_questions" },
@@ -166,17 +210,6 @@ const TEACHER_GROUPS: NavGroup[] = [
166210 { id: "whiteboards", to: "/whiteboards", labelKey: "nav.whiteboards", Icon: IconEdit, module: "boards" },
167211 ],
168212 },
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- },
180213 {
181214 id: "other",
182215 labelKey: "nav.group.other",
@@ -190,6 +223,12 @@ const TEACHER_GROUPS: NavGroup[] = [
190223 settingsAction("settings-teacher"),
191224 ],
192225 },
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+ ]),
193232 ];
194233
195234 const STUDENT_GROUPS: NavGroup[] = [
@@ -198,22 +237,28 @@ const STUDENT_GROUPS: NavGroup[] = [
198237 labelKey: "nav.group.study",
199238 Icon: IconSchool,
200239 items: [
201- { id: "study-plan", to: "/coming-soon/calisma-programim", labelKey: "nav.studyPlan", Icon: IconClock, soon: true },
202240 { id: "topic-mastery", to: "/marks", labelKey: "nav.topicMastery", Icon: IconChart, exactRole: "student", module: "marks" },
203241 { id: "exam-results", to: "/exams", labelKey: "nav.examResults", Icon: IconExam, module: "exams" },
204242 { 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: [
205251 { id: "courses", to: "/courses", labelKey: "nav.courses", Icon: IconBook, module: "courses" },
206252 { id: "notes", to: "/notes", labelKey: "nav.notes", Icon: IconNote, module: "notes" },
207253 { id: "questions", to: "/questions", labelKey: "nav.questions", Icon: IconHelpCircle, module: "questions" },
208254 { 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" },
210255 ],
211256 },
212257 {
213258 id: "ai",
214259 labelKey: "nav.group.ai",
215260 Icon: IconSparkles,
216- items: [CELEBI_ITEM, SOUND_STUDIO_ITEM],
261+ items: [CELEBI_ITEM],
217262 },
218263 {
219264 id: "other",
@@ -228,6 +273,10 @@ const STUDENT_GROUPS: NavGroup[] = [
228273 settingsAction("settings-student"),
229274 ],
230275 },
276+ soonGroup([
277+ { id: "study-plan", to: "/coming-soon/calisma-programim", labelKey: "nav.studyPlan", Icon: IconClock, soon: true },
278+ SOUND_STUDIO_ITEM,
279+ ]),
231280 ];
232281
233282 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";
22 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";
44 import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from "@/components/ui/dropdown-menu";
55 import { IconChevronRight } from "@/components/ui/icons";
66 import { cn } from "@/lib/cn";
@@ -9,6 +9,17 @@ import { useModules } from "@/stores/modules-context";
99 import { useShellFeed } from "@/stores/shell-feed-context";
1010 import { useT } from "@/stores/preferences-context";
1111
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+
1223 export function SideNav(props: {
1324 onNavigate?: () => void;
1425 collapsed?: boolean;
@@ -28,6 +39,18 @@ export function SideNav(props: {
2839 const unread = () => feed.unreadMessages().total;
2940 const badgeFor = (item: NavItem) => (item.id === "messages" ? unread() : 0);
3041
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+
3154 const runAction = (item: NavItem) => {
3255 props.onNavigate?.();
3356 if (item.action === "celebi") props.onOpenCelebi?.();
@@ -64,22 +87,22 @@ export function SideNav(props: {
6487 <For each={groups()}>
6588 {(group) => {
6689 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);
6792 const renderLinks = () => (
6893 <div class="grid gap-px">
6994 <For each={group.items}>
7095 {(item: NavItem) => {
7196 const itemActive = () => current()?.id === item.id;
7297 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",
7699 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",
79102 );
80103 const content = (
81104 <>
82- <item.Icon class="h-4 w-4 shrink-0 opacity-80" />
105+ <item.Icon class="h-4 w-4 shrink-0" />
83106 <span class="truncate">{t(item.labelKey)}</span>
84107 <Show when={item.soon}>
85108 <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: {
115138 <Show
116139 when={props.collapsed}
117140 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"
126147 >
127- <group.Icon class="h-4 w-4 shrink-0" />
128148 <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>
133158 }
134159 >
135160 <DropdownMenu placement="right-start" gutter={8}>
src/i18n/messages.tsmodified+11 -2
@@ -315,6 +315,8 @@ export type MessageKey =
315315 | "nav.group.study"
316316 | "nav.group.other"
317317 | "nav.group.myStudent"
318+ | "nav.group.teaching"
319+ | "nav.group.tracking"
318320 | "nav.studentsRoster"
319321 | "nav.teachersRoster"
320322 | "nav.schedule"
@@ -1449,6 +1451,7 @@ export type MessageKey =
14491451 | "settings.empty"
14501452 | "settings.maxFileSize"
14511453 | "settings.maxFileSizeHelp"
1454+ | "whiteboard.participantCount"
14521455 | "settings.maxFileSizeInvalid"
14531456 | "settings.mealSlotNameInvalid"
14541457 | "settings.aiPolicy"
@@ -2192,6 +2195,8 @@ const en: Dict = {
21922195 "nav.group.study": "Study",
21932196 "nav.group.other": "Other",
21942197 "nav.group.myStudent": "My student",
2198+ "nav.group.teaching": "Teaching & content",
2199+ "nav.group.tracking": "Student tracking",
21952200 "nav.studentsRoster": "Students",
21962201 "nav.teachersRoster": "Teachers",
21972202 "nav.schedule": "Class schedule",
@@ -3397,7 +3402,8 @@ const en: Dict = {
33973402 "settings.unsaved": "Unsaved changes",
33983403 "settings.empty": "No rows yet.",
33993404 "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}",
34013407 "settings.maxFileSizeInvalid": "Enter a valid file size.",
34023408 "settings.mealSlotNameInvalid": "A meal slot name can't contain / \\ ? # or %.",
34033409 "settings.aiPolicy": "AI policy",
@@ -4057,6 +4063,8 @@ const tr: Dict = {
40574063 "nav.group.study": "Çalışma",
40584064 "nav.group.other": "Diğer",
40594065 "nav.group.myStudent": "Öğrencim",
4066+ "nav.group.teaching": "Eğitim ve içerik",
4067+ "nav.group.tracking": "Öğrenci takibi",
40604068 "nav.studentsRoster": "Öğrenciler",
40614069 "nav.teachersRoster": "Öğretmenler",
40624070 "nav.schedule": "Ders programı",
@@ -5262,7 +5270,8 @@ const tr: Dict = {
52625270 "settings.unsaved": "Kaydedilmemiş değişiklikler",
52635271 "settings.empty": "Henüz satır yok.",
52645272 "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}",
52665275 "settings.maxFileSizeInvalid": "Geçerli bir dosya boyutu gir.",
52675276 "settings.mealSlotNameInvalid": "Öğün adı / \\ ? # veya % içeremez.",
52685277 "settings.aiPolicy": "Yapay zekâ politikası",
src/lib/exam-labels.tsmodified+4 -0
@@ -12,6 +12,10 @@ const EXAM_KIND_LABELS: Record<KnownExamKind, MessageKey> = {
1212 oral: "exams.kind.oral",
1313 };
1414
15+export function isKnownExamKind(kind: string): kind is KnownExamKind {
16+ return kind in EXAM_KIND_LABELS;
17+}
18+
1519 export function examKindLabel(kind: string, t: T): string {
1620 return kind in EXAM_KIND_LABELS ? t(EXAM_KIND_LABELS[kind as KnownExamKind]) : kind;
1721 }
src/pages/courses-page.tsxmodified+1 -1
@@ -201,7 +201,7 @@ function CoursesContent() {
201201 >
202202 <Show
203203 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() })} />}
205205 >
206206 <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"}>
207207 <For each={visibleCourses()}>
src/pages/guide-page.tsxmodified+1 -1
@@ -85,7 +85,7 @@ function GuideContent() {
8585
8686 return (
8787 <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")} />
8989
9090 <section class="data-shell space-y-4 border-sky-500/15 bg-sky-500/2.5 p-6">
9191 <div>
src/pages/meals-page.tsxmodified+1 -1
@@ -88,7 +88,7 @@ function MealsContent() {
8888
8989 return (
9090 <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>} />
9292 <SidePanel open={showCreate()} onOpenChange={setShowCreate} title={t("meals.publish")} description={t("meals.publishHelp")}>
9393 <form class="space-y-4" onSubmit={publish}>
9494 <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() {
6969 return (
7070 <div class="space-y-6">
7171 <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")} />
7373 </div>
7474
7575 <Suspense fallback={<PageSpinner />}>
src/pages/notes-page.tsxmodified+0 -1
@@ -76,7 +76,6 @@ function NotesContent() {
7676 <div class="space-y-6">
7777 <div class="space-y-2">
7878 <PageHeader
79- eyebrow={t("nav.notes")}
8079 title={t("notes.title")}
8180 description={t("notes.subtitle")}
8281 actions={
src/pages/payment-statement-page.tsxmodified+0 -1
@@ -119,7 +119,6 @@ function StatementContent() {
119119 return (
120120 <div class="space-y-6">
121121 <PageHeader
122- eyebrow={t("nav.paymentStatement")}
123122 title={t("payments.statementTitle")}
124123 description={t("payments.statementSubtitle")}
125124 />
src/pages/payments-page.tsxmodified+0 -1
@@ -577,7 +577,6 @@ function PaymentsContent() {
577577 return (
578578 <div class="space-y-6">
579579 <PageHeader
580- eyebrow={t("nav.school")}
581580 title={t("payments.title")}
582581 description={t("payments.subtitle")}
583582 actions={
src/pages/pomodoro-page.tsxmodified+0 -1
@@ -179,7 +179,6 @@ function PomodoroContent() {
179179 return (
180180 <div class="space-y-6">
181181 <PageHeader
182- eyebrow={t("nav.pomodoro")}
183182 title={t("pomodoro.title")}
184183 description={t("pomodoro.subtitle")}
185184 />
src/pages/questions-page.tsxmodified+0 -1
@@ -78,7 +78,6 @@ function QuestionsContent() {
7878 return (
7979 <div class="space-y-6">
8080 <PageHeader
81- eyebrow={t("nav.group.community")}
8281 title={t("pool.title")}
8382 description={t("pool.subtitle")}
8483 actions={
src/pages/settings-page.tsxmodified+25 -13
@@ -16,6 +16,8 @@ import { Input } from "@/components/ui/input";
1616 import { Label } from "@/components/ui/label";
1717 import { PageSpinner } from "@/components/ui/page-spinner";
1818 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";
1921 import { getAttendanceStatusMeta } from "@/lib/attendance-status";
2022 import { cn } from "@/lib/cn";
2123 import { dirtySettingsPatch, minuteToUtcTime, utcTimeToMinute } from "@/lib/meals";
@@ -158,7 +160,6 @@ function SettingsContent() {
158160 return (
159161 <div class="space-y-6">
160162 <PageHeader
161- eyebrow={t("nav.admin")}
162163 title={t("settings.title")}
163164 description={t("settings.subtitle")}
164165 actions={
@@ -230,17 +231,28 @@ function SettingsContent() {
230231 <Index each={examKinds()}>
231232 {(item, index) => (
232233 <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>
242242 }
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>
244256 <Input
245257 aria-label={t("settings.weight")}
246258 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() {
608620 <For each={info().catalog.packages}>
609621 {(pkg) => (
610622 <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>
612624 <div class="flex flex-wrap gap-1.5">
613625 <For each={pkg.modules}>
614626 {(name) => (
615627 <Badge variant={info().mine.enabled.includes(name) ? "secondary" : "outline"} class="rounded-full">
616- {name}
628+ {moduleLabel(name, t)}
617629 </Badge>
618630 )}
619631 </For>
src/pages/terms-page.tsxmodified+0 -1
@@ -203,7 +203,6 @@ function TermsContent() {
203203 <div class="space-y-6">
204204 <div class="space-y-2">
205205 <PageHeader
206- eyebrow={t("nav.admin")}
207206 title={t("terms.title")}
208207 description={t("terms.subtitle")}
209208 actions={
src/pages/whiteboards-page.tsxmodified+1 -1
@@ -147,7 +147,7 @@ function BoardCard(props: { board: Board; isCreator: boolean; onOpen: () => void
147147 </div>
148148 </div>
149149 <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 })}
151151 </p>
152152 </button>
153153 );