Remove recovery table inline styles from live demo

This commit is contained in:
rcourtman 2026-04-12 09:23:51 +01:00
parent cb257180ae
commit 80fe2baa5a
3 changed files with 16 additions and 2 deletions

View file

@ -1224,6 +1224,10 @@ That same direct proof rule also applies to the shared recovery summary helper:
`frontend-modern/src/utils/recoverySummaryPresentation.ts` must stay on the
explicit `recovery-product-surface` proof path instead of inheriting coverage
only through pages or higher-level recovery components.
The default protected-inventory recovery route must also keep its primary
table shell on class-driven sizing (`table-fixed` plus owned width classes)
instead of inline `table-layout` / `min-width` styles, so the public recovery
surface stays CSP-safe without drifting from the shared table contract.
That same direct proof rule also applies to the shared recovery record helper:
`frontend-modern/src/utils/recoveryRecordPresentation.ts` must stay on the
explicit `recovery-product-surface` proof path instead of inheriting coverage

View file

@ -339,8 +339,9 @@ export const RecoveryProtectedInventorySection: Component<
<Show when={props.filteredRollups().length > 0}>
<div class="overflow-x-auto bg-surface">
<Table
class="w-full border-collapse whitespace-nowrap"
style={{ 'table-layout': 'fixed', 'min-width': props.isMobile ? '100%' : '640px' }}
class={`w-full border-collapse whitespace-nowrap table-fixed ${
props.isMobile ? 'min-w-full' : 'min-w-[640px]'
}`}
>
<TableHeader>
<TableRow class="bg-surface-alt/95 text-muted">

View file

@ -742,6 +742,15 @@ describe('Recovery', () => {
expect(historyTable).toHaveStyle({ 'min-width': '980px', 'table-layout': 'fixed' });
});
it('keeps the protected inventory table CSP-safe on the default recovery route', async () => {
render(() => <Recovery />);
const protectedInventoryTable = await screen.findByRole('table');
expect(protectedInventoryTable).not.toHaveAttribute('style');
expect(protectedInventoryTable.className).toContain('table-fixed');
expect(protectedInventoryTable.className).toContain('min-w-[640px]');
});
it('keeps canonical item and platform columns visible when legacy hidden-column ids exist', async () => {
facetsPayload.clusters = ['lab-cluster'];
localStorage.setItem(