Add ThemeProvider and comprehensive UI restyle (nav, footer, PolymathBento, buttons, textarea, CSS) - #2
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4fdbe12308
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| useEffect(() => { | ||
| const root = document.documentElement; | ||
| root.setAttribute('data-theme', theme); | ||
| window.localStorage.setItem(STORAGE_KEY, theme); | ||
| }, [theme]); |
There was a problem hiding this comment.
Preserve system-theme tracking until user chooses a theme
The provider persists identity-prism-theme on every mount, even when the theme was only inferred from matchMedia. Because the media-change listener later updates only when !persisted, that branch becomes unreachable immediately after first render, so users who never explicitly toggle theme stop following OS light/dark changes after load. This breaks the intended “media-query fallback” behavior until localStorage is manually cleared.
Useful? React with 👍 / 👎.
| html, | ||
| body, | ||
| #root { | ||
| width: 100vw; | ||
| min-height: 100vh; |
There was a problem hiding this comment.
Replace root 100vw sizing to prevent horizontal overflow
Applying width: 100vw to the root layout container causes a cross-platform overflow issue when vertical scrollbars consume layout space (common on Windows): 100vw includes scrollbar width, so the page becomes wider than the visible viewport and can produce horizontal scrolling/jitter. This affects the whole app shell because these rules apply to html, body, and #root globally.
Useful? React with 👍 / 👎.
Motivation
Description
ThemeProviderandThemeTogglewithuseThemehook and persistent storage (localStorage) and media-query fallbacks, and wrap the app withThemeProviderinApp.tsx.src/index.cssto introduce design tokens (colors, spacing, fonts, states), new utility classes, and dark/light variants controlled bydata-theme, and updateindex.htmlmeta/title and theme attributes.App.tsx,GlobalNav.tsx,MinimalFooter.tsx,PolymathBento.tsx, andTestingDashboard.tsx, addThemeToggleinto the navigation, improve ARIA roles and keyboard semantics, and restructurePolymathBentowith new content blocks and accessible markup.button.tsxandtextarea.tsxvariants to use the new tokenized classes and tuned sizing/behavior.Testing
tsc --noEmit) and a local production build (npm run build) to validate compile-time correctness and bundling, both completed successfully.Codex Task