Skip to content

Centralize and polish the app's theme (browse palette, dark/light toggle, home page) - #219

Closed
Trosper3 wants to merge 4 commits into
ReduxAPI_GUIfrom
theme/combined-theming-bundle
Closed

Trosper3 wants to merge 4 commits into
ReduxAPI_GUIfrom
theme/combined-theming-bundle

Conversation

@Trosper3

@Trosper3 Trosper3 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Features:

  • Updated the Browse page to match the site's orange/grey/white color scheme
  • Consolidated all the app's color and style settings into one place, and fixed the home page's missing background color
  • Added a light/dark mode switch that works across the whole app
  • Fixed text and elements on the home page that were hard to read in dark mode

Issue Handling:
Closes #208
Closes #209
Closes #210
Closes #218

Trosper3 and others added 4 commits September 3, 2026 15:50
/browse (and its FacetFilterGroup/ProblemCard components, used only
there) had a bespoke dark purple/violet "glass" theme, out of step
with the light orange/grey/white theme every other page (home,
About Us, Help, Contribute) already shares. Swapped every hardcoded
color to match those pages' exact values -- same primary (#3F3F46),
secondary/accent (#F47C20), background.default (#F9FAFB), paper
(#FFFFFF), text primary/secondary (#111827/#4B5563), and card style
(white background, #E5E7EB border, orange hover) -- rather than
inventing new ones.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BGUai41kxHnzFP3tiENWkK
Adds components/theme.js as the single source of truth for the
orange/grey/white palette, page background gradient, and section/
inner card styles -- every page previously defined its own
createTheme() with copy-pasted (and drifting: "#3F3F46" vs "#424242"
for the "same" grey, "#F47C20" vs "#f47920" for the "same" orange)
hex values. About Us, Help, Contribute, and Browse now import from
it instead of redeclaring it locally.

Also folds in the home page background fix: pages/index.js had no
CssBaseline and no background styling at all (a leftover of its
older Bootstrap-based layout), so it rendered on flat white while
every other page had the shared radial-gradient/grey backdrop. Now
wrapped in CssBaseline + the shared pageBackground, matching the
rest of the app. Its local theme keeps two page-specific palette
extensions (primary.lGray, white) that only this page's pageblocks
actually use (No_Viz_SVG.js's bgcolor="primary.lGray",
color="white" buttons across several pageblocks) -- extended from
the shared palette rather than duplicating it wholesale.

Centralizing this is also the prerequisite for a future light/dark
mode toggle: one shared theme object instead of five independent
ones is what makes flipping mode application-wide feasible.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BGUai41kxHnzFP3tiENWkK
Adds a small toggle in the top banner that switches the whole app
between light and dark, persisted to localStorage.

- components/theme.js: adds a dark palette alongside the existing
  light one, plus createAppTheme(mode), and turns pageBackground/
  sectionCardSx/innerCardSx from flat constants into mode-aware
  functions. Also folds pages/index.js's page-specific palette
  extensions (primary.lGray, white) into both shared palettes, since
  theme creation is no longer per-page.
- components/ThemeModeContext.js (new): the actual state -- mode,
  persisted to localStorage, read after mount (SSR has no
  localStorage, so the very first render is always light; a
  returning dark-mode user sees a brief flash before it switches,
  not worth a blocking SSR script for this). Renders MUI's own
  ThemeProvider + CssBaseline once, wrapping the whole app.
- pages/_app.js: wraps <Component> in ThemeModeProvider -- this is
  what makes the toggle affect every page from one place, instead of
  each page owning its own independent theme like before.
- Every page (index, aboutus, browse, help, contribute) and the
  Browse-only widgets (ProblemCard, FacetFilterGroup) drop their own
  ThemeProvider/CssBaseline/createTheme and read mode from
  useThemeMode() instead, threading it into the now-mode-aware style
  helpers. Also replaced the many hardcoded body-text hex colors
  (#374151, #6b7280, #9ca3af, ...) with the new textColors(mode) /
  surfaceColors(mode) tiers, since dark-on-dark text would otherwise
  be illegible against the new dark cards.
- ResponsiveAppBar: the banner itself stays one fixed dark chrome
  color in both modes (matches #207's original
  "consistent everywhere" intent, just updated to the canonical
  #3F3F46 grey) rather than becoming mode-aware itself -- it's
  already a deliberately fixed brand element. Adds the toggle
  IconButton (sun/moon) at the top-right corner.

Verified: npm run build succeeds with zero errors, all pages
prerender; npm run dev serves all five pages at 200 with the shared
palette resolving correctly in the default (light) SSR render.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BGUai41kxHnzFP3tiENWkK
Combines five follow-up fixes (originally #211, #213, #214, #215, #217)
found while testing the dark/light toggle against the home page:

- Home page's five accordion sections (Problem, Reduce, Visualize,
  Solve, Verify) stayed white with dark text in dark mode --
  react-bootstrap's Card/Card.Header have their own hardcoded CSS with
  no idea our MUI theme exists. Backgrounds/text now come from the
  shared surfaceColors(mode)/textColors(mode) tokens.
- The white border around each row wasn't actually the Card -- it was
  a separate global CSS rule on the outer Accordion wrapper
  (styles/globals.css: .accordion { border: 2px solid #ccc; }).
  Overridden to transparent in dark mode via inline style.
- ISU logo's "Idaho State University"/"Computer Science" text and
  divider line are baked into the PNG as near-black pixels; in dark
  mode the logo now sits on a white background chip instead (home,
  about us, help, contribute -- browse has no logo footer).
- Visualize row's Refresh/step-navigation/"Show reduction" controls bar
  had a hardcoded light background (#f9f9f9); now theme-aware, plus
  explicit text color on the switch labels.
- Each row's drag-to-reorder icon had a hardcoded light chip (#f5f5f5
  bg, #424242 icon) that stood out as a white circle in dark mode; now
  theme-aware across all 5 row components.
- Verify row's "Enter a certificate" textarea (react-bootstrap
  FormControl) had the same hardcoded-white-background problem as the
  Cards above; fixed the same way.

Light mode is unaffected by all of the above -- every change is gated
on mode === "dark".

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BGUai41kxHnzFP3tiENWkK
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Redux Build System — CI Report

npm · commit 0eec8ef

Operation Status Summary Time
audit 1 high 0.6s
format-check 58 format · 33 import order 0.4s
lint 25 errors, 41 warnings 6.6s
typecheck ⏭️ no tsconfig.json
unit-test ⏭️ no test script in package.json
build built local/redux_gui:ci · 235MB 62.5s
integration-test 1 failed · 3 passed 19.8s
push not run — integration-test failed

Overall: ❌ 1 passed · 4 failed · 2 skipped · 1 blocked

❌ audit — 1 high
Severity Location Rule Message
high svgo@3.0.0 - 3.3.3 GHSA-2p49-hgcm-8545 SVGO removeScripts plugin leaves some executable scripts intact
❌ format-check — 58 format · 33 import order
Severity Location Rule Message
error Tools/Constants.js format needs formatting
error Tools/ProblemInstanceParser.js format needs formatting
error biome.json format needs formatting
error components/ContributorCard.js format needs formatting
error components/Quantum/QuantumCircuitVisualizer.js assist/source/organizeImports Sort these imports.
error components/Quantum/QuantumCircuitVisualizer.js format needs formatting
error components/Quantum/circuitUtils.js format needs formatting
error components/Visualization/Graphvisualization.js format needs formatting
error components/Visualization/GraphvizWrapper.js assist/source/organizeImports Sort these imports.
error components/Visualization/QuantumCircuitVis.js assist/source/organizeImports Sort these imports.
error components/Visualization/QuantumCircuitVis.js format needs formatting
error components/Visualization/ReducedVisualization.js format needs formatting
error components/Visualization/constants/VisColors.js format needs formatting
error components/Visualization/constants/VisColorsArray.js assist/source/organizeImports Sort the exported names.
error components/Visualization/constants/VisColorsArray.js format needs formatting
error components/Visualization/openqasmToQText.js format needs formatting
error components/Visualization/svgs/DynamicTableSvgReact.js format needs formatting
error components/Visualization/svgs/LaTeXGraphSvgReact.js format needs formatting
error components/Visualization/svgs/No_Viz_SVG.js assist/source/organizeImports Sort these imports.
error components/Visualization/svgs/No_Viz_SVG.js format needs formatting
… and 72 more
❌ lint — 25 errors, 41 warnings
Severity Location Rule Message
error components/ThemeModeContext.js:31 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/Visualization/QuantumCircuitVis.js:152 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/hooks/ProblemProvider/Problem.js:51 no-undef 'requestInfo' is not defined.
error components/hooks/ProblemProvider/Problem.js:73 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/hooks/ProblemProvider/Reducer.js:132 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/hooks/ProblemProvider/Reducer.js:152 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/hooks/ProblemProvider/Reducer.js:171 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/hooks/ProblemProvider/Reducer.js:190 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/hooks/ProblemProvider/Reducer.js:211 react-hooks/immutability Error: Cannot access variable before it is declared
error components/hooks/ProblemProvider/Reducer.js:215 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/hooks/ProblemProvider/Reducer.js:51 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/hooks/ProblemProvider/Reducer.js:74 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/hooks/ProblemProvider/Solver.js:138 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/hooks/ProblemProvider/Solver.js:24 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/hooks/ProblemProvider/Verifier.js:87 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/pageblocks/ProblemRowReact.js:160 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/pageblocks/ProblemRowReact.js:169 react-hooks/immutability Error: This value cannot be modified
error components/pageblocks/VerifyRowReact.js:52 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/pageblocks/VerifyRowReact.js:58 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/pageblocks/VisualizeRowReact.js:141 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
… and 46 more

@Trosper3

Trosper3 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #223, which merges this theming PR with #192 into one PR. Closing in favor of #223.

@Trosper3 Trosper3 closed this Sep 8, 2026
@Trosper3
Trosper3 deleted the theme/combined-theming-bundle branch September 10, 2026 18:33
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