Only request gadget mappings when "Show reduction" is on
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript, playwright
Research direction
Read components/widgets/VisualizationLogic.js and components/pageblocks/VisualizeRowReact.js to trace gadget fetching and the two switches. Follow the request watching pattern in #390's tests, then run the relevant Playwright test. Done when gadgets cannot be enabled without Show reduction, disabling Show reduction turns gadgets off, and the gadgets request is sent once when both are on.
Written by the indexing model from the issue text.
Description
Follow-up from the review of #390 (raised by @c-hayCodes when approving).
Why
Gadgets belong to a reduction, not to a problem on its own. The request is ProblemProvider/gadgets?reduction=<chosen reduction>, and it answers "which source pieces became which target pieces". With "Show reduction" off, the target pieces (reductionToIds) aren't on screen, so what's left is a grouping of the main picture's pieces that changes with the reduction dropdown even though no reduction is shown. That is confusing, so the gadget map should go with the reduction.
What happens now
The gadget map (and the solve and reduce requests behind it) is fetched when either "Show reduction" or "Highlight gadgets" is on: wantGadgets = visualizationState.reductionOn || visualizationState.gadgetsOn in components/widgets/VisualizationLogic.js. So turning on "Highlight gadgets" by itself still sends those requests.
What to change
- In
components/widgets/VisualizationLogic.js, fetch the gadget map only when "Show reduction" is on (wantGadgets = visualizationState.reductionOn). - In
components/pageblocks/VisualizeRowReact.js, make "Highlight gadgets" depend on "Show reduction": disable the switch while "Show reduction" is off, and turn it off when "Show reduction" is turned off. - Add a Playwright test: with "Show reduction" off, turning on "Highlight gadgets" isn't possible and no
ProblemProvider/gadgetsrequest is sent. With both on, the request is sent once. #390's tests show how to watch requests.
Out of scope
Changing how the renderers highlight (they also color the hovered piece without the gadget map) is #430.
- Dominant language
- JavaScript
- Stars
- 3
- Forks
- 18
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 27
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ReduxISU/Redux_GUI
-
Add GitHub and YouTube icons to the site footerMay be free again @sushantshetty09 claimed this 15 days ago, and no pull request is open. Openenhancement good first issue
Difficulty 1/5 Under an hour Newbie friendliness 88/100
ReduxISU/Redux_GUI#448 · 1 comment ·
Maintainers usually reply within 1 day
-
documentation good first issue
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Make it clear the visualization shows the problem and the selected solverMay be free again @Trosper3 claimed this 38 days ago, and no pull request is open. Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
ReduxISU/Redux_GUI#391 · 1 assignee ·
Maintainers usually reply within 1 day
-
[Bug]: Main page problem search shows no "Add new problem" button when nothing matchesPossibly taken @ShahadatTest claimed this 32 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
All issues in ReduxISU/Redux_GUI
Similar issues
-
bug data-types
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/clickhouse-js#1293 ·
Maintainers usually reply within 1 day
-
area: tests help wanted size/s
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
DahanItamar/DockNest#368 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 76/100