@atomazing-org/design-system 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +92 -0
- package/README.MD +45 -425
- package/dist/presets/index.d.ts +7 -1
- package/dist/presets/index.js +288 -306
- package/migrations/README.UPDATE.md +32 -20
- package/migrations/docs/migrations/design-system/README.md +48 -17
- package/migrations/docs/migrations/design-system/routes/adopt-existing/AEROCRM-EXAMPLE.md +197 -0
- package/migrations/docs/migrations/design-system/routes/adopt-existing/RUNBOOK.md +185 -25
- package/migrations/docs/migrations/design-system/routes/adopt-existing/migration.spec.json +68 -13
- package/migrations/docs/migrations/design-system/routes/greenfield/RUNBOOK.md +57 -25
- package/migrations/docs/migrations/design-system/routes/greenfield/migration.spec.json +28 -6
- package/migrations/docs/migrations/design-system/routes/mui4-to-latest/RUNBOOK.md +136 -77
- package/migrations/docs/migrations/design-system/routes/mui4-to-latest/migration.spec.json +89 -16
- package/migrations/docs/migrations/design-system/shared/WORKING-RULES.md +194 -0
- package/migrations/docs/migrations/design-system/shared/acceptance.md +76 -20
- package/migrations/docs/migrations/design-system/shared/common-regressions.md +218 -0
- package/migrations/docs/migrations/design-system/shared/gates.md +39 -3
- package/migrations/docs/migrations/design-system/shared/manual-qa-matrix.md +70 -0
- package/migrations/docs/migrations/design-system/shared/phase-exit-criteria.md +129 -0
- package/migrations/docs/migrations/design-system/shared/phases.md +377 -0
- package/migrations/skills/design-system-consumer-agent/SKILL.md +84 -0
- package/migrations/skills/design-system-migration-agent/SKILL.md +75 -9
- package/package.json +2 -1
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
# Working Rules For Consumer Repositories
|
|
2
|
+
|
|
3
|
+
Use this document when integrating or maintaining `@atomazing-org/design-system`
|
|
4
|
+
inside an application repository.
|
|
5
|
+
|
|
6
|
+
## Public Surface Only
|
|
7
|
+
|
|
8
|
+
- Import runtime APIs from `@atomazing-org/design-system`.
|
|
9
|
+
- Import shipped presets from `@atomazing-org/design-system/presets`.
|
|
10
|
+
- Do not import internal files from `src/*`, `dist/*`, or unpublished paths.
|
|
11
|
+
|
|
12
|
+
## Standard Integration Contract
|
|
13
|
+
|
|
14
|
+
- Wrap the app with `ThemeProviderWrapper`.
|
|
15
|
+
- Use `useThemeSettings()` for runtime theme selection and dark-mode changes.
|
|
16
|
+
- Treat the design system as the single source of truth for theme state.
|
|
17
|
+
- Do not keep a second app-level theme state store unless it only mirrors design-system state.
|
|
18
|
+
- Let the active preset own the application background.
|
|
19
|
+
- Do not set app-level background colors or fills on root shells, route wrappers, or page containers when that would override the preset background supplied by the design system.
|
|
20
|
+
- Treat `theme.palette.background.paper` and other surface tokens as component surfaces, not as a replacement for the preset-controlled page background.
|
|
21
|
+
- If the app shell exposes a dedicated workspace or content pane, route roots and page containers must stretch to fill that region instead of shrinking to intrinsic content width.
|
|
22
|
+
|
|
23
|
+
## Preset Selection Rules
|
|
24
|
+
|
|
25
|
+
- `defaultThemes`: baseline application presets.
|
|
26
|
+
- `landingPageThemes`: extended preset pack for landing pages and marketing surfaces.
|
|
27
|
+
- `allBuiltInThemes`: combined pack for showcases or apps that intentionally want both sets.
|
|
28
|
+
- Keep preset selection in one explicit app-owned theme module such as `src/theme/appThemes.ts`.
|
|
29
|
+
- Do not hide preset choice behind generic constants passthrough files such as `src/constants/themes/themes.ts`.
|
|
30
|
+
|
|
31
|
+
If the consumer app only needs one or two presets, prefer importing the named presets explicitly
|
|
32
|
+
instead of building a new parallel preset registry.
|
|
33
|
+
If the consumer needs a curated subset, export that subset from the app theme module instead of
|
|
34
|
+
rebuilding theme state or duplicating preset metadata elsewhere.
|
|
35
|
+
|
|
36
|
+
## Landing Composition Rules
|
|
37
|
+
|
|
38
|
+
When the consumer app uses landing or marketing surfaces:
|
|
39
|
+
|
|
40
|
+
- use `landingPageThemes` intentionally
|
|
41
|
+
- let the active preset own the page background
|
|
42
|
+
- let the active preset own the surface character of landing panels
|
|
43
|
+
- do not hand-style landing `Paper` or `Card` surfaces with local glow, bloom, blur, decorative borders, gradient washes, or pseudo-element chrome
|
|
44
|
+
- app code may control layout, spacing, sizing, and content hierarchy, but the visual treatment of surfaces must come from the preset/theme layer
|
|
45
|
+
- prefer standard MUI composition for previews and proof blocks
|
|
46
|
+
- avoid custom decorative shapes and pseudo-graphics when a simple MUI layout can express the same state
|
|
47
|
+
- avoid nested rectangular surface hierarchies such as `card inside card inside card`
|
|
48
|
+
- keep one primary outer surface and use lightweight MUI primitives inside it
|
|
49
|
+
- if a preview block becomes dense, remove secondary content before tightening spacing
|
|
50
|
+
|
|
51
|
+
## Surface Composition Rules
|
|
52
|
+
|
|
53
|
+
Across consumer components in general:
|
|
54
|
+
|
|
55
|
+
- one logical block should have one primary rectangular surface
|
|
56
|
+
- let the active preset own the visual treatment of `Paper`, `Card`, `Dialog`, `Drawer`, and similar surfaces
|
|
57
|
+
- do not hand-style consumer surfaces with local glow, halo, bloom, decorative borders, blur, gradient washes, or pseudo-element chrome
|
|
58
|
+
- do not keep zero-value surface wrappers such as a local `SurfaceCard` that only forwards props to MUI `Card` without adding real behavior
|
|
59
|
+
- do not keep large inline `sx` objects in JSX; if a component needs substantial styling, extract a local `styled(...)` component in the same file and keep those styled declarations near the bottom of the file
|
|
60
|
+
- keep app styling focused on layout, spacing, sizing, and content hierarchy; move distinct surface looks into presets or MUI theme overrides
|
|
61
|
+
- prefer `Stack`, `List`, `Divider`, `Typography`, `Chip`, and `Avatar` for internal composition
|
|
62
|
+
- do not add extra bordered or elevated rectangular layers unless they carry a separate semantic role
|
|
63
|
+
- do not restyle chart legends, compact filters, segmented controls, or status chips into ad hoc chip-like chrome that competes with the active preset; prefer neutral MUI composition and let the preset own the surface character
|
|
64
|
+
|
|
65
|
+
## Design Token Hardening Rules
|
|
66
|
+
|
|
67
|
+
- Use theme helpers such as `alpha()` instead of string-concatenated palette hacks like `${theme.palette.primary.main}1a`.
|
|
68
|
+
- Decorative gradients and shadow styling are forbidden in normal consumer UI, especially on shared surfaces and shell infrastructure.
|
|
69
|
+
- If a component must visually preview preset data, such as a theme swatch, document that exception inline and keep it on a small explicit allowlist in the repo-local design-contract check.
|
|
70
|
+
- Repo-local design-contract lint should protect against decorative gradients, direct shadow styling, theme shadow-token drift, and palette alpha suffix hacks in addition to raw colors and numeric visual tokens.
|
|
71
|
+
|
|
72
|
+
## MUI-First Component Rules
|
|
73
|
+
|
|
74
|
+
- Prefer direct MUI primitives for base UI elements such as buttons, icon buttons, labels, helper text, skeletons, lists, drawers, and dialog sections.
|
|
75
|
+
- Do not keep consumer-owned substitute atoms that merely recreate an existing MUI primitive with `div`, `label`, `span`, `Box`, or other generic wrappers.
|
|
76
|
+
- If a consumer abstraction is still useful, keep it as a thin wrapper around the MUI primitive rather than a parallel hand-rolled implementation.
|
|
77
|
+
- Remove zero-value wrappers that only rename a MUI primitive or surface without adding behavior, state policy, or accessibility value.
|
|
78
|
+
- Exceptions are allowed only when there is clear custom logic or a pattern MUI does not provide directly, such as drag-and-drop zones, app-specific charts, or brand artwork.
|
|
79
|
+
- Even when an exception is justified, compose it from MUI layout and surface primitives where possible.
|
|
80
|
+
|
|
81
|
+
## Typography Contract Rules
|
|
82
|
+
|
|
83
|
+
- Visible application text should be rendered through `Typography`, not left as raw JSX text inside layout wrappers.
|
|
84
|
+
- Every `Typography` must declare an explicit `variant`.
|
|
85
|
+
- Pick variants by semantics, not convenience:
|
|
86
|
+
- headings and section titles: `header_*`
|
|
87
|
+
- main body copy and helper text: `text_*_regular`
|
|
88
|
+
- button and action labels: compact semibold text such as `text_sm_semibold`
|
|
89
|
+
- chip, badge, and compact status labels: compact text such as `text_xs_semibold`
|
|
90
|
+
- When MUI interactive components such as `Button`, `ToggleButton`, `MenuItem`, `Chip`, or `Alert` need visible text, wrap that text in `Typography component="span"` with an explicit variant.
|
|
91
|
+
- If the repo has a typography contract lint or script, keep it green as part of the migration gate.
|
|
92
|
+
- If bulk replacements or file rewrites touch localized copy, keep files in UTF-8 and scan touched files for mojibake or replacement characters before closeout.
|
|
93
|
+
- Validate at least one real route with non-Latin copy when the migration touched translated strings, mocks, or fixtures.
|
|
94
|
+
|
|
95
|
+
## Overlay And Semantic Contract Rules
|
|
96
|
+
|
|
97
|
+
- Dialogs, drawers, bottom sheets, and other overlay containers must expose stable `aria-labelledby` and `aria-describedby` semantics.
|
|
98
|
+
- Shared dialog-title abstractions should accept stable title and subtitle ids so the overlay can wire those semantics directly instead of relying on incidental text structure.
|
|
99
|
+
- Close buttons inside shared overlays must have explicit accessible labels.
|
|
100
|
+
- Command palettes, searchable pickers, and other overlay search surfaces should use `combobox` plus `listbox` semantics when they own filtered keyboard navigation.
|
|
101
|
+
- Decorative overlay chrome such as drag handles or visual grabbers should be hidden from assistive technology when it does not convey state.
|
|
102
|
+
- Prefer stable overlay test hooks or landmarks for smoke coverage, and avoid brittle tests that depend on incidental navigation paths just to reach a modal.
|
|
103
|
+
|
|
104
|
+
## Workflow Composition Rules
|
|
105
|
+
|
|
106
|
+
- If multiple pages share the same workflow shell, form layout, or section grid, extract one shared layout contract instead of duplicating the page structure per role or route.
|
|
107
|
+
- Keep role-specific behavior in headers, sections, and policy hooks; keep shared structure in a dedicated workflow layout component.
|
|
108
|
+
- Prefer direct local imports for chunk-sensitive app internals when a barrel re-export introduces circular chunk warnings in build output.
|
|
109
|
+
- Do not preserve convenience barrels for local app modules when they make execution order less reliable than direct feature-local imports.
|
|
110
|
+
|
|
111
|
+
## Custom Preset Rules
|
|
112
|
+
|
|
113
|
+
Custom presets must follow `ThemePreset` exactly:
|
|
114
|
+
|
|
115
|
+
- stable string `id`
|
|
116
|
+
- human-readable `label`
|
|
117
|
+
- `colorSchemes.light`
|
|
118
|
+
- `colorSchemes.dark`
|
|
119
|
+
|
|
120
|
+
Each scheme should define:
|
|
121
|
+
|
|
122
|
+
- `palette.background.default`
|
|
123
|
+
- `palette.background.paper`
|
|
124
|
+
- `palette.text.primary`
|
|
125
|
+
- `palette.text.secondary`
|
|
126
|
+
- `palette.divider`
|
|
127
|
+
|
|
128
|
+
## SSR And Next.js Rules
|
|
129
|
+
|
|
130
|
+
- Keep `ThemeProviderWrapper` inside a client boundary.
|
|
131
|
+
- Do not access `window`, `document`, `navigator`, or `localStorage` at module scope.
|
|
132
|
+
- If theme preference must be bridged through cookies or storage, keep the browser-specific logic client-safe.
|
|
133
|
+
|
|
134
|
+
## Runtime Startup Rules
|
|
135
|
+
|
|
136
|
+
- A green build is not enough to close a migration.
|
|
137
|
+
- After dependency, provider, or theme-state changes, start the app with the repo's normal dev/start command.
|
|
138
|
+
- Open the app in a real browser and fix startup console errors before closeout.
|
|
139
|
+
- Fix migration-caused startup warnings before closeout when they indicate broken runtime alignment.
|
|
140
|
+
- If runtime singleton warnings appear for `react`, `react-dom`, `@emotion/react`, or `@emotion/styled`, align the bundler config so only one runtime copy loads.
|
|
141
|
+
- Avoid module-scope calls that require browser APIs, storage, or an activated i18n locale.
|
|
142
|
+
- Register browser event listeners such as `beforeinstallprompt`, `matchMedia`, or other window-driven subscriptions inside effects with cleanup instead of render paths or module scope.
|
|
143
|
+
- Verify that the app background still comes from the active preset after migration.
|
|
144
|
+
- If the consumer uses root shells such as `AppShell`, `Layout`, `PageContainer`, or route wrappers, keep them transparent unless they intentionally represent a surface layer.
|
|
145
|
+
- If token drift is broad, add or tighten a repo-local design contract gate for hardcoded colors, raw numeric type scale, ad hoc radius/opacity values, decorative gradients, shadow styling, and palette alpha suffix hacks, and keep it green.
|
|
146
|
+
|
|
147
|
+
## Build Hygiene Rules
|
|
148
|
+
|
|
149
|
+
- Fix consumer-owned build warnings that come from the app's own config, imports, or chunking strategy.
|
|
150
|
+
- If PWA or Workbox config references asset names, keep those glob patterns aligned with the actual files emitted from `public/` or equivalent static assets.
|
|
151
|
+
- If Vite or Rollup reports oversized consumer-owned chunks, prefer targeted `manualChunks` or additional lazy boundaries over simply increasing `chunkSizeWarningLimit`.
|
|
152
|
+
- Do not silence a real warning when the app can fix the underlying config or bundling cause directly.
|
|
153
|
+
- If the only remaining warning comes from an upstream toolchain package outside the consumer app's control, record the exact package and file instead of misclassifying it as an app regression.
|
|
154
|
+
|
|
155
|
+
## Anti-Patterns
|
|
156
|
+
|
|
157
|
+
Avoid these patterns:
|
|
158
|
+
|
|
159
|
+
- deep imports from internal design-system files
|
|
160
|
+
- a second competing root `ThemeProvider`
|
|
161
|
+
- hardcoded theme colors when a theme token exists
|
|
162
|
+
- hardcoded root-level page backgrounds that override the active preset background
|
|
163
|
+
- hand-rolled substitute primitives for components MUI already provides
|
|
164
|
+
- zero-value wrapper components that only rename a stock MUI primitive or surface
|
|
165
|
+
- decorative gradients or shadow styling applied directly in consumer shells and shared surfaces
|
|
166
|
+
- string-concatenated palette alpha hacks instead of theme helpers such as `alpha()`
|
|
167
|
+
- local storage access outside SSR-safe guards
|
|
168
|
+
- dialogs, drawers, or bottom sheets without stable semantic labeling
|
|
169
|
+
- browser event listeners attached from render flow without cleanup
|
|
170
|
+
- maintaining a parallel dark-mode enum or persistence format
|
|
171
|
+
- role-based workflow pages that duplicate the same layout shell instead of sharing one structural contract
|
|
172
|
+
- local barrel re-exports that introduce circular chunk warnings for app internals
|
|
173
|
+
|
|
174
|
+
## When Migration Is Required
|
|
175
|
+
|
|
176
|
+
Do not treat these as small integration tasks. Use route-based migration instead:
|
|
177
|
+
|
|
178
|
+
- the app still uses `@material-ui/*`
|
|
179
|
+
- the app has a custom token layer that should be replaced or normalized
|
|
180
|
+
- the app mixes multiple theme providers or theme sources of truth
|
|
181
|
+
- the user asks to standardize the project on this library
|
|
182
|
+
- the migration touches a broad set of colors, typography, spacing, or component overrides
|
|
183
|
+
|
|
184
|
+
## Route Selection
|
|
185
|
+
|
|
186
|
+
- `mui4-to-latest`: legacy Material UI v4 imports or dependencies
|
|
187
|
+
- `greenfield`: new app, or no legacy theme/token migration required
|
|
188
|
+
- `adopt-existing`: app already uses modern MUI but needs theme/token adoption
|
|
189
|
+
|
|
190
|
+
## Recommended User Request
|
|
191
|
+
|
|
192
|
+
Use a request like this with an AI agent:
|
|
193
|
+
|
|
194
|
+
`Adopt @atomazing-org/design-system in this repo. If the current theme stack is legacy or custom, choose the correct migration route and execute the migration runbook.`
|
|
@@ -1,27 +1,83 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Shared Acceptance Criteria
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A migration is complete only when all of the following are true.
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
- В проекте присутствует `@atomazing-org/design-system`.
|
|
7
|
-
- Для MUI присутствуют совместимые версии `@mui/material`, `@mui/icons-material`, `@emotion/react`, `@emotion/styled`.
|
|
5
|
+
## 0. Execution Discipline
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
7
|
+
- The route was executed in phases, not as one giant unvalidated diff.
|
|
8
|
+
- The app remained runnable at the end of each committed phase.
|
|
9
|
+
- If the project is large and broad shell, overlay, or shared-component rewrites were in scope, a smoke safety net existed before those rewrites began.
|
|
12
10
|
|
|
13
|
-
##
|
|
14
|
-
- В `package.json` отсутствуют `@material-ui/*`.
|
|
15
|
-
- В коде отсутствуют импорты из `@material-ui/*`.
|
|
11
|
+
## 1. Dependencies
|
|
16
12
|
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
- Основные UI-поверхности (фон/текст/бордеры/основные кнопки) используют `theme.palette`.
|
|
20
|
-
- Основные тексты используют `Typography` variants (или `theme.typography`).
|
|
13
|
+
- The repo installs `@atomazing-org/design-system`.
|
|
14
|
+
- Compatible peer runtimes are present for `@mui/material`, `@mui/icons-material` when needed, `@emotion/react`, and `@emotion/styled`.
|
|
21
15
|
|
|
22
|
-
##
|
|
23
|
-
- `npm test` проходит.
|
|
24
|
-
- `npm run build` проходит.
|
|
25
|
-
- Quality gates проходят (через `migrations/scripts/*` или эквивалентные ручные проверки поиска по коду/импортам).
|
|
16
|
+
## 2. Theme Source Of Truth
|
|
26
17
|
|
|
27
|
-
|
|
18
|
+
- The app root is wrapped with `ThemeProviderWrapper` or an approved thin wrapper around it.
|
|
19
|
+
- There is no second competing root `ThemeProvider`.
|
|
20
|
+
- Theme selection and dark-mode state do not live in a parallel app-specific source of truth unless it only mirrors design-system state.
|
|
21
|
+
- Preset selection is exposed through one explicit app-level theme module, not hidden across generic constants passthrough files.
|
|
22
|
+
|
|
23
|
+
## 3. Legacy MUI Removal
|
|
24
|
+
|
|
25
|
+
- `package.json` does not contain `@material-ui/*`.
|
|
26
|
+
- App source does not import `@material-ui/*`.
|
|
27
|
+
|
|
28
|
+
## 4. Token Adoption
|
|
29
|
+
|
|
30
|
+
- Forbidden legacy token imports and identifiers for the selected route are removed.
|
|
31
|
+
- Main UI surfaces use `theme.palette` instead of hardcoded project token files.
|
|
32
|
+
- Main typography uses MUI variants or `theme.typography`.
|
|
33
|
+
- Visible app text is rendered through `Typography` or approved text-owning MUI APIs, not as raw JSX text in layout wrappers.
|
|
34
|
+
- Every `Typography` used by the consumer declares an explicit `variant`.
|
|
35
|
+
- Interactive labels rendered through `Button`, `ToggleButton`, `MenuItem`, `Chip`, or `Alert` use `Typography component="span"` with an explicit variant when they render visible text.
|
|
36
|
+
- Zero-value wrapper components that merely rename stock MUI primitives or surfaces are removed or collapsed into thin MUI wrappers with real behavior.
|
|
37
|
+
- Zero-value surface wrappers that merely forward to MUI `Card`, `Paper`, or similar components are removed.
|
|
38
|
+
- Large inline `sx` objects are not left in migrated consumer components; substantial styling is extracted into local `styled(...)` components declared in the same file near the bottom.
|
|
39
|
+
- Consumer styling does not rely on decorative gradients, direct shadow styling, or palette alpha suffix hacks in normal app surfaces.
|
|
40
|
+
- If the app keeps a preview-only exception such as a theme swatch, that exception is documented and allowlisted explicitly in the repo-local design-contract gate.
|
|
41
|
+
|
|
42
|
+
## 5. Runtime Startup Health
|
|
43
|
+
|
|
44
|
+
- The app starts with the repo's normal dev or start command.
|
|
45
|
+
- The first route opens successfully in a real browser.
|
|
46
|
+
- Browser console startup errors are fixed before closeout.
|
|
47
|
+
- Startup warnings caused by the migration are fixed before closeout, not merely recorded.
|
|
48
|
+
- Duplicate runtime singleton warnings for `react`, `react-dom`, `@emotion/react`, or `@emotion/styled` are resolved with bundler or runtime alignment.
|
|
49
|
+
- Module-scope code does not depend on browser APIs, storage, or i18n locale activation before app initialization.
|
|
50
|
+
- Core application shell layout is preserved after migration.
|
|
51
|
+
- On desktop layouts, structural regions such as sidebar or menu stay in their intended column and page content stays in its own content region.
|
|
52
|
+
- On mobile layouts, stacked navigation and scroll containers still behave as before.
|
|
53
|
+
- Route roots and primary page containers still fill the intended workspace or content pane; the migration does not leave partial-width page shells, collapsed dashboards, or unused work areas.
|
|
54
|
+
- Shared padded containers such as app-owned cards, page roots, and shell content panes do not overflow horizontally because of `width: 100%` under content-box sizing.
|
|
55
|
+
- The application background is still owned by the active preset; root shells and page wrappers do not hardcode a competing page-level background over it.
|
|
56
|
+
- Shared UI primitives do not regress into placeholder wrappers or empty visual shells; cards, dialogs, drawers, charts, filters, and nav controls still render usable spacing, hierarchy, and interaction states.
|
|
57
|
+
- Shared legends, compact filters, chips, segmented controls, and metric badges remain visually aligned with the active preset; the migration does not replace them with ad hoc chip chrome that fights the preset.
|
|
58
|
+
- Analytics dashboards and metric surfaces keep a clear typographic split between labels and values, and dashboard cards do not drift into accidental full-width spans or mismatched gap patterns on desktop layouts.
|
|
59
|
+
- Shared base primitives that map directly to MUI are implemented with MUI components or thin wrappers around them, not hand-rolled substitutes built from generic nodes.
|
|
60
|
+
- Shared overlays rendered as dialogs, drawers, or bottom sheets expose stable `aria-labelledby` and `aria-describedby` semantics.
|
|
61
|
+
- Shared overlay close actions are labeled, and decorative handles or chrome are hidden from assistive technology when they carry no state.
|
|
62
|
+
- Search overlays that own keyboard-filtered results expose `combobox` and `listbox` semantics instead of generic wrapper markup.
|
|
63
|
+
- Browser event listeners introduced or touched during migration are registered in effects with cleanup rather than render paths or module scope.
|
|
64
|
+
- If smoke or test mode disables auth redirect, the migration provides a deterministic role-bearing user so protected routes can be validated as real screens instead of fallback routes.
|
|
65
|
+
- Automated route checks validate at least one protected content page in addition to shell boot.
|
|
66
|
+
- Automated route checks validate at least one stable overlay interaction when the migration touches shared overlay infrastructure.
|
|
67
|
+
- Touched localized copy, fixtures, and mocks render readable text; the migration does not leave mojibake, replacement characters, or broken non-Latin strings in the shipped UI or smoke-visible test data.
|
|
68
|
+
- Repeated workflow pages that share the same structural shell use a shared layout contract instead of duplicating the page shell across roles.
|
|
69
|
+
- The migration does not leave new circular chunk warnings from local app barrel re-exports when direct local imports are the safer option.
|
|
70
|
+
|
|
71
|
+
## 6. Quality Gates
|
|
72
|
+
|
|
73
|
+
- `npm test` passes when the repo has tests.
|
|
74
|
+
- `npm run build` passes.
|
|
75
|
+
- `npm run lint` passes when it is part of the repo's normal gate. If baseline lint is already red for unrelated files, record that baseline explicitly and keep the migration diff green.
|
|
76
|
+
- `npm run test:smoke` or the repo's equivalent smoke or e2e route gate passes when the repo provides that check for shell, protected routes, overlays, or other runtime-critical flows touched by the migration.
|
|
77
|
+
- `npm run lint:style-contract` passes when the repo provides a local style-contract or styleless-UI gate.
|
|
78
|
+
- `npm run lint:design-contract` passes when the repo provides a design-token or design-contract check.
|
|
79
|
+
- `npm run lint:design-contract` catches decorative gradient or shadow drift, palette alpha suffix hacks, and unapproved visual-token exceptions when the repo provides that gate.
|
|
80
|
+
- `npm run lint:typography-contract` passes when the repo provides a typography contract check.
|
|
81
|
+
- Consumer-owned build warnings caused by asset config drift or oversized local chunks are fixed rather than silenced.
|
|
82
|
+
- If a remaining build warning comes from an upstream third-party toolchain package, the migration report names that package and warning explicitly.
|
|
83
|
+
- Route-specific and shared migration gates pass through scripts or equivalent manual checks.
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
# Common Migration Regressions
|
|
2
|
+
|
|
3
|
+
Use this document as a fast lookup when a migrated consumer app "builds fine"
|
|
4
|
+
but still looks or behaves wrong at runtime.
|
|
5
|
+
|
|
6
|
+
For each regression class below:
|
|
7
|
+
|
|
8
|
+
- confirm the symptom on a real route
|
|
9
|
+
- fix the structural cause, not only the visible symptom
|
|
10
|
+
- add or tighten smoke or lint coverage when the regression is likely to return
|
|
11
|
+
|
|
12
|
+
## Startup Crash On First Route
|
|
13
|
+
|
|
14
|
+
Symptom:
|
|
15
|
+
|
|
16
|
+
- app opens to a blank page, hard crash, or startup error in the browser console
|
|
17
|
+
|
|
18
|
+
Common causes:
|
|
19
|
+
|
|
20
|
+
- module-scope i18n work before locale activation
|
|
21
|
+
- module-scope `window`, `document`, `navigator`, or storage access
|
|
22
|
+
- broken root provider wiring
|
|
23
|
+
|
|
24
|
+
Fix:
|
|
25
|
+
|
|
26
|
+
- move browser-only or locale-dependent work into runtime-safe component or hook code
|
|
27
|
+
- verify the root uses the intended provider stack
|
|
28
|
+
|
|
29
|
+
Catch it with:
|
|
30
|
+
|
|
31
|
+
- real browser startup check
|
|
32
|
+
- smoke route that fails on console or page errors
|
|
33
|
+
|
|
34
|
+
## Duplicate React Or Emotion Runtime
|
|
35
|
+
|
|
36
|
+
Symptom:
|
|
37
|
+
|
|
38
|
+
- startup warning about duplicated `react`, `react-dom`, `@emotion/react`, or `@emotion/styled`
|
|
39
|
+
|
|
40
|
+
Common causes:
|
|
41
|
+
|
|
42
|
+
- bundler dedupe or singleton-sharing not aligned after migration
|
|
43
|
+
|
|
44
|
+
Fix:
|
|
45
|
+
|
|
46
|
+
- align bundler runtime resolution with dedupe, aliasing, or singleton-sharing
|
|
47
|
+
|
|
48
|
+
Catch it with:
|
|
49
|
+
|
|
50
|
+
- browser startup check
|
|
51
|
+
- migration closeout report that records warnings by exact package
|
|
52
|
+
|
|
53
|
+
## Workspace Does Not Fill The Content Region
|
|
54
|
+
|
|
55
|
+
Symptom:
|
|
56
|
+
|
|
57
|
+
- page content collapses into partial-width cards
|
|
58
|
+
- dashboard or form area leaves empty workspace
|
|
59
|
+
|
|
60
|
+
Common causes:
|
|
61
|
+
|
|
62
|
+
- route roots or page containers lost flex growth, `min-width`, or `min-height`
|
|
63
|
+
|
|
64
|
+
Fix:
|
|
65
|
+
|
|
66
|
+
- restore the shared shell and page-root layout contract
|
|
67
|
+
|
|
68
|
+
Catch it with:
|
|
69
|
+
|
|
70
|
+
- shell smoke check on a real content route
|
|
71
|
+
|
|
72
|
+
## Right Edge Overflow On Desktop
|
|
73
|
+
|
|
74
|
+
Symptom:
|
|
75
|
+
|
|
76
|
+
- content protrudes past the visible right edge
|
|
77
|
+
- horizontal scrolling appears unexpectedly
|
|
78
|
+
|
|
79
|
+
Common causes:
|
|
80
|
+
|
|
81
|
+
- `width: 100%` plus internal padding under content-box sizing
|
|
82
|
+
- shell content panes or page roots forced wider than the workspace
|
|
83
|
+
|
|
84
|
+
Fix:
|
|
85
|
+
|
|
86
|
+
- use `box-sizing: border-box` on shared padded full-width containers
|
|
87
|
+
- remove forced width where it is not needed
|
|
88
|
+
|
|
89
|
+
Catch it with:
|
|
90
|
+
|
|
91
|
+
- overflow assertion on the shared content pane
|
|
92
|
+
- overflow assertion on at least one routed page root
|
|
93
|
+
|
|
94
|
+
## Dashboard Metrics Lose Hierarchy
|
|
95
|
+
|
|
96
|
+
Symptom:
|
|
97
|
+
|
|
98
|
+
- metric labels, values, and helper text read like one text level
|
|
99
|
+
- numbers no longer stand out from titles
|
|
100
|
+
|
|
101
|
+
Common causes:
|
|
102
|
+
|
|
103
|
+
- label and value typography share the same effective size and weight
|
|
104
|
+
- broad card cleanup flattened the text hierarchy
|
|
105
|
+
|
|
106
|
+
Fix:
|
|
107
|
+
|
|
108
|
+
- restore distinct label, value, and helper text scales
|
|
109
|
+
- keep metric emphasis explicit instead of relying on defaults
|
|
110
|
+
|
|
111
|
+
Catch it with:
|
|
112
|
+
|
|
113
|
+
- smoke assertion on computed metric label vs value emphasis
|
|
114
|
+
- visual QA on analytics or dashboard routes
|
|
115
|
+
|
|
116
|
+
## Dashboard Card Falls Into Full-Width Row
|
|
117
|
+
|
|
118
|
+
Symptom:
|
|
119
|
+
|
|
120
|
+
- one analytics or dashboard card drops onto its own row on desktop
|
|
121
|
+
- gaps between dashboard cards become inconsistent
|
|
122
|
+
|
|
123
|
+
Common causes:
|
|
124
|
+
|
|
125
|
+
- stale `gridColumn: 1 / -1`
|
|
126
|
+
- mixed grid gap contracts between dashboard panels
|
|
127
|
+
|
|
128
|
+
Fix:
|
|
129
|
+
|
|
130
|
+
- remove accidental full-width spans
|
|
131
|
+
- keep one explicit grid template and gap rhythm per dashboard surface
|
|
132
|
+
|
|
133
|
+
Catch it with:
|
|
134
|
+
|
|
135
|
+
- smoke assertion on desktop card alignment
|
|
136
|
+
|
|
137
|
+
## Overlay Semantics Drift
|
|
138
|
+
|
|
139
|
+
Symptom:
|
|
140
|
+
|
|
141
|
+
- dialog or drawer still opens, but labels, descriptions, or close controls are wrong or missing
|
|
142
|
+
|
|
143
|
+
Common causes:
|
|
144
|
+
|
|
145
|
+
- wrapper refactor dropped stable ids
|
|
146
|
+
- decorative overlay chrome was left visible to assistive tech
|
|
147
|
+
- searchable overlay uses generic markup instead of `combobox` or `listbox`
|
|
148
|
+
|
|
149
|
+
Fix:
|
|
150
|
+
|
|
151
|
+
- restore stable `aria-labelledby` and `aria-describedby`
|
|
152
|
+
- label close actions
|
|
153
|
+
- restore proper overlay search semantics
|
|
154
|
+
|
|
155
|
+
Catch it with:
|
|
156
|
+
|
|
157
|
+
- smoke coverage through stable overlay entrypoints
|
|
158
|
+
|
|
159
|
+
## Compact Controls Drift Away From The Preset
|
|
160
|
+
|
|
161
|
+
Symptom:
|
|
162
|
+
|
|
163
|
+
- legends, chips, segmented filters, or compact badges look like app-local chrome instead of preset-aligned UI
|
|
164
|
+
|
|
165
|
+
Common causes:
|
|
166
|
+
|
|
167
|
+
- consumer restyling replaced neutral shared composition with ad hoc chip-like surfaces
|
|
168
|
+
|
|
169
|
+
Fix:
|
|
170
|
+
|
|
171
|
+
- rebuild compact controls from neutral MUI composition such as `Stack`, markers, and `Typography`
|
|
172
|
+
|
|
173
|
+
Catch it with:
|
|
174
|
+
|
|
175
|
+
- visual QA on charts, segmented controls, and compact summary areas
|
|
176
|
+
|
|
177
|
+
## Mojibake Or Broken Non-Latin Text
|
|
178
|
+
|
|
179
|
+
Symptom:
|
|
180
|
+
|
|
181
|
+
- Cyrillic or other non-Latin copy renders as broken symbols or replacement characters
|
|
182
|
+
|
|
183
|
+
Common causes:
|
|
184
|
+
|
|
185
|
+
- encoding-sensitive rewrites
|
|
186
|
+
- bulk replacements across localized files
|
|
187
|
+
|
|
188
|
+
Fix:
|
|
189
|
+
|
|
190
|
+
- keep touched files in UTF-8
|
|
191
|
+
- restore corrupted copy from a valid source
|
|
192
|
+
|
|
193
|
+
Catch it with:
|
|
194
|
+
|
|
195
|
+
- mojibake scan
|
|
196
|
+
- real-route verification of localized text
|
|
197
|
+
|
|
198
|
+
## Consumer Build Warning Left Unowned
|
|
199
|
+
|
|
200
|
+
Symptom:
|
|
201
|
+
|
|
202
|
+
- build stays noisy and nobody knows whether the app or an upstream package owns the warning
|
|
203
|
+
|
|
204
|
+
Common causes:
|
|
205
|
+
|
|
206
|
+
- stale asset globs
|
|
207
|
+
- oversized local chunks
|
|
208
|
+
- local barrel import cycles
|
|
209
|
+
- upstream toolchain warning misclassified as app debt
|
|
210
|
+
|
|
211
|
+
Fix:
|
|
212
|
+
|
|
213
|
+
- fix consumer-owned warnings in the app
|
|
214
|
+
- record upstream-only warnings by exact package and file
|
|
215
|
+
|
|
216
|
+
Catch it with:
|
|
217
|
+
|
|
218
|
+
- final build review during closeout
|
|
@@ -13,18 +13,54 @@ npm test
|
|
|
13
13
|
npm run build
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
+
If the target repo exposes repo-local contract gates such as
|
|
17
|
+
`npm run lint:style-contract`, `npm run lint:design-contract`, or
|
|
18
|
+
`npm run lint:typography-contract`, run them as part of the migration.
|
|
19
|
+
|
|
20
|
+
If the target repo exposes smoke or e2e coverage for shell, protected routes,
|
|
21
|
+
or overlays such as `npm run test:smoke`, run that as part of the migration too.
|
|
22
|
+
|
|
23
|
+
Also run the repo's normal dev or start command and open the app in a real browser.
|
|
24
|
+
|
|
25
|
+
## Phase gates for large projects
|
|
26
|
+
|
|
27
|
+
For large migrations, do not wait until the end of the route to validate.
|
|
28
|
+
|
|
29
|
+
- Re-run the relevant checks after each meaningful phase.
|
|
30
|
+
- Keep the app runnable at the end of every phase before moving to the next one.
|
|
31
|
+
- At minimum, re-run the repo's typecheck or lint-equivalent after broad mechanical edits and re-run build after dependency or bundler changes.
|
|
32
|
+
- Before broad shell, overlay, or shared-component rewrites, make sure smoke coverage exists for:
|
|
33
|
+
- the application shell
|
|
34
|
+
- at least one protected content route when route guards exist
|
|
35
|
+
- at least one stable overlay interaction when overlays are in scope
|
|
36
|
+
- at least one content-dense route such as a dashboard, analytics page, or workflow screen when shared charts, filters, or page-level layout containers are in scope
|
|
37
|
+
- Do not continue to the next phase when the current phase introduced startup console errors or route-blocking runtime warnings.
|
|
38
|
+
|
|
16
39
|
## Required checks
|
|
17
40
|
|
|
18
41
|
- `ThemeProviderWrapper` is wired at the app root (or an approved thin wrapper around it).
|
|
19
42
|
- No route-blocking dependency conflicts remain after dependency updates.
|
|
20
|
-
- The app reaches the v2 target state (MUI v7
|
|
43
|
+
- The app reaches the v2 target state (MUI v7 plus design-system v2 contract).
|
|
44
|
+
- The app boots on the first route after migration.
|
|
45
|
+
- Browser console startup errors are fixed before closeout.
|
|
46
|
+
- Startup warnings introduced or exposed by the migration are fixed before closeout when they indicate broken runtime alignment.
|
|
47
|
+
- If the repo provides smoke or e2e checks for shell, protected routes, overlays, or other runtime-critical flows touched by the migration, those checks pass before closeout.
|
|
48
|
+
- If the repo provides a local style-contract or styleless-UI gate, keep that gate green during the migration.
|
|
49
|
+
- If the app reports duplicated runtime singleton warnings (`react`, `react-dom`, `@emotion/react`, `@emotion/styled`), fix bundler or runtime alignment with dedupe, aliasing, or the repo's equivalent singleton-sharing mechanism.
|
|
50
|
+
- The migration does not introduce local barrel-based chunk cycle warnings when direct app-local imports resolve them.
|
|
51
|
+
- Consumer-owned build warnings from stale asset globs or oversized local chunks are fixed before closeout.
|
|
52
|
+
- If shell workspaces or page-root containers were touched, verify the main content still fills the content region and that page grids did not collapse into partial-width stacks.
|
|
53
|
+
- If shell workspaces, shared cards, or page-root containers were touched, verify shared padded containers do not overflow horizontally because of `width: 100%` plus content-box sizing.
|
|
54
|
+
- If shared charts, legends, chips, segmented filters, or compact badges were touched, verify compact controls remain preset-aligned instead of drifting into ad hoc chip-like chrome.
|
|
55
|
+
- If analytics dashboards, metric cards, or dashboard grids were touched, verify labels and values still read as different hierarchy levels and desktop cards do not accidentally fall into full-width or broken-row spans.
|
|
56
|
+
- If bulk replacements or localized non-Latin copy were touched, scan for mojibake or replacement characters and verify readable text on at least one real route.
|
|
21
57
|
|
|
22
58
|
## Route-specific checks
|
|
23
59
|
|
|
24
60
|
- `mui4-to-latest`:
|
|
25
61
|
- no `@material-ui/*` dependencies remain
|
|
26
62
|
- no `@material-ui/*` imports remain in app source
|
|
27
|
-
- `adopt-existing`
|
|
63
|
+
- `adopt-existing` or `mui5-6-to-v7` coverage:
|
|
28
64
|
- no forbidden hardcoded token imports remain (per route config)
|
|
29
65
|
- `greenfield`:
|
|
30
66
|
- provider wiring compiles and basic theme switching works (if UI switcher is added)
|
|
@@ -32,4 +68,4 @@ npm run build
|
|
|
32
68
|
## Notes
|
|
33
69
|
|
|
34
70
|
- Token hardcode detection is noisy by nature; keep route configs (`token-gate.config.json`) app-specific.
|
|
35
|
-
- Real app dry-runs can be deferred in this repo backlog flow (`docs/spec-first`) and executed later in app repos
|
|
71
|
+
- Real app dry-runs can be deferred in this repo backlog flow (`docs/spec-first`) and executed later in app repos or optional closeout.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Manual QA Matrix
|
|
2
|
+
|
|
3
|
+
Use this matrix after automated gates pass.
|
|
4
|
+
|
|
5
|
+
Skip rows that are clearly out of scope for the target app, but do not skip a row
|
|
6
|
+
just because build and lint are green.
|
|
7
|
+
|
|
8
|
+
## Startup And Runtime
|
|
9
|
+
|
|
10
|
+
- Open the first route and confirm there are no startup console errors.
|
|
11
|
+
- Confirm any migration-caused warnings were removed, not just recorded.
|
|
12
|
+
- If the app uses non-Latin text, verify at least one real localized route renders readable copy.
|
|
13
|
+
|
|
14
|
+
## Shell And Layout
|
|
15
|
+
|
|
16
|
+
- Desktop:
|
|
17
|
+
- sidebar or navigation stays in its intended column
|
|
18
|
+
- content stays inside the visible workspace
|
|
19
|
+
- routed page roots fill the content pane
|
|
20
|
+
- Mobile:
|
|
21
|
+
- stacked shell still behaves correctly
|
|
22
|
+
- scroll containers and navigation still feel normal
|
|
23
|
+
|
|
24
|
+
## Theme And Preset Ownership
|
|
25
|
+
|
|
26
|
+
- Verify the active preset still owns the page background.
|
|
27
|
+
- Verify root shells and page wrappers do not paint a competing page-level background.
|
|
28
|
+
- If the app exposes multiple presets or theme switching, verify the selection still works from the intended app theme module.
|
|
29
|
+
|
|
30
|
+
## Protected Routes
|
|
31
|
+
|
|
32
|
+
- Verify at least one protected route as real product content, not a fallback page.
|
|
33
|
+
- If smoke mode or QA mode bypasses auth redirect, verify the seeded user still has the required roles.
|
|
34
|
+
|
|
35
|
+
## Overlays
|
|
36
|
+
|
|
37
|
+
- Dialogs, drawers, and bottom sheets:
|
|
38
|
+
- open correctly
|
|
39
|
+
- expose the expected title and description
|
|
40
|
+
- have labeled close actions
|
|
41
|
+
- Search overlays:
|
|
42
|
+
- keyboard filtering still works
|
|
43
|
+
- combobox or listbox semantics still match the behavior
|
|
44
|
+
|
|
45
|
+
## Dashboards And Dense Screens
|
|
46
|
+
|
|
47
|
+
- Metric cards:
|
|
48
|
+
- labels are visually quieter than values
|
|
49
|
+
- values remain the primary reading target
|
|
50
|
+
- helper text does not compete with the metric
|
|
51
|
+
- Dashboard grids:
|
|
52
|
+
- cards align on desktop as intended
|
|
53
|
+
- no accidental full-width spans appear
|
|
54
|
+
- gap rhythm is consistent
|
|
55
|
+
- Compact legends, badges, and segmented filters:
|
|
56
|
+
- still look preset-aligned
|
|
57
|
+
- do not drift into app-local chip chrome
|
|
58
|
+
|
|
59
|
+
## Forms And Workflow Screens
|
|
60
|
+
|
|
61
|
+
- Shared workflow layouts still align correctly across the related pages.
|
|
62
|
+
- Inputs, labels, helper text, and errors still render through the intended MUI or Typography contract.
|
|
63
|
+
- Clear buttons, adornments, drawers, and form overlays still behave correctly after primitive cleanup.
|
|
64
|
+
|
|
65
|
+
## Build And Asset Hygiene
|
|
66
|
+
|
|
67
|
+
- If the app uses PWA or Workbox, verify referenced static assets actually exist in the emitted app.
|
|
68
|
+
- If build output still warns, confirm whether the warning is:
|
|
69
|
+
- consumer-owned and must be fixed
|
|
70
|
+
- or upstream-only and should be recorded precisely
|