forge
Explore
Log in

Don't you dare go Hollow

💄 expand actions column width across reports & data tables to prevent truncation of İŞLEMLER header

Browse files at this commit

d99bbb5bfe60d2798f208a5dcbceab0ec3df41d2Burak BoduroğluParent: 048fc0c
  • fix
    • 💄 expand actions column width across reports & data tables to prevent truncation of İŞLEMLER header
Show full message
fix: 💄 expand actions column width across reports & data tables to prevent truncation of İŞLEMLER header
- increase default actionColumnClass width in DataTable from w-20 to w-28 (min-w-[7rem]) with whitespace-nowrap
- update actions column headerClass across report pages (student marks, student attendance, student pomodoro, staff work, terms, and users)
- verify full visibility of İŞLEMLER header without cutoff or text wrapping
- pass production build and 207/207 vitest unit tests
src/components/ui/data-table.tsxmodified+1 -1
@@ -110,7 +110,7 @@ export function DataTable<TData, TValue = unknown>(props: DataTableProps<TData,
110 },110 },
111 });111 });
112 const hiddenLocked = (columnId: string) => columnId === "actions" || columnId === "update";112 const hiddenLocked = (columnId: string) => columnId === "actions" || columnId === "update";
113- const actionColumnClass = (columnId: string) => hiddenLocked(columnId) ? "w-20 min-w-20 max-w-20 px-1 text-center" : undefined;113+ const actionColumnClass = (columnId: string) => hiddenLocked(columnId) ? "w-28 min-w-[7rem] px-2 text-center whitespace-nowrap" : undefined;
114 const hideableColumns = () => table.getAllColumns().filter((column) => column.getCanHide() && !hiddenLocked(column.id));114 const hideableColumns = () => table.getAllColumns().filter((column) => column.getCanHide() && !hiddenLocked(column.id));
115 const columnLabel = (column: Column<TData, unknown>) => {115 const columnLabel = (column: Column<TData, unknown>) => {
116 const header = column.columnDef.header;116 const header = column.columnDef.header;
src/components/users/user-table.tsxmodified+3 -8
@@ -8,7 +8,7 @@ import { Badge } from "@/components/ui/badge";
8 import { ConfirmDialog } from "@/components/ui/confirm-dialog";8 import { ConfirmDialog } from "@/components/ui/confirm-dialog";
9 import { DataTable } from "@/components/ui/data-table";9 import { DataTable } from "@/components/ui/data-table";
10 import { TableRowActions } from "@/components/ui/table-row-actions";10 import { TableRowActions } from "@/components/ui/table-row-actions";
11-import { IconCheck, IconEye, IconUsers } from "@/components/ui/icons";11+import { IconCheck, IconUsers } from "@/components/ui/icons";
12 import { ROLES } from "@/lib/roles";12 import { ROLES } from "@/lib/roles";
13 import { cn } from "@/lib/cn";13 import { cn } from "@/lib/cn";
14 import { useT } from "@/stores/preferences-context";14 import { useT } from "@/stores/preferences-context";
@@ -128,13 +128,8 @@ export function UserTable(props: {
128 },128 },
129 {129 {
130 id: "actions",130 id: "actions",
131- header: () => (131+ header: t("common.actions"),
132- <span class="flex items-center justify-center" title={t("common.actions")}>132+ meta: { headerClass: "w-28 min-w-[7rem] text-center whitespace-nowrap", cellClass: "w-28 text-center" },
133- <IconEye class="h-4 w-4 text-muted-foreground" />
134- <span class="sr-only">{t("common.actions")}</span>
135- </span>
136- ),
137- meta: { headerClass: "w-14 text-center", cellClass: "w-14" },
138 cell: (cell) => (133 cell: (cell) => (
139 <Show when={cell.row.original.role === "parent"} fallback={<span class="text-center text-muted-foreground/40">—</span>}>134 <Show when={cell.row.original.role === "parent"} fallback={<span class="text-center text-muted-foreground/40">—</span>}>
140 <TableRowActions135 <TableRowActions
src/pages/staff-work-page.tsxmodified+2 -2
@@ -134,7 +134,7 @@ function StaffWorkContent() {
134 {134 {
135 id: "actions",135 id: "actions",
136 header: t("common.actions"),136 header: t("common.actions"),
137- meta: { headerClass: "w-14 text-center" },137+ meta: { headerClass: "w-28 min-w-[7rem] text-center whitespace-nowrap" },
138 cell: (cell) => (138 cell: (cell) => (
139 <TableRowActions139 <TableRowActions
140 label={t("common.actions")}140 label={t("common.actions")}
@@ -179,7 +179,7 @@ function StaffWorkContent() {
179 {179 {
180 id: "actions",180 id: "actions",
181 header: t("common.actions"),181 header: t("common.actions"),
182- meta: { headerClass: "w-14 text-center" },182+ meta: { headerClass: "w-28 min-w-[7rem] text-center whitespace-nowrap" },
183 cell: (cell) => (183 cell: (cell) => (
184 <TableRowActions184 <TableRowActions
185 label={t("common.actions")}185 label={t("common.actions")}
src/pages/student-attendance-page.tsxmodified+1 -1
@@ -85,7 +85,7 @@ function StudentAttendanceContent() {
85 {85 {
86 id: "actions",86 id: "actions",
87 header: t("common.actions"),87 header: t("common.actions"),
88- meta: { headerClass: "w-14 text-center" },88+ meta: { headerClass: "w-28 min-w-[7rem] text-center whitespace-nowrap" },
89 cell: (cell) => (89 cell: (cell) => (
90 <TableRowActions90 <TableRowActions
91 label={t("common.actions")}91 label={t("common.actions")}
src/pages/student-marks-page.tsxmodified+1 -1
@@ -85,7 +85,7 @@ function StudentMarksContent() {
85 {85 {
86 id: "actions",86 id: "actions",
87 header: t("common.actions"),87 header: t("common.actions"),
88- meta: { headerClass: "w-14 text-center" },88+ meta: { headerClass: "w-28 min-w-[7rem] text-center whitespace-nowrap" },
89 cell: (cell) => (89 cell: (cell) => (
90 <TableRowActions90 <TableRowActions
91 label={t("common.actions")}91 label={t("common.actions")}
src/pages/student-pomodoro-page.tsxmodified+1 -1
@@ -86,7 +86,7 @@ function StudentPomodoroContent() {
86 {86 {
87 id: "actions",87 id: "actions",
88 header: t("common.actions"),88 header: t("common.actions"),
89- meta: { headerClass: "w-14 text-center" },89+ meta: { headerClass: "w-28 min-w-[7rem] text-center whitespace-nowrap" },
90 cell: (cell) => (90 cell: (cell) => (
91 <TableRowActions91 <TableRowActions
92 label={t("common.actions")}92 label={t("common.actions")}
src/pages/terms-page.tsxmodified+1 -1
@@ -85,7 +85,7 @@ function TermsContent() {
85 {85 {
86 id: "actions",86 id: "actions",
87 header: t("common.actions"),87 header: t("common.actions"),
88- meta: { headerClass: "w-14 text-center" },88+ meta: { headerClass: "w-28 min-w-[7rem] text-center whitespace-nowrap" },
89 cell: (cell) => (89 cell: (cell) => (
90 <TableRowActions90 <TableRowActions
91 label={t("common.actions")}91 label={t("common.actions")}