The checklist gets a print view: one A4 page, header carrying personnel number, name, date of extract, entry date and position, the items in two flowing columns so twenty-five fit, and two signature lines at the foot. It prints the *state*, dated — not a blank form. The default filename in the save dialog comes from the document title, which is set to the agreed convention: 20260818_2884_Aigner-Manuel_Onboarding-Checklist Surname first, like everywhere else in the application, so a folder of these sorts by person and within a person by date. Umlauts are resolved rather than stripped: the naive route (NFKD, then every non-ASCII to a dash) turns "Müller" into "Mu-ller", because decomposition splits the umlaut and the diaeresis becomes the dash. "Weiß" needs its own rule — it has no decomposition and would otherwise vanish. The reported defect: the printout carried the application's own top bar — hamburger, bell, "Neueinstellung", sign-out. Those are controls; on paper they are decoration, and on a checklist filed in a personnel record, misleading. The rule now sits on AppShell rather than on this one page, so the org-chart print view — which had the same problem — gets it too, along with anything printed later. The shell's padding goes with it: the type area is set by @page on the print page itself, and the shell's would have been added on top. The browser's own header line (date, title, URL) is separate — that is a checkbox in the print dialog, not something CSS can reach. 440 tests pass, including 13 new ones pinning the filename convention. Not yet seen in a browser. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
39 lines
1.8 KiB
TypeScript
39 lines
1.8 KiB
TypeScript
"use client";
|
|
|
|
import { useCallback, useState, type ReactNode } from "react";
|
|
import type { OpenNote } from "@/lib/notes";
|
|
import { Sidebar } from "./Sidebar";
|
|
import { Topbar } from "./Topbar";
|
|
|
|
// Owns the one piece of state the shell needs (is the mobile drawer open),
|
|
// so app/(app)/layout.tsx can stay a Server Component and keep doing its
|
|
// auth check and data loading on the server.
|
|
export function AppShell({ userLabel, openNotes, children }: { userLabel: string; openNotes: OpenNote[]; children: ReactNode }) {
|
|
const [navOpen, setNavOpen] = useState(false);
|
|
const closeNav = useCallback(() => setNavOpen(false), []);
|
|
|
|
// Auf Papier gehört von der Hülle nichts hin: Navigation, Glocke und
|
|
// Abmelde-Knopf sind Bedienelemente, und gedruckt sind sie bestenfalls
|
|
// Zierrat — auf einer Checkliste, die in eine Personalakte geht, sogar
|
|
// irreführend. Die Regel steht hier und nicht auf der einzelnen Druckseite,
|
|
// damit jede weitere sie mitbekommt, statt sie zu wiederholen.
|
|
//
|
|
// Auch die Ränder fallen weg: die Satzfläche bestimmt @page auf der
|
|
// Druckseite selbst, und die Polsterung der Hülle käme obendrauf.
|
|
return (
|
|
<div className="min-h-dvh print:min-h-0">
|
|
<div className="print:hidden">
|
|
<Sidebar open={navOpen} onClose={closeNav} />
|
|
</div>
|
|
<div className="flex min-h-dvh flex-col lg:ml-[236px] print:ml-0 print:block print:min-h-0">
|
|
<div className="print:hidden">
|
|
<Topbar userLabel={userLabel} openNotes={openNotes} onOpenNav={() => setNavOpen(true)} />
|
|
</div>
|
|
<main className="flex-1 px-4 py-4 pb-[max(1rem,env(safe-area-inset-bottom))] sm:px-6 sm:py-6 print:p-0">
|
|
<div className="mx-auto w-full max-w-[1280px] print:max-w-none">{children}</div>
|
|
</main>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|