Skip to content

Fix/mos 0010#15

Merged
Lidizz merged 6 commits into
mainfrom
fix/MOS-0010
Feb 28, 2026
Merged

Fix/mos 0010#15
Lidizz merged 6 commits into
mainfrom
fix/MOS-0010

Conversation

@Lidizz
Copy link
Copy Markdown
Owner

@Lidizz Lidizz commented Feb 28, 2026

No description provided.

- Add css.modules.localsConvention 'camelCase' to Vite config
- Extract CSS custom properties (design system variables) to src/styles/variables.css
- Extract global reset and base styles to src/styles/global.css
- Update main.tsx to import new global style files
- Remove App.css import from App.tsx (all content was dead code or extracted)
- Delete Logo.css (never imported, dead CSS)

No component CSS changed yet  this commit only sets up the infrastructure.
Build succeeds, all 90 tests pass.
Converted 6 components to CSS Modules:
- Layout (header, nav, brand, actions)
- LoadingSpinner (animation, circle, message)
- ThemeToggle
- ErrorBoundary (class component)
- Toast (dynamic type via bracket notation)
- PWAPrompt (install prompt, button variants)

All imports changed to 'import styles from' pattern.
BEM classes mapped to camelCase (e.g. header__container -> styles.headerContainer).
Fixed orphaned CSS rule in LoadingSpinner.
Build passes, all 90 tests pass.
Converted 5 form components to CSS Modules:
- InvestmentBuilder (header, forms, actions, simulate button)
- InvestmentForm (grid, fields, inputs, validation, remove)
- AssetSelector (dropdown, search, filters, badges, options)
- AssetTypeFilter (toggle buttons, active state)
- SectorFilter (label, select dropdown)

Updated getAssetTypeBadgeClass() helper to return scoped class names.
Fixed orphaned CSS in LoadingSpinner (already committed).
Build passes, all 90 tests pass.
Converted 5 components to CSS Modules:
- SimulationResults (metrics, holdings table, mobile summary, disclaimer)
- PortfolioChart (header, view toggle, tooltip, legend, watermark)
- PortfolioHeader (main, assets, duration)
- AllocationChart (donut SVG, legend items)
- TimeframeSelector (buttons, active state, hint)

Migrated test queries from querySelector('.bem-class') to
getByTestId() for CSS Module compatibility:
- Added data-testid='metrics-grid' to metrics section
- Added data-testid='holdings-table' to holdings table
- Updated 5 querySelector calls in SimulationResults.test.tsx

Fixed orphaned CSS rules in PortfolioHeader.module.css.
Build passes (no CSS warnings), all 90 tests pass.
Converted 4 page components to CSS Modules:
- HomePage (hero, features grid, CTA section)
- SimulatorPage (loading, error, debug states)
- AboutPage (header, sections, tech grid, disclaimer)
- NotFoundPage (404 code, message, link)

Build passes, all 90 tests pass.
- Removed orphaned 'logo' className from Logo.tsx (no CSS backing)
- Verified: 0 old-style CSS imports remain (only 2 global imports in main.tsx)
- Verified: 20 CSS Module imports across all components/pages
- Verified: 0 string className attributes in any TSX file
- Verified: 0 querySelector calls in tests (all migrated to data-testid)
- Build passes with no warnings, all 90 tests pass
@Lidizz Lidizz merged commit c652e25 into main Feb 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant