mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-01 20:36:21 -05:00
ui: migrate the extension pages and Configs; five components they needed
Phase 2, part 1. Three files leave Semantic UI (baseline 75 -> 72), and the
components they needed join the library and the gallery:
Header Semantic's shape (as/icon/subheader/dividing). 47 files use
<Header>, and the level now picks the size, so the type scale
stays a scale instead of each call site choosing a font size.
Message gains an icon and a dismiss button.
ActionInput input and button sharing one outline, for <Input action={...}/>.
Loading centered loader with a caption, replacing the
<Loader active inline='centered'> + wrapper div in 19 places.
Modal becomes compound - Modal.Header/.Content/.Actions, plus
Semantic's open, closeIcon, and size names - because 34 files
are written against that shape.
test-utils mounts MantineProvider with ThemeProvider's exact configuration:
migrated components render Mantine internals and every one of their test files
would otherwise need its own provider.
One Semantic bleed found and fixed: semantic.min.css sets
`h1,h2,h3,h4,h5 { font-family: Lato }` and loads after Mantine's element rule,
so headings ignored the theme's body face. Only visible in amber, where the
body is mono and the headings were not. A class-level restatement outranks it;
the rule comes out when Semantic does.
Verified: 925 jest tests, clean production build, and a night-mode audit of
every painted pixel in the gallery (red-only, one known false positive). The
Configs backup and restore flow was exercised against the real API.
This commit is contained in:
parent
a5d2bd7084
commit
528a5702d0
12 changed files with 621 additions and 202 deletions
|
|
@ -6,7 +6,9 @@
|
|||
import React, {createContext, useContext} from 'react';
|
||||
import {render} from '@testing-library/react';
|
||||
import {BrowserRouter} from 'react-router';
|
||||
import {MantineProvider} from '@mantine/core';
|
||||
import {MediaContextProvider, ThemeContext} from './contexts/contexts';
|
||||
import {cssVariablesResolver, mantineTheme} from './themes/mantine';
|
||||
|
||||
// Mock FileWorkerStatusContext for tests - avoids API calls during testing
|
||||
const MockFileWorkerStatusContext = createContext(null);
|
||||
|
|
@ -83,13 +85,21 @@ export function renderWithProviders(
|
|||
};
|
||||
|
||||
function Wrapper({children}) {
|
||||
// MantineProvider, configured exactly as ThemeProvider configures it: components
|
||||
// from src/components/ui render Mantine internals and need it in the tree.
|
||||
const content = (
|
||||
<BrowserRouter>
|
||||
<MockFileWorkerStatusProvider>
|
||||
<ThemeContext.Provider value={defaultThemeContext}>
|
||||
{children}
|
||||
</ThemeContext.Provider>
|
||||
</MockFileWorkerStatusProvider>
|
||||
<MantineProvider
|
||||
theme={mantineTheme}
|
||||
cssVariablesResolver={cssVariablesResolver}
|
||||
forceColorScheme={inverted ? 'dark' : 'light'}
|
||||
>
|
||||
<MockFileWorkerStatusProvider>
|
||||
<ThemeContext.Provider value={defaultThemeContext}>
|
||||
{children}
|
||||
</ThemeContext.Provider>
|
||||
</MockFileWorkerStatusProvider>
|
||||
</MantineProvider>
|
||||
</BrowserRouter>
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue