forge
Explore
Log in

Don't you dare go Hollow

✅ student pomodoro lookup, admin user prefs, missing GET wrappers

Browse files at this commit

cbcc77f84a9b72edd98afb36af6b290054b94568Burak BoduroğluParent: 8d7909b
  • feat
    • ✅ student pomodoro lookup, admin user prefs, missing GET wrappers
Show full message
feat: ✅ student pomodoro lookup, admin user prefs, missing GET wrappers

- student-pomodoro-page: teacher/manager selects student from DataTable,
  views pomodoro log in side panel with total focus time + session table
- getPomodoroByUser API + route + side-nav + dashboard card
- patchUserPreferences API + UserPreferencesActions: admin edits any
  user theme/language inline in users table
- missing single-resource GET wrappers: getSessionById, getSubjectById,
  getTermById (used in detail pages)
- fix: dashboard portal order resets when card set changes
- i18n: nav.studentPomodoro, pomodoro.lookup, pomodoro.forUser
src/api/getPomodoroByUser.tsadded+7 -0
@@ -0,0 +1,7 @@
1+import { client } from "./client";
2+import { pageQuery, type PageParams } from "./page";
3+import type { PomodoroLog } from "./types";
4+
5+export function getPomodoroByUser(userId: string, params?: PageParams, signal?: AbortSignal): Promise<PomodoroLog> {
6+ return client<PomodoroLog>(`/pomodoro/${userId}${pageQuery(params)}`, { signal });
7+}
src/api/getSessionById.tsadded+6 -0
@@ -0,0 +1,6 @@
1+import { client } from "./client";
2+import type { CourseSession } from "./types";
3+
4+export function getSessionById(id: string, signal?: AbortSignal): Promise<CourseSession> {
5+ return client<CourseSession>(`/sessions/${id}`, { signal });
6+}
src/api/getSubjectById.tsadded+6 -0
@@ -0,0 +1,6 @@
1+import { client } from "./client";
2+import type { Subject } from "./types";
3+
4+export function getSubjectById(id: string, signal?: AbortSignal): Promise<Subject> {
5+ return client<Subject>(`/subjects/${id}`, { signal });
6+}
src/api/getTermById.tsadded+6 -0
@@ -0,0 +1,6 @@
1+import { client } from "./client";
2+import type { Term } from "./types";
3+
4+export function getTermById(id: string, signal?: AbortSignal): Promise<Term> {
5+ return client<Term>(`/terms/${id}`, { signal });
6+}
src/api/patchUserPreferences.tsadded+14 -0
@@ -0,0 +1,14 @@
1+import { client } from "./client";
2+import type { User, UserLanguage, UserTheme } from "./types";
3+
4+export type PatchUserPreferencesBody = {
5+ theme?: UserTheme | null;
6+ language?: UserLanguage | null;
7+};
8+
9+export function patchUserPreferences(id: string, body: PatchUserPreferencesBody): Promise<User> {
10+ return client<User>(`/users/${id}/preferences`, {
11+ method: "PATCH",
12+ body,
13+ });
14+}
src/components/layout/app-shell.tsxmodified+1 -0
@@ -43,6 +43,7 @@ export function AppShell(props: ParentProps) {
4343 if (path === "/work") return `${t("nav.group.reports")} / ${t("nav.work")}`;
4444 if (path === "/management/student-marks") return `${t("nav.group.reports")} / ${t("nav.studentMarks")}`;
4545 if (path === "/management/student-attendance") return `${t("nav.group.reports")} / ${t("nav.studentAttendance")}`;
46+ if (path === "/management/pomodoros") return `${t("nav.group.reports")} / ${t("nav.studentPomodoro")}`;
4647 if (path === "/management/staff-work") return `${t("nav.group.reports")} / ${t("nav.staffWork")}`;
4748 if (path === "/management/settings") return `${t("nav.group.settings")} / ${t("nav.settings")}`;
4849 if (path === "/management/terms") return `${t("nav.group.settings")} / ${t("nav.terms")}`;
src/components/layout/side-nav.tsxmodified+1 -0
@@ -85,6 +85,7 @@ const NAV_GROUPS: NavGroup[] = [
8585 items: [
8686 { to: "/management/student-marks", labelKey: "nav.studentMarks", Icon: IconChart, minRole: "teacher" },
8787 { to: "/management/student-attendance", labelKey: "nav.studentAttendance", Icon: IconClipboardCheck, minRole: "teacher" },
88+ { to: "/management/pomodoros", labelKey: "nav.studentPomodoro", Icon: IconClock, minRole: "teacher" },
8889 { to: "/work", labelKey: "nav.work", Icon: IconBriefcase, minRole: "teacher", maxRole: "manager" },
8990 { to: "/management/staff-work", labelKey: "nav.staffWork", Icon: IconBriefcase, minRole: "manager" },
9091 ],
src/components/users/user-preferences-actions.tsxadded+39 -0
@@ -0,0 +1,39 @@
1+import { Show, createSignal } from "solid-js";
2+import type { User, UserLanguage, UserTheme } from "@/api/types";
3+import { Button } from "@/components/ui/button";
4+import { IconCheck } from "@/components/ui/icons";
5+import { Select } from "@/components/ui/select";
6+import { useT } from "@/stores/preferences-context";
7+
8+export function UserPreferencesActions(props: {
9+ user: User;
10+ onPreferencesChange: (userId: string, body: { theme?: UserTheme | null; language?: UserLanguage | null }) => Promise<void>;
11+}) {
12+ const t = useT();
13+ const [theme, setTheme] = createSignal<UserTheme | "">(props.user.theme ?? "");
14+ const [language, setLanguage] = createSignal<UserLanguage | "">(props.user.language ?? "");
15+ const dirty = () => theme() !== (props.user.theme ?? "") || language() !== (props.user.language ?? "");
16+
17+ return (
18+ <div class="grid gap-2">
19+ <div class="grid grid-cols-2 gap-2">
20+ <Select class="h-8 rounded-sm text-xs" value={theme()} aria-label={t("theme.toggle")} onChange={(e) => setTheme(e.currentTarget.value as UserTheme | "")}>
21+ <option value="">—</option>
22+ <option value="light">{t("theme.light")}</option>
23+ <option value="dark">{t("theme.dark")}</option>
24+ </Select>
25+ <Select class="h-8 rounded-sm text-xs" value={language()} aria-label={t("lang.label")} onChange={(e) => setLanguage(e.currentTarget.value as UserLanguage | "")}>
26+ <option value="">—</option>
27+ <option value="tr">{t("lang.tr")}</option>
28+ <option value="en">{t("lang.en")}</option>
29+ </Select>
30+ </div>
31+ <Show when={dirty()}>
32+ <Button type="button" size="sm" class="h-7 rounded-sm px-2" onClick={() => props.onPreferencesChange(props.user.id, { theme: theme() || null, language: language() || null })}>
33+ <IconCheck />
34+ {t("common.save")}
35+ </Button>
36+ </Show>
37+ </div>
38+ );
39+}
src/components/users/user-table.tsxmodified+12 -2
@@ -1,6 +1,6 @@
11 import { createMemo, createSignal, Show } from "solid-js";
22 import type { ColumnDef } from "@tanstack/solid-table";
3-import type { Role, User } from "@/api/types";
3+import type { Role, User, UserLanguage, UserTheme } from "@/api/types";
44 import type { MessageKey } from "@/i18n/messages";
55 import { Select } from "@/components/ui/select";
66 import { Button } from "@/components/ui/button";
@@ -8,6 +8,7 @@ import { Badge } from "@/components/ui/badge";
88 import { ConfirmDialog } from "@/components/ui/confirm-dialog";
99 import { DataTable } from "@/components/ui/data-table";
1010 import { IconCheck } from "@/components/ui/icons";
11+import { UserPreferencesActions } from "@/components/users/user-preferences-actions";
1112 import { ROLES } from "@/lib/roles";
1213 import { cn } from "@/lib/cn";
1314 import { useT } from "@/stores/preferences-context";
@@ -74,6 +75,7 @@ export function UserTable(props: {
7475 users: User[];
7576 currentUserId: string;
7677 onRoleChange: (userId: string, role: Role) => Promise<void>;
78+ onPreferencesChange?: (userId: string, body: { theme?: UserTheme | null; language?: UserLanguage | null }) => Promise<void>;
7779 }) {
7880 const t = useT();
7981 const searchUser = (user: User, query: string) =>
@@ -114,6 +116,14 @@ export function UserTable(props: {
114116 header: t("admin.id"),
115117 meta: { cellClass: "mono truncate text-xs text-muted-foreground" },
116118 },
119+ {
120+ id: "preferences",
121+ header: t("nav.preferences"),
122+ meta: { headerClass: "w-56", cellClass: "w-56" },
123+ cell: (cell) => props.onPreferencesChange
124+ ? <UserPreferencesActions user={cell.row.original} onPreferencesChange={props.onPreferencesChange} />
125+ : "—",
126+ },
117127 {
118128 id: "update",
119129 header: t("common.update"),
@@ -125,6 +135,6 @@ export function UserTable(props: {
125135 ]);
126136
127137 return (
128- <DataTable columns={columns()} data={props.users} tableClass="table-fixed min-w-[58rem]" searchPredicate={searchUser} enablePagination pageSize={20} />
138+ <DataTable columns={columns()} data={props.users} tableClass="table-fixed min-w-[70rem]" searchPredicate={searchUser} enablePagination pageSize={20} />
129139 );
130140 }
src/i18n/messages.tsmodified+10 -1
@@ -26,6 +26,7 @@ export type MessageKey =
2626 | "nav.users"
2727 | "nav.studentMarks"
2828 | "nav.studentAttendance"
29+ | "nav.studentPomodoro"
2930 | "nav.settings"
3031 | "nav.terms"
3132 | "nav.guide"
@@ -344,6 +345,8 @@ export type MessageKey =
344345 | "pomodoro.finished"
345346 | "pomodoro.history"
346347 | "pomodoro.empty"
348+ | "pomodoro.lookup"
349+ | "pomodoro.forUser"
347350 | "pomodoro.startedAt"
348351 | "pomodoro.finishedAt"
349352 | "pomodoro.duration"
@@ -630,6 +633,7 @@ const en: Dict = {
630633 "nav.users": "Users",
631634 "nav.studentMarks": "Student marks",
632635 "nav.studentAttendance": "Student attendance",
636+ "nav.studentPomodoro": "Pomodoros",
633637 "nav.settings": "Settings",
634638 "nav.terms": "Terms",
635639 "nav.guide": "Guide",
@@ -950,6 +954,8 @@ const en: Dict = {
950954 "pomodoro.finished": "Focus session finished.",
951955 "pomodoro.history": "Recent sessions",
952956 "pomodoro.empty": "No focus sessions yet.",
957+ "pomodoro.lookup": "Select a student to review their pomodoro focus history.",
958+ "pomodoro.forUser": "Pomodoros for {user}",
953959 "pomodoro.startedAt": "Started",
954960 "pomodoro.finishedAt": "Finished",
955961 "pomodoro.duration": "Duration",
@@ -1231,7 +1237,7 @@ const tr: Dict = {
12311237 "ai.send": "Gönder",
12321238 "ai.unavailable": "Çelebi henüz bağlı değil. Gerçek yanıtlar için backend AI endpoint’i gerekli.",
12331239 "nav.home": "Ana sayfa",
1234- "nav.notes": "Notlar",
1240+ "nav.notes": "Defter",
12351241 "nav.events": "Etkinlikler",
12361242 "nav.exams": "Sınavlar",
12371243 "nav.courses": "Ders",
@@ -1246,6 +1252,7 @@ const tr: Dict = {
12461252 "nav.users": "Kullanıcılar",
12471253 "nav.studentMarks": "Notlar",
12481254 "nav.studentAttendance": "Yoklamalar",
1255+ "nav.studentPomodoro": "Pomodorolar",
12491256 "nav.settings": "Ayarlar",
12501257 "nav.terms": "Dönemler",
12511258 "nav.guide": "Rehber",
@@ -1566,6 +1573,8 @@ const tr: Dict = {
15661573 "pomodoro.finished": "Odak oturumu bitti.",
15671574 "pomodoro.history": "Son oturumlar",
15681575 "pomodoro.empty": "Henüz odak oturumu yok.",
1576+ "pomodoro.lookup": "Öğrencinin pomodoro odak geçmişini görmek için öğrenci seç.",
1577+ "pomodoro.forUser": "{user} için pomodorolar",
15691578 "pomodoro.startedAt": "Başlangıç",
15701579 "pomodoro.finishedAt": "Bitiş",
15711580 "pomodoro.duration": "Süre",
src/pages/admin-users-page.tsxmodified+14 -2
@@ -1,8 +1,9 @@
11 import { For, Show, Suspense, createResource, createSignal } from "solid-js";
22 import { getUsers } from "@/api/getUsers";
3+import { patchUserPreferences } from "@/api/patchUserPreferences";
34 import { patchUserRole } from "@/api/patchUserRole";
45 import { formatApiError } from "@/api/client";
5-import type { Role, User } from "@/api/types";
6+import type { Role, User, UserLanguage, UserTheme } from "@/api/types";
67 import { RouteGuard } from "@/components/layout/route-guard";
78 import { PageHeader } from "@/components/layout/page-header";
89 import { UserTable } from "@/components/users/user-table";
@@ -45,6 +46,17 @@ function AdminUsersContent() {
4546 }
4647 };
4748
49+ const onPreferencesChange = async (userId: string, body: { theme?: UserTheme | null; language?: UserLanguage | null }) => {
50+ setError("");
51+ try {
52+ await patchUserPreferences(userId, body);
53+ await refetch();
54+ setFlash(t("common.saved"));
55+ } catch (err) {
56+ setError(formatApiError(err));
57+ }
58+ };
59+
4860 return (
4961 <div class="space-y-6">
5062 <div class="space-y-2">
@@ -76,7 +88,7 @@ function AdminUsersContent() {
7688 <Suspense fallback={<DataTableSkeleton columns={6} rows={8} />}>
7789 <Show when={list()}>
7890 <Show when={visibleUsers().length > 0} fallback={<DataTableEmpty>{t("admin.noUsers")}</DataTableEmpty>}>
79- <UserTable users={visibleUsers() as User[]} currentUserId={auth.user()!.id} onRoleChange={onRoleChange} />
91+ <UserTable users={visibleUsers() as User[]} currentUserId={auth.user()!.id} onRoleChange={onRoleChange} onPreferencesChange={onPreferencesChange} />
8092 </Show>
8193 </Show>
8294 </Suspense>
src/pages/dashboard-page.tsxmodified+5 -2
@@ -216,8 +216,9 @@ function DashboardContent() {
216216 { Icon: IconCalendar, titleKey: "nav.events", to: "/events", descKey: "dashboard.portal.eventsDesc", stat: evc, minRole: "teacher" },
217217 { Icon: IconChart, titleKey: "nav.studentMarks", to: "/management/student-marks", descKey: "dashboard.portal.studentMarksDesc", minRole: "teacher" },
218218 { Icon: IconClipboardCheck, titleKey: "nav.studentAttendance", to: "/management/student-attendance", descKey: "dashboard.portal.attendanceDesc", minRole: "teacher" },
219- { Icon: IconNote, titleKey: "nav.notes", to: "/notes", descKey: "dashboard.portal.notesDesc", stat: nc },
219+ { Icon: IconClock, titleKey: "nav.studentPomodoro", to: "/management/pomodoros", descKey: "dashboard.portal.pomodoroDesc", minRole: "teacher" },
220220 { Icon: IconBriefcase, titleKey: "nav.work", to: "/work", descKey: "dashboard.portal.workDesc", minRole: "teacher" },
221+ { Icon: IconNote, titleKey: "nav.notes", to: "/notes", descKey: "dashboard.portal.notesDesc", stat: nc },
221222 );
222223 return list;
223224 }
@@ -229,9 +230,10 @@ function DashboardContent() {
229230 { Icon: IconUsers, titleKey: "nav.clubs", to: "/clubs", descKey: "dashboard.portal.clubsDesc", stat: clc },
230231 { Icon: IconExam, titleKey: "nav.exams", to: "/exams", descKey: "dashboard.portal.examsDesc", stat: ec },
231232 { Icon: IconCalendar, titleKey: "nav.events", to: "/events", descKey: "dashboard.portal.eventsDesc", stat: evc },
232- { Icon: IconNote, titleKey: "nav.notes", to: "/notes", descKey: "dashboard.portal.notesDesc", stat: nc },
233233 { Icon: IconChart, titleKey: "nav.studentMarks", to: "/management/student-marks", descKey: "dashboard.portal.studentMarksDesc", minRole: "teacher" },
234234 { Icon: IconClipboardCheck, titleKey: "nav.studentAttendance", to: "/management/student-attendance", descKey: "dashboard.portal.attendanceDesc", minRole: "teacher" },
235+ { Icon: IconClock, titleKey: "nav.studentPomodoro", to: "/management/pomodoros", descKey: "dashboard.portal.pomodoroDesc", minRole: "teacher" },
236+ { Icon: IconNote, titleKey: "nav.notes", to: "/notes", descKey: "dashboard.portal.notesDesc", stat: nc },
235237 { Icon: IconSettings, titleKey: "nav.settings", to: "/management/settings", descKey: "dashboard.portal.settingsDesc", minRole: "manager" },
236238 { Icon: IconCalendarDays, titleKey: "nav.terms", to: "/management/terms", descKey: "dashboard.portal.termsDesc", minRole: "manager" },
237239 );
@@ -248,6 +250,7 @@ function DashboardContent() {
248250 const orderedPortalCards = createMemo(() => {
249251 const cards = portalCards();
250252 const byId = new Map(cards.map((card) => [card.to, card]));
253+ if (portalOrder().some((id) => !byId.has(id)) || portalOrder().length !== cards.length) return cards;
251254 const ordered = portalOrder().flatMap((id) => byId.get(id) ? [byId.get(id)!] : []);
252255 const seen = new Set(ordered.map((card) => card.to));
253256 return [...ordered, ...cards.filter((card) => !seen.has(card.to))];
src/pages/student-pomodoro-page.tsxadded+190 -0
@@ -0,0 +1,190 @@
1+import { Show, createMemo, createResource, createSignal } from "solid-js";
2+import type { ColumnDef } from "@tanstack/solid-table";
3+import { getPomodoroByUser } from "@/api/getPomodoroByUser";
4+import { getUserSearch } from "@/api/getUserSearch";
5+import type { PersonRef, PomodoroSession } from "@/api/types";
6+import { ApiError, formatApiError } from "@/api/client";
7+import { RouteGuard } from "@/components/layout/route-guard";
8+import { PageHeader } from "@/components/layout/page-header";
9+import { Alert } from "@/components/ui/alert";
10+import { DataTable, DataTableSkeleton } from "@/components/ui/data-table";
11+import { ErrorAlert } from "@/components/ui/error-alert";
12+import { IconEye } from "@/components/ui/icons";
13+import { SidePanel } from "@/components/ui/side-panel";
14+import { TableRowActions } from "@/components/ui/table-row-actions";
15+import { formatDateTime, formatDurationMinutes } from "@/lib/format";
16+import { personLabel } from "@/lib/person";
17+import { usePreferences, useT } from "@/stores/preferences-context";
18+
19+const PAGE_SIZE = 12;
20+
21+export default function StudentPomodoroPage() {
22+ return (
23+ <RouteGuard minRole="teacher">
24+ <StudentPomodoroContent />
25+ </RouteGuard>
26+ );
27+}
28+
29+function StudentPomodoroContent() {
30+ const t = useT();
31+ const { locale } = usePreferences();
32+ const [viewUser, setViewUser] = createSignal<PersonRef | null>(null);
33+ const [error, setError] = createSignal("");
34+
35+ const [list] = createResource(
36+ async () => {
37+ try {
38+ setError("");
39+ return (await getUserSearch("", undefined, "student")).items;
40+ } catch (err) {
41+ setError(formatApiError(err));
42+ return [];
43+ }
44+ },
45+ { initialValue: [] },
46+ );
47+
48+ const [log, { refetch: refetchLog }] = createResource(
49+ () => viewUser()?.id ?? null,
50+ async (id) => {
51+ if (!id) return null;
52+ try {
53+ return await getPomodoroByUser(id, { limit: 20 });
54+ } catch (err) {
55+ if (err instanceof ApiError && err.status === 404) {
56+ setError(t("common.notFound"));
57+ return null;
58+ }
59+ setError(formatApiError(err));
60+ return null;
61+ }
62+ },
63+ );
64+
65+ const total = () => list().length;
66+ const rows = () => list();
67+ const listLoading = () => list.loading;
68+ const searchPerson = (person: PersonRef, query: string) =>
69+ [person.username, person.display_name, person.id].join(" ").toLocaleLowerCase().includes(query.toLocaleLowerCase());
70+ const studentColumns = createMemo<ColumnDef<PersonRef>[]>(() => [
71+ {
72+ accessorKey: "username",
73+ header: t("admin.username"),
74+ cell: (cell) => <span class="font-medium">{cell.row.original.username}</span>,
75+ },
76+ {
77+ accessorKey: "display_name",
78+ header: t("profile.name"),
79+ cell: (cell) => <span class="text-muted-foreground">{cell.row.original.display_name || "—"}</span>,
80+ },
81+ {
82+ accessorKey: "id",
83+ header: t("admin.id"),
84+ cell: (cell) => <span class="mono text-xs text-muted-foreground">{cell.row.original.id}</span>,
85+ },
86+ {
87+ id: "actions",
88+ header: t("common.actions"),
89+ meta: { headerClass: "w-14 text-center" },
90+ cell: (cell) => (
91+ <TableRowActions
92+ label={t("common.actions")}
93+ actions={[
94+ {
95+ label: t("common.view"),
96+ icon: <IconEye class="h-4 w-4" />,
97+ onSelect: () => {
98+ setError("");
99+ setViewUser(cell.row.original);
100+ },
101+ },
102+ ]}
103+ />
104+ ),
105+ },
106+ ]);
107+ const logColumns = createMemo<ColumnDef<PomodoroSession>[]>(() => [
108+ {
109+ accessorKey: "started_at",
110+ header: t("pomodoro.startedAt"),
111+ cell: (cell) => <span class="mono whitespace-nowrap">{formatDateTime(cell.row.original.started_at, locale())}</span>,
112+ },
113+ {
114+ accessorKey: "finished_at",
115+ header: t("pomodoro.finishedAt"),
116+ cell: (cell) => <span class="mono whitespace-nowrap">{formatDateTime(cell.row.original.finished_at, locale())}</span>,
117+ },
118+ {
119+ accessorKey: "duration_ms",
120+ header: t("pomodoro.duration"),
121+ cell: (cell) => formatDurationMinutes(cell.row.original.duration_ms, locale()),
122+ },
123+ ]);
124+
125+ return (
126+ <div class="space-y-6">
127+ <PageHeader accent="mint" eyebrow={t("nav.admin")} title={t("nav.studentPomodoro")} description={t("pomodoro.lookup")} />
128+
129+ <section class="data-shell space-y-4 p-4">
130+ <div class="flex flex-wrap items-center justify-between gap-3">
131+ <div>
132+ <h2 class="font-display text-lg font-semibold">{t("nav.studentPomodoro")}</h2>
133+ <p class="mt-1 text-sm text-muted-foreground">
134+ {rows().length} / {total()}
135+ </p>
136+ </div>
137+ </div>
138+
139+ <Show when={error() && !viewUser()}>
140+ <Alert variant="destructive">{error()}</Alert>
141+ </Show>
142+
143+ <Show when={!listLoading()} fallback={<DataTableSkeleton columns={4} rows={6} />}>
144+ <DataTable
145+ columns={studentColumns()}
146+ data={rows()}
147+ tableClass="min-w-[36rem]"
148+ empty={t("form.noStudents")}
149+ searchPredicate={searchPerson}
150+ enablePagination
151+ pageSize={PAGE_SIZE}
152+ />
153+ </Show>
154+ </section>
155+
156+ <SidePanel
157+ size="wide"
158+ open={viewUser() != null}
159+ onOpenChange={(open) => {
160+ if (!open) {
161+ setViewUser(null);
162+ setError("");
163+ }
164+ }}
165+ title={t("pomodoro.forUser", { user: personLabel(viewUser()) })}
166+ description={t("pomodoro.lookup")}
167+ >
168+ <div class="min-w-0 space-y-3">
169+ <Show when={error()}>
170+ <ErrorAlert message={error()} onRetry={() => void refetchLog()} />
171+ </Show>
172+ <Show when={log.loading}>
173+ <p class="text-sm text-muted-foreground">{t("common.loading")}</p>
174+ </Show>
175+ <Show when={log()}>
176+ {(p) => (
177+ <div class="space-y-4">
178+ <div class="detail-metric-card">
179+ <p class="text-xs font-medium uppercase tracking-[0.08em] text-muted-foreground">{t("pomodoro.total")}</p>
180+ <p class="mono mt-2 text-3xl font-semibold tabular-nums">{formatDurationMinutes(p().total_focus_ms, locale())}</p>
181+ </div>
182+ <DataTable columns={logColumns()} data={p().items} empty={t("pomodoro.empty")} enablePagination pageSize={10} />
183+ </div>
184+ )}
185+ </Show>
186+ </div>
187+ </SidePanel>
188+ </div>
189+ );
190+}
src/routes/router.tsxmodified+8 -0
@@ -36,6 +36,7 @@ const MarksPage = lazyRoute(() => import("@/pages/marks-page"));
3636 const MessagesPage = lazyRoute(() => import("@/pages/messages-page"));
3737 const PomodoroPage = lazyRoute(() => import("@/pages/pomodoro-page"));
3838 const StudentMarksPage = lazyRoute(() => import("@/pages/student-marks-page"));
39+const StudentPomodoroPage = lazyRoute(() => import("@/pages/student-pomodoro-page"));
3940 const AttendancePage = lazyRoute(() => import("@/pages/attendance-page"));
4041 const StudentAttendancePage = lazyRoute(() => import("@/pages/student-attendance-page"));
4142 const WorkLogPage = lazyRoute(() => import("@/pages/work-log-page"));
@@ -173,6 +174,12 @@ const studentMarksRoute = createRoute({
173174 component: StudentMarksPage,
174175 });
175176
177+const studentPomodoroRoute = createRoute({
178+ getParentRoute: () => rootRoute,
179+ path: "/management/pomodoros",
180+ component: StudentPomodoroPage,
181+});
182+
176183 const attendanceRoute = createRoute({
177184 getParentRoute: () => rootRoute,
178185 path: "/attendance",
@@ -252,6 +259,7 @@ const routeTree = rootRoute.addChildren([
252259 messagesRoute,
253260 pomodoroRoute,
254261 studentMarksRoute,
262+ studentPomodoroRoute,
255263 attendanceRoute,
256264 studentAttendanceRoute,
257265 workRoute,