Skip to content

Add a CLI flag and dialog option for "Highlight row on click" - #603

Open
RakTikoo wants to merge 4 commits into
openscopeproject:masterfrom
RakTikoo:highlight-row-on-click-setting
Open

RakTikoo wants to merge 4 commits into
openscopeproject:masterfrom
RakTikoo:highlight-row-on-click-setting

Conversation

@RakTikoo

Copy link
Copy Markdown

Fixes #597.

"Highlight row on click" existed only inside the generated page, with its default hardcoded to false in util.js. Unlike its neighbours (dark_mode, redraw_on_drag, offset_back_rotation, …) it was never wired into the generated config, so there was no way to preset it from the command line, an ini file, or the settings dialog — which is what the reporter needs for a downstream export script.

This wires it through the same plumbing as the other boolean HTML settings:

  • New highlight_row_on_click config field (default false, so generated pages behave exactly as before unless the option is used), included in the config embedded in the generated HTML.
  • New CLI pair --highlight-row-on-click / --no-highlight-row-on-click, plus ini support (both the wx ini load/save and --use-ini).
  • New "Highlight row on click" checkbox in the HTML settings dialog (added to both settings_dialog.fbp and the generated dialog_base.py, mirroring the Offset back rotation checkbox), with set_from_dialog / transfer_to_dialog support.
  • util.js now takes the setting's default from config.highlight_row_on_click; a viewer's stored choice still overrides it, like the other settings.
  • DATAFORMAT.md config struct updated.

Testing: I don't have a KiCad/wxPython setup here, so I verified headless with a minimal generic-JSON board through the real CLI: on the old code the flag is rejected (unrecognized arguments) and the config key is absent; with this change the default run embeds "highlight_row_on_click": false, --highlight-row-on-click embeds true, and --use-ini with the key set in ibom.config.ini also embeds true. The dialog transfer code was exercised against a mock dialog in both directions, but I could not open the real wx dialog — worth a quick visual check from someone with KiCad.

One scoping note: a few other viewer settings share the same hardcoded-default shape (references/values/tracks/zones visibility, DNP outline). I left those alone to keep this PR to the requested setting, but they could be wired the same way if you'd like a follow-up.

Full disclosure: this fix was prepared with AI assistance (Spark, an AI agent working for me). I have reviewed the diff and the test results myself and I own the change — happy to explain or adjust any part of it.

This branch has not been deployed

No deployments
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.

Some settings are not configurable in command line or settings dialog

1 participant