Skip to content

Remove hardcoded problemType=NPC from frontend#133

Open
wrigjl wants to merge 2 commits into
ReduxISU:ReduxAPI_GUIfrom
wrigjl:feature/120-remove-hardcoded-npc-problemtype
Open

Remove hardcoded problemType=NPC from frontend#133
wrigjl wants to merge 2 commits into
ReduxISU:ReduxAPI_GUIfrom
wrigjl:feature/120-remove-hardcoded-npc-problemtype

Conversation

@wrigjl

@wrigjl wrigjl commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The frontend hardcoded problemType=NPC on every reduction/solver/verifier/visualization request. The backend now makes this field optional (#331, #330, #329 all closed/merged upstream in ReduxISU/Redux), so it's removed here.
  • problemType was dead state: initialized once via useState("NPC") in Problem.js, its setter was never called anywhere, and it was just threaded unchanged through every ProblemProvider hook down to the 5 redux/index.js API functions. This is a pure deletion — no behavior change, since the value sent was always "NPC" and the backend now applies its own default once the param is absent.

Closes #120

Test plan

  • npm run lint on touched files — no new errors/warnings (pre-existing react-hooks/* findings are unrelated baseline noise)
  • npm run build — production build compiles, all 7 routes prerender successfully
  • Hit all 5 modified backend endpoints directly (localhost:27000) without problemType — all return 200 with correct data
  • Round-tripped the same requests through the GUI's own /api/redux proxy on a running dev server — same correct results

The backend now makes problemType optional across visualizations,
verifiers, and solvers, so the frontend no longer needs to hardcode
and thread "NPC" through every ProblemProvider hook and Redux API
call. problemType was dead state (initialized once, never set).

Closes ReduxISU#120

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Comment thread components/hooks/ProblemProvider/Reducer.js Fixed
GitHub Advanced Security's ESLint check flagged this as a new alert
because these lines were touched while removing problemType. Declaring
the helper before the effect that calls it resolves it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.

Remove hardcoded use of problemType=NPC

2 participants