forge
Explore
Log in

Don't you dare go Hollow

🧭 rebuild the navigation tree from the Figma design

Browse files at this commit

0691d474dd7dedf2d74eb7de2f6b30ef0a860b79Burak BoduroğluParent: 8e721b9
  • feat
    • 🧭 rebuild the navigation tree from the Figma design
Show full message
feat: 🧭 rebuild the navigation tree from the Figma design

- the sidebar was an information architecture of its own invention —
  Today, Education, Academics, Planning, Workspace, Community — against a
  design that groups the same routes under Operasyon, Yapay zekâ and
  Kurum; all four role trees now carry Figma's groups, labels and order
- every menu entry the design names is present, including the ones no API
  can serve yet: they wear a "yakında" badge and resolve to a shared
  coming-soon page rather than a half-drawn screen
- entries whose label implies a screen we already have reuse that route
  instead of inventing one: Ders programı is /calendar, Tahta is
  /whiteboards, Veli iletişimi is /messages, Mesai is /work
- Çelebi and Ayarlar open the panel and the profile dialog in place, so
  they no longer need a URL of their own
- the design nests Soru bankası and Optik okuma under Sınavlar; the
  sidebar's data model is group-then-item, so that third level is
  flattened for now
- manager keeps the admin tree minus the three admin-only Kurum entries,
  and every route guard is untouched: regrouping a menu must not widen
  anyone's access

Walked as admin, teacher, student and parent at 1440px and 393px, in both
languages. Page composition still follows the old layouts — that is the
next pass.
src/components/layout/app-shell.tsxmodified+7 -1
@@ -93,7 +93,11 @@ export function AppShell(props: ParentProps) {
9393 </div>
9494
9595 <div class="min-h-0 flex-1 overflow-y-auto overflow-x-hidden px-1.5 py-2.5">
96- <SideNav collapsed={collapsed()} />
96+ <SideNav
97+ collapsed={collapsed()}
98+ onOpenCelebi={() => setCelebiOpen(true)}
99+ onOpenProfile={() => setProfileOpen(true)}
100+ />
97101 </div>
98102
99103 <SidebarAccount collapsed={collapsed()} onLogout={logout} />
@@ -105,6 +109,8 @@ export function AppShell(props: ParentProps) {
105109 open={mobileOpen()}
106110 onClose={() => setMobileOpen(false)}
107111 onLogout={logout}
112+ onOpenCelebi={() => setCelebiOpen(true)}
113+ onOpenProfile={() => setProfileOpen(true)}
108114 />
109115 </Show>
110116
src/components/layout/command-palette.tsxmodified+4 -0
@@ -205,6 +205,10 @@ export function CommandPalette(props: CommandPaletteProps) {
205205 for (const group of visibleNavGroups(userRole, modules.enabled())) {
206206 const groupName = t(group.labelKey);
207207 for (const item of group.items) {
208+ // Çelebi and the account-settings entries open an existing shell
209+ // surface rather than a route — the palette already offers both
210+ // above, wired to the panel/dialog directly.
211+ if (item.action) continue;
208212 list.push({
209213 id: `page-${item.to}`,
210214 category: "pages",
src/components/layout/mobile-nav-sheet.tsxmodified+35 -13
@@ -1,6 +1,6 @@
11 import { For, Show, createSignal } from "solid-js";
22 import { Link, useRouterState } from "@tanstack/solid-router";
3-import { routeNavItem, sidebarNavGroups, type NavItem } from "@/components/layout/nav-items";
3+import { routeNavItem, visibleNavGroups, type NavItem } from "@/components/layout/nav-items";
44 import { SidebarAccount } from "@/components/layout/sidebar-account";
55 import { IconX } from "@/components/ui/icons";
66 import { cn } from "@/lib/cn";
@@ -27,6 +27,8 @@ export function MobileNavSheet(props: {
2727 open: boolean;
2828 onClose: () => void;
2929 onLogout: () => void | Promise<void>;
30+ onOpenCelebi?: () => void;
31+ onOpenProfile?: () => void;
3032 }) {
3133 const auth = useAuth();
3234 const t = useT();
@@ -36,9 +38,14 @@ export function MobileNavSheet(props: {
3638
3739 // The primary destinations are already one tap away in the tab bar, so the
3840 // sheet lists everything else.
39- const groups = () => sidebarNavGroups(auth.user()?.role, modules.enabled());
41+ const groups = () => visibleNavGroups(auth.user()?.role, modules.enabled());
4042 const current = () => routeNavItem(pathname(), auth.user()?.role);
4143 const badgeFor = (item: NavItem) => (item.id === "messages" ? feed.unreadMessages().total : 0);
44+ const runAction = (item: NavItem) => {
45+ props.onClose();
46+ if (item.action === "celebi") props.onOpenCelebi?.();
47+ if (item.action === "profile") props.onOpenProfile?.();
48+ };
4249
4350 // Drag-to-dismiss. Only the grab area drives it, so a flick inside the list
4451 // still scrolls the list. While dragging, the sheet follows the finger with
@@ -135,16 +142,12 @@ export function MobileNavSheet(props: {
135142 <For each={group.items}>
136143 {(item) => {
137144 const active = () => current()?.id === item.id;
138- return (
139- <Link
140- to={item.to}
141- onClick={props.onClose}
142- aria-current={active() ? "page" : undefined}
143- class={cn(
144- "flex items-center gap-2.5 rounded-md px-3 py-1.5 transition-colors active:bg-muted",
145- active() ? "text-primary" : "text-foreground",
146- )}
147- >
145+ const rowClass = cn(
146+ "flex w-full items-center gap-2.5 rounded-md px-3 py-1.5 text-left transition-colors active:bg-muted",
147+ active() ? "text-primary" : "text-foreground",
148+ );
149+ const content = (
150+ <>
148151 <span
149152 class={cn(
150153 "inline-flex size-7 shrink-0 items-center justify-center rounded-md",
@@ -156,12 +159,31 @@ export function MobileNavSheet(props: {
156159 <span class="min-w-0 flex-1 truncate text-[13px] font-medium">
157160 {t(item.labelKey)}
158161 </span>
162+ <Show when={item.soon}>
163+ <span class="shrink-0 rounded-full bg-muted px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-muted-foreground">
164+ {t("nav.soon")}
165+ </span>
166+ </Show>
159167 <Show when={badgeFor(item) > 0}>
160168 <span class="flex h-5 min-w-5 items-center justify-center rounded-full bg-rose-500 px-1.5 text-[10px] font-bold text-white">
161169 {badgeFor(item) > 99 ? "99+" : badgeFor(item)}
162170 </span>
163171 </Show>
164- </Link>
172+ </>
173+ );
174+ return (
175+ <Show
176+ when={!item.action}
177+ fallback={
178+ <button type="button" onClick={() => runAction(item)} class={rowClass}>
179+ {content}
180+ </button>
181+ }
182+ >
183+ <Link to={item.to} onClick={props.onClose} aria-current={active() ? "page" : undefined} class={rowClass}>
184+ {content}
185+ </Link>
186+ </Show>
165187 );
166188 }}
167189 </For>
src/components/layout/nav-items.test.tsmodified+121 -47
@@ -1,70 +1,138 @@
1-import { moduleVisible, pathActive, primaryNavItems, primaryPathActive, routeLabelKey, routeNavItem, sidebarNavGroups, visibleNavItems } from "@/components/layout/nav-items";
1+import { moduleVisible, pathActive, primaryNavItems, primaryPathActive, routeLabelKey, routeNavItem, visibleNavGroups, visibleNavItems } from "@/components/layout/nav-items";
22
33 test.each([
4- ["student", ["/", "/courses", "/calendar", "/marks"]],
5- ["teacher", ["/", "/courses", "/calendar"]],
6- ["manager", ["/", "/courses", "/calendar"]],
7- ["admin", ["/", "/courses", "/calendar"]],
8- ["parent", ["/", "/students", "/calendar"]],
4+ ["student", ["/", "/exams", "/marks"]],
5+ ["teacher", ["/", "/management/classes", "/calendar"]],
6+ ["manager", ["/", "/management/classes", "/exams"]],
7+ ["admin", ["/", "/management/classes", "/exams"]],
8+ ["parent", ["/", "/students", "/appointments"]],
99 ] as const)("%s gets role-specific primary destinations", (role, expected) => {
1010 expect(primaryNavItems(role).map((item) => item.to)).toEqual(expected);
1111 });
1212
1313 test("invalid role destinations stay hidden", () => {
14- expect(visibleNavItems("student").map((item) => item.to)).not.toContain("/school");
15- expect(visibleNavItems("parent").map((item) => item.to)).not.toContain("/courses");
1614 expect(visibleNavItems("teacher").map((item) => item.to)).not.toContain("/admin/users");
15+ expect(visibleNavItems("student").map((item) => item.to)).not.toContain("/admin/users");
16+ expect(visibleNavItems("parent").map((item) => item.to)).not.toContain("/management/staff-work");
1717 });
1818
19-test("student secondary navigation follows the academic, planning, workspace, services, community flow", () => {
19+test("admin's sidebar mirrors the Figma Operasyon / Yapay zekâ / Kurum tree", () => {
2020 expect(
21- sidebarNavGroups("student").map((group) => ({
21+ visibleNavGroups("admin").map((group) => ({
2222 id: group.id,
2323 items: group.items.map((item) => item.id),
2424 })),
2525 ).toEqual([
26- { id: "classes", items: ["homework", "exams"] },
27- { id: "planning", items: ["events", "appointments"] },
28- { id: "workspace", items: ["notes", "whiteboards", "pomodoro"] },
29- { id: "services", items: ["meals", "payment-statement"] },
30- { id: "community", items: ["messages", "questions"] },
26+ {
27+ id: "operations",
28+ items: [
29+ "students-roster",
30+ "teachers-roster",
31+ "class-groups",
32+ "schedule",
33+ "student-attendance",
34+ "exams",
35+ "question-bank",
36+ "mock-exams",
37+ "optical-reading",
38+ "payments-collection",
39+ ],
40+ },
41+ { id: "ai", items: ["hezarfen-zeka", "celebi", "sound-studio"] },
42+ {
43+ id: "institution",
44+ items: ["reports", "license-modules", "users", "data-protection", "school-meals", "staff-work", "settings"],
45+ },
3146 ]);
3247 });
3348
34-test("parent's services group includes meals and payment-statement, consistent with every other role", () => {
35- const services = sidebarNavGroups("parent").find((group) => group.id === "services");
36- expect(services?.items.map((item) => item.id)).toEqual(["meals", "payment-statement"]);
49+test("manager sees the same admin tree minus the admin-only entries", () => {
50+ const institution = visibleNavGroups("manager").find((group) => group.id === "institution");
51+ expect(institution?.items.map((item) => item.id)).toEqual(["reports", "school-meals", "staff-work", "settings"]);
52+ expect(institution?.items.map((item) => item.id)).not.toContain("license-modules");
53+ expect(institution?.items.map((item) => item.id)).not.toContain("users");
54+ expect(institution?.items.map((item) => item.id)).not.toContain("data-protection");
3755 });
3856
39-test.each(["student", "parent", "teacher", "manager", "admin"] as const)(
40- "%s can reach every visible feature and appointments from the sidebar",
41- (role) => {
42- const paths = [
43- ...primaryNavItems(role).map((item) => item.to),
44- ...sidebarNavGroups(role).flatMap((group) => group.items.map((item) => item.to)),
45- ];
46- expect(new Set(paths)).toEqual(new Set(visibleNavItems(role).map((item) => item.to)));
47- expect(paths).toContain("/appointments");
48- },
49-);
57+test("teacher's sidebar mirrors the Figma Sınıfım / Yapay zekâ / Diğer tree", () => {
58+ expect(
59+ visibleNavGroups("teacher").map((group) => ({
60+ id: group.id,
61+ items: group.items.map((item) => item.id),
62+ })),
63+ ).toEqual([
64+ { id: "my-classroom", items: ["my-classes", "my-schedule", "student-attendance", "homework", "exams", "whiteboards"] },
65+ { id: "ai", items: ["student-analysis", "pending-approvals", "question-generation", "sound-studio"] },
66+ { id: "other", items: ["parent-communication", "work", "settings-teacher"] },
67+ ]);
68+});
69+
70+test("student's sidebar mirrors the Figma Çalışma / Yapay zekâ / Diğer tree", () => {
71+ expect(
72+ visibleNavGroups("student").map((group) => ({
73+ id: group.id,
74+ items: group.items.map((item) => item.id),
75+ })),
76+ ).toEqual([
77+ { id: "study", items: ["study-plan", "topic-mastery", "exam-results", "my-homework", "whiteboards", "pomodoro"] },
78+ { id: "ai", items: ["celebi", "sound-studio"] },
79+ { id: "other", items: ["calendar", "settings-student"] },
80+ ]);
81+});
82+
83+test("parent's sidebar mirrors the Figma Öğrencim / Kurum tree", () => {
84+ expect(
85+ visibleNavGroups("parent").map((group) => ({
86+ id: group.id,
87+ items: group.items.map((item) => item.id),
88+ })),
89+ ).toEqual([
90+ { id: "my-student", items: ["progress-report", "absence", "child-exam-results", "child-study-plan"] },
91+ { id: "institution", items: ["payment-statement", "appointments", "settings-parent"] },
92+ ]);
93+});
94+
95+test("appointments is a parent-only sidebar entry, matching the Figma parent screen", () => {
96+ expect(visibleNavGroups("parent").flatMap((g) => g.items).map((i) => i.to)).toContain("/appointments");
97+ for (const role of ["student", "teacher", "manager", "admin"] as const) {
98+ const paths = [...primaryNavItems(role).map((i) => i.to), ...visibleNavGroups(role).flatMap((g) => g.items.map((i) => i.to))];
99+ expect(paths).not.toContain("/appointments");
100+ }
101+});
102+
103+test("entries with no backend yet are flagged soon and route to the shared placeholder", () => {
104+ const hezarfenZeka = visibleNavGroups("admin")
105+ .flatMap((g) => g.items)
106+ .find((i) => i.id === "hezarfen-zeka");
107+ expect(hezarfenZeka?.soon).toBe(true);
108+ expect(hezarfenZeka?.to).toBe("/coming-soon/hezarfen-zeka");
109+});
110+
111+test("Çelebi and account settings open an existing shell surface instead of navigating", () => {
112+ const celebi = visibleNavGroups("student")
113+ .flatMap((g) => g.items)
114+ .find((i) => i.id === "celebi");
115+ expect(celebi?.action).toBe("celebi");
116+ const settings = visibleNavGroups("student")
117+ .flatMap((g) => g.items)
118+ .find((i) => i.id === "settings-student");
119+ expect(settings?.action).toBe("profile");
120+});
50121
51122 test("nested entity routes keep their primary destination active", () => {
52- expect(pathActive("/courses/course-1", "/courses")).toBe(true);
53- expect(routeNavItem("/courses/course-1", "teacher")?.id).toBe("classes");
123+ expect(pathActive("/management/classes/class-1", "/management/classes")).toBe(true);
124+ expect(routeNavItem("/management/classes/class-1", "teacher")?.id).toBe("my-classes");
54125 expect(routeNavItem("/management/student-attendance", "teacher")?.id).toBe("student-attendance");
55126 expect(primaryPathActive("/exams/exam-1", primaryNavItems("student")[1]!)).toBe(true);
56127 });
57128
58129 test.each([
59- ["/homework", "student", "homework"],
60- ["/events/event-1", "teacher", "events"],
130+ ["/homework/hw-1", "student", "my-homework"],
131+ ["/homework/hw-1", "teacher", "homework"],
61132 ["/management/student-attendance", "teacher", "student-attendance"],
62133 ["/management/settings", "manager", "settings"],
63134 ] as const)("sidebar resolves one active item for %s", (pathname, role, expected) => {
64- const items = [
65- ...primaryNavItems(role),
66- ...sidebarNavGroups(role).flatMap((group) => group.items),
67- ];
135+ const items = [...primaryNavItems(role), ...visibleNavGroups(role).flatMap((group) => group.items)];
68136 const current = routeNavItem(pathname, role);
69137
70138 expect(items.filter((item) => item.id === current?.id).map((item) => item.id)).toEqual([expected]);
@@ -79,12 +147,18 @@ test.each([
79147 ["/attendance", "nav.attendance"],
80148 ["/studies", "courses.kind.study"],
81149 ["/clubs", "courses.kind.club"],
150+ ["/courses", "nav.courses"],
151+ ["/courses/course-1", "nav.courses"],
152+ ["/notes", "nav.notes"],
153+ ["/questions", "nav.questions"],
154+ ["/events", "nav.events"],
155+ ["/meals", "nav.meals"],
82156 ] as const)("%s has a header label", (pathname, expected) => {
83157 expect(routeLabelKey(pathname, "student")).toBe(expected);
84158 });
85159
86160 test("routes with a sidebar entry still take their nav label", () => {
87- expect(routeLabelKey("/courses/course-1", "teacher")).toBe(routeNavItem("/courses/course-1", "teacher")?.labelKey);
161+ expect(routeLabelKey("/homework/hw-1", "teacher")).toBe(routeNavItem("/homework/hw-1", "teacher")?.labelKey);
88162 });
89163
90164 test("a route rendered outside the shell has no label rather than a raw path", () => {
@@ -94,8 +168,8 @@ test("a route rendered outside the shell has no label rather than a raw path", (
94168 test("a page keeps its name for a viewer who may not open it", () => {
95169 // /students is parent-only; an admin lands on the no-access screen, and the
96170 // shell header must still say what page that is.
97- expect(routeLabelKey("/students", "admin")).toBe("nav.children");
98- expect(routeLabelKey("/students", "parent")).toBe("nav.children");
171+ expect(routeLabelKey("/students", "admin")).toBe("nav.progressReport");
172+ expect(routeLabelKey("/students", "parent")).toBe("nav.progressReport");
99173 });
100174
101175 test("module gate fails open while the entitlement lookup is unknown", () => {
@@ -104,13 +178,13 @@ test("module gate fails open while the entitlement lookup is unknown", () => {
104178 });
105179
106180 test("module gate hides nests the school did not buy", () => {
107- const enabled = ["courses", "notes"];
108- const primary = primaryNavItems("student", enabled).map((item) => item.to);
109- expect(primary).toContain("/courses");
110- expect(primary).not.toContain("/marks");
111- const sidebar = sidebarNavGroups("teacher", enabled).flatMap((group) => group.items.map((item) => item.to));
112- expect(sidebar).not.toContain("/meals");
113- expect(sidebar).not.toContain("/messages");
181+ const enabled = ["courses"];
182+ const teacherPaths = visibleNavGroups("teacher", enabled).flatMap((group) => group.items.map((item) => item.to));
183+ expect(teacherPaths).not.toContain("/homework");
184+ expect(teacherPaths).not.toContain("/exams");
185+ expect(teacherPaths).not.toContain("/whiteboards");
186+ expect(teacherPaths).toContain("/management/classes");
187+ expect(teacherPaths).toContain("/calendar");
114188 });
115189
116190 test("ungated entries never drop on module filtering", () => {
src/components/layout/nav-items.tsmodified+173 -116
@@ -2,29 +2,32 @@ import type { Component } from "solid-js";
22 import type { Role } from "@/api/client";
33 import {
44 IconArchive,
5- IconBook,
5+ IconBotSquare,
66 IconBriefcase,
7- IconCalendar,
87 IconCalendarDays,
8+ IconChalkboardTeacher,
99 IconChart,
10- IconClock,
10+ IconChartPie,
1111 IconClipboardCheck,
12+ IconClock,
13+ IconEdit,
1214 IconExam,
13- IconGlobe,
14- IconGrid,
15- IconGuide,
1615 IconHelpCircle,
1716 IconHomework,
1817 IconHome,
1918 IconMessage,
20- IconEdit,
21- IconNote,
19+ IconPackage,
2220 IconReportAnalytics,
21+ IconScan,
2322 IconSchool,
2423 IconSettings,
24+ IconShieldCheck,
25+ IconSparkles,
26+ IconTarget,
2527 IconUserCog,
2628 IconUsers,
2729 IconUtensils,
30+ IconWaveform,
2831 } from "@/components/ui/icons";
2932 import type { MessageKey } from "@/i18n/messages";
3033 import { hasExactRole, roleInRange } from "@/lib/roles";
@@ -40,6 +43,11 @@ export type NavItem = {
4043 exact?: boolean;
4144 /** Backend module nest behind this entry; hidden when the school did not buy it. */
4245 module?: string;
46+ /** No backend yet — routes to the shared placeholder and carries a "yakında" badge. */
47+ soon?: boolean;
48+ /** Opens an existing shell surface instead of navigating (the Çelebi panel,
49+ * the account settings dialog) — both already live elsewhere in the shell. */
50+ action?: "celebi" | "profile";
4351 };
4452
4553 export type NavGroup = {
@@ -57,139 +65,190 @@ export const HOME_ITEM: NavItem = {
5765 exact: true,
5866 };
5967
60-const CLASSES_ITEM: NavItem = {
61- id: "classes",
62- to: "/courses",
63- labelKey: "nav.classes",
64- Icon: IconBook,
65- module: "courses",
66-};
67-
68-const CALENDAR_ITEM: NavItem = {
69- id: "calendar",
70- to: "/calendar",
71- labelKey: "nav.calendar",
72- Icon: IconCalendarDays,
73-};
74-
75-const CHILDREN_ITEM: NavItem = {
76- id: "children",
77- to: "/students",
78- labelKey: "nav.children",
79- Icon: IconUsers,
80- exactRole: "parent",
68+const CELEBI_ITEM: NavItem = {
69+ id: "celebi",
70+ to: "",
71+ labelKey: "nav.celebi",
72+ Icon: IconSparkles,
73+ action: "celebi",
8174 };
8275
83-const PROGRESS_ITEM: NavItem = {
84- id: "progress",
85- to: "/marks",
86- labelKey: "nav.marks",
87- Icon: IconChart,
88- exactRole: "student",
89- module: "marks",
76+const SOUND_STUDIO_ITEM: NavItem = {
77+ id: "sound-studio",
78+ to: "/coming-soon/ses-atolyesi",
79+ labelKey: "nav.soundStudio",
80+ Icon: IconWaveform,
81+ soon: true,
9082 };
9183
92-const MEALS_ITEM: NavItem = {
93- id: "meals",
94- to: "/meals",
95- labelKey: "nav.meals",
96- Icon: IconUtensils,
97- module: "meals",
98-};
84+function settingsAction(id: string): NavItem {
85+ return { id, to: "", labelKey: "nav.settings", Icon: IconSettings, action: "profile" };
86+}
9987
100-const PRIMARY_BY_ROLE: Record<Role, NavItem[]> = {
101- student: [HOME_ITEM, CLASSES_ITEM, CALENDAR_ITEM, PROGRESS_ITEM],
102- teacher: [HOME_ITEM, CLASSES_ITEM, CALENDAR_ITEM],
103- manager: [HOME_ITEM, CLASSES_ITEM, CALENDAR_ITEM],
104- admin: [HOME_ITEM, CLASSES_ITEM, CALENDAR_ITEM],
105- // Meals stays out of the primary strip so it lives under "Community" for
106- // every role consistently, same as teacher/manager/admin/student.
107- parent: [HOME_ITEM, CHILDREN_ITEM, CALENDAR_ITEM],
108-};
88+// Admin and manager share one Figma information architecture (Operasyon /
89+// Yapay zekâ / Kurum) — manager just qualifies for fewer of its items, via
90+// the same minRole gates the rest of this file already uses.
91+const ADMIN_GROUPS: NavGroup[] = [
92+ {
93+ id: "operations",
94+ labelKey: "nav.group.operations",
95+ Icon: IconSchool,
96+ items: [
97+ { id: "students-roster", to: "/coming-soon/ogrenciler", labelKey: "nav.studentsRoster", Icon: IconUsers, soon: true, minRole: "manager" },
98+ { id: "teachers-roster", to: "/coming-soon/ogretmenler", labelKey: "nav.teachersRoster", Icon: IconChalkboardTeacher, soon: true, minRole: "manager" },
99+ { id: "class-groups", to: "/management/classes", labelKey: "nav.classGroups", Icon: IconSchool, minRole: "teacher" },
100+ { id: "schedule", to: "/calendar", labelKey: "nav.schedule", Icon: IconCalendarDays, minRole: "manager" },
101+ { id: "student-attendance", to: "/management/student-attendance", labelKey: "nav.attendance", Icon: IconClipboardCheck, minRole: "teacher", module: "attendance" },
102+ { id: "exams", to: "/exams", labelKey: "nav.exams", Icon: IconExam, minRole: "teacher", module: "exams" },
103+ { id: "question-bank", to: "/question-bank", labelKey: "nav.questionBank", Icon: IconArchive, minRole: "teacher", module: "bank_questions" },
104+ { id: "mock-exams", to: "/coming-soon/deneme-sinavlari", labelKey: "nav.mockExams", Icon: IconTarget, soon: true, minRole: "manager" },
105+ { id: "optical-reading", to: "/coming-soon/optik-okuma", labelKey: "nav.opticalReading", Icon: IconScan, soon: true, minRole: "manager" },
106+ { id: "payments-collection", to: "/management/payments", labelKey: "nav.payments", Icon: IconReportAnalytics, minRole: "manager", module: "payments" },
107+ ],
108+ },
109+ {
110+ id: "ai",
111+ labelKey: "nav.group.ai",
112+ Icon: IconSparkles,
113+ items: [
114+ { id: "hezarfen-zeka", to: "/coming-soon/hezarfen-zeka", labelKey: "nav.hezarfenZeka", Icon: IconBotSquare, soon: true, minRole: "manager" },
115+ CELEBI_ITEM,
116+ SOUND_STUDIO_ITEM,
117+ ],
118+ },
119+ {
120+ id: "institution",
121+ labelKey: "nav.group.institution",
122+ Icon: IconUserCog,
123+ items: [
124+ { id: "reports", to: "/coming-soon/raporlar", labelKey: "nav.reports", Icon: IconChartPie, soon: true, minRole: "manager" },
125+ { id: "license-modules", to: "/coming-soon/lisans-modulleri", labelKey: "nav.licenseModules", Icon: IconPackage, soon: true, minRole: "admin" },
126+ { id: "users", to: "/admin/users", labelKey: "nav.users", Icon: IconUserCog, minRole: "admin" },
127+ { id: "data-protection", to: "/coming-soon/kvkk-denetim", labelKey: "nav.dataProtection", Icon: IconShieldCheck, soon: true, minRole: "admin" },
128+ { id: "school-meals", to: "/meals", labelKey: "nav.schoolMeals", Icon: IconUtensils, minRole: "manager", module: "meals" },
129+ { id: "staff-work", to: "/management/staff-work", labelKey: "nav.staffWork", Icon: IconBriefcase, minRole: "manager", module: "work" },
130+ { id: "settings", to: "/management/settings", labelKey: "nav.settings", Icon: IconSettings, minRole: "manager" },
131+ ],
132+ },
133+];
109134
110-const NAV_GROUPS: NavGroup[] = [
135+const TEACHER_GROUPS: NavGroup[] = [
111136 {
112- id: "classes",
113- labelKey: "nav.group.classes",
137+ id: "my-classroom",
138+ labelKey: "nav.group.myClassroom",
114139 Icon: IconSchool,
115140 items: [
116- CLASSES_ITEM,
141+ { id: "my-classes", to: "/management/classes", labelKey: "nav.myClasses", Icon: IconSchool },
142+ { id: "my-schedule", to: "/calendar", labelKey: "nav.mySchedule", Icon: IconCalendarDays },
143+ { id: "student-attendance", to: "/management/student-attendance", labelKey: "nav.attendance", Icon: IconClipboardCheck, module: "attendance" },
117144 { id: "homework", to: "/homework", labelKey: "nav.homework", Icon: IconHomework, module: "homework" },
118145 { id: "exams", to: "/exams", labelKey: "nav.exams", Icon: IconExam, module: "exams" },
119- { id: "question-bank", to: "/question-bank", labelKey: "nav.questionBank", Icon: IconArchive, minRole: "teacher", module: "bank_questions" },
120- { id: "marks", to: "/marks", labelKey: "nav.marks", Icon: IconChart, exactRole: "student", module: "marks" },
146+ { id: "whiteboards", to: "/whiteboards", labelKey: "nav.whiteboards", Icon: IconEdit, module: "boards" },
121147 ],
122148 },
123149 {
124- id: "planning",
125- labelKey: "nav.group.planning",
126- Icon: IconCalendarDays,
150+ id: "ai",
151+ labelKey: "nav.group.ai",
152+ Icon: IconSparkles,
127153 items: [
128- { id: "events", to: "/events", labelKey: "nav.events", Icon: IconCalendar, module: "events" },
129- CALENDAR_ITEM,
130- { id: "appointments", to: "/appointments", labelKey: "nav.appointments", Icon: IconClock, module: "appointments" },
154+ { id: "student-analysis", to: "/coming-soon/ogrenci-analizi", labelKey: "nav.studentAnalysis", Icon: IconChart, soon: true },
155+ { id: "pending-approvals", to: "/coming-soon/bekleyen-onaylar", labelKey: "nav.pendingApprovals", Icon: IconHelpCircle, soon: true },
156+ { id: "question-generation", to: "/coming-soon/soru-uretimi", labelKey: "nav.questionGeneration", Icon: IconEdit, soon: true },
157+ SOUND_STUDIO_ITEM,
131158 ],
132159 },
133160 {
134- id: "workspace",
135- labelKey: "nav.group.workspace",
136- Icon: IconNote,
161+ id: "other",
162+ labelKey: "nav.group.other",
163+ Icon: IconMessage,
137164 items: [
138- { id: "notes", to: "/notes", labelKey: "nav.notes", Icon: IconNote, module: "notes" },
139- { id: "whiteboards", to: "/whiteboards", labelKey: "nav.whiteboards", Icon: IconEdit, minRole: "student", module: "boards" },
140- { id: "pomodoro", to: "/pomodoro", labelKey: "nav.pomodoro", Icon: IconClock, exactRole: "student", module: "pomodoro" },
141- { id: "work", to: "/work", labelKey: "nav.work", Icon: IconBriefcase, minRole: "teacher", maxRole: "manager", module: "work" },
165+ { id: "parent-communication", to: "/messages", labelKey: "nav.parentCommunication", Icon: IconMessage, module: "messages" },
166+ { id: "work", to: "/work", labelKey: "nav.work", Icon: IconClock, minRole: "teacher", maxRole: "manager", module: "work" },
167+ settingsAction("settings-teacher"),
142168 ],
143169 },
170+];
171+
172+const STUDENT_GROUPS: NavGroup[] = [
144173 {
145- id: "students",
146- labelKey: "nav.group.students",
147- Icon: IconReportAnalytics,
174+ id: "study",
175+ labelKey: "nav.group.study",
176+ Icon: IconSchool,
148177 items: [
149- CHILDREN_ITEM,
150- { id: "class-groups", to: "/management/classes", labelKey: "nav.classGroups", Icon: IconUsers, minRole: "teacher", module: "classes" },
151- { id: "student-marks", to: "/management/student-marks", labelKey: "nav.studentMarks", Icon: IconChart, minRole: "teacher", module: "marks" },
152- { id: "student-attendance", to: "/management/student-attendance", labelKey: "nav.studentAttendance", Icon: IconClipboardCheck, minRole: "teacher", module: "attendance" },
153- { id: "student-pomodoro", to: "/management/pomodoros", labelKey: "nav.studentPomodoro", Icon: IconClock, minRole: "teacher", module: "pomodoro" },
178+ { id: "study-plan", to: "/coming-soon/calisma-programim", labelKey: "nav.studyPlan", Icon: IconClock, soon: true },
179+ { id: "topic-mastery", to: "/marks", labelKey: "nav.topicMastery", Icon: IconChart, exactRole: "student", module: "marks" },
180+ { id: "exam-results", to: "/exams", labelKey: "nav.examResults", Icon: IconExam, module: "exams" },
181+ { id: "my-homework", to: "/homework", labelKey: "nav.myHomework", Icon: IconHomework, module: "homework" },
182+ { id: "whiteboards", to: "/whiteboards", labelKey: "nav.whiteboards", Icon: IconEdit, module: "boards" },
183+ { id: "pomodoro", to: "/pomodoro", labelKey: "nav.pomodoro", Icon: IconClock, exactRole: "student", module: "pomodoro" },
154184 ],
155185 },
156186 {
157- id: "services",
158- labelKey: "nav.group.services",
159- Icon: IconGuide,
187+ id: "ai",
188+ labelKey: "nav.group.ai",
189+ Icon: IconSparkles,
190+ items: [CELEBI_ITEM, SOUND_STUDIO_ITEM],
191+ },
192+ {
193+ id: "other",
194+ labelKey: "nav.group.other",
195+ Icon: IconCalendarDays,
160196 items: [
161- MEALS_ITEM,
162- { id: "payment-statement", to: "/payments", labelKey: "nav.paymentStatement", Icon: IconChart, maxRole: "student", module: "payments" },
197+ { id: "calendar", to: "/calendar", labelKey: "nav.mySchedule", Icon: IconCalendarDays },
198+ settingsAction("settings-student"),
163199 ],
164200 },
201+];
202+
203+const PARENT_GROUPS: NavGroup[] = [
165204 {
166- id: "community",
167- labelKey: "nav.group.community",
168- Icon: IconGlobe,
205+ id: "my-student",
206+ labelKey: "nav.group.myStudent",
207+ Icon: IconUsers,
169208 items: [
170- { id: "messages", to: "/messages", labelKey: "nav.messages", Icon: IconMessage, module: "messages" },
171- { id: "questions", to: "/questions", labelKey: "nav.questions", Icon: IconHelpCircle, module: "questions" },
209+ { id: "progress-report", to: "/students", labelKey: "nav.progressReport", Icon: IconReportAnalytics, exactRole: "parent" },
210+ { id: "absence", to: "/coming-soon/devamsizlik", labelKey: "nav.absence", Icon: IconClipboardCheck, soon: true },
211+ { id: "child-exam-results", to: "/coming-soon/sinav-sonuclari-veli", labelKey: "nav.childExamResults", Icon: IconExam, soon: true },
212+ { id: "child-study-plan", to: "/coming-soon/calisma-plani", labelKey: "nav.childStudyPlan", Icon: IconClock, soon: true },
172213 ],
173214 },
174215 {
175- id: "school",
176- labelKey: "nav.group.school",
177- Icon: IconGrid,
216+ id: "institution",
217+ labelKey: "nav.group.institution",
218+ Icon: IconUserCog,
178219 items: [
179- { id: "staff-work", to: "/management/staff-work", labelKey: "nav.staffWork", Icon: IconBriefcase, minRole: "manager", module: "work" },
180- { id: "settings", to: "/management/settings", labelKey: "nav.settings", Icon: IconSettings, minRole: "manager" },
181- { id: "terms", to: "/management/terms", labelKey: "nav.terms", Icon: IconCalendarDays, minRole: "manager" },
182- { id: "payments", to: "/management/payments", labelKey: "nav.payments", Icon: IconReportAnalytics, minRole: "manager", module: "payments" },
183- { id: "users", to: "/admin/users", labelKey: "nav.users", Icon: IconUserCog, minRole: "admin" },
220+ { id: "payment-statement", to: "/payments", labelKey: "nav.payments", Icon: IconReportAnalytics, exactRole: "parent", module: "payments" },
221+ { id: "appointments", to: "/appointments", labelKey: "nav.appointmentsAndCommunication", Icon: IconClock, exactRole: "parent", module: "appointments" },
222+ settingsAction("settings-parent"),
184223 ],
185224 },
186225 ];
187226
227+const GROUPS_BY_ROLE: Record<Role, NavGroup[]> = {
228+ student: STUDENT_GROUPS,
229+ teacher: TEACHER_GROUPS,
230+ manager: ADMIN_GROUPS,
231+ admin: ADMIN_GROUPS,
232+ parent: PARENT_GROUPS,
233+};
234+
235+// The mobile bottom tab bar keeps its own small, role-specific set — Figma's
236+// desktop sidebar has no equivalent "primary strip" (only "Ana Sayfa" sits
237+// outside the groups there), so this stays a phone-only affordance built
238+// from items that also exist in the role's group tree above.
239+const PRIMARY_BY_ROLE: Record<Role, NavItem[]> = {
240+ student: [HOME_ITEM, { id: "exam-results", to: "/exams", labelKey: "nav.examResults", Icon: IconExam, module: "exams" }, { id: "topic-mastery", to: "/marks", labelKey: "nav.topicMastery", Icon: IconChart, exactRole: "student", module: "marks" }],
241+ teacher: [HOME_ITEM, { id: "my-classes", to: "/management/classes", labelKey: "nav.myClasses", Icon: IconSchool }, { id: "my-schedule", to: "/calendar", labelKey: "nav.mySchedule", Icon: IconCalendarDays }],
242+ manager: [HOME_ITEM, { id: "class-groups", to: "/management/classes", labelKey: "nav.classGroups", Icon: IconSchool, minRole: "teacher" }, { id: "exams", to: "/exams", labelKey: "nav.exams", Icon: IconExam, minRole: "teacher", module: "exams" }],
243+ admin: [HOME_ITEM, { id: "class-groups", to: "/management/classes", labelKey: "nav.classGroups", Icon: IconSchool, minRole: "teacher" }, { id: "exams", to: "/exams", labelKey: "nav.exams", Icon: IconExam, minRole: "teacher", module: "exams" }],
244+ parent: [HOME_ITEM, { id: "progress-report", to: "/students", labelKey: "nav.progressReport", Icon: IconReportAnalytics, exactRole: "parent" }, { id: "appointments", to: "/appointments", labelKey: "nav.appointmentsAndCommunication", Icon: IconClock, exactRole: "parent", module: "appointments" }],
245+};
246+
188247 function itemVisible(item: NavItem, role: Role | undefined) {
189248 if (!role) return false;
190249 if (item.exactRole) return hasExactRole(role, item.exactRole);
191250 if (item.minRole || item.maxRole) return roleInRange(role, item.minRole, item.maxRole);
192- return role !== "parent" || ["/", "/calendar", "/appointments", "/meals", "/messages"].includes(item.to);
251+ return true;
193252 }
194253
195254 /**
@@ -208,8 +267,12 @@ export function primaryNavItems(role: Role | undefined, enabled?: readonly strin
208267 return PRIMARY_BY_ROLE[role].filter((item) => moduleVisible(item, enabled));
209268 }
210269
270+/** The full, role-specific group tree — desktop sidebar and the mobile menu
271+ * sheet both render this directly; it mirrors the Figma sidebar as-is, with
272+ * no items pulled out for a separate "primary" section. */
211273 export function visibleNavGroups(role: Role | undefined, enabled?: readonly string[] | null): NavGroup[] {
212- return NAV_GROUPS
274+ if (!role) return [];
275+ return GROUPS_BY_ROLE[role]
213276 .map((group) => ({
214277 ...group,
215278 items: group.items.filter((item) => itemVisible(item, role) && moduleVisible(item, enabled)),
@@ -217,31 +280,19 @@ export function visibleNavGroups(role: Role | undefined, enabled?: readonly stri
217280 .filter((group) => group.items.length > 0);
218281 }
219282
220-export function sidebarNavGroups(role: Role | undefined, enabled?: readonly string[] | null): NavGroup[] {
221- const primaryPaths = new Set(primaryNavItems(role, enabled).map((item) => item.to));
222- return visibleNavGroups(role, enabled)
223- .map((group) => ({ ...group, items: group.items.filter((item) => !primaryPaths.has(item.to)) }))
224- .filter((group) => group.items.length > 0);
225-}
226-
227283 export function visibleNavItems(role: Role | undefined, enabled?: readonly string[] | null): NavItem[] {
228- const items = [HOME_ITEM, ...visibleNavGroups(role, enabled).flatMap((group) => group.items)];
229- return items.filter((item, index) => items.findIndex((candidate) => candidate.to === item.to) === index);
284+ const items = [HOME_ITEM, ...primaryNavItems(role, enabled), ...visibleNavGroups(role, enabled).flatMap((group) => group.items)];
285+ return items.filter((item, index) => items.findIndex((candidate) => candidate.id === item.id && candidate.to === item.to) === index);
230286 }
231287
232288 export function pathActive(pathname: string, to: string, exact?: boolean) {
289+ if (!to) return false;
233290 if (exact) return pathname === to;
234291 return pathname === to || pathname.startsWith(`${to}/`);
235292 }
236293
237294 export function primaryPathActive(pathname: string, item: NavItem) {
238- if (pathActive(pathname, item.to, item.exact)) return true;
239- const prefixes: Partial<Record<string, string[]>> = {
240- classes: ["/homework", "/exams", "/question-bank"],
241- calendar: ["/events", "/appointments"],
242- progress: ["/attendance", "/pomodoro"],
243- };
244- return (prefixes[item.id] ?? []).some((prefix) => pathname.startsWith(prefix));
295+ return pathActive(pathname, item.to, item.exact);
245296 }
246297
247298 export function routeNavItem(pathname: string, role: Role | undefined): NavItem | undefined {
@@ -262,6 +313,11 @@ const UNLISTED_ROUTE_LABELS: { prefix: string; labelKey: MessageKey }[] = [
262313 { prefix: "/attendance", labelKey: "nav.attendance" },
263314 { prefix: "/studies", labelKey: "courses.kind.study" },
264315 { prefix: "/clubs", labelKey: "courses.kind.club" },
316+ { prefix: "/courses", labelKey: "nav.courses" },
317+ { prefix: "/notes", labelKey: "nav.notes" },
318+ { prefix: "/questions", labelKey: "nav.questions" },
319+ { prefix: "/events", labelKey: "nav.events" },
320+ { prefix: "/meals", labelKey: "nav.meals" },
265321 ];
266322
267323 /**
@@ -281,7 +337,8 @@ export function routeLabelKey(pathname: string, role: Role | undefined): Message
281337 // A page still has a name when the viewer may not open it — the shell title
282338 // must not go blank on the "no access" screen — so fall back to the nav entry
283339 // for any role, not just this one.
284- return [HOME_ITEM, ...NAV_GROUPS.flatMap((group) => group.items)]
340+ const allItems = [HOME_ITEM, ...Object.values(GROUPS_BY_ROLE).flatMap((groups) => groups.flatMap((group) => group.items))];
341+ return allItems
285342 .filter((entry) => pathActive(pathname, entry.to, entry.exact))
286343 .sort((a, b) => b.to.length - a.to.length)[0]?.labelKey;
287344 }
src/components/layout/side-nav.tsxmodified+58 -47
@@ -1,6 +1,6 @@
11 import { For, Show } from "solid-js";
22 import { Link, useNavigate, useRouterState } from "@tanstack/solid-router";
3-import { primaryNavItems, routeNavItem, sidebarNavGroups, type NavItem } from "@/components/layout/nav-items";
3+import { HOME_ITEM, routeNavItem, visibleNavGroups, 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,7 +9,12 @@ import { useModules } from "@/stores/modules-context";
99 import { useShellFeed } from "@/stores/shell-feed-context";
1010 import { useT } from "@/stores/preferences-context";
1111
12-export function SideNav(props: { onNavigate?: () => void; collapsed?: boolean }) {
12+export function SideNav(props: {
13+ onNavigate?: () => void;
14+ collapsed?: boolean;
15+ onOpenCelebi?: () => void;
16+ onOpenProfile?: () => void;
17+}) {
1318 const auth = useAuth();
1419 const t = useT();
1520 const feed = useShellFeed();
@@ -17,16 +22,22 @@ export function SideNav(props: { onNavigate?: () => void; collapsed?: boolean })
1722 const navigate = useNavigate();
1823 const pathname = useRouterState({ select: (state) => state.location.pathname });
1924
20- const primary = () => primaryNavItems(auth.user()?.role, modules.enabled());
21- const groups = () => sidebarNavGroups(auth.user()?.role, modules.enabled());
25+ const home = () => (auth.user() ? [HOME_ITEM] : []);
26+ const groups = () => visibleNavGroups(auth.user()?.role, modules.enabled());
2227 const current = () => routeNavItem(pathname(), auth.user()?.role);
2328 const unread = () => feed.unreadMessages().total;
2429 const badgeFor = (item: NavItem) => (item.id === "messages" ? unread() : 0);
2530
31+ const runAction = (item: NavItem) => {
32+ props.onNavigate?.();
33+ if (item.action === "celebi") props.onOpenCelebi?.();
34+ if (item.action === "profile") props.onOpenProfile?.();
35+ };
36+
2637 return (
2738 <nav class="flex h-full flex-col gap-1" aria-label={t("nav.menu")}>
2839 <div class="grid gap-1">
29- <For each={primary()}>
40+ <For each={home()}>
3041 {(item) => {
3142 const active = () => current()?.id === item.id;
3243 return (
@@ -45,20 +56,6 @@ export function SideNav(props: { onNavigate?: () => void; collapsed?: boolean })
4556 >
4657 <item.Icon class="h-4 w-4 shrink-0" />
4758 <span class={props.collapsed ? "sr-only" : "truncate"}>{t(item.labelKey)}</span>
48- <Show when={badgeFor(item) > 0}>
49- <Show
50- when={!props.collapsed}
51- fallback={
52- <span class="absolute -right-0.5 -top-0.5 flex h-4 min-w-4 items-center justify-center rounded-full bg-rose-500 px-1 text-[9px] font-bold text-white">
53- {unread() > 9 ? "9+" : unread()}
54- </span>
55- }
56- >
57- <span class="ml-auto flex h-5 min-w-5 items-center justify-center rounded-full bg-rose-500 px-1.5 text-[10px] font-bold text-white">
58- {unread() > 9 ? "9+" : unread()}
59- </span>
60- </Show>
61- </Show>
6259 </Link>
6360 );
6461 }}
@@ -72,38 +69,43 @@ export function SideNav(props: { onNavigate?: () => void; collapsed?: boolean })
7269 <For each={group.items}>
7370 {(item: NavItem) => {
7471 const itemActive = () => current()?.id === item.id;
75- return (
76- <Link
77- to={item.to}
78- onClick={() => props.onNavigate?.()}
79- title={t(item.labelKey)}
80- aria-current={itemActive() ? "page" : undefined}
81- class={cn(
82- // Active submenu item: bold foreground text + a bright segment over
83- // the group's left guide line (no filled pill).
84- "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",
85- itemActive()
86- ? "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"
87- : "font-medium text-muted-foreground hover:bg-muted/70 hover:text-foreground",
88- )}
89- >
72+ 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",
76+ 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",
79+ );
80+ const content = (
81+ <>
9082 <item.Icon class="h-4 w-4 shrink-0 opacity-80" />
9183 <span class="truncate">{t(item.labelKey)}</span>
84+ <Show when={item.soon}>
85+ <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">
86+ {t("nav.soon")}
87+ </span>
88+ </Show>
9289 <Show when={badgeFor(item) > 0}>
93- <Show
94- when={!props.collapsed}
95- fallback={
96- <span class="absolute -right-0.5 -top-0.5 flex h-4 min-w-4 items-center justify-center rounded-full bg-rose-500 px-1 text-[9px] font-bold text-white">
97- {unread() > 9 ? "9+" : unread()}
98- </span>
99- }
100- >
101- <span class="ml-auto flex h-5 min-w-5 items-center justify-center rounded-full bg-rose-500 px-1.5 text-[10px] font-bold text-white">
102- {unread() > 9 ? "9+" : unread()}
103- </span>
104- </Show>
90+ <span class="ml-auto flex h-5 min-w-5 items-center justify-center rounded-full bg-rose-500 px-1.5 text-[10px] font-bold text-white">
91+ {unread() > 9 ? "9+" : unread()}
92+ </span>
10593 </Show>
106- </Link>
94+ </>
95+ );
96+ return (
97+ <Show
98+ when={!item.action}
99+ fallback={
100+ <button type="button" onClick={() => runAction(item)} title={t(item.labelKey)} class={cn(linkClass, "w-full text-left")}>
101+ {content}
102+ </button>
103+ }
104+ >
105+ <Link to={item.to} onClick={() => props.onNavigate?.()} title={t(item.labelKey)} aria-current={itemActive() ? "page" : undefined} class={linkClass}>
106+ {content}
107+ </Link>
108+ </Show>
107109 );
108110 }}
109111 </For>
@@ -154,12 +156,21 @@ export function SideNav(props: { onNavigate?: () => void; collapsed?: boolean })
154156 <DropdownMenuItem
155157 class="min-h-8 gap-2.5 rounded-md px-2.5 py-1.5 text-[13px]"
156158 onSelect={() => {
159+ if (item.action) {
160+ runAction(item);
161+ return;
162+ }
157163 props.onNavigate?.();
158164 void navigate({ to: item.to });
159165 }}
160166 >
161167 <item.Icon class="h-4 w-4 shrink-0" />
162168 <span>{t(item.labelKey)}</span>
169+ <Show when={item.soon}>
170+ <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">
171+ {t("nav.soon")}
172+ </span>
173+ </Show>
163174 <Show when={badgeFor(item) > 0}>
164175 <span class="ml-auto flex h-5 min-w-5 items-center justify-center rounded-full bg-rose-500 px-1.5 text-[10px] font-bold text-white">
165176 {unread() > 9 ? "9+" : unread()}
src/components/ui/icons.tsxmodified+35 -0
@@ -5,6 +5,8 @@ import bellUrl from "@phosphor-icons/core/regular/bell.svg?url";
55 import bookOpenUrl from "@phosphor-icons/core/regular/book-open.svg?url";
66 import calendarDotsUrl from "@phosphor-icons/core/regular/calendar-dots.svg?url";
77 import caretDownUrl from "@phosphor-icons/core/regular/caret-down.svg?url";
8+import chalkboardTeacherUrl from "@phosphor-icons/core/regular/chalkboard-teacher.svg?url";
9+import chartPieUrl from "@phosphor-icons/core/regular/chart-pie.svg?url";
810 import caretLeftUrl from "@phosphor-icons/core/regular/caret-left.svg?url";
911 import caretRightUrl from "@phosphor-icons/core/regular/caret-right.svg?url";
1012 import caretUpDownUrl from "@phosphor-icons/core/regular/caret-up-down.svg?url";
@@ -27,17 +29,22 @@ import houseUrl from "@phosphor-icons/core/regular/house.svg?url";
2729 import listUrl from "@phosphor-icons/core/regular/list.svg?url";
2830 import lockSimpleUrl from "@phosphor-icons/core/regular/lock-simple.svg?url";
2931 import magnifyingGlassUrl from "@phosphor-icons/core/regular/magnifying-glass.svg?url";
32+import packageUrl from "@phosphor-icons/core/regular/package.svg?url";
3033 import paperPlaneTiltUrl from "@phosphor-icons/core/regular/paper-plane-tilt.svg?url";
3134 import pencilSimpleUrl from "@phosphor-icons/core/regular/pencil-simple.svg?url";
3235 import plusUrl from "@phosphor-icons/core/regular/plus.svg?url";
3336 import questionUrl from "@phosphor-icons/core/regular/question.svg?url";
37+import scanUrl from "@phosphor-icons/core/regular/scan.svg?url";
38+import shieldCheckUrl from "@phosphor-icons/core/regular/shield-check.svg?url";
3439 import sidebarSimpleUrl from "@phosphor-icons/core/regular/sidebar-simple.svg?url";
3540 import signOutUrl from "@phosphor-icons/core/regular/sign-out.svg?url";
3641 import sparkleUrl from "@phosphor-icons/core/regular/sparkle.svg?url";
42+import targetUrl from "@phosphor-icons/core/regular/target.svg?url";
3743 import trashUrl from "@phosphor-icons/core/regular/trash.svg?url";
3844 import uploadSimpleUrl from "@phosphor-icons/core/regular/upload-simple.svg?url";
3945 import usersUrl from "@phosphor-icons/core/regular/users.svg?url";
4046 import warningUrl from "@phosphor-icons/core/regular/warning.svg?url";
47+import waveformUrl from "@phosphor-icons/core/regular/waveform.svg?url";
4148 import xUrl from "@phosphor-icons/core/regular/x.svg?url";
4249
4350 type IconProps = {
@@ -596,3 +603,31 @@ export function IconExternalLink(props: IconProps) {
596603 export function IconBell(props: IconProps) {
597604 return <PhosphorIcon {...props} src={bellUrl} />;
598605 }
606+
607+export function IconChalkboardTeacher(props: IconProps) {
608+ return <PhosphorIcon {...props} src={chalkboardTeacherUrl} />;
609+}
610+
611+export function IconChartPie(props: IconProps) {
612+ return <PhosphorIcon {...props} src={chartPieUrl} />;
613+}
614+
615+export function IconPackage(props: IconProps) {
616+ return <PhosphorIcon {...props} src={packageUrl} />;
617+}
618+
619+export function IconScan(props: IconProps) {
620+ return <PhosphorIcon {...props} src={scanUrl} />;
621+}
622+
623+export function IconShieldCheck(props: IconProps) {
624+ return <PhosphorIcon {...props} src={shieldCheckUrl} />;
625+}
626+
627+export function IconTarget(props: IconProps) {
628+ return <PhosphorIcon {...props} src={targetUrl} />;
629+}
630+
631+export function IconWaveform(props: IconProps) {
632+ return <PhosphorIcon {...props} src={waveformUrl} />;
633+}
src/i18n/messages.tsmodified+127 -10
@@ -258,6 +258,45 @@ export type MessageKey =
258258 | "nav.group.grades"
259259 | "nav.group.community"
260260 | "nav.group.services"
261+ | "nav.group.operations"
262+ | "nav.group.ai"
263+ | "nav.group.institution"
264+ | "nav.group.myClassroom"
265+ | "nav.group.study"
266+ | "nav.group.other"
267+ | "nav.group.myStudent"
268+ | "nav.studentsRoster"
269+ | "nav.teachersRoster"
270+ | "nav.schedule"
271+ | "nav.mySchedule"
272+ | "nav.mockExams"
273+ | "nav.opticalReading"
274+ | "nav.hezarfenZeka"
275+ | "nav.celebi"
276+ | "nav.soundStudio"
277+ | "nav.reports"
278+ | "nav.licenseModules"
279+ | "nav.dataProtection"
280+ | "nav.schoolMeals"
281+ | "nav.myClasses"
282+ | "nav.studentAnalysis"
283+ | "nav.pendingApprovals"
284+ | "nav.questionGeneration"
285+ | "nav.parentCommunication"
286+ | "nav.studyPlan"
287+ | "nav.topicMastery"
288+ | "nav.examResults"
289+ | "nav.myHomework"
290+ | "nav.progressReport"
291+ | "nav.absence"
292+ | "nav.childExamResults"
293+ | "nav.childStudyPlan"
294+ | "nav.appointmentsAndCommunication"
295+ | "nav.soon"
296+ | "comingSoon.title"
297+ | "comingSoon.description"
298+ | "comingSoon.emptyTitle"
299+ | "comingSoon.emptyDescription"
261300 | "nav.darkMode"
262301 | "rightPanel.messagesTitle"
263302 | "rightPanel.calendarTitle"
@@ -1794,9 +1833,9 @@ const en: Dict = {
17941833 "nav.pomodoro": "Pomodoro",
17951834 "nav.attendance": "Attendance",
17961835 "nav.questions": "Question pool",
1797- "nav.work": "Work log",
1836+ "nav.work": "Shift",
17981837 "nav.staffWork": "Staff shifts",
1799- "nav.users": "Users",
1838+ "nav.users": "Users & roles",
18001839 "nav.studentMarks": "Student marks",
18011840 "nav.studentAttendance": "Student attendance",
18021841 "nav.studentPomodoro": "Student pomodoros",
@@ -1820,6 +1859,45 @@ const en: Dict = {
18201859 "nav.group.grades": "Grades",
18211860 "nav.group.community": "Community",
18221861 "nav.group.services": "School services",
1862+ "nav.group.operations": "Operations",
1863+ "nav.group.ai": "AI",
1864+ "nav.group.institution": "Institution",
1865+ "nav.group.myClassroom": "My classroom",
1866+ "nav.group.study": "Study",
1867+ "nav.group.other": "Other",
1868+ "nav.group.myStudent": "My student",
1869+ "nav.studentsRoster": "Students",
1870+ "nav.teachersRoster": "Teachers",
1871+ "nav.schedule": "Class schedule",
1872+ "nav.mySchedule": "My schedule",
1873+ "nav.mockExams": "Mock exams",
1874+ "nav.opticalReading": "Optical reading",
1875+ "nav.hezarfenZeka": "Hezarfen AI",
1876+ "nav.celebi": "Çelebi",
1877+ "nav.soundStudio": "Sound studio",
1878+ "nav.reports": "Reports",
1879+ "nav.licenseModules": "License & modules",
1880+ "nav.dataProtection": "Data protection & audit",
1881+ "nav.schoolMeals": "Cafeteria management",
1882+ "nav.myClasses": "My classes",
1883+ "nav.studentAnalysis": "Student analysis",
1884+ "nav.pendingApprovals": "Pending approvals",
1885+ "nav.questionGeneration": "Question generation",
1886+ "nav.parentCommunication": "Parent communication",
1887+ "nav.studyPlan": "Study plan",
1888+ "nav.topicMastery": "Topic mastery",
1889+ "nav.examResults": "My exam results",
1890+ "nav.myHomework": "My homework",
1891+ "nav.progressReport": "Progress report",
1892+ "nav.absence": "Absence",
1893+ "nav.childExamResults": "Exam results",
1894+ "nav.childStudyPlan": "Study plan",
1895+ "nav.appointmentsAndCommunication": "Appointments & messages",
1896+ "nav.soon": "Coming soon",
1897+ "comingSoon.title": "Coming soon",
1898+ "comingSoon.description": "This module is on its way — there is nothing to show here yet.",
1899+ "comingSoon.emptyTitle": "Not available yet",
1900+ "comingSoon.emptyDescription": "This part of Hezarfen is still being built. Check back soon.",
18231901 "nav.darkMode": "Dark mode",
18241902 "parents.title": "My Students",
18251903 "parents.subtitle": "Review academic records for the students linked to your account.",
@@ -2893,9 +2971,9 @@ const en: Dict = {
28932971 "meals.editDish": "Edit dish",
28942972 "meals.dishName": "Dish name",
28952973 "meals.priceTry": "Price (TRY)",
2896- "nav.payments": "Fees",
2974+ "nav.payments": "Payments & collection",
28972975 "nav.paymentStatement": "My Fees",
2898- "nav.whiteboards": "Whiteboards",
2976+ "nav.whiteboards": "Board",
28992977 "whiteboard.title": "Whiteboards",
29002978 "whiteboard.subtitle": "Live collaborative sketch boards.",
29012979 "whiteboard.empty": "No whiteboards yet.",
@@ -3136,7 +3214,7 @@ const tr: Dict = {
31363214 "ai.skipTyping": "Cevabın tamamını göster",
31373215 "nav.today": "Bugün",
31383216 "nav.classes": "Eğitim",
3139- "nav.classGroups": "Şubeler",
3217+ "nav.classGroups": "Sınıflar",
31403218 "classGroups.title": "Şubeler",
31413219 "classGroups.subtitle": "Aynı dersleri paylaşan öğrenci grupları.",
31423220 "classGroups.newClass": "Yeni şube",
@@ -3351,9 +3429,9 @@ const tr: Dict = {
33513429 "nav.pomodoro": "Pomodoro",
33523430 "nav.attendance": "Yoklama",
33533431 "nav.questions": "Soru havuzu",
3354- "nav.work": "Çalışma kaydı",
3355- "nav.staffWork": "Personel mesaisi",
3356- "nav.users": "Kullanıcılar",
3432+ "nav.work": "Mesai",
3433+ "nav.staffWork": "Personel Mesai",
3434+ "nav.users": "Kullanıcılar ve roller",
33573435 "nav.studentMarks": "Öğrenci notları",
33583436 "nav.studentAttendance": "Öğrenci yoklamaları",
33593437 "nav.studentPomodoro": "Öğrenci pomodoroları",
@@ -3377,6 +3455,45 @@ const tr: Dict = {
33773455 "nav.group.grades": "Notlar",
33783456 "nav.group.community": "Topluluk",
33793457 "nav.group.services": "Okul hizmetleri",
3458+ "nav.group.operations": "Operasyon",
3459+ "nav.group.ai": "Yapay zekâ",
3460+ "nav.group.institution": "Kurum",
3461+ "nav.group.myClassroom": "Sınıfım",
3462+ "nav.group.study": "Çalışma",
3463+ "nav.group.other": "Diğer",
3464+ "nav.group.myStudent": "Öğrencim",
3465+ "nav.studentsRoster": "Öğrenciler",
3466+ "nav.teachersRoster": "Öğretmenler",
3467+ "nav.schedule": "Ders programı",
3468+ "nav.mySchedule": "Ders programım",
3469+ "nav.mockExams": "Deneme sınavları",
3470+ "nav.opticalReading": "Optik okuma",
3471+ "nav.hezarfenZeka": "Hezarfen Zekâ",
3472+ "nav.celebi": "Çelebi",
3473+ "nav.soundStudio": "Ses Atölyesi",
3474+ "nav.reports": "Raporlar",
3475+ "nav.licenseModules": "Lisans ve modüller",
3476+ "nav.dataProtection": "KVKK ve denetim",
3477+ "nav.schoolMeals": "Yemekhane Yönetimi",
3478+ "nav.myClasses": "Sınıflarım",
3479+ "nav.studentAnalysis": "Öğrenci analizi",
3480+ "nav.pendingApprovals": "Bekleyen onaylar",
3481+ "nav.questionGeneration": "Soru üretimi",
3482+ "nav.parentCommunication": "Veli iletişimi",
3483+ "nav.studyPlan": "Çalışma programım",
3484+ "nav.topicMastery": "Konu yetkinliğim",
3485+ "nav.examResults": "Sınav sonuçlarım",
3486+ "nav.myHomework": "Ödevlerim",
3487+ "nav.progressReport": "Gelişim raporu",
3488+ "nav.absence": "Devamsızlık",
3489+ "nav.childExamResults": "Sınav sonuçları",
3490+ "nav.childStudyPlan": "Çalışma planı",
3491+ "nav.appointmentsAndCommunication": "Randevu ve iletişim",
3492+ "nav.soon": "Yakında",
3493+ "comingSoon.title": "Yakında",
3494+ "comingSoon.description": "Bu modül hazırlanıyor — henüz gösterecek bir şey yok.",
3495+ "comingSoon.emptyTitle": "Henüz kullanıma açık değil",
3496+ "comingSoon.emptyDescription": "Hezarfen'in bu bölümü hâlâ hazırlanıyor. Yakında tekrar bakın.",
33803497 "nav.darkMode": "Karanlık mod",
33813498 "parents.title": "Öğrencilerim",
33823499 "parents.subtitle": "Size bağlı öğrencilerin akademik kayıtlarını inceleyin.",
@@ -4450,9 +4567,9 @@ const tr: Dict = {
44504567 "meals.editDish": "Yemeği düzenle",
44514568 "meals.dishName": "Yemek adı",
44524569 "meals.priceTry": "Fiyat (TRY)",
4453- "nav.payments": "Ücretler",
4570+ "nav.payments": "Ödeme ve tahsilat",
44544571 "nav.paymentStatement": "Ücretlerim",
4455- "nav.whiteboards": "Beyaz tahtalar",
4572+ "nav.whiteboards": "Tahta",
44564573 "whiteboard.title": "Beyaz tahtalar",
44574574 "whiteboard.subtitle": "Canlı ortak çizim tahtaları.",
44584575 "whiteboard.empty": "Henüz beyaz tahta yok.",
src/pages/coming-soon-page.tsxadded+58 -0
@@ -0,0 +1,58 @@
1+import { useLocation } from "@tanstack/solid-router";
2+import { RouteGuard } from "@/components/layout/route-guard";
3+import { PageHeader } from "@/components/layout/page-header";
4+import { EmptyState } from "@/components/ui/empty-state";
5+import type { MessageKey } from "@/i18n/messages";
6+import { useT } from "@/stores/preferences-context";
7+
8+/**
9+ * One route per not-yet-built module (see router.tsx's comingSoonRoutes) so
10+ * each has its own URL, breadcrumb and back-button target, but they all
11+ * render this same "not ready yet" page. The label comes from the last path
12+ * segment, kept in step with COMING_SOON_LABELS below and with the matching
13+ * sidebar entry's own labelKey in nav-items.ts.
14+ */
15+const COMING_SOON_LABELS: Record<string, MessageKey> = {
16+ "hezarfen-zeka": "nav.hezarfenZeka",
17+ "ses-atolyesi": "nav.soundStudio",
18+ "deneme-sinavlari": "nav.mockExams",
19+ "optik-okuma": "nav.opticalReading",
20+ raporlar: "nav.reports",
21+ "lisans-modulleri": "nav.licenseModules",
22+ "kvkk-denetim": "nav.dataProtection",
23+ ogrenciler: "nav.studentsRoster",
24+ ogretmenler: "nav.teachersRoster",
25+ "ogrenci-analizi": "nav.studentAnalysis",
26+ "bekleyen-onaylar": "nav.pendingApprovals",
27+ "soru-uretimi": "nav.questionGeneration",
28+ "calisma-programim": "nav.studyPlan",
29+ devamsizlik: "nav.absence",
30+ "sinav-sonuclari-veli": "nav.childExamResults",
31+ "calisma-plani": "nav.childStudyPlan",
32+};
33+
34+export default function ComingSoonPage() {
35+ return (
36+ <RouteGuard>
37+ <ComingSoonContent />
38+ </RouteGuard>
39+ );
40+}
41+
42+function ComingSoonContent() {
43+ const t = useT();
44+ const location = useLocation();
45+ const slug = () => location().pathname.split("/").filter(Boolean).pop() ?? "";
46+ const labelKey = () => COMING_SOON_LABELS[slug()];
47+ const title = () => {
48+ const key = labelKey();
49+ return key ? t(key) : t("comingSoon.title");
50+ };
51+
52+ return (
53+ <div class="space-y-6">
54+ <PageHeader title={title()} description={t("comingSoon.description")} />
55+ <EmptyState title={t("comingSoon.emptyTitle")} description={t("comingSoon.emptyDescription")} />
56+ </div>
57+ );
58+}
src/routes/router.tsxmodified+32 -0
@@ -66,6 +66,7 @@ const ProfilePage = lazyRoute(() => import("@/pages/profile-page"));
6666 const PaymentStatementPage = lazyRoute(() => import("@/pages/payment-statement-page"));
6767 const WhiteboardsPage = lazyRoute(() => import("@/pages/whiteboards-page"));
6868 const WhiteboardPage = lazyRoute(() => import("@/pages/whiteboard-page"));
69+const ComingSoonPage = lazyRoute(() => import("@/pages/coming-soon-page"));
6970
7071 function RootComponent() {
7172 return (
@@ -396,6 +397,36 @@ const whiteboardRoute = createRoute({
396397 component: WhiteboardPage,
397398 });
398399
400+// One route per Figma menu entry with no backend yet — each gets its own URL
401+// (so breadcrumbs, back and direct links behave normally) but all render the
402+// same "not ready" page. Slugs are read back by coming-soon-page.tsx.
403+const COMING_SOON_SLUGS = [
404+ "hezarfen-zeka",
405+ "ses-atolyesi",
406+ "deneme-sinavlari",
407+ "optik-okuma",
408+ "raporlar",
409+ "lisans-modulleri",
410+ "kvkk-denetim",
411+ "ogrenciler",
412+ "ogretmenler",
413+ "ogrenci-analizi",
414+ "bekleyen-onaylar",
415+ "soru-uretimi",
416+ "calisma-programim",
417+ "devamsizlik",
418+ "sinav-sonuclari-veli",
419+ "calisma-plani",
420+] as const;
421+
422+const comingSoonRoutes = COMING_SOON_SLUGS.map((slug) =>
423+ createRoute({
424+ getParentRoute: () => rootRoute,
425+ path: `/coming-soon/${slug}`,
426+ component: ComingSoonPage,
427+ }),
428+);
429+
399430 const routeTree = rootRoute.addChildren([
400431 indexRoute,
401432 loginRoute,
@@ -445,6 +476,7 @@ const routeTree = rootRoute.addChildren([
445476 whiteboardRoute,
446477 myProfileRoute,
447478 userProfileRoute,
479+ ...comingSoonRoutes,
448480 ]);
449481
450482 function RouterPending() {