forge
Explore
Log in

Don't you dare go Hollow

🧩 simplify class group surfaces

Browse files at this commit

8af6c6efae6b99c631691a9d44d72cefb7897169Burak BoduroğluParent: 45223be
  • refactor
    • 🧩 simplify class group surfaces
Show full message
refactor: 🧩 simplify class group surfaces

- remove redundant class list heading copy and split toolbar from class cards\n- make school year badges use available card width\n- keep academic year and term badges from collapsing in table cells
src/pages/academic-years-page.tsxmodified+3 -3
@@ -150,10 +150,10 @@ function AcademicYearsContent() {
150 minSize: 170,150 minSize: 170,
151 meta: { cellClass: "min-w-0" },151 meta: { cellClass: "min-w-0" },
152 cell: (cell) => (152 cell: (cell) => (
153- <span class="flex min-w-0 items-center gap-2 font-medium">153+ <span class="flex min-w-0 flex-wrap items-center justify-center gap-2 font-medium">
154- <span class="truncate">{cell.row.original.name}</span>154+ <span class="min-w-0 truncate">{cell.row.original.name}</span>
155 <Show when={cell.row.original.archived_at != null}>155 <Show when={cell.row.original.archived_at != null}>
156- <Badge variant="secondary" class="rounded-full">{t("academicYears.archived")}</Badge>156+ <Badge variant="secondary" class="shrink-0 whitespace-nowrap rounded-full">{t("academicYears.archived")}</Badge>
157 </Show>157 </Show>
158 </span>158 </span>
159 ),159 ),
src/pages/classes-page.tsxmodified+6 -8
@@ -10,7 +10,6 @@ import { BlueprintSkippedReport } from "@/components/classes/blueprint-skipped-r
10 import { RouteGuard } from "@/components/layout/route-guard";10 import { RouteGuard } from "@/components/layout/route-guard";
11 import { DataToolbar } from "@/components/ui/data-toolbar";11 import { DataToolbar } from "@/components/ui/data-toolbar";
12 import { DropdownSelect, Select } from "@/components/ui/select";12 import { DropdownSelect, Select } from "@/components/ui/select";
13-import { DataSection } from "@/components/ui/data-section";
14 import { Alert } from "@/components/ui/alert";13 import { Alert } from "@/components/ui/alert";
15 import { Badge } from "@/components/ui/badge";14 import { Badge } from "@/components/ui/badge";
16 import { Button } from "@/components/ui/button";15 import { Button } from "@/components/ui/button";
@@ -223,10 +222,7 @@ function ClassesContent() {
223 </Show>222 </Show>
224 223
225 <TabsContent value="classes">224 <TabsContent value="classes">
226- <DataSection225+ <div class="space-y-4">
227- title={t("classGroups.title")}
228- description={t("classGroups.subtitle")}
229- >
230 <div class="rounded-xl border border-border-line bg-surface-base p-3 shadow-xs">226 <div class="rounded-xl border border-border-line bg-surface-base p-3 shadow-xs">
231 <DataToolbar227 <DataToolbar
232 searchValue={query()}228 searchValue={query()}
@@ -274,7 +270,7 @@ function ClassesContent() {
274 </div>270 </div>
275 </Show>271 </Show>
276 </Suspense>272 </Suspense>
277- </DataSection>273+ </div>
278 </TabsContent>274 </TabsContent>
279 275
280 <TabsContent value="blueprints">276 <TabsContent value="blueprints">
@@ -303,8 +299,10 @@ function ClassCard(props: { cls: ClassGroup; yearName: string; memberCount: numb
303 </div>299 </div>
304 <IconChevronRight class="h-4 w-4 shrink-0 text-text-subtle transition-transform group-hover:translate-x-0.5 group-hover:text-primary-text" />300 <IconChevronRight class="h-4 w-4 shrink-0 text-text-subtle transition-transform group-hover:translate-x-0.5 group-hover:text-primary-text" />
305 </div>301 </div>
306- <div class="flex items-center gap-2 text-xs text-text-subtle">302+ <div class="grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-2 text-xs text-text-subtle">
307- <Badge variant="outline" class="min-w-0 max-w-[65%] rounded-full bg-transparent"><span class="truncate">{props.yearName}</span></Badge>303+ <Badge variant="outline" class="min-w-0 max-w-full justify-start rounded-full bg-transparent" title={props.yearName}>
304+ <span class="min-w-0 truncate">{props.yearName}</span>
305+ </Badge>
308 <Show when={props.memberCount != null} fallback={<span class="shrink-0 text-xs text-text-subtle">—</span>}>306 <Show when={props.memberCount != null} fallback={<span class="shrink-0 text-xs text-text-subtle">—</span>}>
309 <span class="shrink-0">{t("classGroups.studentsCount", { count: String(props.memberCount) })}</span>307 <span class="shrink-0">{t("classGroups.studentsCount", { count: String(props.memberCount) })}</span>
310 </Show>308 </Show>
src/pages/terms-page.tsxmodified+1 -1
@@ -118,7 +118,7 @@ function TermsContent() {
118 meta: { cellClass: "whitespace-nowrap" },118 meta: { cellClass: "whitespace-nowrap" },
119 cell: (cell) => (119 cell: (cell) => (
120 <Show when={cell.row.original.archived_at != null} fallback={<span class="text-muted-foreground">—</span>}>120 <Show when={cell.row.original.archived_at != null} fallback={<span class="text-muted-foreground">—</span>}>
121- <Badge variant="secondary" class="rounded-full">{t("terms.archived")}</Badge>121+ <Badge variant="secondary" class="shrink-0 whitespace-nowrap rounded-full">{t("terms.archived")}</Badge>
122 </Show>122 </Show>
123 ),123 ),
124 },124 },