From 5d23f51ce721f9dcb84b1e6f3f267093df649ff1 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 19 Jul 2026 07:07:20 +0000 Subject: [PATCH 1/2] Fix report card header logo missing on pages after the first The header image relied on being repeated via the outer table's , but the actual content isn't laid out as rows of that same table (it's a single cell containing nested divs and its own inner table), so Chromium's print engine never re-triggers the thead on subsequent pages. Switch Header to the same fixed-position + placeholder technique already used by Footer, which does repeat correctly on every printed page. --- server/src/reports/studentReportCardReact.tsx | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/server/src/reports/studentReportCardReact.tsx b/server/src/reports/studentReportCardReact.tsx index ee2d5a28..18c1e94e 100644 --- a/server/src/reports/studentReportCardReact.tsx +++ b/server/src/reports/studentReportCardReact.tsx @@ -133,12 +133,32 @@ const App: React.FunctionComponent = (props) => { ); }; +const headerContainerStyle: React.CSSProperties = { + paddingBottom: '1rem', +} +const headerImageWrapperStyle: React.CSSProperties = { + position: 'fixed', + top: 0, + right: 0, + width: '100%', +} +const placeHolderHeaderImageWrapperStyle: React.CSSProperties = { + width: '100%', + visibility: 'hidden', +} const headerImageStyle: React.CSSProperties = { width: '95%', margin: '0 2.5%', } const Header = ({ image }: { image: Image }) => image && ( - +
+
+ +
+
+ +
+
); const footerContainerStyle: React.CSSProperties = { From 29af58e100154e70deb9180208267ad6ec702f59 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 19 Jul 2026 07:38:50 +0000 Subject: [PATCH 2/2] Extract shared RepeatingPageImage component for report card header/footer Header and Footer were near-duplicate implementations of the same fixed-position-plus-placeholder technique, differing only in which edge (top/bottom) the image pins to. Deduplicate into one component. Verified render output is unchanged (byte-identical generated PDF). --- server/src/reports/studentReportCardReact.tsx | 75 +++++++------------ 1 file changed, 27 insertions(+), 48 deletions(-) diff --git a/server/src/reports/studentReportCardReact.tsx b/server/src/reports/studentReportCardReact.tsx index 18c1e94e..80e8a680 100644 --- a/server/src/reports/studentReportCardReact.tsx +++ b/server/src/reports/studentReportCardReact.tsx @@ -133,61 +133,40 @@ const App: React.FunctionComponent = (props) => { ); }; -const headerContainerStyle: React.CSSProperties = { - paddingBottom: '1rem', -} -const headerImageWrapperStyle: React.CSSProperties = { - position: 'fixed', - top: 0, - right: 0, - width: '100%', -} -const placeHolderHeaderImageWrapperStyle: React.CSSProperties = { - width: '100%', - visibility: 'hidden', -} -const headerImageStyle: React.CSSProperties = { +const repeatingImageStyle: React.CSSProperties = { width: '95%', margin: '0 2.5%', } -const Header = ({ image }: { image: Image }) => image && ( -
-
- -
-
- -
-
-); - -const footerContainerStyle: React.CSSProperties = { - paddingTop: '1rem', -} -const footerImageWrapperStyle: React.CSSProperties = { - position: 'fixed', - bottom: 0, - right: 0, - width: '100%', -} -const placeHolderFooterImageWrapperStyle: React.CSSProperties = { +const placeHolderImageWrapperStyle: React.CSSProperties = { width: '100%', visibility: 'hidden', } -const footerImageStyle: React.CSSProperties = { - width: '95%', - margin: '0 2.5%', -} -const Footer = ({ image }: { image: Image }) => image && ( -
-
- -
-
- +type RepeatingPageImageEdge = 'top' | 'bottom'; +const RepeatingPageImage = ({ image, edge }: { image: Image; edge: RepeatingPageImageEdge }) => { + if (!image) return null; + + const containerStyle: React.CSSProperties = edge === 'top' ? { paddingBottom: '1rem' } : { paddingTop: '1rem' }; + const imageWrapperStyle: React.CSSProperties = { + position: 'fixed', + [edge]: 0, + right: 0, + width: '100%', + }; + + return ( +
+
+ +
+
+ +
-
-); + ); +}; + +const Header = ({ image }: { image: Image }) => ; +const Footer = ({ image }: { image: Image }) => ; const PersonalNote = ({ note }: { note: string }) => note && (

{note}