📋 one value per table cell across the app
Browse files at this commitd03714333a839bbdae4f22bbacacfb5ee796d520Parent: 233723f- fix
- 📋 one value per table cell across the app
38 changed files +458 -314
- src/components/attendance/attendance-report-view.tsx +1 -0
- src/components/classes/blueprints-tab.tsx +1 -1
- src/components/courses/course-subjects-panel.tsx +1 -1
- src/components/courses/course-teachers-panel.tsx +1 -1
- src/components/events/attendance-table.tsx +1 -1
- src/components/homework/course-homework-panel.tsx +1 -1
- src/components/homework/homework-report-view.tsx +18 -16
- src/components/insights/insight-module-views.tsx +1 -1
- src/components/insights/insight-runs-table.tsx +50 -43
- src/components/marks/marks-report-view.tsx +31 -19
- src/components/sessions/course-sessions-panel.tsx +14 -12
- src/components/ui/data-table.tsx +11 -2
- src/components/users/user-table.tsx +31 -19
- src/components/whiteboard/board-settings-panel.tsx +13 -7
- src/i18n/insights-run-report.ts +12 -0
- src/i18n/locales/en.ts +8 -1
- src/i18n/locales/tr.ts +8 -1
- src/i18n/messages.ts +11 -4
- src/pages/academic-years-page.tsx +18 -13
- src/pages/appointments-page.tsx +50 -59
- src/pages/builder-schools-page.tsx +10 -5
- src/pages/classes-page.tsx +1 -1
- src/pages/course-detail-page.tsx +2 -2
- src/pages/courses-page.tsx +34 -18
- src/pages/dashboard-page.tsx +17 -9
- src/pages/event-detail-page.tsx +1 -1
- src/pages/events-page.tsx +20 -16
- src/pages/exams-page.tsx +1 -3
- src/pages/homework-page.tsx +3 -5
- src/pages/instance-detail-page.tsx +28 -17
- src/pages/license-modules-page.tsx +28 -15
- src/pages/live-monitor-page.tsx +1 -1
- src/pages/question-bank-page.tsx +13 -8
- src/pages/staff-work-page.tsx +11 -7
- src/pages/student-pomodoro-page.tsx +1 -1
- src/pages/students-roster-page.tsx +2 -1
- src/pages/teachers-roster-page.tsx +2 -1
- src/pages/terms-page.tsx +1 -1
src/components/attendance/attendance-report-view.tsxmodified+1 -0
| @@ -44,6 +44,7 @@ export function AttendanceReportView(props: { report: AttendanceReport; compact? | |||
| 44 | const columns = createMemo<ColumnDef<CourseAttendanceRow>[]>(() => [ | 44 | const columns = createMemo<ColumnDef<CourseAttendanceRow>[]>(() => [ |
| 45 | { | 45 | { |
| 46 | id: "course", | 46 | id: "course", |
| 47 | + accessorFn: (row) => row.course.title, | ||
| 47 | header: t("nav.courses"), | 48 | header: t("nav.courses"), |
| 48 | meta: { stickyLeft: true }, | 49 | meta: { stickyLeft: true }, |
| 49 | cell: (cell) => ( | 50 | cell: (cell) => ( |
src/components/classes/blueprints-tab.tsxmodified+1 -1
| @@ -77,7 +77,7 @@ export function BlueprintsTab(props: { | |||
| 77 | { | 77 | { |
| 78 | id: "actions", | 78 | id: "actions", |
| 79 | header: t("common.actions"), | 79 | header: t("common.actions"), |
| 80 | - meta: { headerClass: "w-14 text-center", cellClass: "px-1 text-center" }, | 80 | + meta: { headerClass: "w-[110px] min-w-[110px] max-w-[110px] h-[45px] text-center whitespace-nowrap", cellClass: "text-center" }, |
| 81 | cell: (cell) => ( | 81 | cell: (cell) => ( |
| 82 | <TableRowActions | 82 | <TableRowActions |
| 83 | label={t("common.actions")} | 83 | label={t("common.actions")} |
src/components/courses/course-subjects-panel.tsxmodified+1 -1
| @@ -55,7 +55,7 @@ export function CourseSubjectsPanel(props: { courseId: string; canManage: boolea | |||
| 55 | ? [{ | 55 | ? [{ |
| 56 | id: "actions", | 56 | id: "actions", |
| 57 | header: t("common.actions"), | 57 | header: t("common.actions"), |
| 58 | - meta: { headerClass: "w-14 text-center", cellClass: "px-1 text-center" }, | 58 | + meta: { headerClass: "w-[110px] min-w-[110px] max-w-[110px] h-[45px] text-center whitespace-nowrap", cellClass: "text-center" }, |
| 59 | cell: (cell) => ( | 59 | cell: (cell) => ( |
| 60 | <TableRowActions | 60 | <TableRowActions |
| 61 | label={t("common.actions")} | 61 | label={t("common.actions")} |
src/components/courses/course-teachers-panel.tsxmodified+1 -1
| @@ -46,7 +46,7 @@ export function CourseTeachersPanel(props: { | |||
| 46 | { | 46 | { |
| 47 | id: "actions", | 47 | id: "actions", |
| 48 | header: t("common.actions"), | 48 | header: t("common.actions"), |
| 49 | - meta: { headerClass: "w-14 text-center", cellClass: "px-1 text-center" }, | 49 | + meta: { headerClass: "w-[110px] min-w-[110px] max-w-[110px] h-[45px] text-center whitespace-nowrap", cellClass: "text-center" }, |
| 50 | cell: (cell: { row: { original: PersonRef } }) => ( | 50 | cell: (cell: { row: { original: PersonRef } }) => ( |
| 51 | <TableRowActions | 51 | <TableRowActions |
| 52 | label={t("common.actions")} | 52 | label={t("common.actions")} |
src/components/events/attendance-table.tsxmodified+1 -1
| @@ -52,7 +52,7 @@ export function AttendanceTable(props: { | |||
| 52 | ? [{ | 52 | ? [{ |
| 53 | id: "actions", | 53 | id: "actions", |
| 54 | header: t("common.actions"), | 54 | header: t("common.actions"), |
| 55 | - meta: { headerClass: "w-14 text-center", cellClass: "px-1 text-center" }, | 55 | + meta: { headerClass: "w-[110px] min-w-[110px] max-w-[110px] h-[45px] text-center whitespace-nowrap", cellClass: "text-center" }, |
| 56 | cell: (cell) => ( | 56 | cell: (cell) => ( |
| 57 | <TableRowActions | 57 | <TableRowActions |
| 58 | label={t("common.actions")} | 58 | label={t("common.actions")} |
src/components/homework/course-homework-panel.tsxmodified+1 -1
| @@ -187,7 +187,7 @@ export function CourseHomeworkPanel(props: { | |||
| 187 | ? [{ | 187 | ? [{ |
| 188 | id: "actions", | 188 | id: "actions", |
| 189 | header: t("common.actions"), | 189 | header: t("common.actions"), |
| 190 | - meta: { headerClass: "w-28 min-w-28 text-center whitespace-nowrap", cellClass: "px-1 text-center" }, | 190 | + meta: { headerClass: "w-[110px] min-w-[110px] max-w-[110px] h-[45px] text-center whitespace-nowrap", cellClass: "text-center" }, |
| 191 | cell: (cell) => ( | 191 | cell: (cell) => ( |
| 192 | <TableRowActions | 192 | <TableRowActions |
| 193 | label={t("common.actions")} | 193 | label={t("common.actions")} |
src/components/homework/homework-report-view.tsxmodified+18 -16
| @@ -39,34 +39,36 @@ export function HomeworkReportView(props: { userId: string }) { | |||
| 39 | { | 39 | { |
| 40 | accessorKey: "title", | 40 | accessorKey: "title", |
| 41 | header: t("form.title"), | 41 | header: t("form.title"), |
| 42 | - cell: (cell) => ( | 42 | + meta: { cellClass: "font-medium" }, |
| 43 | - <div class="min-w-0"> | 43 | + }, |
| 44 | - <p class="truncate font-medium">{cell.row.original.title}</p> | 44 | + // One value per cell: the subject used to sit under the title as a |
| 45 | - <p class="truncate text-xs text-muted-foreground">{cell.row.original.subject || "—"}</p> | 45 | + // caption, which made these rows taller than every other table's. |
| 46 | - </div> | 46 | + { |
| 47 | - ), | 47 | + id: "subject", |
| 48 | + accessorFn: (row) => row.subject || undefined, | ||
| 49 | + header: t("subjects.subject"), | ||
| 50 | + meta: { cellClass: "text-muted-foreground" }, | ||
| 48 | }, | 51 | }, |
| 49 | { | 52 | { |
| 50 | id: "due_at", | 53 | id: "due_at", |
| 51 | accessorFn: (row) => row.due_at, | 54 | accessorFn: (row) => row.due_at, |
| 52 | header: t("homework.dueAt"), | 55 | header: t("homework.dueAt"), |
| 53 | - meta: { cellClass: "whitespace-nowrap text-xs text-muted-foreground" }, | 56 | + meta: { cellClass: "text-muted-foreground" }, |
| 54 | cell: (cell) => formatDateTime(cell.row.original.due_at, locale()), | 57 | cell: (cell) => formatDateTime(cell.row.original.due_at, locale()), |
| 55 | }, | 58 | }, |
| 56 | { | 59 | { |
| 57 | id: "status", | 60 | id: "status", |
| 61 | + accessorFn: (row) => statusLabel(row), | ||
| 58 | header: t("events.status"), | 62 | header: t("events.status"), |
| 59 | - cell: (cell) => ( | 63 | + // "Late" rides inside the status badge instead of a second line. |
| 60 | - <div class="space-y-1"> | 64 | + cell: (cell) => |
| 61 | - <Badge variant="outline" class="rounded-full">{statusLabel(cell.row.original)}</Badge> | 65 | + cell.row.original.late |
| 62 | - <Show when={cell.row.original.late}> | 66 | + ? <Badge variant="warning" class="rounded-full">{statusLabel(cell.row.original)} · {t("homework.late")}</Badge> |
| 63 | - <p class="text-[11px] text-destructive-text">{t("homework.late")}</p> | 67 | + : <Badge variant="outline" class="rounded-full">{statusLabel(cell.row.original)}</Badge>, |
| 64 | - </Show> | ||
| 65 | - </div> | ||
| 66 | - ), | ||
| 67 | }, | 68 | }, |
| 68 | { | 69 | { |
| 69 | id: "mark", | 70 | id: "mark", |
| 71 | + accessorFn: (row) => row.result?.mark ?? undefined, | ||
| 70 | header: t("form.mark"), | 72 | header: t("form.mark"), |
| 71 | meta: { align: "right", cellClass: "font-medium tabular-nums" }, | 73 | meta: { align: "right", cellClass: "font-medium tabular-nums" }, |
| 72 | cell: (cell) => cell.row.original.result?.mark ?? "—", | 74 | cell: (cell) => cell.row.original.result?.mark ?? "—", |
| @@ -74,7 +76,7 @@ export function HomeworkReportView(props: { userId: string }) { | |||
| 74 | { | 76 | { |
| 75 | id: "actions", | 77 | id: "actions", |
| 76 | header: t("common.actions"), | 78 | header: t("common.actions"), |
| 77 | - meta: { headerClass: "w-28 min-w-28 text-center whitespace-nowrap" }, | 79 | + meta: { headerClass: "w-[110px] min-w-[110px] max-w-[110px] h-[45px] text-center whitespace-nowrap", cellClass: "text-center" }, |
| 78 | cell: (cell) => ( | 80 | cell: (cell) => ( |
| 79 | <TableRowActions | 81 | <TableRowActions |
| 80 | label={t("common.actions")} | 82 | label={t("common.actions")} |
src/components/insights/insight-module-views.tsxmodified+1 -1
| @@ -407,9 +407,9 @@ function MarksView(props: { value: Rec; courseTitle: CourseTitle }) { | |||
| 407 | const courseColumns: ColumnDef<{ id: string; stat: unknown; index: number }>[] = [ | 407 | const courseColumns: ColumnDef<{ id: string; stat: unknown; index: number }>[] = [ |
| 408 | { | 408 | { |
| 409 | id: "course", | 409 | id: "course", |
| 410 | + accessorFn: (row) => str(obj(row.stat).course_title) ?? courseLabel(row.id, props.courseTitle, row.index), | ||
| 410 | header: detailText("marks.course"), | 411 | header: detailText("marks.course"), |
| 411 | meta: { cellClass: "font-medium text-text-strong" }, | 412 | meta: { cellClass: "font-medium text-text-strong" }, |
| 412 | - cell: (cell) => str(obj(cell.row.original.stat).course_title) ?? courseLabel(cell.row.original.id, props.courseTitle, cell.row.original.index), | ||
| 413 | }, | 413 | }, |
| 414 | { id: "average", header: detailText("marks.average"), meta: centered, cell: (cell) => nText(obj(cell.row.original.stat).average) ?? "—" }, | 414 | { id: "average", header: detailText("marks.average"), meta: centered, cell: (cell) => nText(obj(cell.row.original.stat).average) ?? "—" }, |
| 415 | { id: "n_marks", header: detailText("marks.nMarks"), meta: centered, cell: (cell) => String(num(obj(cell.row.original.stat).n_marks) ?? 0) }, | 415 | { id: "n_marks", header: detailText("marks.nMarks"), meta: centered, cell: (cell) => String(num(obj(cell.row.original.stat).n_marks) ?? 0) }, |
src/components/insights/insight-runs-table.tsxmodified+50 -43
| @@ -26,17 +26,21 @@ export function InsightRunsTable(props: { runs: InsightRun[] }) { | |||
| 26 | const rtx = (key: RunReportKey, vars?: Record<string, string | number>) => | 26 | const rtx = (key: RunReportKey, vars?: Record<string, string | number>) => |
| 27 | runReportText(prefs.locale(), key, vars); | 27 | runReportText(prefs.locale(), key, vars); |
| 28 | const [selectedRun, setSelectedRun] = createSignal<InsightRun | null>(null); | 28 | const [selectedRun, setSelectedRun] = createSignal<InsightRun | null>(null); |
| 29 | + // One value per cell: the start time, the failed/skipped counts and each | ||
| 30 | + // kind of issue used to stack under a headline value, so rows grew to | ||
| 31 | + // different heights. Each now has its own column. | ||
| 29 | const columns = createMemo<ColumnDef<InsightRun>[]>(() => [ | 32 | const columns = createMemo<ColumnDef<InsightRun>[]>(() => [ |
| 30 | { | 33 | { |
| 31 | accessorKey: "run_day", | 34 | accessorKey: "run_day", |
| 32 | header: tx("insights.runDay"), | 35 | header: tx("insights.runDay"), |
| 33 | - meta: { align: "center" }, | 36 | + meta: { align: "center", cellClass: "font-medium text-text-strong" }, |
| 34 | - cell: (cell) => ( | 37 | + }, |
| 35 | - <div> | 38 | + { |
| 36 | - <p class="font-medium text-text-strong">{cell.row.original.run_day}</p> | 39 | + id: "started_at", |
| 37 | - <p class="text-xs text-muted-foreground">{formatDateTime(cell.row.original.started_at, prefs.locale())}</p> | 40 | + accessorFn: (row) => row.started_at, |
| 38 | - </div> | 41 | + header: rtx("startedAt"), |
| 39 | - ), | 42 | + meta: { align: "center", cellClass: "text-muted-foreground" }, |
| 43 | + cell: (cell) => formatDateTime(cell.row.original.started_at, prefs.locale()), | ||
| 40 | }, | 44 | }, |
| 41 | { | 45 | { |
| 42 | accessorKey: "status", | 46 | accessorKey: "status", |
| @@ -52,16 +56,18 @@ export function InsightRunsTable(props: { runs: InsightRun[] }) { | |||
| 52 | id: "processed", | 56 | id: "processed", |
| 53 | header: tx("insights.processed"), | 57 | header: tx("insights.processed"), |
| 54 | accessorFn: (row) => row.students_ok, | 58 | accessorFn: (row) => row.students_ok, |
| 55 | - meta: { align: "center" }, | 59 | + meta: { align: "center", cellClass: "font-medium tabular-nums" }, |
| 56 | - cell: (cell) => { | 60 | + cell: (cell) => `${cell.row.original.students_ok}/${cell.row.original.students_total}`, |
| 57 | - const run = cell.row.original; | 61 | + }, |
| 58 | - return ( | 62 | + { |
| 59 | - <div class="text-center"> | 63 | + accessorKey: "students_failed", |
| 60 | - <p class="font-medium tabular-nums">{run.students_ok}/{run.students_total}</p> | 64 | + header: rtx("failed"), |
| 61 | - <p class="text-[11px] text-muted-foreground">{run.students_failed} / {run.students_skipped}</p> | 65 | + meta: { align: "center", cellClass: "tabular-nums" }, |
| 62 | - </div> | 66 | + }, |
| 63 | - ); | 67 | + { |
| 64 | - }, | 68 | + accessorKey: "students_skipped", |
| 69 | + header: rtx("skipped"), | ||
| 70 | + meta: { align: "center", cellClass: "tabular-nums" }, | ||
| 65 | }, | 71 | }, |
| 66 | { | 72 | { |
| 67 | accessorKey: "rows_written", | 73 | accessorKey: "rows_written", |
| @@ -75,42 +81,43 @@ export function InsightRunsTable(props: { runs: InsightRun[] }) { | |||
| 75 | cell: (cell) => <span class="tabular-nums">{formatDurationMinutes(cell.row.original.duration_ms, prefs.locale())}</span>, | 81 | cell: (cell) => <span class="tabular-nums">{formatDurationMinutes(cell.row.original.duration_ms, prefs.locale())}</span>, |
| 76 | }, | 82 | }, |
| 77 | { | 83 | { |
| 78 | - id: "issues", | 84 | + id: "budget", |
| 79 | - header: tx("insights.issues"), | 85 | + accessorFn: (row) => (row.budget_exceeded ? 1 : 0), |
| 80 | - enableSorting: false, | 86 | + header: rtx("budget"), |
| 87 | + meta: { align: "center" }, | ||
| 88 | + cell: (cell) => | ||
| 89 | + cell.row.original.budget_exceeded | ||
| 90 | + ? <Badge variant="warning" class="rounded-full">{rtx("budgetOver")}</Badge> | ||
| 91 | + : <span class="text-muted-foreground">{rtx("budgetOk")}</span>, | ||
| 92 | + }, | ||
| 93 | + { | ||
| 94 | + id: "pending", | ||
| 95 | + accessorFn: (row) => row.pending_students.length, | ||
| 96 | + header: rtx("pendingColumn"), | ||
| 81 | meta: { align: "center" }, | 97 | meta: { align: "center" }, |
| 82 | cell: (cell) => { | 98 | cell: (cell) => { |
| 83 | - const run = cell.row.original; | 99 | + const pending = cell.row.original.pending_students; |
| 84 | - const issueCount = run.pending_students.length + run.failed_modules.length; | ||
| 85 | return ( | 100 | return ( |
| 86 | - <div class="space-y-1 text-center"> | 101 | + <span class={cn("tabular-nums", pending.length > 0 ? "text-warning-text" : "text-muted-foreground")} title={pending.join(", ") || undefined}> |
| 87 | - <p class={cn("text-xs", issueCount > 0 || run.budget_exceeded ? "text-warning-text" : "text-muted-foreground")}> | 102 | + {pending.length} |
| 88 | - {issueCount > 0 ? tx("insights.issueCount", { count: issueCount }) : tx("insights.noIssues")} | 103 | + </span> |
| 89 | - </p> | ||
| 90 | - {run.budget_exceeded && <p class="text-[11px] text-warning-text">{tx("insights.budgetExceeded")}</p>} | ||
| 91 | - {run.pending_students.length > 0 && ( | ||
| 92 | - <p class="max-w-56 truncate text-[11px] text-muted-foreground" title={run.pending_students.join(", ")}> | ||
| 93 | - {tx("insights.pendingStudents", { count: run.pending_students.length })} | ||
| 94 | - </p> | ||
| 95 | - )} | ||
| 96 | - {run.failed_modules.length > 0 && ( | ||
| 97 | - <p class="max-w-56 truncate text-[11px] text-muted-foreground" title={run.failed_modules.join(", ")}> | ||
| 98 | - {tx("insights.failedModules", { | ||
| 99 | - modules: run.failed_modules.map((stage) => failedStageText(prefs.locale(), stage)).join(", "), | ||
| 100 | - })} | ||
| 101 | - </p> | ||
| 102 | - )} | ||
| 103 | - </div> | ||
| 104 | ); | 104 | ); |
| 105 | }, | 105 | }, |
| 106 | }, | 106 | }, |
| 107 | + { | ||
| 108 | + id: "failed_modules", | ||
| 109 | + accessorFn: (row) => row.failed_modules.map((stage) => failedStageText(prefs.locale(), stage)).join(", "), | ||
| 110 | + header: rtx("failedModulesColumn"), | ||
| 111 | + enableSorting: false, | ||
| 112 | + meta: { cellClass: "text-warning-text" }, | ||
| 113 | + }, | ||
| 107 | { | 114 | { |
| 108 | id: "actions", | 115 | id: "actions", |
| 109 | header: tx("common.actions"), | 116 | header: tx("common.actions"), |
| 110 | enableSorting: false, | 117 | enableSorting: false, |
| 111 | meta: { | 118 | meta: { |
| 112 | - headerClass: "w-[150px] min-w-[150px] max-w-[150px] h-[45px] text-center whitespace-nowrap", | 119 | + headerClass: "w-[110px] min-w-[110px] max-w-[110px] h-[45px] text-center whitespace-nowrap", |
| 113 | - cellClass: "w-[150px] min-w-[150px] max-w-[150px] h-[45px] text-center whitespace-nowrap", | 120 | + cellClass: "text-center", |
| 114 | }, | 121 | }, |
| 115 | cell: (cell) => ( | 122 | cell: (cell) => ( |
| 116 | <TableRowActions | 123 | <TableRowActions |
| @@ -135,7 +142,7 @@ export function InsightRunsTable(props: { runs: InsightRun[] }) { | |||
| 135 | columns={columns()} | 142 | columns={columns()} |
| 136 | data={props.runs} | 143 | data={props.runs} |
| 137 | empty={tx("insights.emptyRuns")} | 144 | empty={tx("insights.emptyRuns")} |
| 138 | - tableClass="insight-grid-table min-w-[56rem]" | 145 | + tableClass="insight-grid-table min-w-[76rem]" |
| 139 | enablePagination | 146 | enablePagination |
| 140 | pageSize={10} | 147 | pageSize={10} |
| 141 | storageKey="insight-runs" | 148 | storageKey="insight-runs" |
src/components/marks/marks-report-view.tsxmodified+31 -19
| @@ -67,8 +67,9 @@ export function MarksReportView(props: { report: MarksReport; compact?: boolean | |||
| 67 | const courseColumns = createMemo<ColumnDef<CourseBlock>[]>(() => [ | 67 | const courseColumns = createMemo<ColumnDef<CourseBlock>[]>(() => [ |
| 68 | { | 68 | { |
| 69 | id: "course", | 69 | id: "course", |
| 70 | + accessorFn: (row) => row.course.title, | ||
| 70 | header: t("nav.courses"), | 71 | header: t("nav.courses"), |
| 71 | - meta: { headerClass: "w-[42%]" }, | 72 | + meta: { headerClass: "w-[36%]" }, |
| 72 | cell: (cell) => ( | 73 | cell: (cell) => ( |
| 73 | <Link to="/courses/$id" params={{ id: cell.row.original.course.id }} class="block truncate font-medium hover:text-primary-text hover:underline"> | 74 | <Link to="/courses/$id" params={{ id: cell.row.original.course.id }} class="block truncate font-medium hover:text-primary-text hover:underline"> |
| 74 | {cell.row.original.course.title} | 75 | {cell.row.original.course.title} |
| @@ -78,7 +79,7 @@ export function MarksReportView(props: { report: MarksReport; compact?: boolean | |||
| 78 | { | 79 | { |
| 79 | id: "instance", | 80 | id: "instance", |
| 80 | header: t("instances.title"), | 81 | header: t("instances.title"), |
| 81 | - meta: { headerClass: "w-[28%]", cellClass: "text-muted-foreground" }, | 82 | + meta: { headerClass: "w-[24%]", cellClass: "text-muted-foreground" }, |
| 82 | cell: (cell) => ( | 83 | cell: (cell) => ( |
| 83 | <Link | 84 | <Link |
| 84 | to="/instances/$id" | 85 | to="/instances/$id" |
| @@ -91,19 +92,28 @@ export function MarksReportView(props: { report: MarksReport; compact?: boolean | |||
| 91 | </Link> | 92 | </Link> |
| 92 | ), | 93 | ), |
| 93 | }, | 94 | }, |
| 95 | + // The average and its band are two values, so two columns: "68,2 · Bant 3" | ||
| 96 | + // in one cell was the one row taller and wider than its neighbours. | ||
| 94 | { | 97 | { |
| 95 | id: "average", | 98 | id: "average", |
| 99 | + accessorFn: (row) => row.average ?? undefined, | ||
| 96 | header: t("marks.courseAvg"), | 100 | header: t("marks.courseAvg"), |
| 97 | - meta: { headerClass: "w-[30%]" }, | 101 | + meta: { headerClass: "w-[22%]" }, |
| 98 | cell: (cell) => ( | 102 | cell: (cell) => ( |
| 99 | - <div class="flex items-center gap-2"> | 103 | + <div class="flex min-w-0 items-center gap-2"> |
| 100 | <div class="h-1.5 w-12 min-w-8 shrink overflow-hidden rounded-full bg-muted"> | 104 | <div class="h-1.5 w-12 min-w-8 shrink overflow-hidden rounded-full bg-muted"> |
| 101 | <div class="h-full rounded-full bg-primary" style={{ width: scoreWidth(cell.row.original.average) }} /> | 105 | <div class="h-full rounded-full bg-primary" style={{ width: scoreWidth(cell.row.original.average) }} /> |
| 102 | </div> | 106 | </div> |
| 103 | - <span class="shrink-0 text-xs font-semibold tabular-nums">{markWithGrade(cell.row.original.average, cell.row.original.average_grade)}</span> | 107 | + <span class="shrink-0 font-semibold tabular-nums">{formatDecimal(cell.row.original.average!, locale())}</span> |
| 104 | </div> | 108 | </div> |
| 105 | ), | 109 | ), |
| 106 | }, | 110 | }, |
| 111 | + { | ||
| 112 | + id: "band", | ||
| 113 | + accessorFn: (row) => row.average_grade || undefined, | ||
| 114 | + header: t("marks.band"), | ||
| 115 | + meta: { headerClass: "w-[18%]" }, | ||
| 116 | + }, | ||
| 107 | ]); | 117 | ]); |
| 108 | const [settings] = createResource(() => getSettings()); | 118 | const [settings] = createResource(() => getSettings()); |
| 109 | const compact = () => props.compact === true; | 119 | const compact = () => props.compact === true; |
| @@ -121,22 +131,17 @@ export function MarksReportView(props: { report: MarksReport; compact?: boolean | |||
| 121 | header: t("marks.exam"), | 131 | header: t("marks.exam"), |
| 122 | meta: { stickyLeft: true }, | 132 | meta: { stickyLeft: true }, |
| 123 | cell: (cell) => ( | 133 | cell: (cell) => ( |
| 124 | - <span class="min-w-0"> | 134 | + <ExamLink examId={cell.row.original.exam} class="block truncate font-medium hover:underline"> |
| 125 | - <ExamLink examId={cell.row.original.exam} class="block truncate font-medium hover:underline"> | 135 | + {cell.row.original.title} |
| 126 | - {cell.row.original.title} | 136 | + </ExamLink> |
| 127 | - </ExamLink> | ||
| 128 | - <Show when={compact()}> | ||
| 129 | - <p class="mt-0.5 truncate text-[11px] text-muted-foreground sm:hidden"> | ||
| 130 | - {examKindLabel(cell.row.original.kind, t)} | ||
| 131 | - </p> | ||
| 132 | - </Show> | ||
| 133 | - </span> | ||
| 134 | ), | 137 | ), |
| 135 | }, | 138 | }, |
| 139 | + // The kind is its own column at every width; the compact view used to hide | ||
| 140 | + // it and stack it under the title as a second line instead. | ||
| 136 | { | 141 | { |
| 137 | - accessorKey: "kind", | 142 | + id: "kind", |
| 143 | + accessorFn: (row) => examKindLabel(row.kind, t), | ||
| 138 | header: t("exams.kind"), | 144 | header: t("exams.kind"), |
| 139 | - meta: { headerClass: compact() ? "hidden sm:table-cell" : undefined, cellClass: compact() ? "hidden sm:table-cell" : undefined }, | ||
| 140 | cell: (cell) => <Badge variant="outline" class="rounded-sm capitalize">{examKindLabel(cell.row.original.kind, t)}</Badge>, | 145 | cell: (cell) => <Badge variant="outline" class="rounded-sm capitalize">{examKindLabel(cell.row.original.kind, t)}</Badge>, |
| 141 | }, | 146 | }, |
| 142 | { | 147 | { |
| @@ -146,10 +151,17 @@ export function MarksReportView(props: { report: MarksReport; compact?: boolean | |||
| 146 | cell: (cell) => examWeight(cell.row.original, settings()?.exam_kinds) ?? "—", | 151 | cell: (cell) => examWeight(cell.row.original, settings()?.exam_kinds) ?? "—", |
| 147 | }, | 152 | }, |
| 148 | { | 153 | { |
| 149 | - accessorKey: "mark", | 154 | + id: "mark", |
| 155 | + accessorFn: (row) => row.mark ?? undefined, | ||
| 150 | header: t("marks.mark"), | 156 | header: t("marks.mark"), |
| 151 | meta: { align: "right", cellClass: "font-semibold" }, | 157 | meta: { align: "right", cellClass: "font-semibold" }, |
| 152 | - cell: (cell) => markWithGrade(cell.row.original.mark, cell.row.original.grade), | 158 | + cell: (cell) => formatDecimal(cell.row.original.mark!, locale()), |
| 159 | + }, | ||
| 160 | + { | ||
| 161 | + id: "grade", | ||
| 162 | + accessorFn: (row) => row.grade || undefined, | ||
| 163 | + header: t("marks.band"), | ||
| 164 | + meta: { align: "right" }, | ||
| 153 | }, | 165 | }, |
| 154 | ]); | 166 | ]); |
| 155 | 167 | ||
src/components/sessions/course-sessions-panel.tsxmodified+14 -12
| @@ -213,19 +213,21 @@ export function CourseSessionsPanel(props: { | |||
| 213 | meta: { cellClass: "font-medium" }, | 213 | meta: { cellClass: "font-medium" }, |
| 214 | cell: (cell) => cell.row.original.topic || t("sessions.untitled"), | 214 | cell: (cell) => cell.row.original.topic || t("sessions.untitled"), |
| 215 | }, | 215 | }, |
| 216 | + // Start and end are separate columns so each cell holds one value and | ||
| 217 | + // every row keeps the same height. | ||
| 216 | { | 218 | { |
| 217 | - id: "time", | 219 | + id: "starts", |
| 218 | accessorFn: (row) => row.starts_at, | 220 | accessorFn: (row) => row.starts_at, |
| 219 | - header: t("appointments.time"), | 221 | + header: t("appointments.starts"), |
| 220 | - meta: { cellClass: "text-xs text-muted-foreground" }, | 222 | + meta: { cellClass: "text-muted-foreground" }, |
| 221 | - cell: (cell) => ( | 223 | + cell: (cell) => formatDateTime(cell.row.original.starts_at, locale()), |
| 222 | - <div class="whitespace-nowrap"> | 224 | + }, |
| 223 | - <p>{formatDateTime(cell.row.original.starts_at, locale())}</p> | 225 | + { |
| 224 | - <Show when={cell.row.original.ends_at}> | 226 | + id: "ends", |
| 225 | - <p class="text-[11px]">→ {formatDateTime(cell.row.original.ends_at, locale())}</p> | 227 | + accessorFn: (row) => row.ends_at ?? undefined, |
| 226 | - </Show> | 228 | + header: t("appointments.ends"), |
| 227 | - </div> | 229 | + meta: { cellClass: "text-muted-foreground" }, |
| 228 | - ), | 230 | + cell: (cell) => formatDateTime(cell.row.original.ends_at, locale()), |
| 229 | }, | 231 | }, |
| 230 | { | 232 | { |
| 231 | id: "teacher", | 233 | id: "teacher", |
| @@ -237,7 +239,7 @@ export function CourseSessionsPanel(props: { | |||
| 237 | ? [{ | 239 | ? [{ |
| 238 | id: "actions", | 240 | id: "actions", |
| 239 | header: t("common.actions"), | 241 | header: t("common.actions"), |
| 240 | - meta: { headerClass: "w-14 text-center", cellClass: "px-1 text-center" }, | 242 | + meta: { headerClass: "w-[110px] min-w-[110px] max-w-[110px] h-[45px] text-center whitespace-nowrap", cellClass: "text-center" }, |
| 241 | cell: (cell) => ( | 243 | cell: (cell) => ( |
| 242 | <TableRowActions | 244 | <TableRowActions |
| 243 | label={t("common.actions")} | 245 | label={t("common.actions")} |
src/components/ui/data-table.tsxmodified+11 -2
| @@ -608,7 +608,6 @@ export function DataTable<TData, TValue = unknown>(props: DataTableProps<TData, | |||
| 608 | <For each={row.getVisibleCells()}> | 608 | <For each={row.getVisibleCells()}> |
| 609 | {(cell) => { | 609 | {(cell) => { |
| 610 | const val = cell.getValue(); | 610 | const val = cell.getValue(); |
| 611 | - const isText = typeof val === "string" || typeof val === "number"; | ||
| 612 | const isSystemColumn = ["actions", "update", "select"].includes(cell.column.id); | 611 | const isSystemColumn = ["actions", "update", "select"].includes(cell.column.id); |
| 613 | // A display column (no accessorFn/accessorKey) has no | 612 | // A display column (no accessorFn/accessorKey) has no |
| 614 | // value to be empty — getValue() is always undefined — | 613 | // value to be empty — getValue() is always undefined — |
| @@ -629,7 +628,17 @@ export function DataTable<TData, TValue = unknown>(props: DataTableProps<TData, | |||
| 629 | actionColumnClass(cell.column.id), | 628 | actionColumnClass(cell.column.id), |
| 630 | )} | 629 | )} |
| 631 | style={{ width: columnWidth(cell.column) }} | 630 | style={{ width: columnWidth(cell.column) }} |
| 632 | - title={isText && !isEmpty ? String(val) : undefined} | 631 | + // The tooltip is what the cell shows, and only when |
| 632 | + // it is cut: the accessor value is a sort key (an | ||
| 633 | + // epoch, minutes, an unrounded mark), not the text. | ||
| 634 | + onMouseEnter={(event) => { | ||
| 635 | + if (isSystemColumn) return; | ||
| 636 | + const el = event.currentTarget; | ||
| 637 | + const clipped = [el, ...el.querySelectorAll<HTMLElement>("*")].some((node) => node.scrollWidth > node.clientWidth + 1); | ||
| 638 | + const text = el.textContent?.trim() ?? ""; | ||
| 639 | + if (clipped && text) el.title = text; | ||
| 640 | + else el.removeAttribute("title"); | ||
| 641 | + }} | ||
| 633 | > | 642 | > |
| 634 | <Show when={!isEmpty} fallback={<span class="text-muted-foreground/40">-</span>}> | 643 | <Show when={!isEmpty} fallback={<span class="text-muted-foreground/40">-</span>}> |
| 635 | {flexRender(cell.column.columnDef.cell, cell.getContext())} | 644 | {flexRender(cell.column.columnDef.cell, cell.getContext())} |
src/components/users/user-table.tsxmodified+31 -19
| @@ -32,23 +32,34 @@ function UserRoleActions(props: { | |||
| 32 | 32 | ||
| 33 | return ( | 33 | return ( |
| 34 | <> | 34 | <> |
| 35 | - <Select | 35 | + {/* The confirm button sits beside the select, not under it, so a row |
| 36 | - class="h-9 rounded-md text-xs" | 36 | + with a pending role change keeps the same height as the others. */} |
| 37 | - value={pendingRole()} | 37 | + <div class="flex min-w-0 items-center gap-1.5"> |
| 38 | - disabled={isSelf()} | 38 | + <Select |
| 39 | - onChange={(e) => setPendingRole(e.currentTarget.value as Role)} | 39 | + wrapperClass="min-w-0 flex-1" |
| 40 | - aria-label={t("admin.role")} | 40 | + class="h-8 rounded-md text-xs" |
| 41 | - > | 41 | + value={pendingRole()} |
| 42 | - {ROLES.map((r) => ( | 42 | + disabled={isSelf()} |
| 43 | - <option value={r}>{t(`role.${r}` as MessageKey)}</option> | 43 | + onChange={(e) => setPendingRole(e.currentTarget.value as Role)} |
| 44 | - ))} | 44 | + aria-label={t("admin.role")} |
| 45 | - </Select> | 45 | + > |
| 46 | - <Show when={!isSelf() && dirty()}> | 46 | + {ROLES.map((r) => ( |
| 47 | - <Button type="button" size="sm" class="mt-2" onClick={(e) => { e.stopPropagation(); setConfirmOpen(true); }}> | 47 | + <option value={r}>{t(`role.${r}` as MessageKey)}</option> |
| 48 | - <IconCheck /> | 48 | + ))} |
| 49 | - {t("common.update")} | 49 | + </Select> |
| 50 | - </Button> | 50 | + <Show when={!isSelf() && dirty()}> |
| 51 | - </Show> | 51 | + <Button |
| 52 | + type="button" | ||
| 53 | + size="icon" | ||
| 54 | + class="h-8 w-8 shrink-0 rounded-md" | ||
| 55 | + aria-label={t("common.update")} | ||
| 56 | + title={t("common.update")} | ||
| 57 | + onClick={(e) => { e.stopPropagation(); setConfirmOpen(true); }} | ||
| 58 | + > | ||
| 59 | + <IconCheck /> | ||
| 60 | + </Button> | ||
| 61 | + </Show> | ||
| 62 | + </div> | ||
| 52 | <ConfirmDialog | 63 | <ConfirmDialog |
| 53 | open={confirmOpen()} | 64 | open={confirmOpen()} |
| 54 | onOpenChange={setConfirmOpen} | 65 | onOpenChange={setConfirmOpen} |
| @@ -97,6 +108,7 @@ export function UserTable(props: { | |||
| 97 | }, | 108 | }, |
| 98 | { | 109 | { |
| 99 | id: "phone", | 110 | id: "phone", |
| 111 | + accessorFn: (row) => row.phone || undefined, | ||
| 100 | header: t("profile.phone"), | 112 | header: t("profile.phone"), |
| 101 | size: 180, | 113 | size: 180, |
| 102 | minSize: 130, | 114 | minSize: 130, |
| @@ -129,8 +141,8 @@ export function UserTable(props: { | |||
| 129 | minSize: 110, | 141 | minSize: 110, |
| 130 | enableHiding: false, | 142 | enableHiding: false, |
| 131 | meta: { | 143 | meta: { |
| 132 | - headerClass: "w-[110px] min-w-[110px] max-w-[110px] text-center whitespace-nowrap", | 144 | + headerClass: "w-[110px] min-w-[110px] max-w-[110px] h-[45px] text-center whitespace-nowrap", |
| 133 | - cellClass: "w-[110px] min-w-[110px] max-w-[110px] text-center whitespace-nowrap", | 145 | + cellClass: "text-center", |
| 134 | }, | 146 | }, |
| 135 | cell: (cell) => ( | 147 | cell: (cell) => ( |
| 136 | <TableRowActions | 148 | <TableRowActions |
src/components/whiteboard/board-settings-panel.tsxmodified+13 -7
| @@ -90,17 +90,23 @@ export function BoardSettingsPanel(props: { | |||
| 90 | { | 90 | { |
| 91 | accessorKey: "name", | 91 | accessorKey: "name", |
| 92 | header: t("whiteboard.participants"), | 92 | header: t("whiteboard.participants"), |
| 93 | - cell: (cell) => ( | 93 | + meta: { cellClass: "font-medium" }, |
| 94 | - <div class="min-w-0"> | 94 | + }, |
| 95 | - <p class="truncate text-sm font-medium">{cell.row.original.name}</p> | 95 | + // The role used to sit under the name as a second line; one value per cell. |
| 96 | - <Show when={cell.row.original.role}><p class="text-xs text-muted-foreground">{cell.row.original.role}</p></Show> | 96 | + { |
| 97 | - </div> | 97 | + id: "role", |
| 98 | - ), | 98 | + accessorFn: (row) => row.role || undefined, |
| 99 | + header: t("admin.role"), | ||
| 100 | + meta: { cellClass: "text-muted-foreground" }, | ||
| 99 | }, | 101 | }, |
| 100 | { | 102 | { |
| 101 | id: "actions", | 103 | id: "actions", |
| 102 | header: t("common.actions"), | 104 | header: t("common.actions"), |
| 103 | - meta: { align: "center", label: t("common.actions") }, | 105 | + meta: { |
| 106 | + label: t("common.actions"), | ||
| 107 | + headerClass: "w-[110px] min-w-[110px] max-w-[110px] h-[45px] text-center whitespace-nowrap", | ||
| 108 | + cellClass: "text-center", | ||
| 109 | + }, | ||
| 104 | cell: (cell) => ( | 110 | cell: (cell) => ( |
| 105 | <Show | 111 | <Show |
| 106 | when={props.canManageParticipants() && !cell.row.original.creator} | 112 | when={props.canManageParticipants() && !cell.row.original.creator} |
src/i18n/insights-run-report.tsmodified+12 -0
| @@ -46,6 +46,10 @@ export type RunReportKey = | |||
| 46 | | "noIssues" | 46 | | "noIssues" |
| 47 | | "pendingStudents" | 47 | | "pendingStudents" |
| 48 | | "failedModules" | 48 | | "failedModules" |
| 49 | + | "pendingColumn" | ||
| 50 | + | "failedModulesColumn" | ||
| 51 | + | "budgetOver" | ||
| 52 | + | "budgetOk" | ||
| 49 | | "coverage" | 53 | | "coverage" |
| 50 | | "coverageNote" | 54 | | "coverageNote" |
| 51 | | "loadAll" | 55 | | "loadAll" |
| @@ -114,6 +118,10 @@ const tr: Record<RunReportKey, string> = { | |||
| 114 | noIssues: "Sorun yok", | 118 | noIssues: "Sorun yok", |
| 115 | pendingStudents: "{count} öğrenci sıradaki çalıştırmaya kaldı", | 119 | pendingStudents: "{count} öğrenci sıradaki çalıştırmaya kaldı", |
| 116 | failedModules: "Veri üretmeyen modüller: {modules}", | 120 | failedModules: "Veri üretmeyen modüller: {modules}", |
| 121 | + pendingColumn: "Sırada kalan", | ||
| 122 | + failedModulesColumn: "Veri üretmeyen modüller", | ||
| 123 | + budgetOver: "Aşıldı", | ||
| 124 | + budgetOk: "İçinde", | ||
| 117 | coverage: "Sinyalleri yüklenen öğrenci: {loaded}/{total}", | 125 | coverage: "Sinyalleri yüklenen öğrenci: {loaded}/{total}", |
| 118 | coverageNote: "Okul geneli sayılar yalnızca sinyalleri yüklenmiş öğrencileri kapsar.", | 126 | coverageNote: "Okul geneli sayılar yalnızca sinyalleri yüklenmiş öğrencileri kapsar.", |
| 119 | loadAll: "Kalan {count} öğrenciyi yükle", | 127 | loadAll: "Kalan {count} öğrenciyi yükle", |
| @@ -183,6 +191,10 @@ const en: Record<RunReportKey, string> = { | |||
| 183 | noIssues: "No issues", | 191 | noIssues: "No issues", |
| 184 | pendingStudents: "{count} students left for the next run", | 192 | pendingStudents: "{count} students left for the next run", |
| 185 | failedModules: "Modules that produced nothing: {modules}", | 193 | failedModules: "Modules that produced nothing: {modules}", |
| 194 | + pendingColumn: "Left pending", | ||
| 195 | + failedModulesColumn: "Modules without data", | ||
| 196 | + budgetOver: "Exceeded", | ||
| 197 | + budgetOk: "Within", | ||
| 186 | coverage: "Students with signals loaded: {loaded}/{total}", | 198 | coverage: "Students with signals loaded: {loaded}/{total}", |
| 187 | coverageNote: "School overview numbers cover only the students whose signals are loaded.", | 199 | coverageNote: "School overview numbers cover only the students whose signals are loaded.", |
| 188 | loadAll: "Load the remaining {count} students", | 200 | loadAll: "Load the remaining {count} students", |
src/i18n/locales/en.tsmodified+8 -1
| @@ -517,6 +517,7 @@ export const en: Dict = { | |||
| 517 | "roster.studentClass": "Class", | 517 | "roster.studentClass": "Class", |
| 518 | "roster.teacher": "Teacher", | 518 | "roster.teacher": "Teacher", |
| 519 | "roster.class": "Class", | 519 | "roster.class": "Class", |
| 520 | + "roster.enrolledVia": "Enrolled via", | ||
| 520 | "roster.term": "Term", | 521 | "roster.term": "Term", |
| 521 | "roster.termAll": "Term: All", | 522 | "roster.termAll": "Term: All", |
| 522 | "roster.mastery": "Topic mastery", | 523 | "roster.mastery": "Topic mastery", |
| @@ -555,6 +556,7 @@ export const en: Dict = { | |||
| 555 | "builder.createSchool": "New school", | 556 | "builder.createSchool": "New school", |
| 556 | "builder.createSchoolHint": "Creates the school's database and its first admin in one step.", | 557 | "builder.createSchoolHint": "Creates the school's database and its first admin in one step.", |
| 557 | "builder.schoolName": "School name", | 558 | "builder.schoolName": "School name", |
| 559 | + "builder.schoolId": "ID", | ||
| 558 | "builder.adminUsername": "Admin username", | 560 | "builder.adminUsername": "Admin username", |
| 559 | "builder.adminPassword": "Admin password", | 561 | "builder.adminPassword": "Admin password", |
| 560 | "builder.sellEverything": "Enable every module in the catalog", | 562 | "builder.sellEverything": "Enable every module in the catalog", |
| @@ -589,6 +591,7 @@ export const en: Dict = { | |||
| 589 | "modules.conflictRequires": "{module} needs {needed}, which is not enabled.", | 591 | "modules.conflictRequires": "{module} needs {needed}, which is not enabled.", |
| 590 | "modules.conflictRequiredBy": "{module} cannot be turned off: {dependents} depend on it.", | 592 | "modules.conflictRequiredBy": "{module} cannot be turned off: {dependents} depend on it.", |
| 591 | "modules.module": "Module", | 593 | "modules.module": "Module", |
| 594 | + "modules.package": "Package", | ||
| 592 | "modules.active": "Active", | 595 | "modules.active": "Active", |
| 593 | "modules.unitPrice": "Unit price", | 596 | "modules.unitPrice": "Unit price", |
| 594 | "modules.activeSeats": "Active seats", | 597 | "modules.activeSeats": "Active seats", |
| @@ -990,6 +993,7 @@ export const en: Dict = { | |||
| 990 | "dashboard.col.dueDate": "Due date", | 993 | "dashboard.col.dueDate": "Due date", |
| 991 | "dashboard.col.type": "Type", | 994 | "dashboard.col.type": "Type", |
| 992 | "dashboard.col.status": "Status", | 995 | "dashboard.col.status": "Status", |
| 996 | + "dashboard.col.section": "Course / Section", | ||
| 993 | "dashboard.type.exam": "Exam", | 997 | "dashboard.type.exam": "Exam", |
| 994 | "dashboard.type.event": "Event", | 998 | "dashboard.type.event": "Event", |
| 995 | "dashboard.type.payment": "Payment", | 999 | "dashboard.type.payment": "Payment", |
| @@ -1391,6 +1395,9 @@ export const en: Dict = { | |||
| 1391 | "appointments.series.weekly": "Weekly", | 1395 | "appointments.series.weekly": "Weekly", |
| 1392 | "appointments.series.once": "One-off", | 1396 | "appointments.series.once": "One-off", |
| 1393 | "appointments.time": "Time", | 1397 | "appointments.time": "Time", |
| 1398 | + "appointments.proposalPending": "New time proposed", | ||
| 1399 | + "appointments.proposal": "Time proposal", | ||
| 1400 | + "appointments.date": "Date", | ||
| 1394 | "appointments.status": "Status", | 1401 | "appointments.status": "Status", |
| 1395 | "appointments.publishSubtitle": "Offer a time window students can book. Repeat it weekly if you like.", | 1402 | "appointments.publishSubtitle": "Offer a time window students can book. Repeat it weekly if you like.", |
| 1396 | "appointments.bookSubtitle": "Tell the teacher why you would like to meet.", | 1403 | "appointments.bookSubtitle": "Tell the teacher why you would like to meet.", |
| @@ -1890,6 +1897,7 @@ export const en: Dict = { | |||
| 1890 | "homework.tab.open": "Open", | 1897 | "homework.tab.open": "Open", |
| 1891 | "homework.tab.past": "Past due", | 1898 | "homework.tab.past": "Past due", |
| 1892 | "homework.result": "Result", | 1899 | "homework.result": "Result", |
| 1900 | + "homework.mark": "Mark", | ||
| 1893 | "homework.grade": "Grade", | 1901 | "homework.grade": "Grade", |
| 1894 | "homework.ungrade": "Ungrade", | 1902 | "homework.ungrade": "Ungrade", |
| 1895 | "homework.student": "Student", | 1903 | "homework.student": "Student", |
| @@ -1917,7 +1925,6 @@ export const en: Dict = { | |||
| 1917 | "marks.tabByCourse": "By course", | 1925 | "marks.tabByCourse": "By course", |
| 1918 | "marks.selectCourse": "Course", | 1926 | "marks.selectCourse": "Course", |
| 1919 | "exams.mustBelongCourse": "Exams are created under a course. Open a course to add one.", | 1927 | "exams.mustBelongCourse": "Exams are created under a course. Open a course to add one.", |
| 1920 | - "homework.mark": "Mark", | ||
| 1921 | "exams.missingCourse": "Course unavailable", | 1928 | "exams.missingCourse": "Course unavailable", |
| 1922 | "exams.statistics": "Statistics", | 1929 | "exams.statistics": "Statistics", |
| 1923 | "exams.audience.tab": "Shared sections", | 1930 | "exams.audience.tab": "Shared sections", |
src/i18n/locales/tr.tsmodified+8 -1
| @@ -513,6 +513,7 @@ export const tr: Dict = { | |||
| 513 | "roster.studentClass": "Sınıfı", | 513 | "roster.studentClass": "Sınıfı", |
| 514 | "roster.teacher": "Öğretmen", | 514 | "roster.teacher": "Öğretmen", |
| 515 | "roster.class": "Sınıf", | 515 | "roster.class": "Sınıf", |
| 516 | + "roster.enrolledVia": "Kayıt yolu", | ||
| 516 | "roster.term": "Dönem", | 517 | "roster.term": "Dönem", |
| 517 | "roster.termAll": "Dönem: Tümü", | 518 | "roster.termAll": "Dönem: Tümü", |
| 518 | "roster.mastery": "Konu yetkinliği", | 519 | "roster.mastery": "Konu yetkinliği", |
| @@ -551,6 +552,7 @@ export const tr: Dict = { | |||
| 551 | "builder.createSchool": "Yeni okul", | 552 | "builder.createSchool": "Yeni okul", |
| 552 | "builder.createSchoolHint": "Okulun veritabanını ve ilk yöneticisini tek adımda oluşturur.", | 553 | "builder.createSchoolHint": "Okulun veritabanını ve ilk yöneticisini tek adımda oluşturur.", |
| 553 | "builder.schoolName": "Okul adı", | 554 | "builder.schoolName": "Okul adı", |
| 555 | + "builder.schoolId": "Kimlik", | ||
| 554 | "builder.adminUsername": "Yönetici kullanıcı adı", | 556 | "builder.adminUsername": "Yönetici kullanıcı adı", |
| 555 | "builder.adminPassword": "Yönetici şifresi", | 557 | "builder.adminPassword": "Yönetici şifresi", |
| 556 | "builder.sellEverything": "Katalogdaki tüm modülleri aç", | 558 | "builder.sellEverything": "Katalogdaki tüm modülleri aç", |
| @@ -585,6 +587,7 @@ export const tr: Dict = { | |||
| 585 | "modules.conflictRequires": "{module} için {needed} açık olmalı.", | 587 | "modules.conflictRequires": "{module} için {needed} açık olmalı.", |
| 586 | "modules.conflictRequiredBy": "{module} kapatılamaz: {dependents} buna bağlı.", | 588 | "modules.conflictRequiredBy": "{module} kapatılamaz: {dependents} buna bağlı.", |
| 587 | "modules.module": "Modül", | 589 | "modules.module": "Modül", |
| 590 | + "modules.package": "Paket", | ||
| 588 | "modules.active": "Etkin", | 591 | "modules.active": "Etkin", |
| 589 | "modules.unitPrice": "Birim fiyat", | 592 | "modules.unitPrice": "Birim fiyat", |
| 590 | "modules.activeSeats": "Aktif lisans", | 593 | "modules.activeSeats": "Aktif lisans", |
| @@ -986,6 +989,7 @@ export const tr: Dict = { | |||
| 986 | "dashboard.col.dueDate": "Son tarih", | 989 | "dashboard.col.dueDate": "Son tarih", |
| 987 | "dashboard.col.type": "Tür", | 990 | "dashboard.col.type": "Tür", |
| 988 | "dashboard.col.status": "Durum", | 991 | "dashboard.col.status": "Durum", |
| 992 | + "dashboard.col.section": "Ders / Şube", | ||
| 989 | "dashboard.type.exam": "Sınav", | 993 | "dashboard.type.exam": "Sınav", |
| 990 | "dashboard.type.event": "Etkinlik", | 994 | "dashboard.type.event": "Etkinlik", |
| 991 | "dashboard.type.payment": "Ödeme", | 995 | "dashboard.type.payment": "Ödeme", |
| @@ -1387,6 +1391,9 @@ export const tr: Dict = { | |||
| 1387 | "appointments.series.weekly": "Haftalık", | 1391 | "appointments.series.weekly": "Haftalık", |
| 1388 | "appointments.series.once": "Tek seferlik", | 1392 | "appointments.series.once": "Tek seferlik", |
| 1389 | "appointments.time": "Saat", | 1393 | "appointments.time": "Saat", |
| 1394 | + "appointments.proposalPending": "Yeni saat önerildi", | ||
| 1395 | + "appointments.proposal": "Saat önerisi", | ||
| 1396 | + "appointments.date": "Tarih", | ||
| 1390 | "appointments.status": "Durum", | 1397 | "appointments.status": "Durum", |
| 1391 | "appointments.publishSubtitle": "Öğrencilerin alabileceği bir saat aralığı sunun. İsterseniz haftalık tekrarlayın.", | 1398 | "appointments.publishSubtitle": "Öğrencilerin alabileceği bir saat aralığı sunun. İsterseniz haftalık tekrarlayın.", |
| 1392 | "appointments.bookSubtitle": "Öğretmene neden görüşmek istediğinizi belirtin.", | 1399 | "appointments.bookSubtitle": "Öğretmene neden görüşmek istediğinizi belirtin.", |
| @@ -1886,6 +1893,7 @@ export const tr: Dict = { | |||
| 1886 | "homework.tab.open": "Açık", | 1893 | "homework.tab.open": "Açık", |
| 1887 | "homework.tab.past": "Süresi geçen", | 1894 | "homework.tab.past": "Süresi geçen", |
| 1888 | "homework.result": "Sonuç", | 1895 | "homework.result": "Sonuç", |
| 1896 | + "homework.mark": "Puan", | ||
| 1889 | "homework.grade": "Notlandır", | 1897 | "homework.grade": "Notlandır", |
| 1890 | "homework.ungrade": "Notu kaldır", | 1898 | "homework.ungrade": "Notu kaldır", |
| 1891 | "homework.student": "Öğrenci", | 1899 | "homework.student": "Öğrenci", |
| @@ -1913,7 +1921,6 @@ export const tr: Dict = { | |||
| 1913 | "marks.tabByCourse": "Derslere göre", | 1921 | "marks.tabByCourse": "Derslere göre", |
| 1914 | "marks.selectCourse": "Ders", | 1922 | "marks.selectCourse": "Ders", |
| 1915 | "exams.mustBelongCourse": "Sınavlar ders altında oluşturulur. Eklemek için bir ders aç.", | 1923 | "exams.mustBelongCourse": "Sınavlar ders altında oluşturulur. Eklemek için bir ders aç.", |
| 1916 | - "homework.mark": "Puan", | ||
| 1917 | "exams.missingCourse": "Ders bilgisi yok", | 1924 | "exams.missingCourse": "Ders bilgisi yok", |
| 1918 | "exams.statistics": "İstatistikler", | 1925 | "exams.statistics": "İstatistikler", |
| 1919 | "exams.audience.tab": "Paylaşılan şubeler", | 1926 | "exams.audience.tab": "Paylaşılan şubeler", |
src/i18n/messages.tsmodified+11 -4
| @@ -453,6 +453,7 @@ export type MessageKey = | |||
| 453 | | "roster.studentClass" | 453 | | "roster.studentClass" |
| 454 | | "roster.teacher" | 454 | | "roster.teacher" |
| 455 | | "roster.class" | 455 | | "roster.class" |
| 456 | + | "roster.enrolledVia" | ||
| 456 | | "roster.term" | 457 | | "roster.term" |
| 457 | | "roster.termAll" | 458 | | "roster.termAll" |
| 458 | | "roster.mastery" | 459 | | "roster.mastery" |
| @@ -491,6 +492,7 @@ export type MessageKey = | |||
| 491 | | "builder.createSchool" | 492 | | "builder.createSchool" |
| 492 | | "builder.createSchoolHint" | 493 | | "builder.createSchoolHint" |
| 493 | | "builder.schoolName" | 494 | | "builder.schoolName" |
| 495 | + | "builder.schoolId" | ||
| 494 | | "builder.adminUsername" | 496 | | "builder.adminUsername" |
| 495 | | "builder.adminPassword" | 497 | | "builder.adminPassword" |
| 496 | | "builder.sellEverything" | 498 | | "builder.sellEverything" |
| @@ -524,6 +526,7 @@ export type MessageKey = | |||
| 524 | | "modules.on" | 526 | | "modules.on" |
| 525 | | "modules.off" | 527 | | "modules.off" |
| 526 | | "modules.module" | 528 | | "modules.module" |
| 529 | + | "modules.package" | ||
| 527 | | "modules.active" | 530 | | "modules.active" |
| 528 | | "modules.unitPrice" | 531 | | "modules.unitPrice" |
| 529 | | "modules.activeSeats" | 532 | | "modules.activeSeats" |
| @@ -585,9 +588,6 @@ export type MessageKey = | |||
| 585 | | "notifications.unreadCount" | 588 | | "notifications.unreadCount" |
| 586 | | "errors.notFoundDescription" | 589 | | "errors.notFoundDescription" |
| 587 | | "errors.accessDeniedDescription" | 590 | | "errors.accessDeniedDescription" |
| 588 | - | "network.offlineTitle" | ||
| 589 | - | "network.offlineDescription" | ||
| 590 | - | "network.reconnect" | ||
| 591 | | "errors.pageLoad.title" | 591 | | "errors.pageLoad.title" |
| 592 | | "errors.pageLoad.retry" | 592 | | "errors.pageLoad.retry" |
| 593 | | "errors.pageLoad.retryIn" | 593 | | "errors.pageLoad.retryIn" |
| @@ -615,6 +615,9 @@ export type MessageKey = | |||
| 615 | | "errors.recordNotFound.description" | 615 | | "errors.recordNotFound.description" |
| 616 | | "errors.recordNotFound.backToList" | 616 | | "errors.recordNotFound.backToList" |
| 617 | | "errors.recordNotFound.backHome" | 617 | | "errors.recordNotFound.backHome" |
| 618 | + | "network.offlineTitle" | ||
| 619 | + | "network.offlineDescription" | ||
| 620 | + | "network.reconnect" | ||
| 618 | | "parents.title" | 621 | | "parents.title" |
| 619 | | "parents.subtitle" | 622 | | "parents.subtitle" |
| 620 | | "common.loading" | 623 | | "common.loading" |
| @@ -977,6 +980,7 @@ export type MessageKey = | |||
| 977 | | "dashboard.col.dueDate" | 980 | | "dashboard.col.dueDate" |
| 978 | | "dashboard.col.type" | 981 | | "dashboard.col.type" |
| 979 | | "dashboard.col.status" | 982 | | "dashboard.col.status" |
| 983 | + | "dashboard.col.section" | ||
| 980 | | "dashboard.type.exam" | 984 | | "dashboard.type.exam" |
| 981 | | "dashboard.type.event" | 985 | | "dashboard.type.event" |
| 982 | | "dashboard.type.payment" | 986 | | "dashboard.type.payment" |
| @@ -1782,6 +1786,7 @@ export type MessageKey = | |||
| 1782 | | "homework.tab.open" | 1786 | | "homework.tab.open" |
| 1783 | | "homework.tab.past" | 1787 | | "homework.tab.past" |
| 1784 | | "homework.result" | 1788 | | "homework.result" |
| 1789 | + | "homework.mark" | ||
| 1785 | | "homework.grade" | 1790 | | "homework.grade" |
| 1786 | | "homework.ungrade" | 1791 | | "homework.ungrade" |
| 1787 | | "homework.student" | 1792 | | "homework.student" |
| @@ -1809,7 +1814,6 @@ export type MessageKey = | |||
| 1809 | | "marks.tabByCourse" | 1814 | | "marks.tabByCourse" |
| 1810 | | "marks.selectCourse" | 1815 | | "marks.selectCourse" |
| 1811 | | "exams.mustBelongCourse" | 1816 | | "exams.mustBelongCourse" |
| 1812 | - | "homework.mark" | ||
| 1813 | | "exams.missingCourse" | 1817 | | "exams.missingCourse" |
| 1814 | | "exams.statistics" | 1818 | | "exams.statistics" |
| 1815 | | "exams.audience.tab" | 1819 | | "exams.audience.tab" |
| @@ -2337,6 +2341,9 @@ export type MessageKey = | |||
| 2337 | | "appointments.series.weekly" | 2341 | | "appointments.series.weekly" |
| 2338 | | "appointments.series.once" | 2342 | | "appointments.series.once" |
| 2339 | | "appointments.time" | 2343 | | "appointments.time" |
| 2344 | + | "appointments.proposalPending" | ||
| 2345 | + | "appointments.proposal" | ||
| 2346 | + | "appointments.date" | ||
| 2340 | | "appointments.status" | 2347 | | "appointments.status" |
| 2341 | | "appointments.publishSubtitle" | 2348 | | "appointments.publishSubtitle" |
| 2342 | | "appointments.bookSubtitle" | 2349 | | "appointments.bookSubtitle" |
src/pages/academic-years-page.tsxmodified+18 -13
| @@ -150,19 +150,12 @@ function AcademicYearsContent() { | |||
| 150 | { | 150 | { |
| 151 | accessorKey: "name", | 151 | accessorKey: "name", |
| 152 | header: t("settings.name"), | 152 | header: t("settings.name"), |
| 153 | - size: 190, | 153 | + size: 170, |
| 154 | - minSize: 170, | 154 | + minSize: 150, |
| 155 | - // One line: a long name ends in "…" beside its badge rather than | 155 | + // One line: a long name ends in "…" (full name on hover and in the |
| 156 | - // wrapping; the full name is on hover and in the detail panel. | 156 | + // detail panel); the archived flag has its own column. |
| 157 | meta: { cellClass: "max-w-0" }, | 157 | meta: { cellClass: "max-w-0" }, |
| 158 | - cell: (cell) => ( | 158 | + cell: (cell) => <span class="block truncate font-medium" title={cell.row.original.name}>{cell.row.original.name}</span>, |
| 159 | - <span class="flex min-w-0 items-center justify-center gap-2 font-medium"> | ||
| 160 | - <span class="min-w-0 truncate" title={cell.row.original.name}>{cell.row.original.name}</span> | ||
| 161 | - <Show when={cell.row.original.archived_at != null}> | ||
| 162 | - <Badge variant="secondary" class="shrink-0 whitespace-nowrap rounded-full">{t("academicYears.archived")}</Badge> | ||
| 163 | - </Show> | ||
| 164 | - </span> | ||
| 165 | - ), | ||
| 166 | }, | 159 | }, |
| 167 | { | 160 | { |
| 168 | accessorKey: "starts_at", | 161 | accessorKey: "starts_at", |
| @@ -196,10 +189,22 @@ function AcademicYearsContent() { | |||
| 196 | minSize: 80, | 189 | minSize: 80, |
| 197 | meta: { cellClass: "text-center", align: "center" }, | 190 | meta: { cellClass: "text-center", align: "center" }, |
| 198 | }, | 191 | }, |
| 192 | + { | ||
| 193 | + accessorKey: "archived_at", | ||
| 194 | + header: t("academicYears.archived"), | ||
| 195 | + size: 115, | ||
| 196 | + minSize: 105, | ||
| 197 | + meta: { cellClass: "whitespace-nowrap" }, | ||
| 198 | + cell: (cell) => ( | ||
| 199 | + <Show when={cell.row.original.archived_at != null} fallback={<span class="text-muted-foreground">—</span>}> | ||
| 200 | + <Badge variant="secondary" class="shrink-0 whitespace-nowrap rounded-full">{t("academicYears.archived")}</Badge> | ||
| 201 | + </Show> | ||
| 202 | + ), | ||
| 203 | + }, | ||
| 199 | { | 204 | { |
| 200 | id: "actions", | 205 | id: "actions", |
| 201 | header: t("common.actions"), | 206 | header: t("common.actions"), |
| 202 | - meta: { headerClass: "w-14 text-center", cellClass: "px-1 text-center" }, | 207 | + meta: { headerClass: "w-[110px] min-w-[110px] max-w-[110px] h-[45px] text-center whitespace-nowrap", cellClass: "text-center" }, |
| 203 | cell: (cell) => { | 208 | cell: (cell) => { |
| 204 | const year = cell.row.original; | 209 | const year = cell.row.original; |
| 205 | const archived = year.archived_at != null; | 210 | const archived = year.archived_at != null; |
src/pages/appointments-page.tsxmodified+50 -59
| @@ -140,19 +140,45 @@ function AppointmentsContent() { | |||
| 140 | sameDay(starts, ends) | 140 | sameDay(starts, ends) |
| 141 | ? `${formatDateTime(starts, locale())} – ${timeOnly(ends)}` | 141 | ? `${formatDateTime(starts, locale())} – ${timeOnly(ends)}` |
| 142 | : `${formatDateTime(starts, locale())} — ${formatDateTime(ends, locale())}`; | 142 | : `${formatDateTime(starts, locale())} — ${formatDateTime(ends, locale())}`; |
| 143 | - // Stacked date/time cell: date on top, clock range below (tabular-nums so | 143 | + // One value per cell: the date and the clock range are separate columns so |
| 144 | - // digits line up across rows). Same-day windows show one date; cross-day | 144 | + // every row stays one line tall. A cross-day window names the end date |
| 145 | - // spells out the end date on the second line. | 145 | + // inside the (single-line) range. |
| 146 | - const timeCell = (starts: number | null, ends: number | null) => ( | 146 | + const dateCell = (starts: number | null) => <span class="whitespace-nowrap tabular-nums">{formatDate(starts, locale())}</span>; |
| 147 | - <div class="flex flex-col text-xs leading-tight tabular-nums"> | 147 | + const rangeText = (starts: number | null, ends: number | null) => |
| 148 | - <span class="text-foreground">{formatDate(starts, locale())}</span> | 148 | + sameDay(starts, ends) |
| 149 | - <span class="text-muted-foreground"> | 149 | + ? `${timeOnly(starts)} – ${timeOnly(ends)}` |
| 150 | - {sameDay(starts, ends) | 150 | + : `${timeOnly(starts)} → ${formatDate(ends, locale())} ${timeOnly(ends)}`; |
| 151 | - ? `${timeOnly(starts)} – ${timeOnly(ends)}` | 151 | + const rangeCell = (starts: number | null, ends: number | null) => { |
| 152 | - : `${timeOnly(starts)} → ${formatDate(ends, locale())} ${timeOnly(ends)}`} | 152 | + const text = rangeText(starts, ends); |
| 153 | - </span> | 153 | + return <span class="block truncate tabular-nums text-muted-foreground" title={text}>{text}</span>; |
| 154 | - </div> | 154 | + }; |
| 155 | - ); | 155 | + const windowColumns = <T extends { starts_at: number | null; ends_at: number | null }>(): ColumnDef<T>[] => [ |
| 156 | + { | ||
| 157 | + id: "date", | ||
| 158 | + accessorFn: (row) => row.starts_at ?? 0, | ||
| 159 | + header: t("appointments.date"), | ||
| 160 | + meta: { cellClass: "whitespace-nowrap" }, | ||
| 161 | + cell: (cell) => dateCell(cell.row.original.starts_at), | ||
| 162 | + }, | ||
| 163 | + { | ||
| 164 | + id: "time", | ||
| 165 | + header: t("appointments.time"), | ||
| 166 | + meta: { cellClass: "max-w-0" }, | ||
| 167 | + cell: (cell) => rangeCell(cell.row.original.starts_at, cell.row.original.ends_at), | ||
| 168 | + }, | ||
| 169 | + ]; | ||
| 170 | + // A standing reschedule proposal is its own flag column, not a caption | ||
| 171 | + // under the time (the row's window already IS the proposed one). | ||
| 172 | + const proposalColumn = (): ColumnDef<Appointment> => ({ | ||
| 173 | + id: "proposal", | ||
| 174 | + accessorFn: (row) => (hasStandingProposal(row) ? 1 : 0), | ||
| 175 | + header: t("appointments.proposal"), | ||
| 176 | + meta: { headerClass: "text-center", cellClass: "text-center" }, | ||
| 177 | + cell: (cell) => | ||
| 178 | + hasStandingProposal(cell.row.original) | ||
| 179 | + ? <Badge variant="info" class="rounded-full">{t("appointments.proposalPending")}</Badge> | ||
| 180 | + : <span class="text-muted-foreground">—</span>, | ||
| 181 | + }); | ||
| 156 | const statusBadge = (status: AppointmentStatus) => ( | 182 | const statusBadge = (status: AppointmentStatus) => ( |
| 157 | <Badge variant="outline" class={cn("w-28 justify-center rounded-full", appointmentStatusClass(status))}> | 183 | <Badge variant="outline" class={cn("w-28 justify-center rounded-full", appointmentStatusClass(status))}> |
| 158 | <span class={cn("mr-1.5 h-1.5 w-1.5 rounded-full", appointmentStatusDotClass(status))} /> | 184 | <span class={cn("mr-1.5 h-1.5 w-1.5 rounded-full", appointmentStatusDotClass(status))} /> |
| @@ -176,25 +202,20 @@ function AppointmentsContent() { | |||
| 176 | const slotBooking = (slotId: string) => (appts.latest ?? []).find((a) => a.slot === slotId && isLive(a.status)); | 202 | const slotBooking = (slotId: string) => (appts.latest ?? []).find((a) => a.slot === slotId && isLive(a.status)); |
| 177 | 203 | ||
| 178 | const slotColumns = createMemo<ColumnDef<AppointmentSlot>[]>(() => [ | 204 | const slotColumns = createMemo<ColumnDef<AppointmentSlot>[]>(() => [ |
| 179 | - { | 205 | + ...windowColumns<AppointmentSlot>(), |
| 180 | - id: "time", | ||
| 181 | - header: t("appointments.time"), | ||
| 182 | - meta: { headerClass: "w-44", cellClass: "align-top pr-4" }, | ||
| 183 | - cell: (cell) => timeCell(cell.row.original.starts_at, cell.row.original.ends_at), | ||
| 184 | - }, | ||
| 185 | { | 206 | { |
| 186 | id: "status", | 207 | id: "status", |
| 187 | header: t("appointments.status"), | 208 | header: t("appointments.status"), |
| 188 | meta: { headerClass: "text-center", cellClass: "text-center" }, | 209 | meta: { headerClass: "text-center", cellClass: "text-center" }, |
| 189 | cell: (cell) => { | 210 | cell: (cell) => { |
| 190 | const booking = slotBooking(cell.row.original.id); | 211 | const booking = slotBooking(cell.row.original.id); |
| 191 | - return booking ? statusBadge(booking.status) : <span class="text-xs text-muted-foreground">{t("appointments.availableSlots")}</span>; | 212 | + return booking ? statusBadge(booking.status) : <span class="text-muted-foreground">{t("appointments.availableSlots")}</span>; |
| 192 | }, | 213 | }, |
| 193 | }, | 214 | }, |
| 194 | { | 215 | { |
| 195 | id: "actions", | 216 | id: "actions", |
| 196 | header: t("common.actions"), | 217 | header: t("common.actions"), |
| 197 | - meta: { headerClass: "text-center", cellClass: "w-28 min-w-[7rem] text-center whitespace-nowrap" }, | 218 | + meta: { headerClass: "w-[110px] min-w-[110px] max-w-[110px] h-[45px] text-center whitespace-nowrap", cellClass: "text-center" }, |
| 198 | cell: (cell) => { | 219 | cell: (cell) => { |
| 199 | const slot = cell.row.original; | 220 | const slot = cell.row.original; |
| 200 | const actions = [{ | 221 | const actions = [{ |
| @@ -237,19 +258,8 @@ function AppointmentsContent() { | |||
| 237 | header: t("appointments.student"), | 258 | header: t("appointments.student"), |
| 238 | cell: (cell) => <span class="block truncate font-medium">{personLabel(cell.row.original.requester)}</span>, | 259 | cell: (cell) => <span class="block truncate font-medium">{personLabel(cell.row.original.requester)}</span>, |
| 239 | }, | 260 | }, |
| 240 | - { | 261 | + ...windowColumns<Appointment>(), |
| 241 | - id: "time", | 262 | + proposalColumn(), |
| 242 | - header: t("appointments.time"), | ||
| 243 | - meta: { headerClass: "w-44", cellClass: "align-top pr-4" }, | ||
| 244 | - cell: (cell) => ( | ||
| 245 | - <div class="flex flex-col gap-0.5"> | ||
| 246 | - {timeCell(cell.row.original.starts_at, cell.row.original.ends_at)} | ||
| 247 | - <Show when={hasStandingProposal(cell.row.original)}> | ||
| 248 | - <div class="text-info-text text-xs">{t("appointments.rescheduleProposed")}</div> | ||
| 249 | - </Show> | ||
| 250 | - </div> | ||
| 251 | - ), | ||
| 252 | - }, | ||
| 253 | { | 263 | { |
| 254 | id: "status", | 264 | id: "status", |
| 255 | header: t("appointments.status"), | 265 | header: t("appointments.status"), |
| @@ -259,7 +269,7 @@ function AppointmentsContent() { | |||
| 259 | { | 269 | { |
| 260 | id: "actions", | 270 | id: "actions", |
| 261 | header: t("common.actions"), | 271 | header: t("common.actions"), |
| 262 | - meta: { headerClass: "text-center", cellClass: "w-28 min-w-[7rem] text-center whitespace-nowrap" }, | 272 | + meta: { headerClass: "w-[110px] min-w-[110px] max-w-[110px] h-[45px] text-center whitespace-nowrap", cellClass: "text-center" }, |
| 263 | cell: (cell) => { | 273 | cell: (cell) => { |
| 264 | const a = cell.row.original; | 274 | const a = cell.row.original; |
| 265 | const actions = [] as { label: string; icon: import("solid-js").JSX.Element; destructive?: boolean; onSelect: () => void }[]; | 275 | const actions = [] as { label: string; icon: import("solid-js").JSX.Element; destructive?: boolean; onSelect: () => void }[]; |
| @@ -291,16 +301,11 @@ function AppointmentsContent() { | |||
| 291 | header: t("appointments.teacher"), | 301 | header: t("appointments.teacher"), |
| 292 | cell: (cell) => <span class="block truncate font-medium">{personLabel(cell.row.original.teacher)}</span>, | 302 | cell: (cell) => <span class="block truncate font-medium">{personLabel(cell.row.original.teacher)}</span>, |
| 293 | }, | 303 | }, |
| 294 | - { | 304 | + ...windowColumns<AppointmentSlot>(), |
| 295 | - id: "time", | ||
| 296 | - header: t("appointments.time"), | ||
| 297 | - meta: { headerClass: "w-44", cellClass: "align-top pr-4" }, | ||
| 298 | - cell: (cell) => timeCell(cell.row.original.starts_at, cell.row.original.ends_at), | ||
| 299 | - }, | ||
| 300 | { | 305 | { |
| 301 | id: "actions", | 306 | id: "actions", |
| 302 | header: t("common.actions"), | 307 | header: t("common.actions"), |
| 303 | - meta: { headerClass: "w-40 text-center", cellClass: "w-40 min-w-[10rem] text-center whitespace-nowrap" }, | 308 | + meta: { headerClass: "w-[110px] min-w-[110px] max-w-[110px] h-[45px] text-center whitespace-nowrap", cellClass: "text-center" }, |
| 304 | cell: (cell) => ( | 309 | cell: (cell) => ( |
| 305 | <TableRowActions | 310 | <TableRowActions |
| 306 | label={t("common.actions")} | 311 | label={t("common.actions")} |
| @@ -327,22 +332,8 @@ function AppointmentsContent() { | |||
| 327 | header: t("appointments.teacher"), | 332 | header: t("appointments.teacher"), |
| 328 | cell: (cell) => <span class="block truncate font-medium">{personLabel(cell.row.original.teacher)}</span>, | 333 | cell: (cell) => <span class="block truncate font-medium">{personLabel(cell.row.original.teacher)}</span>, |
| 329 | }, | 334 | }, |
| 330 | - { | 335 | + ...windowColumns<Appointment>(), |
| 331 | - id: "time", | 336 | + proposalColumn(), |
| 332 | - header: t("appointments.time"), | ||
| 333 | - meta: { headerClass: "w-44", cellClass: "align-top pr-4" }, | ||
| 334 | - cell: (cell) => ( | ||
| 335 | - <div class="flex flex-col gap-0.5"> | ||
| 336 | - {/* The effective window IS the proposal while one stands (backend | ||
| 337 | - `Appointment::window`), so the row's own time already shows the | ||
| 338 | - proposed one — label it instead of printing it twice. */} | ||
| 339 | - <Show when={hasStandingProposal(cell.row.original)}> | ||
| 340 | - <div class="text-info-text text-xs">{t("appointments.proposedTime")}:</div> | ||
| 341 | - </Show> | ||
| 342 | - {timeCell(cell.row.original.starts_at, cell.row.original.ends_at)} | ||
| 343 | - </div> | ||
| 344 | - ), | ||
| 345 | - }, | ||
| 346 | { | 337 | { |
| 347 | id: "status", | 338 | id: "status", |
| 348 | header: t("appointments.status"), | 339 | header: t("appointments.status"), |
| @@ -352,7 +343,7 @@ function AppointmentsContent() { | |||
| 352 | { | 343 | { |
| 353 | id: "actions", | 344 | id: "actions", |
| 354 | header: t("common.actions"), | 345 | header: t("common.actions"), |
| 355 | - meta: { headerClass: "text-center", cellClass: "w-28 min-w-[7rem] text-center whitespace-nowrap" }, | 346 | + meta: { headerClass: "w-[110px] min-w-[110px] max-w-[110px] h-[45px] text-center whitespace-nowrap", cellClass: "text-center" }, |
| 356 | cell: (cell) => { | 347 | cell: (cell) => { |
| 357 | const a = cell.row.original; | 348 | const a = cell.row.original; |
| 358 | const actions = [] as { label: string; icon: import("solid-js").JSX.Element; destructive?: boolean; onSelect: () => void }[]; | 349 | const actions = [] as { label: string; icon: import("solid-js").JSX.Element; destructive?: boolean; onSelect: () => void }[]; |
src/pages/builder-schools-page.tsxmodified+10 -5
| @@ -66,12 +66,17 @@ function BuilderSchoolsContent() { | |||
| 66 | { | 66 | { |
| 67 | accessorKey: "name", | 67 | accessorKey: "name", |
| 68 | header: t("builder.schoolName"), | 68 | header: t("builder.schoolName"), |
| 69 | + meta: { cellClass: "max-w-0" }, | ||
| 70 | + cell: (cell) => <span class="block truncate font-medium" title={cell.row.original.name}>{cell.row.original.name}</span>, | ||
| 71 | + }, | ||
| 72 | + { | ||
| 73 | + // Short id in its own column (full id on hover) instead of a caption | ||
| 74 | + // under the name, so every row stays one line tall. | ||
| 75 | + accessorKey: "id", | ||
| 76 | + header: t("builder.schoolId"), | ||
| 69 | cell: (cell) => ( | 77 | cell: (cell) => ( |
| 70 | - <span class="block min-w-0"> | 78 | + <span class="font-mono text-xs text-text-subtle" title={cell.row.original.id}> |
| 71 | - <span class="block font-medium">{cell.row.original.name}</span> | 79 | + {cell.row.original.id.slice(0, 8)} |
| 72 | - <span class="block truncate font-mono text-xs text-text-subtle" title={cell.row.original.id}> | ||
| 73 | - {cell.row.original.id.slice(0, 8)} | ||
| 74 | - </span> | ||
| 75 | </span> | 80 | </span> |
| 76 | ), | 81 | ), |
| 77 | }, | 82 | }, |
src/pages/classes-page.tsxmodified+1 -1
| @@ -197,7 +197,7 @@ function ClassesContent() { | |||
| 197 | { | 197 | { |
| 198 | id: "actions", | 198 | id: "actions", |
| 199 | header: t("common.actions"), | 199 | header: t("common.actions"), |
| 200 | - meta: { headerClass: "w-28 min-w-28 text-center whitespace-nowrap", cellClass: "px-1 text-center" }, | 200 | + meta: { headerClass: "w-[110px] min-w-[110px] max-w-[110px] h-[45px] text-center whitespace-nowrap", cellClass: "text-center" }, |
| 201 | cell: (cell) => ( | 201 | cell: (cell) => ( |
| 202 | <TableRowActions | 202 | <TableRowActions |
| 203 | label={t("common.actions")} | 203 | label={t("common.actions")} |
src/pages/course-detail-page.tsxmodified+2 -2
| @@ -162,7 +162,7 @@ function CourseDetailContent() { | |||
| 162 | header: t("classGroups.className"), | 162 | header: t("classGroups.className"), |
| 163 | meta: { cellClass: "font-medium" }, | 163 | meta: { cellClass: "font-medium" }, |
| 164 | cell: (cell) => ( | 164 | cell: (cell) => ( |
| 165 | - <Link to="/instances/$id" params={{ id: cell.row.original.id }} class="hover:text-primary-text hover:underline"> | 165 | + <Link to="/instances/$id" params={{ id: cell.row.original.id }} class="block truncate hover:text-primary-text hover:underline" title={cell.row.original.class_name}> |
| 166 | {cell.row.original.class_name} | 166 | {cell.row.original.class_name} |
| 167 | </Link> | 167 | </Link> |
| 168 | ), | 168 | ), |
| @@ -209,7 +209,7 @@ function CourseDetailContent() { | |||
| 209 | { | 209 | { |
| 210 | id: "actions", | 210 | id: "actions", |
| 211 | header: t("common.actions"), | 211 | header: t("common.actions"), |
| 212 | - meta: { headerClass: "w-14 text-center", cellClass: "px-1 text-center" }, | 212 | + meta: { headerClass: "w-[110px] min-w-[110px] max-w-[110px] h-[45px] text-center whitespace-nowrap", cellClass: "text-center" }, |
| 213 | cell: (cell) => ( | 213 | cell: (cell) => ( |
| 214 | <Show when={canManageCatalog()}> | 214 | <Show when={canManageCatalog()}> |
| 215 | <TableRowActions | 215 | <TableRowActions |
src/pages/courses-page.tsxmodified+34 -18
| @@ -100,35 +100,51 @@ function CoursesContent() { | |||
| 100 | { | 100 | { |
| 101 | accessorKey: "title", | 101 | accessorKey: "title", |
| 102 | header: t("form.title"), | 102 | header: t("form.title"), |
| 103 | - size: 280, | 103 | + size: 200, |
| 104 | - minSize: 200, | 104 | + minSize: 160, |
| 105 | meta: { cellClass: "max-w-0" }, | 105 | meta: { cellClass: "max-w-0" }, |
| 106 | + cell: (cell) => <span class="block truncate font-medium" title={cell.row.original.title}>{cell.row.original.title}</span>, | ||
| 107 | + }, | ||
| 108 | + { | ||
| 109 | + // The description is its own column (one line, "…" + hover for the | ||
| 110 | + // rest) rather than a caption under the title. | ||
| 111 | + id: "description", | ||
| 112 | + accessorFn: (row) => row.description ?? "", | ||
| 113 | + header: t("form.description"), | ||
| 114 | + size: 220, | ||
| 115 | + minSize: 160, | ||
| 116 | + enableSorting: false, | ||
| 117 | + meta: { cellClass: "max-w-0 text-text-subtle" }, | ||
| 106 | cell: (cell) => ( | 118 | cell: (cell) => ( |
| 107 | - // Always two lines, description or not, so every row is the same height. | 119 | + <span class="block truncate" title={cell.row.original.description || undefined}> |
| 108 | - <div class="min-w-0"> | 120 | + {cell.row.original.description || "—"} |
| 109 | - <p class="truncate font-medium" title={cell.row.original.title}>{cell.row.original.title}</p> | 121 | + </span> |
| 110 | - <p class="truncate text-xs text-text-subtle" title={cell.row.original.description || undefined}> | ||
| 111 | - {cell.row.original.description || "—"} | ||
| 112 | - </p> | ||
| 113 | - </div> | ||
| 114 | ), | 122 | ), |
| 115 | }, | 123 | }, |
| 116 | { | 124 | { |
| 117 | id: "kind", | 125 | id: "kind", |
| 118 | accessorFn: (row) => courseKindLabel(row.kind, t), | 126 | accessorFn: (row) => courseKindLabel(row.kind, t), |
| 119 | header: t("exams.kind"), | 127 | header: t("exams.kind"), |
| 120 | - size: 120, | 128 | + size: 110, |
| 121 | minSize: 100, | 129 | minSize: 100, |
| 122 | - meta: { cellClass: "whitespace-nowrap" }, | 130 | + meta: { cellClass: "whitespace-nowrap text-center" }, |
| 123 | cell: (cell) => ( | 131 | cell: (cell) => ( |
| 124 | - <div class="flex w-full items-center justify-center gap-1.5"> | 132 | + <Badge variant="outline" class="rounded-md text-[11px] font-medium">{courseKindLabel(cell.row.original.kind, t)}</Badge> |
| 125 | - <Badge variant="outline" class="rounded-md text-[11px] font-medium">{courseKindLabel(cell.row.original.kind, t)}</Badge> | ||
| 126 | - <Show when={auth.user()?.role === "student"}> | ||
| 127 | - <Badge variant="secondary" class="rounded-md text-[11px]">{t("courses.enrolled")}</Badge> | ||
| 128 | - </Show> | ||
| 129 | - </div> | ||
| 130 | ), | 133 | ), |
| 131 | }, | 134 | }, |
| 135 | + // A student sees only the courses they take: the "enrolled" marker is its | ||
| 136 | + // own column for them rather than a second badge in the kind cell. | ||
| 137 | + ...(auth.user()?.role === "student" | ||
| 138 | + ? [{ | ||
| 139 | + id: "enrolled", | ||
| 140 | + header: t("roster.status"), | ||
| 141 | + size: 100, | ||
| 142 | + minSize: 90, | ||
| 143 | + enableSorting: false, | ||
| 144 | + meta: { cellClass: "whitespace-nowrap text-center" }, | ||
| 145 | + cell: () => <Badge variant="secondary" class="rounded-md text-[11px]">{t("courses.enrolled")}</Badge>, | ||
| 146 | + } satisfies ColumnDef<Course>] | ||
| 147 | + : []), | ||
| 132 | { | 148 | { |
| 133 | id: "sections", | 149 | id: "sections", |
| 134 | accessorFn: (row) => row.class_course_count, | 150 | accessorFn: (row) => row.class_course_count, |
| @@ -148,7 +164,7 @@ function CoursesContent() { | |||
| 148 | { | 164 | { |
| 149 | id: "actions", | 165 | id: "actions", |
| 150 | header: t("common.actions"), | 166 | header: t("common.actions"), |
| 151 | - meta: { headerClass: "w-28 min-w-28 text-center whitespace-nowrap", cellClass: "px-1 text-center" }, | 167 | + meta: { headerClass: "w-[110px] min-w-[110px] max-w-[110px] h-[45px] text-center whitespace-nowrap", cellClass: "text-center" }, |
| 152 | cell: (cell) => ( | 168 | cell: (cell) => ( |
| 153 | <TableRowActions | 169 | <TableRowActions |
| 154 | label={t("common.actions")} | 170 | label={t("common.actions")} |
src/pages/dashboard-page.tsxmodified+17 -9
| @@ -688,15 +688,23 @@ function DashboardContent() { | |||
| 688 | accessorKey: "title", | 688 | accessorKey: "title", |
| 689 | header: t("dashboard.col.task"), | 689 | header: t("dashboard.col.task"), |
| 690 | enableSorting: false, | 690 | enableSorting: false, |
| 691 | - meta: { headerClass }, | 691 | + meta: { headerClass, cellClass: "max-w-0" }, |
| 692 | - cell: (info) => ( | 692 | + cell: (info) => <span class="block truncate font-medium" title={info.row.original.title}>{info.row.original.title}</span>, |
| 693 | - <div class="min-w-0"> | 693 | + }, |
| 694 | - <span class="block truncate font-medium">{info.row.original.title}</span> | 694 | + { |
| 695 | - <Show when={deadlineSection(info.row.original)}> | 695 | + // "<ders> — <şube>" in its own column, not a caption under the title, |
| 696 | - {(section) => <span class="block truncate text-xs text-text-subtle">{section()}</span>} | 696 | + // so every row stays one line tall. |
| 697 | - </Show> | 697 | + id: "section", |
| 698 | - </div> | 698 | + accessorFn: (row) => deadlineSection(row) ?? "", |
| 699 | - ), | 699 | + header: t("dashboard.col.section"), |
| 700 | + enableSorting: false, | ||
| 701 | + meta: { headerClass, cellClass: "max-w-0" }, | ||
| 702 | + cell: (info) => { | ||
| 703 | + const section = deadlineSection(info.row.original); | ||
| 704 | + return section | ||
| 705 | + ? <span class="block truncate text-text-subtle" title={section}>{section}</span> | ||
| 706 | + : <span class="text-muted-foreground">—</span>; | ||
| 707 | + }, | ||
| 700 | }, | 708 | }, |
| 701 | { | 709 | { |
| 702 | accessorKey: "kind", | 710 | accessorKey: "kind", |
src/pages/event-detail-page.tsxmodified+1 -1
| @@ -138,7 +138,7 @@ function EventDetailContent() { | |||
| 138 | { | 138 | { |
| 139 | id: "actions", | 139 | id: "actions", |
| 140 | header: t("common.actions"), | 140 | header: t("common.actions"), |
| 141 | - meta: { headerClass: "w-14 text-center", cellClass: "px-1 text-center" }, | 141 | + meta: { headerClass: "w-[110px] min-w-[110px] max-w-[110px] h-[45px] text-center whitespace-nowrap", cellClass: "text-center" }, |
| 142 | cell: (cell) => ( | 142 | cell: (cell) => ( |
| 143 | <TableRowActions | 143 | <TableRowActions |
| 144 | label={t("common.actions")} | 144 | label={t("common.actions")} |
src/pages/events-page.tsxmodified+20 -16
| @@ -131,29 +131,32 @@ function EventsContent() { | |||
| 131 | header: t("events.title"), | 131 | header: t("events.title"), |
| 132 | size: 220, | 132 | size: 220, |
| 133 | minSize: 180, | 133 | minSize: 180, |
| 134 | + meta: { cellClass: "max-w-0" }, | ||
| 134 | cell: (cell) => ( | 135 | cell: (cell) => ( |
| 135 | - <div class="min-w-0"> | 136 | + <Link to="/events/$id" params={{ id: cell.row.original.id }} class="block truncate font-medium hover:text-primary-text hover:underline" title={cell.row.original.title}> |
| 136 | - <Link to="/events/$id" params={{ id: cell.row.original.id }} class="truncate font-medium hover:text-primary-text hover:underline"> | 137 | + {cell.row.original.title} |
| 137 | - {cell.row.original.title} | 138 | + </Link> |
| 138 | - </Link> | ||
| 139 | - </div> | ||
| 140 | ), | 139 | ), |
| 141 | }, | 140 | }, |
| 141 | + // Start and end are separate columns (one date-time each) so every row | ||
| 142 | + // stays one line tall. | ||
| 142 | { | 143 | { |
| 143 | id: "time", | 144 | id: "time", |
| 144 | accessorFn: (event) => event.starts_at ?? event.ends_at ?? 0, | 145 | accessorFn: (event) => event.starts_at ?? event.ends_at ?? 0, |
| 145 | header: t("events.starts"), | 146 | header: t("events.starts"), |
| 146 | - size: 190, | 147 | + size: 160, |
| 147 | - minSize: 160, | 148 | + minSize: 140, |
| 148 | - meta: { cellClass: "text-xs text-muted-foreground" }, | 149 | + meta: { cellClass: "whitespace-nowrap text-muted-foreground" }, |
| 149 | - cell: (cell) => ( | 150 | + cell: (cell) => formatDateTime(cell.row.original.starts_at, locale()), |
| 150 | - <div class="whitespace-nowrap"> | 151 | + }, |
| 151 | - <p>{formatDateTime(cell.row.original.starts_at, locale())}</p> | 152 | + { |
| 152 | - <Show when={cell.row.original.ends_at}> | 153 | + id: "ends", |
| 153 | - <p class="text-[11px]">→ {formatDateTime(cell.row.original.ends_at, locale())}</p> | 154 | + accessorFn: (event) => event.ends_at ?? 0, |
| 154 | - </Show> | 155 | + header: t("events.ends"), |
| 155 | - </div> | 156 | + size: 160, |
| 156 | - ), | 157 | + minSize: 140, |
| 158 | + meta: { cellClass: "whitespace-nowrap text-muted-foreground" }, | ||
| 159 | + cell: (cell) => (cell.row.original.ends_at ? formatDateTime(cell.row.original.ends_at, locale()) : "—"), | ||
| 157 | }, | 160 | }, |
| 158 | { | 161 | { |
| 159 | id: "audience", | 162 | id: "audience", |
| @@ -181,6 +184,7 @@ function EventsContent() { | |||
| 181 | { | 184 | { |
| 182 | id: "actions", | 185 | id: "actions", |
| 183 | header: t("common.actions"), | 186 | header: t("common.actions"), |
| 187 | + meta: { headerClass: "w-[110px] min-w-[110px] max-w-[110px] h-[45px] text-center whitespace-nowrap", cellClass: "text-center" }, | ||
| 184 | cell: (cell) => ( | 188 | cell: (cell) => ( |
| 185 | <TableRowActions | 189 | <TableRowActions |
| 186 | label={t("common.actions")} | 190 | label={t("common.actions")} |
src/pages/exams-page.tsxmodified+1 -3
| @@ -203,9 +203,7 @@ function ExamsContent() { | |||
| 203 | size: 220, | 203 | size: 220, |
| 204 | minSize: 160, | 204 | minSize: 160, |
| 205 | cell: (cell) => ( | 205 | cell: (cell) => ( |
| 206 | - <div class="min-w-0"> | 206 | + <span class="block truncate font-medium" title={cell.row.original.title}>{cell.row.original.title}</span> |
| 207 | - <p class="truncate font-medium">{cell.row.original.title}</p> | ||
| 208 | - </div> | ||
| 209 | ), | 207 | ), |
| 210 | }, | 208 | }, |
| 211 | { | 209 | { |
src/pages/homework-page.tsxmodified+3 -5
| @@ -174,9 +174,7 @@ function HomeworkContent() { | |||
| 174 | minSize: 180, | 174 | minSize: 180, |
| 175 | meta: { cellClass: "font-medium" }, | 175 | meta: { cellClass: "font-medium" }, |
| 176 | cell: (cell) => ( | 176 | cell: (cell) => ( |
| 177 | - <div class="min-w-0"> | 177 | + <span class="block truncate font-medium" title={cell.row.original.title}>{cell.row.original.title}</span> |
| 178 | - <p class="truncate font-medium">{cell.row.original.title}</p> | ||
| 179 | - </div> | ||
| 180 | ), | 178 | ), |
| 181 | }, | 179 | }, |
| 182 | { | 180 | { |
| @@ -186,7 +184,7 @@ function HomeworkContent() { | |||
| 186 | size: 180, | 184 | size: 180, |
| 187 | minSize: 140, | 185 | minSize: 140, |
| 188 | meta: { cellClass: "max-w-0 truncate text-text-subtle" }, | 186 | meta: { cellClass: "max-w-0 truncate text-text-subtle" }, |
| 189 | - cell: (cell) => <span class="block truncate">{courseName(cell.row.original.class_course)}</span>, | 187 | + cell: (cell) => <span class="block truncate" title={courseName(cell.row.original.class_course)}>{courseName(cell.row.original.class_course)}</span>, |
| 190 | }, | 188 | }, |
| 191 | { | 189 | { |
| 192 | id: "due_at", | 190 | id: "due_at", |
| @@ -208,7 +206,7 @@ function HomeworkContent() { | |||
| 208 | { | 206 | { |
| 209 | id: "actions", | 207 | id: "actions", |
| 210 | header: t("common.actions"), | 208 | header: t("common.actions"), |
| 211 | - meta: { headerClass: "text-center", cellClass: "px-1 text-center" }, | 209 | + meta: { headerClass: "w-[110px] min-w-[110px] max-w-[110px] h-[45px] text-center whitespace-nowrap", cellClass: "text-center" }, |
| 212 | cell: (cell) => ( | 210 | cell: (cell) => ( |
| 213 | <TableRowActions | 211 | <TableRowActions |
| 214 | label={t("common.actions")} | 212 | label={t("common.actions")} |
src/pages/instance-detail-page.tsxmodified+28 -17
| @@ -236,17 +236,22 @@ function InstanceDetailContent() { | |||
| 236 | id: "student", | 236 | id: "student", |
| 237 | accessorFn: (row) => row.user.display_name || row.user.username, | 237 | accessorFn: (row) => row.user.display_name || row.user.username, |
| 238 | header: t("roster.studentName"), | 238 | header: t("roster.studentName"), |
| 239 | - meta: { cellClass: "font-medium" }, | 239 | + meta: { cellClass: "max-w-0 font-medium" }, |
| 240 | - cell: (cell) => ( | 240 | + cell: (cell) => { |
| 241 | - <span class="flex items-center gap-2"> | 241 | + const name = cell.row.original.user.display_name || t("exams.nameless"); |
| 242 | - {cell.row.original.user.display_name || t("exams.nameless")} | 242 | + return <span class="block truncate" title={name}>{name}</span>; |
| 243 | - <Show when={cell.row.original.source}> | 243 | + }, |
| 244 | - <Badge variant="secondary" class="rounded-full text-xs font-normal"> | 244 | + }, |
| 245 | - {t("course.fromClass", { name: klass.latest?.name ?? "—" })} | 245 | + { |
| 246 | - </Badge> | 246 | + // How the student got here (through the şube vs. added directly) is its |
| 247 | - </Show> | 247 | + // own column, not a badge beside the name. |
| 248 | - </span> | 248 | + id: "source", |
| 249 | - ), | 249 | + accessorFn: (row) => (row.source ? 1 : 0), |
| 250 | + header: t("roster.enrolledVia"), | ||
| 251 | + cell: (cell) => | ||
| 252 | + cell.row.original.source | ||
| 253 | + ? <Badge variant="secondary" class="rounded-full text-xs font-normal">{t("course.fromClass", { name: klass.latest?.name ?? "—" })}</Badge> | ||
| 254 | + : <span class="text-muted-foreground">—</span>, | ||
| 250 | }, | 255 | }, |
| 251 | { | 256 | { |
| 252 | id: "class", | 257 | id: "class", |
| @@ -258,7 +263,7 @@ function InstanceDetailContent() { | |||
| 258 | { | 263 | { |
| 259 | id: "actions", | 264 | id: "actions", |
| 260 | header: t("common.actions"), | 265 | header: t("common.actions"), |
| 261 | - meta: { headerClass: "w-14 text-center", cellClass: "px-1 text-center" }, | 266 | + meta: { headerClass: "w-[110px] min-w-[110px] max-w-[110px] h-[45px] text-center whitespace-nowrap", cellClass: "text-center" }, |
| 262 | cell: (cell) => ( | 267 | cell: (cell) => ( |
| 263 | <Show when={canManage()}> | 268 | <Show when={canManage()}> |
| 264 | <TableRowActions | 269 | <TableRowActions |
| @@ -285,9 +290,9 @@ function InstanceDetailContent() { | |||
| 285 | { | 290 | { |
| 286 | accessorKey: "title", | 291 | accessorKey: "title", |
| 287 | header: t("form.title"), | 292 | header: t("form.title"), |
| 288 | - meta: { cellClass: "font-medium" }, | 293 | + meta: { cellClass: "max-w-0 font-medium" }, |
| 289 | cell: (cell) => ( | 294 | cell: (cell) => ( |
| 290 | - <ExamLink examId={cell.row.original.id} class="hover:text-primary-text hover:underline"> | 295 | + <ExamLink examId={cell.row.original.id} class="block truncate hover:text-primary-text hover:underline" title={cell.row.original.title}> |
| 291 | {cell.row.original.title} | 296 | {cell.row.original.title} |
| 292 | </ExamLink> | 297 | </ExamLink> |
| 293 | ), | 298 | ), |
| @@ -299,12 +304,18 @@ function InstanceDetailContent() { | |||
| 299 | cell: (cell) => ( | 304 | cell: (cell) => ( |
| 300 | <Badge variant="outline" class="rounded-full capitalize"> | 305 | <Badge variant="outline" class="rounded-full capitalize"> |
| 301 | {examKindLabel(String(cell.row.original.kind), t)} | 306 | {examKindLabel(String(cell.row.original.kind), t)} |
| 302 | - <Show when={examWeight(cell.row.original, sectionWeights())}> | ||
| 303 | - {(weight) => <span class="ml-1 text-text-subtle">({t("courses.weight")}: {weight()})</span>} | ||
| 304 | - </Show> | ||
| 305 | </Badge> | 307 | </Badge> |
| 306 | ), | 308 | ), |
| 307 | }, | 309 | }, |
| 310 | + { | ||
| 311 | + // The kind's weight in this şube's average: its own column, not a | ||
| 312 | + // parenthesised suffix inside the kind badge. | ||
| 313 | + id: "weight", | ||
| 314 | + accessorFn: (row) => examWeight(row, sectionWeights()) ?? -1, | ||
| 315 | + header: t("courses.weight"), | ||
| 316 | + meta: { cellClass: "tabular-nums" }, | ||
| 317 | + cell: (cell) => examWeight(cell.row.original, sectionWeights()) ?? "—", | ||
| 318 | + }, | ||
| 308 | { | 319 | { |
| 309 | id: "mode", | 320 | id: "mode", |
| 310 | accessorFn: (row) => examModeLabel(row.mode), | 321 | accessorFn: (row) => examModeLabel(row.mode), |
src/pages/license-modules-page.tsxmodified+28 -15
| @@ -50,22 +50,35 @@ function LicenseModulesContent() { | |||
| 50 | { | 50 | { |
| 51 | id: "module", | 51 | id: "module", |
| 52 | header: t("modules.module"), | 52 | header: t("modules.module"), |
| 53 | - cell: (cell) => ( | 53 | + meta: { cellClass: "max-w-0" }, |
| 54 | - <div class="flex min-w-0 items-center gap-2.5"> | 54 | + cell: (cell) => { |
| 55 | - <span class="flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-surface-tint text-text-subtle"> | 55 | + const label = moduleLabel(cell.row.original.module, t); |
| 56 | - <IconPackage class="h-4 w-4" /> | 56 | + return ( |
| 57 | + <span class="flex min-w-0 items-center gap-2 font-medium text-text-strong"> | ||
| 58 | + <IconPackage class="h-4 w-4 shrink-0 text-text-subtle" /> | ||
| 59 | + <span class="truncate" title={label}>{label}</span> | ||
| 57 | </span> | 60 | </span> |
| 58 | - <div class="min-w-0"> | 61 | + ); |
| 59 | - <p class="truncate text-sm font-medium text-text-strong">{moduleLabel(cell.row.original.module, t)}</p> | 62 | + }, |
| 60 | - <p class="truncate text-xs text-text-subtle"> | 63 | + }, |
| 61 | - {packageLabel(cell.row.original.package, t)} | 64 | + // Package and prerequisites are their own columns rather than a caption |
| 62 | - <Show when={cell.row.original.requires.length > 0}> | 65 | + // line under the module name, so every row stays one line tall. |
| 63 | - {` · ${t("modules.requires")}: ${cell.row.original.requires.map((name) => moduleLabel(name, t)).join(", ")}`} | 66 | + { |
| 64 | - </Show> | 67 | + id: "package", |
| 65 | - </p> | 68 | + accessorFn: (row) => packageLabel(row.package, t), |
| 66 | - </div> | 69 | + header: t("modules.package"), |
| 67 | - </div> | 70 | + meta: { cellClass: "max-w-0 text-text-subtle" }, |
| 68 | - ), | 71 | + }, |
| 72 | + { | ||
| 73 | + id: "requires", | ||
| 74 | + accessorFn: (row) => row.requires.map((name) => moduleLabel(name, t)).join(", "), | ||
| 75 | + header: t("modules.requires"), | ||
| 76 | + enableSorting: false, | ||
| 77 | + meta: { cellClass: "max-w-0 text-text-subtle" }, | ||
| 78 | + cell: (cell) => { | ||
| 79 | + const text = cell.row.original.requires.map((name) => moduleLabel(name, t)).join(", "); | ||
| 80 | + return text ? <span class="block truncate" title={text}>{text}</span> : "—"; | ||
| 81 | + }, | ||
| 69 | }, | 82 | }, |
| 70 | { | 83 | { |
| 71 | id: "status", | 84 | id: "status", |
src/pages/live-monitor-page.tsxmodified+1 -1
| @@ -233,7 +233,7 @@ function LiveMonitorContent() { | |||
| 233 | { | 233 | { |
| 234 | id: "actions", | 234 | id: "actions", |
| 235 | header: t("common.actions"), | 235 | header: t("common.actions"), |
| 236 | - meta: { headerClass: "w-28 min-w-28 text-center whitespace-nowrap" }, | 236 | + meta: { headerClass: "w-[110px] min-w-[110px] max-w-[110px] h-[45px] text-center whitespace-nowrap", cellClass: "text-center" }, |
| 237 | cell: (cell) => ( | 237 | cell: (cell) => ( |
| 238 | <TableRowActions | 238 | <TableRowActions |
| 239 | label={t("common.actions")} | 239 | label={t("common.actions")} |
src/pages/question-bank-page.tsxmodified+13 -8
| @@ -111,14 +111,19 @@ function QuestionBankContent() { | |||
| 111 | { | 111 | { |
| 112 | accessorKey: "text", | 112 | accessorKey: "text", |
| 113 | header: t("questions.text"), | 113 | header: t("questions.text"), |
| 114 | - cell: (cell) => ( | 114 | + meta: { cellClass: "max-w-0" }, |
| 115 | - <div class="min-w-0"> | 115 | + cell: (cell) => <span class="block truncate font-medium" title={cell.row.original.text}>{cell.row.original.text}</span>, |
| 116 | - <p class="max-w-[30rem] truncate font-medium">{cell.row.original.text}</p> | 116 | + }, |
| 117 | - <Show when={cell.row.original.subject_name}> | 117 | + { |
| 118 | - <p class="truncate text-xs text-muted-foreground">{cell.row.original.subject_name}</p> | 118 | + // The subject is its own column, not a caption under the question. |
| 119 | - </Show> | 119 | + id: "subject", |
| 120 | - </div> | 120 | + accessorFn: (row) => row.subject_name ?? "", |
| 121 | - ), | 121 | + header: t("subjects.subject"), |
| 122 | + meta: { cellClass: "max-w-0 text-muted-foreground" }, | ||
| 123 | + cell: (cell) => { | ||
| 124 | + const subject = cell.row.original.subject_name; | ||
| 125 | + return subject ? <span class="block truncate" title={subject}>{subject}</span> : "—"; | ||
| 126 | + }, | ||
| 122 | }, | 127 | }, |
| 123 | { | 128 | { |
| 124 | accessorKey: "kind", | 129 | accessorKey: "kind", |
src/pages/staff-work-page.tsxmodified+11 -7
| @@ -189,13 +189,17 @@ function StaffWorkContent() { | |||
| 189 | id: "time", | 189 | id: "time", |
| 190 | accessorFn: (row) => row.check_in, | 190 | accessorFn: (row) => row.check_in, |
| 191 | header: t("work.checkIn"), | 191 | header: t("work.checkIn"), |
| 192 | - meta: { cellClass: "text-xs" }, | 192 | + meta: { cellClass: "text-xs whitespace-nowrap" }, |
| 193 | - cell: (cell) => ( | 193 | + cell: (cell) => formatDateTime(cell.row.original.check_in, locale()), |
| 194 | - <div class="whitespace-nowrap"> | 194 | + }, |
| 195 | - <p>{formatDateTime(cell.row.original.check_in, locale())}</p> | 195 | + // Check-out is its own column (as on the work-log page), not a second |
| 196 | - <p class="text-[11px] text-muted-foreground">→ {formatDateTime(cell.row.original.check_out, locale())}</p> | 196 | + // line under check-in. |
| 197 | - </div> | 197 | + { |
| 198 | - ), | 198 | + id: "checkOut", |
| 199 | + accessorFn: (row) => row.check_out ?? 0, | ||
| 200 | + header: t("work.checkOut"), | ||
| 201 | + meta: { cellClass: "text-xs whitespace-nowrap text-muted-foreground" }, | ||
| 202 | + cell: (cell) => formatDateTime(cell.row.original.check_out, locale()), | ||
| 199 | }, | 203 | }, |
| 200 | { | 204 | { |
| 201 | accessorKey: "duration_ms", | 205 | accessorKey: "duration_ms", |
src/pages/student-pomodoro-page.tsxmodified+1 -1
| @@ -82,7 +82,7 @@ function StudentPomodoroContent() { | |||
| 82 | { | 82 | { |
| 83 | id: "actions", | 83 | id: "actions", |
| 84 | header: t("common.actions"), | 84 | header: t("common.actions"), |
| 85 | - meta: { headerClass: "w-28 min-w-28 text-center whitespace-nowrap" }, | 85 | + meta: { headerClass: "w-[110px] min-w-[110px] max-w-[110px] h-[45px] text-center whitespace-nowrap", cellClass: "text-center" }, |
| 86 | cell: (cell) => ( | 86 | cell: (cell) => ( |
| 87 | <TableRowActions | 87 | <TableRowActions |
| 88 | label={t("common.actions")} | 88 | label={t("common.actions")} |
src/pages/students-roster-page.tsxmodified+2 -1
| @@ -98,8 +98,9 @@ function StudentsRosterContent() { | |||
| 98 | id: "class", | 98 | id: "class", |
| 99 | size: 90, | 99 | size: 90, |
| 100 | header: t("roster.class"), | 100 | header: t("roster.class"), |
| 101 | + meta: { cellClass: "max-w-0" }, | ||
| 101 | cell: (cell) => ( | 102 | cell: (cell) => ( |
| 102 | - <span class="truncate text-sm">{cell.row.original.classes.map((cls) => cls.name).join(", ") || "—"}</span> | 103 | + <span class="block truncate text-sm" title={cell.row.original.classes.map((cls) => cls.name).join(", ") || undefined}>{cell.row.original.classes.map((cls) => cls.name).join(", ") || "—"}</span> |
| 103 | ), | 104 | ), |
| 104 | }, | 105 | }, |
| 105 | { | 106 | { |
src/pages/teachers-roster-page.tsxmodified+2 -1
| @@ -99,7 +99,8 @@ function TeachersRosterContent() { | |||
| 99 | size: 130, | 99 | size: 130, |
| 100 | accessorFn: (row) => row.homeroom.join(", "), | 100 | accessorFn: (row) => row.homeroom.join(", "), |
| 101 | header: t("roster.homeroomOf"), | 101 | header: t("roster.homeroomOf"), |
| 102 | - cell: (cell) => <span class="truncate text-sm">{cell.row.original.homeroom.join(", ") || "—"}</span>, | 102 | + meta: { cellClass: "max-w-0" }, |
| 103 | + cell: (cell) => <span class="block truncate text-sm" title={cell.row.original.homeroom.join(", ") || undefined}>{cell.row.original.homeroom.join(", ") || "—"}</span>, | ||
| 103 | }, | 104 | }, |
| 104 | { | 105 | { |
| 105 | id: "actions", | 106 | id: "actions", |
src/pages/terms-page.tsxmodified+1 -1
| @@ -129,7 +129,7 @@ function TermsContent() { | |||
| 129 | { | 129 | { |
| 130 | id: "actions", | 130 | id: "actions", |
| 131 | header: t("common.actions"), | 131 | header: t("common.actions"), |
| 132 | - meta: { headerClass: "w-28 min-w-28 text-center whitespace-nowrap" }, | 132 | + meta: { headerClass: "w-[110px] min-w-[110px] max-w-[110px] h-[45px] text-center whitespace-nowrap", cellClass: "text-center" }, |
| 133 | cell: (cell) => ( | 133 | cell: (cell) => ( |
| 134 | <TableRowActions | 134 | <TableRowActions |
| 135 | label={t("common.actions")} | 135 | label={t("common.actions")} |