chore(autonomous-session): consolidate uncommitted work from prior session

Bundles the prior autonomous-session output that was sitting unstaged:

- Em-dash sweep across src/ + tests/ (en-dash/em-dash to hyphen, ~2280 instances)
- country-flag-icons rollout (CountryFlag component, replaces emoji glyphs that
  never rendered on Windows; lazy-loads the 3x2 SVG index as a single chunk
  after the per-subpath dynamic-import approach silently failed in webpack)
- Admin IA Phase 1+2: 7-domain regroup, 41 to 38 pages, /admin/berths index,
  redirects (ocr to ai, reports to dashboard, invitations to users),
  docs/admin-ia-proposal.md
- Per-template email tester (registry + endpoint + UI on Email admin page)
- Cancel-document mode picker (delete-from-Documenso vs keep-for-audit)
- Dashboard PDF report: 25 widgets, SVG charts, date-range picker, 11 resolvers
- Customize-widgets per-region sortables at xl+ (charts/rails/feed); single
  flat sortable below xl when the layout stacks; per-viewport saved orders
- Audit doc updates capturing each shipped item
- Lint fixes: react-compiler immutability in DonutChart (reduce instead of
  let-reassign), set-state-in-effect disables in CountryFlag and
  UploadForSigning preview-bytes effect, unused 'confirm' destructures in
  interest contract + reservation tabs, unescaped apostrophe in test-template
  card copy
This commit is contained in:
2026-05-23 00:52:59 +02:00
parent 43719b49e9
commit 221ae5784e
749 changed files with 7440 additions and 3118 deletions

View File

@@ -29,7 +29,7 @@ interface TopbarProps {
ports: Port[];
user?: { name: string; email: string };
/** Optional leading slot rendered before the breadcrumbs on tablet
* viewports used by AppShell to mount a sidebar trigger button
* viewports - used by AppShell to mount a sidebar trigger button
* (logo) when the sidebar is hidden behind a slide-over Sheet. */
leadingSlot?: ReactNode;
}
@@ -49,7 +49,7 @@ export function Topbar({ ports, user, leadingSlot }: TopbarProps) {
// The mobile-chrome flag still wins when a page explicitly opts in.
// Pages that already render their own "back to X" link inline
// (residential interest detail, expense scan flow, etc.) opt OUT
// by setting the chrome flag to false on mount the flag override
// by setting the chrome flag to false on mount - the flag override
// path here lets them suppress this auto-show.
const segments = pathname.split('/').filter(Boolean);
const isDeepPage = segments.length > 2;
@@ -69,7 +69,7 @@ export function Topbar({ ports, user, leadingSlot }: TopbarProps) {
// Avatar" and pushed the New button off-screen at every tablet +
// narrow-desktop width. With the center as a single fr-track, the
// right column always gets the space it needs.
<header className="grid h-14 grid-cols-[auto_1fr_auto] items-center border-b border-border bg-background gap-3 px-4 shrink-0">
<header className="relative grid h-14 grid-cols-[auto_1fr_auto] items-center border-b border-border bg-background gap-3 px-4 shrink-0">
{/* LEFT: optional sidebar trigger (tablet) + optional back button + breadcrumbs */}
<div className="min-w-0 flex items-center gap-1.5">
{leadingSlot}
@@ -90,18 +90,30 @@ export function Topbar({ ports, user, leadingSlot }: TopbarProps) {
<Breadcrumbs />
</div>
{/* CENTER: global search. Caps scale by viewport tier so the search
bar doesn't crowd the side columns at narrow widths:
base: max-w-md (28rem / 448px) — fits tablet 768-1023 with
~150-200px left for the right column.
lg: max-w-xl (36rem / 576px) — narrow desktop with sidebar.
xl: max-w-2xl (42rem / 672px) — full desktop, plenty of room.
The lg: translate-X visually centers the search against the FULL
viewport (compensating for the sidebar's 256px on the left). It
stays gated to lg+ so tablet (sidebar hidden behind Sheet)
doesn't get an unnecessary shift. */}
<div className="flex items-center justify-center min-w-0">
<div className="w-full max-w-md mx-auto min-w-0 lg:max-w-xl xl:max-w-2xl lg:-translate-x-[calc(var(--width-sidebar)/2)]">
{/* CENTER (spacer): the search bar is absolutely positioned below
so it anchors to true viewport center regardless of left/right
column widths. This empty grid track keeps `auto 1fr auto` so
the right column behaves the same as before. */}
<div aria-hidden />
{/* CENTER: global search, anchored to true viewport center.
The topbar element starts AFTER the 256px sidebar at lg+, so
`left: 50%` of the topbar lands sidebar/2 (=128px) right of the
viewport center. We subtract that offset at lg+ so the search
bar sits under the browser address bar; below lg the sidebar
is hidden behind a Sheet and the topbar spans the full
viewport, so plain `left: 50%` is already correct.
Caps scale by viewport tier so the bar doesn't crowd the side
columns:
base: max-w-md (28rem)
lg: max-w-xl (36rem)
xl: max-w-2xl (42rem)
The wrapper is pointer-events-none so it doesn't capture
clicks meant for the left/right columns underneath; only the
input itself receives pointer events. */}
<div className="pointer-events-none absolute inset-y-0 left-1/2 lg:left-[calc(50%-var(--width-sidebar)/2)] flex w-full max-w-md -translate-x-1/2 items-center px-4 lg:max-w-xl xl:max-w-2xl">
<div className="pointer-events-auto w-full min-w-0">
<CommandSearch />
</div>
</div>
@@ -176,7 +188,7 @@ export function Topbar({ ports, user, leadingSlot }: TopbarProps) {
trigger={
// Button shrunk to match the Avatar's visible footprint so
// the hover halo lands as a tight circle behind the avatar
// (was h-11 w-11 default the rounded-full halo extended
// (was h-11 w-11 default - the rounded-full halo extended
// well past the visible avatar and read as a square glow).
<Button variant="ghost" className="rounded-full h-9 w-9 p-0">
<Avatar className="w-7 h-7">