forge
Explore
Log in

Don't you dare go Hollow

Merge branch 'fix/figma-parity' into dev

Browse files at this commit

ecd47c4539acc9c4016e9a444878bd3f86caac80Burak BoduroğluParent: d19a43d7fe966e
- staff meal detail crash and whiteboard roster names
- Figma coverage for exam room, live monitor, whiteboard, meal detail,
  user profile and the app login
docs/ui/figma-migration-coverage.mdmodified+10 -6
@@ -39,6 +39,10 @@ badge). Each screen overrides only its open group and active row. When the
39 nav tree changes in code, update the sidebar component, not individual39 nav tree changes in code, update the sidebar component, not individual
40 screens. `Web / Switch` (Off/On) backs module and review toggles.40 screens. `Web / Switch` (Off/On) backs module and review toggles.
41 41
42+Color variables `brand/default`, `brand/hover`, `brand/accent`, `text/link`
43+and `border/focus` carry the app's values (#00ADD8 brand, #046B86 light
44+focus ring), so Figma and the app no longer differ on the brand color.
45+
42 The shell matches the app too: `Web / Sidebar / *` is full height with the46 The shell matches the app too: `Web / Sidebar / *` is full height with the
43 `Brand / Logo Mark` row on top and the account row at the bottom, and47 `Brand / Logo Mark` row on top and the account row at the bottom, and
44 `Web / Top Bar` is the 1180px content header (back, route label, command48 `Web / Top Bar` is the 1180px content header (back, route label, command
@@ -69,7 +73,7 @@ were swapped for these component instances; their content is raw layers.
69 | Route | Figma coverage | Migration rule |73 | Route | Figma coverage | Migration rule |
70 |---|---|---|74 |---|---|---|
71 | `/` | Admin, teacher, student, parent dashboards | Restyle role branches; keep read-only, API-backed data |75 | `/` | Admin, teacher, student, parent dashboards | Restyle role branches; keep read-only, API-backed data |
72-| `/login` | SYS-01 | Visual migration; keep current auth contract |76+| `/login` | SYS-01 Giriş | Captured from the running app; the earlier e-mail/SSO design lives on the `90 Arşiv` page |
73 | `/courses`, `/courses/:id` | Teacher/student classes and mobile lessons | Reuse current course/enrollment behavior |77 | `/courses`, `/courses/:id` | Teacher/student classes and mobile lessons | Reuse current course/enrollment behavior |
74 | `/homework`, `/homework/:id` | Teacher/student homework | Reuse DataTable, submissions, files, and role gates |78 | `/homework`, `/homework/:id` | Teacher/student homework | Reuse DataTable, submissions, files, and role gates |
75 | `/exams`, `/exams/:id` | Admin/teacher/student exams and results | Keep draft/publish, attempts, grading, and statistics gates |79 | `/exams`, `/exams/:id` | Admin/teacher/student exams and results | Keep draft/publish, attempts, grading, and statistics gates |
@@ -100,6 +104,11 @@ were swapped for these component instances; their content is raw layers.
100 | `/questions`, `/questions/:id` | TCH-15 Soru Havuzu, STU-13 Soru Detayı | Captured from the running app |104 | `/questions`, `/questions/:id` | TCH-15 Soru Havuzu, STU-13 Soru Detayı | Captured from the running app |
101 | `/notes` | STU-12 Defter | Captured from the running app |105 | `/notes` | STU-12 Defter | Captured from the running app |
102 | `/guide`, `/profile/me`, `/register` | SYS-08 Rehber, SYS-09 Profilim, SYS-10 Kayıt Ol | Captured from the running app |106 | `/guide`, `/profile/me`, `/register` | SYS-08 Rehber, SYS-09 Profilim, SYS-10 Kayıt Ol | Captured from the running app |
107+| `/exam-room/:id` | STU-14 Sınav Odası | Captured from the running app (attempt in progress) |
108+| `/exams/:id/live` | TCH-16 Canlı Sınav İzleme | Captured from the running app |
109+| `/whiteboards/:id` | TCH-17 Tahta Çizim Ekranı | Captured from the running app |
110+| `/meals/:id` | ADM-28 Yemek Menüsü Detayı | Captured from the running app (staff view) |
111+| `/profile/:userId` | ADM-29 Kullanıcı Profili | Captured from the running app |
103 | `/builder/login` | BLD-01 Operatör Girişi | Builder session only; linked from the SYS-01/login footer |112 | `/builder/login` | BLD-01 Operatör Girişi | Builder session only; linked from the SYS-01/login footer |
104 | `/builder` | BLD-02 Okullar, BLD-02a Yeni Okul | Create, suspend/activate, delete |113 | `/builder` | BLD-02 Okullar, BLD-02a Yeni Okul | Create, suspend/activate, delete |
105 | `/builder/schools/:slug` | BLD-03 Okul Detayı, BLD-03a Okula Gir | Module switchboard, password reset, enter as admin |114 | `/builder/schools/:slug` | BLD-03 Okul Detayı, BLD-03a Okula Gir | Module switchboard, password reset, enter as admin |
@@ -128,12 +137,7 @@ false actions:
128 137
129 Keep the current UI and behavior until a specific design is added:138 Keep the current UI and behavior until a specific design is added:
130 139
131-- `/profile/:userId` (another user's profile)
132-- `/exam-room/:id`
133-- `/exams/:id/live`
134-- `/whiteboards/:id` live canvas details beyond the list concept
135 - `/students/attendance`, `/students/exams`, `/students/study` parent tab routes140 - `/students/attendance`, `/students/exams`, `/students/study` parent tab routes
136-- `/meals/:id` detailed account/service/management tabs
137 - `/studies`, `/clubs`, and `/attendance` redirect aliases141 - `/studies`, `/clubs`, and `/attendance` redirect aliases
138 142
139 ## Asset policy143 ## Asset policy
src/pages/meal-detail-page.tsxmodified+4 -2
@@ -95,7 +95,9 @@ function MealDetailContent() {
95 createEffect(() => {95 createEffect(() => {
96 if (isParent() && !selectedStudent() && children()?.items[0]) setSelectedStudent(children()!.items[0].id);96 if (isParent() && !selectedStudent() && children()?.items[0]) setSelectedStudent(children()!.items[0].id);
97 });97 });
98- const targetId = () => isStudent() ? auth.user()!.id : isParent() ? selectedStudent() : lookupStudent();98+ // null, not "", until a student is chosen: createResource still fetches on an
99+ // empty-string source, and `/meals/profiles/` 404s the whole page for staff.
100+ const targetId = () => (isStudent() ? auth.user()!.id : isParent() ? selectedStudent() : lookupStudent()) || null;
99 const canBook = () => (isStudent() || isParent()) && !!targetId();101 const canBook = () => (isStudent() || isParent()) && !!targetId();
100 102
101 const [bookings, { refetch: refetchBookings }] = createResource(() => canBook(), async (enabled) => enabled ? getMyMealBookings({ limit: 100 }) : null);103 const [bookings, { refetch: refetchBookings }] = createResource(() => canBook(), async (enabled) => enabled ? getMyMealBookings({ limit: 100 }) : null);
@@ -229,7 +231,7 @@ function MealDetailContent() {
229 <Show when={canBook()}>231 <Show when={canBook()}>
230 <div class="data-shell flex flex-wrap items-center justify-between gap-3 p-4">232 <div class="data-shell flex flex-wrap items-center justify-between gap-3 p-4">
231 <div><p class="font-semibold">{activeBooking() ? t("meals.booked") : t("meals.notBooked")}</p><p class="text-sm text-muted-foreground">{cutoffClosed() ? t("meals.cutoffPassed") : t("meals.bookingHelp")}</p></div>233 <div><p class="font-semibold">{activeBooking() ? t("meals.booked") : t("meals.notBooked")}</p><p class="text-sm text-muted-foreground">{cutoffClosed() ? t("meals.cutoffPassed") : t("meals.bookingHelp")}</p></div>
232- <Show when={activeBooking()} fallback={<Button disabled={pending() || cutoffClosed()} onClick={() => void run(async () => { await postMealBooking(id(), isParent() ? targetId() : undefined); await Promise.all([refetchBookings(), refetchBalance(), refetchLedger()]); }, t("meals.booked"))}>{t("meals.book")}</Button>}><Button variant="destructive" disabled={pending() || cutoffClosed()} onClick={() => setCancelOpen(true)}>{t("meals.cancelBooking")}</Button></Show>234+ <Show when={activeBooking()} fallback={<Button disabled={pending() || cutoffClosed()} onClick={() => void run(async () => { await postMealBooking(id(), isParent() ? targetId() ?? undefined : undefined); await Promise.all([refetchBookings(), refetchBalance(), refetchLedger()]); }, t("meals.booked"))}>{t("meals.book")}</Button>}><Button variant="destructive" disabled={pending() || cutoffClosed()} onClick={() => setCancelOpen(true)}>{t("meals.cancelBooking")}</Button></Show>
233 </div>235 </div>
234 </Show>236 </Show>
235 </TabsContent>237 </TabsContent>
src/pages/whiteboard-page.tsxmodified+25 -3
@@ -9,7 +9,7 @@ import {
9 postBoardClear,9 postBoardClear,
10 postBoardClose,10 postBoardClose,
11 } from "@/api/boards";11 } from "@/api/boards";
12-import { getUsers } from "@/api/users";12+import { getUserProfile, getUsers } from "@/api/users";
13 import { formatApiError } from "@/api/client";13 import { formatApiError } from "@/api/client";
14 import type { MessageKey } from "@/i18n/messages";14 import type { MessageKey } from "@/i18n/messages";
15 import { WhiteboardRoom, type BoardLiveState } from "@/components/whiteboard/whiteboard-room-ws";15 import { WhiteboardRoom, type BoardLiveState } from "@/components/whiteboard/whiteboard-room-ws";
@@ -116,12 +116,13 @@ function WhiteboardContent() {
116 if (me) return [me.name, me.surname].filter(Boolean).join(" ") || me.username;116 if (me) return [me.name, me.surname].filter(Boolean).join(" ") || me.username;
117 }117 }
118 const u = (users() ?? []).find((x) => x.id === userId);118 const u = (users() ?? []).find((x) => x.id === userId);
119- if (!u) return userId;119+ if (!u) return profiles.latest?.get(userId)?.name ?? userId;
120 return [u.name, u.surname].filter(Boolean).join(" ") || u.username;120 return [u.name, u.surname].filter(Boolean).join(" ") || u.username;
121 };121 };
122 const roleOf = (userId: string) => {122 const roleOf = (userId: string) => {
123 const u = (users() ?? []).find((x) => x.id === userId);123 const u = (users() ?? []).find((x) => x.id === userId);
124- return u ? t(`role.${u.role}` as MessageKey) : "";124+ const role = u?.role ?? profiles.latest?.get(userId)?.role ?? (userId === meId() ? auth.user()?.role : undefined);
125+ return role ? t(`role.${role}` as MessageKey) : "";
125 };126 };
126 const roster = () => {127 const roster = () => {
127 const creator = live().creator;128 const creator = live().creator;
@@ -130,6 +131,27 @@ function WhiteboardContent() {
130 };131 };
131 const isParticipant = () => roster().includes(meId());132 const isParticipant = () => roster().includes(meId());
132 133
134+ // Below admin, resolve each roster id through its public profile — any
135+ // signed-in account may read one (a parent only their linked students; the
136+ // rest 403 and keep the id). The roster is small and capped by the backend.
137+ const [profiles] = createResource(
138+ () => (isAdmin() ? null : roster().filter((userId) => userId !== meId()).sort().join(",") || null),
139+ async (key) => {
140+ const entries = await Promise.all(
141+ key.split(",").map(async (userId) => {
142+ try {
143+ const p = await getUserProfile(userId);
144+ return [userId, { name: p.display_name || p.username, role: p.role }] as const;
145+ } catch {
146+ return null;
147+ }
148+ }),
149+ );
150+ return new Map(entries.filter((entry) => entry !== null));
151+ },
152+ );
153+
154+
133 const [error, setError] = createSignal("");155 const [error, setError] = createSignal("");
134 const [busy, setBusy] = createSignal(false);156 const [busy, setBusy] = createSignal(false);
135 const [clearOpen, setClearOpen] = createSignal(false);157 const [clearOpen, setClearOpen] = createSignal(false);