Skip to content

Centralize the app's theme and reorder the Reduce/Verify panes - #223

Merged
Trosper3 merged 9 commits into
ReduxAPI_GUIfrom
theme-and-layout-combined
Sep 10, 2026
Merged

Trosper3 merged 9 commits into
ReduxAPI_GUIfrom
theme-and-layout-combined

Conversation

@Trosper3

@Trosper3 Trosper3 commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

This PR is related to theme centralization and a layout fix on the main problem page.

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
  • Moved the Reduce pane below the Verify pane on the main problem page

Issue Handling:
Closes #226
Closes #227
Closes #228
Closes #229
Closes #191

Trosper3 and others added 7 commits September 1, 2026 21:08
Reorders the default problem detail page layout so Reduce is last
(problem, visualize, solve, verify, reduce) instead of third
(problem, reduce, visualize, solve, verify). Reductions are an
optional, exploratory side-feature -- you can solve/verify a problem
directly without ever reducing it -- so it belongs at the end of the
pipeline rather than visually gating the rest of it. Matches the
section order the new Redux_Frontend project independently settled on
(Overview, Visualizations, Solvers, Verifier, Reductions -- Reductions
last).

No persisted row-order state to migrate (rowOrder is a plain in-memory
useState default, not read from localStorage), and the drag-handle
ids/tour selectors are keyed by row id rather than position, so nothing
else needed to change.

Closes #191

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013HmzCMwvXP5jDBE3qgSmkj
/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
Comment thread components/ThemeModeContext.js Fixed
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Redux Build System — CI Report

npm · commit d39c1fc

Operation Status Summary Time
audit 2 high · 1 moderate 1.1s
format-check 60 format · 33 import order 0.5s
lint 24 errors, 41 warnings 7.7s
typecheck ⏭️ no tsconfig.json
unit-test ⏭️ no test script in package.json
build built local/redux_gui:ci · 235MB 58.9s
integration-test 1 failed · 3 passed 20.2s
push not run — integration-test failed

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

❌ audit — 2 high · 1 moderate
Severity Location Rule Message
high sharp@<0.35.4 GHSA-rgj7-g3m4-5g8c sharp: Vulnerabilities in libheif: GHSA-g89c-p67h-r497 and GHSA-2jg2-4ch7-h545
high svgo@3.0.0 - 3.3.4 GHSA-2p49-hgcm-8545 SVGO removeScripts plugin leaves some executable scripts intact
moderate baseline-browser-mapping@>=2.0.0 <2.11.0 GHSA-w5vr-8v7q-w6rv baseline-browser-mapping process termination on invalid input causes denial of service
❌ format-check — 60 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 74 more
❌ lint — 24 errors, 41 warnings
Severity Location Rule Message
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:122 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:177 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
error components/pageblocks/ProblemRowReact.js:186 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
error components/pageblocks/VisualizeRowReact.js:145 react-hooks/set-state-in-effect Error: Calling setState synchronously within an effect can trigger cascading renders
… and 45 more

…tification

The localStorage read must stay in an effect (not a useState lazy
initializer) to avoid a hydration mismatch, since localStorage isn't
available during SSR.
@Trosper3
Trosper3 merged commit 836e024 into ReduxAPI_GUI Sep 10, 2026
7 checks passed
@Trosper3
Trosper3 deleted the theme-and-layout-combined branch September 10, 2026 15: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

3 participants