Skip to content

Add information-layer filtering to NAD#4054

Open
flomillot wants to merge 4 commits into
nad-voltage-level-filteringfrom
nad-information-filtering
Open

Add information-layer filtering to NAD#4054
flomillot wants to merge 4 commits into
nad-voltage-level-filteringfrom
nad-information-filtering

Conversation

@flomillot

@flomillot flomillot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

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

  • Selectors are derived from the network-viewer rendering: values are <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.
  • Toggle state is transient (per panel, reset on reload), consistent with the existing voltage filter.

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>
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d78a86d9-5a77-439f-9878-f641a7cc51f2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>

@Meklo Meklo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"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'],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"nad-reactive" seems to still be visible after filtering it out

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plain ".nad-reactive" instead of "text.nad-reactive" seems to do the trick

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

'text.nad-reactive': {

@Meklo Meklo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"nad-arrow-in nad-permanent-limit-percentage", "nad-arrow-out nad-permanent-limit-percentage" are still visible after filtering everything out, maybe it ought to be included in the IST category duplicate comment

flomillot and others added 2 commits July 3, 2026 15:26
…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>
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.

2 participants