Add information-layer filtering to NAD#4054
Conversation
Add an "Information" section to the NAD navigation sidebar letting users toggle the visibility of P/Q values, % IST, P/Q arrows and voltage-level names. Each toggle hides the matching elements through CSS classes on the rendered SVG, reusing the voltage-filter masking mechanism without refetching the diagram. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
Meklo
left a comment
There was a problem hiding this comment.
"nad-arrow-in nad-permanent-limit-percentage", "nad-arrow-out nad-permanent-limit-percentage" are still visible after filtering everything out, I feel it ought to be included, maybe in the IST category ?
| // (nad-arrow-in/out) and the edge-info type class (nad-active/nad-reactive). | ||
| const INFO_SELECTORS: Record<NadSelectedInfoKey, string[]> = { | ||
| activePowerValue: ['text.nad-active'], | ||
| reactivePowerValue: ['text.nad-reactive'], |
There was a problem hiding this comment.
"nad-reactive" seems to still be visible after filtering it out
There was a problem hiding this comment.
plain ".nad-reactive" instead of "text.nad-reactive" seems to do the trick
There was a problem hiding this comment.
I don't really understand because we want to hide the text only. Can you show me a picture of the problem ?
Also where I got those selectors
…o nad-information-filtering # Conflicts: # src/components/workspace/diagrams/nad/nad-navigation-sidebar.tsx # src/components/workspace/panel-contents/diagrams/nad/nad-panel-content.tsx
Active-power arrows carry only the direction class (nad-arrow-in/out) while reactive arrows also carry nad-reactive, so the previous `.nad-active.nad-arrow-*` selectors matched no active arrow. Target active arrows by direction, excluding reactive ones, consistent with the theme css-vars files. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
Summary
Adds an Information section to the NAD navigation sidebar (after History and Voltage), letting users toggle the visibility of individual information layers to tailor the diagram to their use.
Each toggle hides the matching elements through CSS classes on the rendered SVG, reusing the voltage-filter masking mechanism — no refetch of the diagram.
Notes
<text>elements (text.nad-active,text.nad-reactive,text.nad-permanent-limit-percentage), arrows are<path>elements carrying both the direction and type classes (.nad-active.nad-arrow-in/out,.nad-reactive.nad-arrow-in/out), voltage-level names are.nad-text-nodes. This mirrors the convention already used in the theme CSS vars.