@@ -11,6 +11,8 @@ in `out/` is served by any static host (GitHub Pages, GitLab Pages, Bitbucket).
1111** Key Features:**
1212- Search over curated repository listing (` repositories.txt ` )
1313- Reports rendered with Mustache.js (bundled template is authoritative)
14+ - Enhanced report tables: sticky headers, pagination (>20 rows), sortable
15+ columns, in-table search, CSV export, click/keyboard cell copy with toasts
1416- Repository submission via pre-filled platform issues — no login, apps or tokens
1517- Fully static deploy; deep links handled via generateStaticParams + ` 404.html `
1618
@@ -60,12 +62,17 @@ app/ # Next.js App Router (static export)
6062components/ # client components: report-view, repo-list,
6163 # repo-submission-form, search-combobox,
6264 # hero-search, menu-search, menu-toggle,
63- # workflow-sample, platform-config, sentry-provider
65+ # workflow-sample, platform-config, sentry-provider,
66+ # toast-notification (copy feedback live region)
6467lib/ # shared logic (client + RSC): routes, fetcher,
6568 # renderer, search, utils, host, rate-limiter,
6669 # cache-manager, error-handler, repo-submission,
67- # report-view, static-params, widget-loader; the
68- # Node-side listing loader is lib/repositories.js
70+ # report-view, static-params, widget-loader,
71+ # table-operations (filter/sort/paginate/CSV/copy +
72+ # TABLE_CONFIG + REPORT_TABLES descriptors),
73+ # table-enhancer (binds toolbar/sort/pagination/
74+ # copy onto the rendered report DOM); the Node-side
75+ # listing loader is lib/repositories.js
6976public/ # static files copied verbatim into out/:
7077 repositories.txt # synced from the repo root (sync-repositories.mjs)
7178 assets/ # mustache template, logo
@@ -117,12 +124,54 @@ coverage there when introducing new markup patterns.
117124 ` sentry-dsn ` , ` platform-base-url ` ) plus ` NEXT_PUBLIC_HOSTING_ENVIRONMENT `
118125 / ` NEXT_PUBLIC_BASE_PATH ` at build time.
119126
127+ ## Report Tables (Enhanced)
128+
129+ - Every data table in the report (class/package relationships, disharmony
130+ findings, cycle summary, cycle breakdown) is enhanced: sticky ` thead th ` ,
131+ toolbar (match live region + copy hint left; search + CSV export right —
132+ the ` .rf-table-block ` wrapper shrink-wraps the table and the toolbar uses
133+ ` contain: inline-size ` so controls align with the table's right edge),
134+ sortable th buttons with ` aria-sort ` , pagination below 20+ row tables, and
135+ click/Enter/Space cell copy with toast feedback. The filter's clear control
136+ is an × button (accessible name "Clear the … table filter").
137+ - Horizontal scrollbar: tables wider than the viewport get ` overflow-x: auto `
138+ via the ` rf-scroll-x-enabled ` class, toggled by ` lib/table-enhancer.js `
139+ after measuring ` wrapper.scrollWidth > clientWidth ` (re-measured on each
140+ re-render and on window resize). It MUST stay conditional — any overflow
141+ ancestor becomes the sticky constraint container and breaks the
142+ viewport-sticky ` thead th ` . Scrolling tables keep their header pinned
143+ anyway: ` refreshStickyHeaders ` in lib/table-enhancer.js compensates by
144+ translating every ` thead th ` down by the viewport scroll offset (clamped to
145+ the table's bottom edge) on window scroll/resize; narrow tables keep pure
146+ CSS stickiness and stale transforms are cleared when overflow goes away.
147+ - Pipeline: ` prepareReportData(data, tableStates, TABLE_CONFIG) ` in
148+ lib/renderer.js applies ** filter → sort → paginate** per table and injects
149+ ` tableUi ` blocks the mustache template renders; ` enhanceTables ` in
150+ lib/table-enhancer.js binds the controls and reports state changes back to
151+ components/report-view.jsx, which re-renders (widgets only gate the first
152+ render; the search input's focus/caret is restored after each re-render).
153+ The expensive ` enhanceReport ` pipeline (Chart.js charts, WASM DOT layout)
154+ runs only when the payload changes — table-state re-renders stash the live
155+ chart canvases / graph containers before the innerHTML swap and graft them
156+ back into the fresh DOM (` statefulElementIds ` /` stashStatefulDom ` /
157+ ` graftStatefulDom ` in lib/report-view.js), re-binding only the cheap popup
158+ handlers.
159+ - Search ` <input> ` s are injected by table-enhancer — ` <input> ` is FORBID in
160+ the renderer's sanitization allow-list, so it must never appear in the
161+ mustache template.
162+ - CSV export honors the current filter + sort but ignores pagination;
163+ filenames are ` refactorfirst-<table>-<ISO timestamp>.csv ` .
164+
120165## Current Test Count
121166
122- ~ 313 unit/integration + 112 E2E (three browsers + basePath leg).
167+ ~ 485 unit/integration + 175 E2E (171 across three browsers + 4 basePath leg).
123168
124169WCAG 2.2 AA / HTML5 guards live in tests/unit/html5-attributes.test.js,
125170tests/unit/report-template-wcag.test.js, tests/unit/css-a11y.test.js and
126171tests/unit/page-titles.test.js — the report mustache keeps a single h1,
127172scoped table headers, captions, labelled canvases and a named nav; obsolete
128- presentational attributes are FORBID_ATTR-stripped in lib/renderer.js.
173+ presentational attributes are FORBID_ATTR-stripped in lib/renderer.js. The
174+ report-template-wcag guard also asserts sticky-header CSS, per-table
175+ toolbars/aria-labelled export buttons and pagination navs, valid ` aria-sort `
176+ on every enhanced th, sortable keyboard-operable header buttons and live
177+ match-count regions.
0 commit comments