Skip to content

Add network modification row expansion#3824

Draft
Meklo wants to merge 3 commits intomainfrom
marcellinh/add_network_modification_row_expansion
Draft

Add network modification row expansion#3824
Meklo wants to merge 3 commits intomainfrom
marcellinh/add_network_modification_row_expansion

Conversation

@Meklo
Copy link
Contributor

@Meklo Meklo commented Mar 20, 2026

PR Summary

@coderabbitai
Copy link

coderabbitai bot commented Mar 20, 2026

Important

Review skipped

Draft detected.

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: a59265b1-89cb-4c9c-96fa-626c7d9b4acf

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
📝 Walkthrough

Walkthrough

Introduced hierarchical support for network modifications by creating a new ComposedModificationMetadata type that extends NetworkModificationMetadata with recursive subModifications. Updated all table components to use this new type and added expandable row functionality for composite modifications with visual hierarchy indicators.

Changes

Cohort / File(s) Summary
Core Data Structure & Utilities
src/components/graph/menus/network-modifications/network-modification-table/utils.ts
Added new ComposedModificationMetadata interface extending NetworkModificationMetadata with recursive subModifications field. Added formatComposedModification() utility to transform flat modification arrays.
Column Definitions
src/components/graph/menus/network-modifications/network-modification-table/columns-definition.tsx
Updated createBaseColumns and createRootNetworksColumns function signatures to use ComposedModificationMetadata[] instead of NetworkModificationMetadata[].
Table Core
src/components/graph/menus/network-modifications/network-modification-table/network-modifications-table.tsx
Introduced expanded row state, wired TanStack expansion features (getExpandedRowModel, getSubRows, onExpandedChange). Changed row data source to use formatComposedModification() and updated row identity logic to parent-qualified format for hierarchical support.
Styling & Hierarchy
src/components/graph/menus/network-modifications/network-modification-table/styles.ts
Updated createRowSx() and createCellStyle() signatures to accept theme, depth, and isExpanded parameters. Added conditional border styling and column-specific border suppression for hierarchical rows.
Visual Hierarchy Component
src/components/graph/menus/network-modifications/network-modification-table/renderers/depth-box.tsx
New component rendering visual depth indicators (vertical dividers and optional horizontal tick marks) for hierarchical row indentation.
Name Cell Renderer
src/components/graph/menus/network-modifications/network-modification-table/renderers/name-cell.tsx
Added expand/collapse button with arrow icons, indentation via DepthBox chain, and conditional border styling. Updated to use Row<ComposedModificationMetadata>.
Cell Renderers
src/components/graph/menus/network-modifications/network-modification-table/renderers/description-cell.tsx, root-network-chip-cell.tsx, select-cell.tsx, select-header-cell.tsx, switch-cell.tsx, drag-row-clone.tsx
Type updates replacing NetworkModificationMetadata with ComposedModificationMetadata and corresponding Row/Table generic parameters across all cell and row renderer components.
Row Components & Drag/Drop
src/components/graph/menus/network-modifications/network-modification-table/row/modification-row.tsx, use-modifications-drag-and-drop.tsx
Updated type parameters to ComposedModificationMetadata. Modified modification-row.tsx to compute depth, isExpanded, and isLastLeaf for hierarchical styling.
Service Import Reordering
src/services/study/network-modifications.ts
Reordered import of NetworkModificationMetadata without functional changes.
🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The PR description block is empty with no meaningful content provided by the author. Provide a description explaining what problem this solves, how it works, and any important context for reviewers.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main feature being added: row expansion functionality for network modifications in the table.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

📝 Coding Plan
  • Generate coding plan for human review comments

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 and usage tips.

Tip

You can disable sequence diagrams in the walkthrough.

Disable the reviews.sequence_diagrams setting to disable sequence diagrams in the walkthrough.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/components/graph/menus/network-modifications/network-modification-table/renderers/switch-cell.tsx (1)

55-72: ⚠️ Potential issue | 🟠 Major

Flat search won't find sub-modifications in hierarchical state.

toggleModificationActive uses findIndex to search oldModifications at the root level only. With the new hierarchical ComposedModificationMetadata[] structure, sub-modifications are nested inside their parent's subModifications array and won't be found by this flat search.

When toggling a sub-modification's switch, modificationToUpdateIndex will be -1, causing the function to return early without updating local state, even though the API call proceeds.

Consider implementing a recursive search or flattening helper to locate modifications at any depth:

🐛 Proposed fix sketch
// Helper to recursively find and update a modification
const findAndUpdateModification = (
    mods: ComposedModificationMetadata[],
    uuid: string,
    updater: (mod: ComposedModificationMetadata) => ComposedModificationMetadata
): ComposedModificationMetadata[] => {
    return mods.map((mod) => {
        if (mod.uuid === uuid) {
            return updater(mod);
        }
        if (mod.subModifications?.length) {
            return {
                ...mod,
                subModifications: findAndUpdateModification(mod.subModifications, uuid, updater),
            };
        }
        return mod;
    });
};
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/components/graph/menus/network-modifications/network-modification-table/renderers/switch-cell.tsx`
around lines 55 - 72, toggleModificationActive fails to find nested
sub-modifications because it uses a flat findIndex on oldModifications;
implement a recursive updater (e.g., findAndUpdateModification) that walks
ComposedModificationMetadata[] and returns a new array with only the target
modification's activated toggled, preserving all other items and their
subModifications, then call setModifications(old =>
findAndUpdateModification(old, modificationUuid, mod => ({ ...mod, activated:
!mod.activated }))) inside toggleModificationActive and leave the existing
updateModification(newStatus) call; ensure the helper recurses into
subModifications and returns new objects for any branch that changed.
src/components/graph/menus/network-modifications/network-modification-table/use-modifications-drag-and-drop.tsx (1)

51-54: ⚠️ Potential issue | 🔴 Critical

Index mismatch when dragging sub-rows in expanded composite modifications.

When composite modifications are expanded, table.getRowModel().rows contains a flattened array including sub-rows. The drag handlers use virtualRow.index (position in the flattened list) but onRowDragEnd applies these indices directly to the top-level modifications array. If a sub-row is dragged, the indices will be misaligned—the code will attempt to reorder the wrong top-level modification.

Additionally, isRowDragDisabled is a flat boolean with no depth checking, so sub-rows remain draggable.

Solutions:

  1. Prevent sub-row dragging by passing depth > 0 check to isDragDisabled in modification-row.tsx line 47
  2. Map flattened indices back to top-level modification indices in onRowDragEnd before applying the reorder
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/components/graph/menus/network-modifications/network-modification-table/use-modifications-drag-and-drop.tsx`
around lines 51 - 54, The drag handlers are using flattened virtual row indices
but onRowDragEnd reorders the top-level modifications array, causing wrong moves
for sub-rows and allowing sub-row drags; update modification-row.tsx to pass a
depth check (depth > 0) into the isDragDisabled / isRowDragDisabled prop so any
row with depth > 0 is not draggable, and modify the onRowDragEnd handler to map
source.index and destination.index from the flattened table.getRowModel().rows
back to their parent/top-level modification indices before mutating the
modifications array (use rows[source.index].original.parentId or a top-level
lookup from rows[...] to resolve the correct modification index) so reorders
operate on top-level modification positions only.
🧹 Nitpick comments (5)
src/components/graph/menus/network-modifications/network-modification-table/utils.ts (1)

10-17: Consider defining the interface before the function that uses it.

While TypeScript hoisting makes this work, conventional code organization places type/interface definitions before the functions that reference them.

Also, formatComposedModification always initializes subModifications to an empty array. Based on the context, actual nested modifications for COMPOSITE_MODIFICATION types would need to be populated elsewhere (e.g., from the API response). Ensure the data source provides populated subModifications for composite types, or this transformation may need to recursively process nested data.

🔧 Suggested reordering
 import { NetworkModificationMetadata } from '@gridsuite/commons-ui';

+export interface ComposedModificationMetadata extends NetworkModificationMetadata {
+    subModifications: ComposedModificationMetadata[];
+}
+
 export const formatComposedModification = (
     modifications: NetworkModificationMetadata[]
 ): ComposedModificationMetadata[] => {
     return modifications.map((modification) => ({ ...modification, subModifications: [] }));
 };
-
-export interface ComposedModificationMetadata extends NetworkModificationMetadata {
-    subModifications: ComposedModificationMetadata[];
-}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/components/graph/menus/network-modifications/network-modification-table/utils.ts`
around lines 10 - 17, Move the ComposedModificationMetadata interface
declaration above the formatComposedModification function and update
formatComposedModification (which currently returns modifications.map(m => ({
...m, subModifications: [] }))) so it does not always overwrite nested data: if
the incoming NetworkModificationMetadata already contains subModifications,
preserve them, and if composite types (e.g., type === 'COMPOSITE_MODIFICATION')
require recursive construction, recursively map those nested items into
ComposedModificationMetadata via the same function; reference the symbols
ComposedModificationMetadata, NetworkModificationMetadata and
formatComposedModification when making these changes and ensure the function
either uses existing subModifications from the API or builds them recursively
rather than always setting an empty array.
src/components/graph/menus/network-modifications/network-modification-table/network-modifications-table.tsx (2)

66-74: Dual state management may cause synchronization issues.

The component maintains two pieces of state: modifications (from props/parent) and composedModification (local derived state). The useEffect syncs composedModification when modifications changes, but setComposedModification is passed to child components (via columns) which may update only the local state without propagating changes back to the parent's modifications.

This could lead to state divergence where composedModification is modified locally but modifications in the parent remains stale until the next external update.

Consider either:

  1. Making the transformation purely derived via useMemo instead of useState + useEffect
  2. Ensuring all local updates also propagate to setModifications
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/components/graph/menus/network-modifications/network-modification-table/network-modifications-table.tsx`
around lines 66 - 74, Component holds derived local state composedModification
(set via formatComposedModification(modifications)) while also accepting
modifications from parent; child updates use setComposedModification only,
risking divergence. Fix by making composedModification a pure derived value with
useMemo: replace useState/useEffect with const composedModification = useMemo(()
=> formatComposedModification(modifications), [modifications]) so it always
reflects parent props, or alternatively ensure every place that calls
setComposedModification (including columns/children) also calls the parent's
updater (setModifications) so changes are propagated upstream; update references
to setComposedModification, formatComposedModification, and any column handlers
accordingly.

35-35: Type mismatch between prop and child component expectations.

handleCellClick is typed as (modification: NetworkModificationMetadata) => void in the props interface (line 35), but ModificationRow expects handleCellClick?: (modification: ComposedModificationMetadata) => void. While this compiles due to TypeScript's structural subtyping (contravariance on function parameters), it creates an implicit contract that the parent handler must handle the extended type.

Consider updating the prop type to explicitly accept ComposedModificationMetadata for clarity and type safety:

-    handleCellClick: (modification: NetworkModificationMetadata) => void;
+    handleCellClick: (modification: ComposedModificationMetadata) => void;

Also applies to: 189-189

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/components/graph/menus/network-modifications/network-modification-table/network-modifications-table.tsx`
at line 35, The prop type for handleCellClick is too narrow: props define
handleCellClick as (modification: NetworkModificationMetadata) => void while
child component ModificationRow expects (modification:
ComposedModificationMetadata) => void; update the parent prop signature to
accept ComposedModificationMetadata (change handleCellClick: (modification:
ComposedModificationMetadata) => void) so the handler explicitly accepts the
extended type and matches ModificationRow's expectation (also update any other
occurrences noted around line 189 to the same ComposedModificationMetadata
type).
src/components/graph/menus/network-modifications/network-modification-table/styles.ts (1)

175-177: Misleading comment about border suppression logic.

The comment states "For the last leaf row of a group" but the actual condition depth > 0 || isExpanded applies to all nested rows and expanded parents, not specifically the last leaf. Consider updating the comment to accurately describe the behavior:

📝 Proposed comment fix
-    // For the last leaf row of a group, only suppress border on the name column (not drag/select)
+    // Suppress bottom border for nested rows and expanded parents to create visual grouping
     const suppressedColumns = BORDER_SUPPRESSED_COLUMNS;
     const suppressBorder = suppressedColumns.has(cell.column.id) && (depth > 0 || isExpanded);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/components/graph/menus/network-modifications/network-modification-table/styles.ts`
around lines 175 - 177, The comment for the border suppression logic is
misleading: it says "For the last leaf row of a group" but the condition uses
suppressedColumns.has(cell.column.id) && (depth > 0 || isExpanded), which
applies to any nested row or any expanded parent, not only the last leaf. Update
the comment near suppressedColumns/BORDER_SUPPRESSED_COLUMNS and the
suppressBorder variable to accurately describe that border suppression is
applied for columns in BORDER_SUPPRESSED_COLUMNS when the row is nested (depth >
0) or the row is expanded (isExpanded), and clarify that this is not limited to
last-leaf rows.
src/components/graph/menus/network-modifications/network-modification-table/renderers/name-cell.tsx (1)

81-81: Internationalize aria-label for accessibility.

The aria-label values "Collapse" and "Expand" are hardcoded English strings. For consistency with the rest of the application using react-intl, consider using intl.formatMessage.

♻️ Proposed fix
-                            aria-label={row.getIsExpanded() ? 'Collapse' : 'Expand'}
+                            aria-label={intl.formatMessage({ id: row.getIsExpanded() ? 'collapse' : 'expand' })}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/components/graph/menus/network-modifications/network-modification-table/renderers/name-cell.tsx`
at line 81, The aria-label currently uses hardcoded "Collapse"/"Expand"; change
it to use react-intl by importing and calling useIntl within the component (or
receive an intl prop), then replace aria-label={row.getIsExpanded() ? 'Collapse'
: 'Expand'} with aria-label that calls intl.formatMessage for both states (e.g.,
message IDs like "networkModification.collapse" and "networkModification.expand"
with sensible defaultMessage values) so accessibility labels are
internationalized while preserving the row.getIsExpanded() logic.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@src/components/graph/menus/network-modifications/network-modification-table/renderers/name-cell.tsx`:
- Around line 95-105: The style object returned for the name cell (the branch
that runs when row.getIsExpanded() || depth > 0) currently uses hardcoded
rgba(81,81,81,1) and declares unused theme parameters; update those
borderTop/borderLeft/borderBottom values to use the theme palette (e.g.,
theme.palette.divider or an appropriate theme.palette.grey variant) so borders
adapt to light/dark mode, and remove the unused standalone "(theme: Theme) =>"
parameter if you inline the style function or otherwise ensure the theme
parameter is actually used; locate the renderer in name-cell.tsx around the
conditional that checks row.getIsExpanded() || depth > 0 and replace the
hardcoded color with a theme-derived color and eliminate the unused theme
parameter to fix the ESLint warning.
- Around line 20-24: Remove the unused depth parameter from the
createIndentedCellStyle function signature and body (change from
createIndentedCellStyle(depth: number) to createIndentedCellStyle():
SxProps<Theme>) to eliminate the `@typescript-eslint/no-unused-vars` warning, and
update the call site where createIndentedCellStyle(...) is invoked in this
component to call createIndentedCellStyle() with no arguments; ensure the
function name createIndentedCellStyle and its usages in this file are
consistently updated.

In
`@src/components/graph/menus/network-modifications/network-modification-table/row/modification-row.tsx`:
- Around line 32-35: The computed but unused isLastLeaf variable in
modification-row.tsx (defined using row.depth, row.getParentRow()?.subRows and
row.index) causes an ESLint no-unused-vars warning; remove the entire
declaration of isLastLeaf (and parentSubRows if only used to compute it) or if
you intended to style the last leaf, apply isLastLeaf where needed (e.g., pass
it to the row className/props or conditional rendering in the component) so the
variable is actually used; update any related code that referenced parentSubRows
solely for this computation.

---

Outside diff comments:
In
`@src/components/graph/menus/network-modifications/network-modification-table/renderers/switch-cell.tsx`:
- Around line 55-72: toggleModificationActive fails to find nested
sub-modifications because it uses a flat findIndex on oldModifications;
implement a recursive updater (e.g., findAndUpdateModification) that walks
ComposedModificationMetadata[] and returns a new array with only the target
modification's activated toggled, preserving all other items and their
subModifications, then call setModifications(old =>
findAndUpdateModification(old, modificationUuid, mod => ({ ...mod, activated:
!mod.activated }))) inside toggleModificationActive and leave the existing
updateModification(newStatus) call; ensure the helper recurses into
subModifications and returns new objects for any branch that changed.

In
`@src/components/graph/menus/network-modifications/network-modification-table/use-modifications-drag-and-drop.tsx`:
- Around line 51-54: The drag handlers are using flattened virtual row indices
but onRowDragEnd reorders the top-level modifications array, causing wrong moves
for sub-rows and allowing sub-row drags; update modification-row.tsx to pass a
depth check (depth > 0) into the isDragDisabled / isRowDragDisabled prop so any
row with depth > 0 is not draggable, and modify the onRowDragEnd handler to map
source.index and destination.index from the flattened table.getRowModel().rows
back to their parent/top-level modification indices before mutating the
modifications array (use rows[source.index].original.parentId or a top-level
lookup from rows[...] to resolve the correct modification index) so reorders
operate on top-level modification positions only.

---

Nitpick comments:
In
`@src/components/graph/menus/network-modifications/network-modification-table/network-modifications-table.tsx`:
- Around line 66-74: Component holds derived local state composedModification
(set via formatComposedModification(modifications)) while also accepting
modifications from parent; child updates use setComposedModification only,
risking divergence. Fix by making composedModification a pure derived value with
useMemo: replace useState/useEffect with const composedModification = useMemo(()
=> formatComposedModification(modifications), [modifications]) so it always
reflects parent props, or alternatively ensure every place that calls
setComposedModification (including columns/children) also calls the parent's
updater (setModifications) so changes are propagated upstream; update references
to setComposedModification, formatComposedModification, and any column handlers
accordingly.
- Line 35: The prop type for handleCellClick is too narrow: props define
handleCellClick as (modification: NetworkModificationMetadata) => void while
child component ModificationRow expects (modification:
ComposedModificationMetadata) => void; update the parent prop signature to
accept ComposedModificationMetadata (change handleCellClick: (modification:
ComposedModificationMetadata) => void) so the handler explicitly accepts the
extended type and matches ModificationRow's expectation (also update any other
occurrences noted around line 189 to the same ComposedModificationMetadata
type).

In
`@src/components/graph/menus/network-modifications/network-modification-table/renderers/name-cell.tsx`:
- Line 81: The aria-label currently uses hardcoded "Collapse"/"Expand"; change
it to use react-intl by importing and calling useIntl within the component (or
receive an intl prop), then replace aria-label={row.getIsExpanded() ? 'Collapse'
: 'Expand'} with aria-label that calls intl.formatMessage for both states (e.g.,
message IDs like "networkModification.collapse" and "networkModification.expand"
with sensible defaultMessage values) so accessibility labels are
internationalized while preserving the row.getIsExpanded() logic.

In
`@src/components/graph/menus/network-modifications/network-modification-table/styles.ts`:
- Around line 175-177: The comment for the border suppression logic is
misleading: it says "For the last leaf row of a group" but the condition uses
suppressedColumns.has(cell.column.id) && (depth > 0 || isExpanded), which
applies to any nested row or any expanded parent, not only the last leaf. Update
the comment near suppressedColumns/BORDER_SUPPRESSED_COLUMNS and the
suppressBorder variable to accurately describe that border suppression is
applied for columns in BORDER_SUPPRESSED_COLUMNS when the row is nested (depth >
0) or the row is expanded (isExpanded), and clarify that this is not limited to
last-leaf rows.

In
`@src/components/graph/menus/network-modifications/network-modification-table/utils.ts`:
- Around line 10-17: Move the ComposedModificationMetadata interface declaration
above the formatComposedModification function and update
formatComposedModification (which currently returns modifications.map(m => ({
...m, subModifications: [] }))) so it does not always overwrite nested data: if
the incoming NetworkModificationMetadata already contains subModifications,
preserve them, and if composite types (e.g., type === 'COMPOSITE_MODIFICATION')
require recursive construction, recursively map those nested items into
ComposedModificationMetadata via the same function; reference the symbols
ComposedModificationMetadata, NetworkModificationMetadata and
formatComposedModification when making these changes and ensure the function
either uses existing subModifications from the API or builds them recursively
rather than always setting an empty array.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6dfe2f86-2d8b-4718-9c5e-bde901696e81

📥 Commits

Reviewing files that changed from the base of the PR and between 602ba8e and bea993d.

📒 Files selected for processing (15)
  • src/components/graph/menus/network-modifications/network-modification-table/columns-definition.tsx
  • src/components/graph/menus/network-modifications/network-modification-table/network-modifications-table.tsx
  • src/components/graph/menus/network-modifications/network-modification-table/renderers/depth-box.tsx
  • src/components/graph/menus/network-modifications/network-modification-table/renderers/description-cell.tsx
  • src/components/graph/menus/network-modifications/network-modification-table/renderers/name-cell.tsx
  • src/components/graph/menus/network-modifications/network-modification-table/renderers/root-network-chip-cell.tsx
  • src/components/graph/menus/network-modifications/network-modification-table/renderers/select-cell.tsx
  • src/components/graph/menus/network-modifications/network-modification-table/renderers/select-header-cell.tsx
  • src/components/graph/menus/network-modifications/network-modification-table/renderers/switch-cell.tsx
  • src/components/graph/menus/network-modifications/network-modification-table/row/drag-row-clone.tsx
  • src/components/graph/menus/network-modifications/network-modification-table/row/modification-row.tsx
  • src/components/graph/menus/network-modifications/network-modification-table/styles.ts
  • src/components/graph/menus/network-modifications/network-modification-table/use-modifications-drag-and-drop.tsx
  • src/components/graph/menus/network-modifications/network-modification-table/utils.ts
  • src/services/study/network-modifications.ts

Comment on lines +20 to +24
const createIndentedCellStyle = (depth: number): SxProps<Theme> => ({
display: 'flex',
alignItems: 'stretch',
gap: 0,
});
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Remove unused depth parameter to fix ESLint warning.

The depth parameter is defined but never used in the function body. This triggers the @typescript-eslint/no-unused-vars warning flagged in CI.

🔧 Proposed fix
-const createIndentedCellStyle = (depth: number): SxProps<Theme> => ({
+const createIndentedCellStyle = (): SxProps<Theme> => ({
     display: 'flex',
     alignItems: 'stretch',
     gap: 0,
 });

Also update the call site at line 57:

-                createIndentedCellStyle(depth),
+                createIndentedCellStyle(),
🧰 Tools
🪛 GitHub Check: build / build

[warning] 20-20:
'depth' is defined but never used. Allowed unused args must match /^_/u

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/components/graph/menus/network-modifications/network-modification-table/renderers/name-cell.tsx`
around lines 20 - 24, Remove the unused depth parameter from the
createIndentedCellStyle function signature and body (change from
createIndentedCellStyle(depth: number) to createIndentedCellStyle():
SxProps<Theme>) to eliminate the `@typescript-eslint/no-unused-vars` warning, and
update the call site where createIndentedCellStyle(...) is invoked in this
component to call createIndentedCellStyle() with no arguments; ensure the
function name createIndentedCellStyle and its usages in this file are
consistently updated.

Comment on lines +95 to +105
row.getIsExpanded() || depth > 0
? {
alignSelf: 'stretch',
display: 'flex',
alignItems: 'center',
flex: 1,
borderBottom: (theme: Theme) => `1px solid rgba(81, 81, 81, 1)`,
borderLeft: (theme: Theme) => `1px solid rgba(81, 81, 81, 1)`,
borderTop: (theme: Theme) => `1px solid rgba(81, 81, 81, 1)`,
}
: {}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Use theme palette instead of hardcoded color; remove unused theme parameters.

The border colors use hardcoded rgba(81, 81, 81, 1) which won't adapt to light/dark mode themes. The theme parameters are declared but unused, triggering ESLint warnings.

Either use the theme parameter for the border color or remove it:

🔧 Proposed fix using theme
                               ? {
                                     alignSelf: 'stretch',
                                     display: 'flex',
                                     alignItems: 'center',
                                     flex: 1,
-                                    borderBottom: (theme: Theme) => `1px solid rgba(81, 81, 81, 1)`,
-                                    borderLeft: (theme: Theme) => `1px solid rgba(81, 81, 81, 1)`,
-                                    borderTop: (theme: Theme) => `1px solid rgba(81, 81, 81, 1)`,
+                                    borderBottom: (theme: Theme) => `1px solid ${theme.palette.divider}`,
+                                    borderLeft: (theme: Theme) => `1px solid ${theme.palette.divider}`,
+                                    borderTop: (theme: Theme) => `1px solid ${theme.palette.divider}`,
                                 }
🧰 Tools
🪛 GitHub Actions: CI

[warning] 101-101: ESLint (@typescript-eslint/no-unused-vars): 'theme' is defined but never used. Allowed unused args must match /^_/u


[warning] 102-102: ESLint (@typescript-eslint/no-unused-vars): 'theme' is defined but never used. Allowed unused args must match /^_/u


[warning] 103-103: ESLint (@typescript-eslint/no-unused-vars): 'theme' is defined but never used. Allowed unused args must match /^_/u

🪛 GitHub Check: build / build

[warning] 103-103:
'theme' is defined but never used. Allowed unused args must match /^_/u


[warning] 102-102:
'theme' is defined but never used. Allowed unused args must match /^_/u


[warning] 101-101:
'theme' is defined but never used. Allowed unused args must match /^_/u

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/components/graph/menus/network-modifications/network-modification-table/renderers/name-cell.tsx`
around lines 95 - 105, The style object returned for the name cell (the branch
that runs when row.getIsExpanded() || depth > 0) currently uses hardcoded
rgba(81,81,81,1) and declares unused theme parameters; update those
borderTop/borderLeft/borderBottom values to use the theme palette (e.g.,
theme.palette.divider or an appropriate theme.palette.grey variant) so borders
adapt to light/dark mode, and remove the unused standalone "(theme: Theme) =>"
parameter if you inline the style function or otherwise ensure the theme
parameter is actually used; locate the renderer in name-cell.tsx around the
conditional that checks row.getIsExpanded() || depth > 0 and replace the
hardcoded color with a theme-derived color and eliminate the unused theme
parameter to fix the ESLint warning.

Comment on lines +32 to +35
// Last leaf: depth > 0 and this row is the last child of its parent
const parentSubRows = row.getParentRow()?.subRows;
const isLastLeaf =
row.depth > 0 && !!parentSubRows && row.index === parentSubRows[parentSubRows.length - 1].index;
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Remove unused isLastLeaf variable to fix ESLint warning.

isLastLeaf is computed but never used, which triggers the @typescript-eslint/no-unused-vars ESLint warning flagged in the CI pipeline. Either use this variable for its intended purpose (e.g., styling the last leaf row differently) or remove it.

🔧 Proposed fix to remove unused code
         const isExpanded = row.getIsExpanded() && !!row.subRows?.length;
-        // Last leaf: depth > 0 and this row is the last child of its parent
-        const parentSubRows = row.getParentRow()?.subRows;
-        const isLastLeaf =
-            row.depth > 0 && !!parentSubRows && row.index === parentSubRows[parentSubRows.length - 1].index;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Last leaf: depth > 0 and this row is the last child of its parent
const parentSubRows = row.getParentRow()?.subRows;
const isLastLeaf =
row.depth > 0 && !!parentSubRows && row.index === parentSubRows[parentSubRows.length - 1].index;
🧰 Tools
🪛 GitHub Actions: CI

[warning] 34-34: ESLint (@typescript-eslint/no-unused-vars): 'isLastLeaf' is assigned a value but never used

🪛 GitHub Check: build / build

[warning] 34-34:
'isLastLeaf' is assigned a value but never used

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/components/graph/menus/network-modifications/network-modification-table/row/modification-row.tsx`
around lines 32 - 35, The computed but unused isLastLeaf variable in
modification-row.tsx (defined using row.depth, row.getParentRow()?.subRows and
row.index) causes an ESLint no-unused-vars warning; remove the entire
declaration of isLastLeaf (and parentSubRows if only used to compute it) or if
you intended to style the last leaf, apply isLastLeaf where needed (e.g., pass
it to the row className/props or conditional rendering in the component) so the
variable is actually used; update any related code that referenced parentSubRows
solely for this computation.

@Meklo Meklo marked this pull request as draft March 20, 2026 13:45
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.

1 participant