Gadget highlighting should come only from the gadget map

Open
#430 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
javascript, react
Domain
frontend

Research direction

Start with components/Visualization/svgs/StandardGraphSvgReact.js and StandardSATSvgReact.js, then trace the ProblemProvider/gadgets response for each reduction offered by the GUI. Confirm which gadget maps cover the pieces highlighted today before changing renderer behavior; gaps belong in the backend reductions. Done means gadget highlighting uses only the map, reports loading, failure, or empty states, clears exactly its own highlights, and any plain hover highlighting has a separate option.

Written by the indexing model from the issue text.

Description

Follow-up from #429 and the review of #390.

The problem

With "Highlight gadgets" on, hovering a piece colors it in two layers (components/Visualization/svgs/StandardGraphSvgReact.js, StandardSATSvgReact.js):

  1. Without the gadget map: the hovered piece (#id…) and everything sharing its class (.class…) are colored before the renderer looks at the gadget map at all.
  2. From the gadget map: every other id in a gadget that contains the hovered piece.

Layer 1 is the renderer's guess, not something the reduction reported. So when the gadgets request is blocked, fails or hasn't arrived, the switch still highlights things and looks like it works (seen in the #390 review with the endpoint blocked). And when the map is there, the highlight mixes the guess with the reduction's real answer.

There is also a clean-up bug from the same order: in StandardGraphSvgReact.js, clearClusters returns early when the map is empty, but highlightCluster already colored the .class… group, so those highlights should stay on after the mouse leaves when there is no map. (Not yet reproduced; read from the code.)

Proposal

  1. Gadget highlighting comes only from the gadget map: the hovered piece and its gadget partners, nothing else.
  2. If the map is loading, failed or empty, there is no gadget highlighting, and the user is told why instead of it failing silently (for example "Gadgets unavailable: …" using the failure text #390 added).
  3. Clearing undoes exactly what was highlighted.
  4. If plain "highlight what I hover" is still wanted without a reduction, it becomes its own option with its own name, not part of "Highlight gadgets".

Check first

Some reductions' gadget maps may not cover what Layer 1 covers today (for example a clause's literals). Before changing the renderers, check what ProblemProvider/gadgets returns for each reduction the GUI offers, so map-only highlighting doesn't make highlighting disappear for those reductions. Gaps go to the backend reductions.

Related: #429 (fetch the gadget map only when "Show reduction" is on).

Dominant language
JavaScript
Stars
3
Forks
18
Avg merge
1d 15h
Merged PRs (30d)
27

Getting set up

Open in Codespaces

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from ReduxISU/Redux_GUI

All issues in ReduxISU/Redux_GUI

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.