forge
Explore
Log in

Don't you dare go Hollow

📐 let detail pages use the full width and drop the holidays card

Browse files at this commit

b05b03b49f5977d22804e96010548c807718357fBurak BoduroğluParent: 881f809
  • fix
    • 📐 let detail pages use the full width and drop the holidays card
Show full message
fix: 📐 let detail pages use the full width and drop the holidays card

- remove the 1100/1240/1440px and max-w-4xl caps from detail pages
- holidays table sits in a plain section like every other list page
- success trend chart spans two columns on the student and teacher
  boards and only keeps a 480px floor, so it stops scrolling sideways
  inside its card on a 1280px screen
src/components/ui/chart-line.tsxmodified+3 -1
@@ -118,9 +118,11 @@ export const ChartLine: Component<ChartLineProps> = (props) => {
118118 </div>
119119 </dl>
120120
121+ {/* The floor only keeps axis text legible on a phone: at 640px it
122+ forced a sideways scroller into the card on a 1280px screen. */}
121123 <div class="overflow-x-auto pb-1">
122124 <svg
123- class="h-60 min-w-[640px] w-full"
125+ class="h-60 min-w-[480px] w-full"
124126 viewBox={`0 0 ${VIEW_WIDTH} ${VIEW_HEIGHT}`}
125127 role="img"
126128 aria-label={props.items.map((item) => `${item.label}${item.caption ? ` (${item.caption})` : ""}: ${item.formattedValue ?? item.value}`).join(", ")}
src/pages/admin-user-detail-page.tsxmodified+1 -1
@@ -63,7 +63,7 @@ function AdminUserDetailContent() {
6363 }
6464 >
6565 {(current) => (
66- <div class="mx-auto w-full max-w-[1100px] space-y-5">
66+ <div class="w-full space-y-5">
6767 <Show when={error()}>
6868 <Alert variant="destructive">{error()}</Alert>
6969 </Show>
src/pages/bank-question-detail-page.tsxmodified+1 -1
@@ -97,7 +97,7 @@ function BankQuestionDetailContent() {
9797 }
9898 >
9999 {(current) => (
100- <div class="mx-auto w-full max-w-[1100px] space-y-6">
100+ <div class="w-full space-y-6">
101101 <Show when={error()}>
102102 <Alert variant="destructive">{error()}</Alert>
103103 </Show>
src/pages/class-detail-page.tsxmodified+1 -1
@@ -283,7 +283,7 @@ function ClassDetailContent() {
283283 }
284284 >
285285 {(c) => (
286- <div class="mx-auto w-full max-w-[1440px] space-y-4">
286+ <div class="w-full space-y-4">
287287 <section class="rounded-xl border border-border-line bg-surface-base px-4 py-3 shadow-xs sm:px-5">
288288 <Breadcrumbs items={[{ label: t("classGroups.title"), to: "/management/classes" }, { label: c().name }]} />
289289 <PageHeader
src/pages/course-detail-page.tsxmodified+1 -1
@@ -264,7 +264,7 @@ function CourseDetailContent() {
264264 {(c) => (
265265 <Show when={accessReady()} fallback={<PageSpinner />}>
266266 <Show when={canViewCourse()} fallback={<Alert variant="destructive">{t("common.accessDenied")}</Alert>}>
267- <div class="mx-auto w-full max-w-[1440px] space-y-4">
267+ <div class="w-full space-y-4">
268268 <section class="rounded-xl border border-border-line bg-surface-base px-4 py-3 shadow-xs sm:px-5">
269269 <Breadcrumbs
270270 items={[
src/pages/dashboard-page.tsxmodified+4 -1
@@ -848,7 +848,7 @@ function DashboardContent() {
848848 (this week's pomodoro minutes), so it gets the rail slot the
849849 design reserves for that kind of card. */}
850850 <div class="grid grid-cols-1 gap-3 lg:grid-cols-4">
851- <div class="grid grid-cols-1 gap-3 sm:grid-cols-2 lg:col-span-3 lg:grid-cols-3">
851+ <div class="grid grid-cols-1 gap-3 sm:grid-cols-2 lg:col-span-3">
852852 <Show when={on("marks")}>
853853 <ChartBar
854854 title={t("dashboard.progressOverview")}
@@ -858,6 +858,7 @@ function DashboardContent() {
858858 itemsPerPage={5}
859859 />
860860 <ChartLine
861+ class="sm:order-first sm:col-span-2"
861862 title={t("dashboard.successTrend")}
862863 subtitle={t("dashboard.successTrendMine")}
863864 items={myMarkTrend()}
@@ -927,12 +928,14 @@ function DashboardContent() {
927928 <Show when={on("exams")}>
928929 <div class="grid grid-cols-1 gap-3 sm:grid-cols-2 lg:col-span-2">
929930 <ChartLine
931+ class="sm:col-span-2"
930932 title={t("dashboard.successTrend")}
931933 subtitle={t("dashboard.successTrendSchool")}
932934 items={examAverageTrend()}
933935 maxScale={100}
934936 />
935937 <ChartBar
938+ class="sm:col-span-2"
936939 title={t("dashboard.courseAverages")}
937940 subtitle={t("dashboard.courseAveragesSchool")}
938941 items={courseAverageBars()}
src/pages/exam-detail-page.tsxmodified+1 -1
@@ -401,7 +401,7 @@ function ExamDetailContent() {
401401 {(ex) => (
402402 <Show when={accessReady()} fallback={<PageSpinner />}>
403403 <Show when={canViewExam()} fallback={<Alert variant="destructive">{t("common.accessDenied")}</Alert>}>
404- <div class="mx-auto w-full max-w-[1100px] space-y-5">
404+ <div class="w-full space-y-5">
405405 <section class="data-shell space-y-2 p-4 sm:p-5">
406406 <Breadcrumbs items={[{ label: t("exams.title"), to: "/exams" }, { label: ex().title }]} />
407407 <PageHeader
src/pages/holidays-page.tsxmodified+1 -1
@@ -148,7 +148,7 @@ function HolidaysContent() {
148148 <Show when={flash()}><Alert variant="success">{flash()}</Alert></Show>
149149 <Show when={error() && !panelOpen()}><Alert variant="destructive">{error()}</Alert></Show>
150150
151- <section class="data-shell space-y-4 p-0">
151+ <section class="space-y-4">
152152 <Suspense fallback={<DataTableSkeleton columns={5} rows={6} />}>
153153 <Show when={list.error}>
154154 <ErrorAlert message={formatApiError(list.error)} onRetry={() => void refetch()} />
src/pages/homework-detail-page.tsxmodified+1 -1
@@ -63,7 +63,7 @@ export default function HomeworkDetailPage() {
6363 fallback={<Show when={homework.error} fallback={<PageSpinner />}><Alert variant="destructive">{formatApiError(homework.error, locale())}</Alert></Show>}
6464 >
6565 {(item) => (
66- <div class="mx-auto w-full max-w-[1100px] space-y-5">
66+ <div class="w-full space-y-5">
6767 <section class="data-shell space-y-2 p-4 sm:p-5">
6868 <Breadcrumbs items={[{ label: t("homework.title"), to: "/homework" }, { label: item().title }]} />
6969 <PageHeader title={item().title} description={item().description || undefined} />
src/pages/instance-detail-page.tsxmodified+1 -1
@@ -334,7 +334,7 @@ function InstanceDetailContent() {
334334 }
335335 >
336336 {(inst) => (
337- <div class="mx-auto w-full max-w-[1440px] space-y-4">
337+ <div class="w-full space-y-4">
338338 <div class="space-y-1.5">
339339 <Breadcrumbs
340340 items={[
src/pages/question-detail-page.tsxmodified+1 -1
@@ -114,7 +114,7 @@ function QuestionDetailContent() {
114114 };
115115
116116 return (
117- <div class="space-y-6 max-w-4xl mx-auto">
117+ <div class="w-full space-y-6">
118118 <Suspense fallback={<PageSpinner />}>
119119 <Show when={question()}>
120120 {(q) => (
src/pages/question-generation-page.tsxmodified+1 -1
@@ -103,7 +103,7 @@ function QuestionGenerationContent() {
103103 };
104104
105105 return (
106- <div class="mx-auto w-full max-w-[1100px] space-y-5">
106+ <div class="w-full space-y-5">
107107 <section class="data-shell p-4 sm:p-5">
108108 <PageHeader title={t("nav.questionGeneration")} description={t("qgen.subtitle")} />
109109 </section>