Skip to content

chore(LineCreation): use form from commons-UI#4062

Open
dbraquart wants to merge 19 commits into
mainfrom
dbraquart/use-line-creation-form-from-commons-UI
Open

chore(LineCreation): use form from commons-UI#4062
dbraquart wants to merge 19 commits into
mainfrom
dbraquart/use-line-creation-form-from-commons-UI

Conversation

@dbraquart

@dbraquart dbraquart commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

PR Summary

We remove from grid-study what has been moved to commons-ui by gridsuite/commons-ui#1213.

Signed-off-by: David BRAQUART <david.braquart@rte-france.com>
Signed-off-by: David BRAQUART <david.braquart@rte-france.com>
Signed-off-by: David BRAQUART <david.braquart@rte-france.com>
Signed-off-by: David BRAQUART <david.braquart@rte-france.com>
Signed-off-by: David BRAQUART <david.braquart@rte-france.com>
Signed-off-by: David BRAQUART <david.braquart@rte-france.com>
Signed-off-by: David BRAQUART <david.braquart@rte-france.com>
Signed-off-by: David BRAQUART <david.braquart@rte-france.com>
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 74f1bbaf-2c8d-4aa2-8332-4cee829e9d83

📥 Commits

Reviewing files that changed from the base of the PR and between 4155282 and df67f78.

📒 Files selected for processing (1)
  • src/components/dialogs/network-modifications/line/modification/line-modification-dialog-header.tsx
✅ Files skipped from review due to trivial changes (1)
  • src/components/dialogs/network-modifications/line/modification/line-modification-dialog-header.tsx

📝 Walkthrough

Walkthrough

Moves line and limits dialogs, DTOs, and helpers to shared @gridsuite/commons-ui exports, removes obsolete local modules, refactors line segment dialog save/edit handling into creation and modification cases, and updates translation keys for removed UI and renamed current-limit labels.

Changes

Shared types and constants migration

Layer / File(s) Summary
Remove local types and constants, redirect to commons-ui
src/services/network-modification-types.ts, src/services/study/network-map.type.ts, src/services/study/network-modifications.ts, src/components/network/constants.ts, src/components/utils/field-constants.ts, src/components/utils/utils.ts, src/components/tooltips/..., src/components/dialogs/line-types-catalog/line-catalog.type.ts, src/components/dialogs/line-types-catalog/use-row-data.ts, src/components/dialogs/line-types-catalog/line-types-catalog-selector-form.tsx, src/components/dialogs/line-types-catalog/limit-custom-aggrid.tsx, src/services/network-modification.ts, src/components/dialogs/network-modifications/tabular/tabular-modification-utils.ts, src/components/dialogs/network-modifications/limit-sets/limit-sets-tabular-modification-utils.ts, src/components/dialogs/network-modifications/two-windings-transformer/two-windings-transformer.types.ts, src/components/dialogs/network-modifications/line-attach-to-voltage-level/line-attach-to-voltage-level-form.tsx
Removes local limits, line, and segment type definitions and constants, and updates import sites to use shared @gridsuite/commons-ui exports.

Line segment dialog refactor

Layer / File(s) Summary
Split segment dialog save paths
src/components/dialogs/line-types-catalog/line-type-segment-dialog.tsx, src/components/dialogs/line-types-catalog/line-type-segment-form.tsx, src/components/dialogs/line-types-catalog/line-types-catalog-selector-dialog.tsx
Replaces the single onSave/editData/isModification contract with separate creation and modification props, and branches segment-row initialization on the active mode.

Line creation and modification dialogs

Layer / File(s) Summary
Rework line creation dialog
src/components/dialogs/network-modifications/line/creation/line-creation-dialog.tsx, src/components/dialogs/network-modifications/line/line-dialog-tabs.tsx, src/components/dialogs/network-modifications/line/modification/line-dialog-tabs.tsx
Switches line creation to shared form/schema helpers and DTO conversion, removes the old tabbed pane implementation, and adds the new local tabs component under the modification folder.
Rework line modification dialog
src/components/dialogs/network-modifications/line/modification/line-modification-dialog-header.tsx, src/components/dialogs/network-modifications/line/modification/line-modification-dialog-tabs.tsx, src/components/dialogs/network-modifications/line/modification/line-modification-dialog.tsx, src/components/dialogs/network-modifications/line/modification/line-modification-type.ts
Drops displayConnectivity, switches to shared characteristics and limits helpers, updates operational-limits reset behavior, and wires the new segment-dialog props.

Transformer and line-attach updates

Layer / File(s) Summary
Update 2WT and line-attach dialogs
src/components/dialogs/network-modifications/two-windings-transformer/creation/..., src/components/dialogs/network-modifications/two-windings-transformer/modification/..., src/components/dialogs/network-modifications/line-attach-to-voltage-level/..., src/components/dialogs/network-modifications/limit-sets/limit-sets-modification-dialog.tsx
Switches two-windings transformer dialogs to shared limit schemas/helpers, migrates line attach to LineCreationDto, and updates related import wiring.

Locale cleanup

Layer / File(s) Summary
Remove obsolete translation keys
src/translations/en.json, src/translations/fr.json
Removes keys for deleted UI and updates the current-limit label strings between PATL and IST.

Suggested reviewers: Mathieu-Deharbe, basseche, flomillot

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

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.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: moving line creation form usage to commons-ui and removing the local implementation.
Description check ✅ Passed The description is directly related to the changeset and correctly notes the move of code from grid-study to commons-ui.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

…eation-form-from-commons-UI

# Conflicts:
#	src/components/dialogs/network-modifications/line/creation/line-creation-dialog.tsx
Signed-off-by: David BRAQUART <david.braquart@rte-france.com>
Signed-off-by: David BRAQUART <david.braquart@rte-france.com>
@dbraquart dbraquart force-pushed the dbraquart/use-line-creation-form-from-commons-UI branch from b0074bd to 664a8a7 Compare June 25, 2026 20:12
…eation-form-from-commons-UI

# Conflicts:
#	package-lock.json
#	package.json

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 7

Caution

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

⚠️ Outside diff range comments (3)
src/components/dialogs/network-modifications/line/creation/line-creation-dialog.tsx (1)

195-205: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Keep these translation IDs or switch to existing ones.

titleId="CreateLine" and headerId: 'LineCreationError' still reference keys that this PR removes from src/translations/en.json and src/translations/fr.json, so the dialog title and error snackbar will fall back to missing-message output.

Also applies to: 235-240

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/components/dialogs/network-modifications/line/creation/line-creation-dialog.tsx`
around lines 195 - 205, The dialog still references translation keys that are
being removed, so update the line creation UI to use only existing IDs or
restore the removed ones. In line-creation-dialog.tsx, review the title setup
around titleId="CreateLine" and the error handling in onSubmit/snackWithFallback
with headerId: 'LineCreationError', then either switch both to translation keys
that still exist in the active locale files or keep those keys in the
translation resources. Also check the related usage around the other affected
block so the dialog title and snackbar do not fall back to missing-message
output.
src/components/utils/utils.ts (1)

91-112: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Don’t serialize missing permanent limits as zero.

Line 104 turns a missing permanentLimit into an explicit 0, so a copied line with no permanent limit can be saved back with a zero current limit. Keep the empty form value, matching the TWT mapping, and reuse the normalized applicability for the row ID.

Proposed fix
     if (completeLimitsGroups) {
         for (const elt of completeLimitsGroups) {
             if (isNotBlankOrEmpty(elt.id)) {
+                const applicability = elt.applicability ?? '';
                 formattedCompleteLimitsGroups.push({
-                    [ID]: elt.id + elt.applicability,
+                    [ID]: elt.id + applicability,
                     [NAME]: elt.id,
-                    [APPLICABILITY_FIELD]: elt.applicability ?? '',
+                    [APPLICABILITY_FIELD]: applicability,
                     [LIMITS_PROPERTIES]: elt.limitsProperties,
                     [CURRENT_LIMITS]: {
-                        permanentLimit: elt.permanentLimit ?? 0,
+                        permanentLimit: (elt.permanentLimit ?? '') as unknown as number,
                         temporaryLimits: addSelectedFieldToRows(elt.temporaryLimits),
                     },
                 });
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/utils/utils.ts` around lines 91 - 112, The current limit
formatter is coercing a missing permanent limit into 0, which can serialize an
empty value back as an explicit zero. Update formatCompleteCurrentLimit in
utils.ts so CURRENT_LIMITS.permanentLimit preserves the empty form value when
elt.permanentLimit is absent, matching the TWT mapping behavior, and use the
normalized applicability value when building the row ID instead of the raw
field.
src/components/dialogs/network-modifications/line/modification/line-modification-dialog.tsx (1)

335-346: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Preserve the selected OLG IDs when refreshing the equipment.

Lines 335-346 rebuild LIMITS without SELECTED_OPERATIONAL_LIMITS_GROUP_ID1/2. That fetch runs after the edit-data reset, so an existing modification loses both selections before onSubmit serializes them and falls back to "None".

Proposed fix
                                         [LIMITS]: formValues?.limits[ENABLE_OLG_MODIFICATION]
                                             ? {
                                                   [ENABLE_OLG_MODIFICATION]: formValues.limits[ENABLE_OLG_MODIFICATION],
                                                   [OPERATIONAL_LIMITS_GROUPS]:
                                                       formValues.limits?.operationalLimitsGroups ?? [],
+                                                  [SELECTED_OPERATIONAL_LIMITS_GROUP_ID1]:
+                                                      formValues.limits?.[SELECTED_OPERATIONAL_LIMITS_GROUP_ID1] ??
+                                                      null,
+                                                  [SELECTED_OPERATIONAL_LIMITS_GROUP_ID2]:
+                                                      formValues.limits?.[SELECTED_OPERATIONAL_LIMITS_GROUP_ID2] ??
+                                                      null,
                                               }
                                             : {
                                                   [ENABLE_OLG_MODIFICATION]: false,
                                                   [OPERATIONAL_LIMITS_GROUPS]:
                                                       convertToOperationalLimitsGroupFormSchema(
                                                           line?.currentLimits ?? []
                                                       ),
+                                                  [SELECTED_OPERATIONAL_LIMITS_GROUP_ID1]:
+                                                      formValues.limits?.[SELECTED_OPERATIONAL_LIMITS_GROUP_ID1] ??
+                                                      null,
+                                                  [SELECTED_OPERATIONAL_LIMITS_GROUP_ID2]:
+                                                      formValues.limits?.[SELECTED_OPERATIONAL_LIMITS_GROUP_ID2] ??
+                                                      null,
                                               },
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/components/dialogs/network-modifications/line/modification/line-modification-dialog.tsx`
around lines 335 - 346, The LIMITS rebuild in line-modification-dialog.tsx is
dropping the selected OLG IDs during equipment refresh, so preserve
SELECTED_OPERATIONAL_LIMITS_GROUP_ID1 and SELECTED_OPERATIONAL_LIMITS_GROUP_ID2
when constructing the limits object in the refresh/reset path. Update the logic
around the LIMITS mapping to carry forward any existing selected OLG values from
formValues.limits (or prior edit data) alongside OPERATIONAL_LIMITS_GROUPS, so
onSubmit can serialize the real selections instead of defaulting to None.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/dialogs/line-types-catalog/limit-custom-aggrid.tsx`:
- Line 10: The import in limit-custom-aggrid and the same pattern in
line-types-catalog-selector-form and use-row-data is pulling CATEGORIES_TABS and
LineTypeInfo from `@gridsuite/commons-ui` even though that package does not export
them. Update those imports to use the module that actually exports
CATEGORIES_TABS and LineTypeInfo, while keeping CustomAGGrid imported from the
UI package where appropriate.

In `@src/components/dialogs/line-types-catalog/line-type-segment-dialog.tsx`:
- Around line 14-22: The import block in line-type-segment-dialog is pulling
several types that are not exported by `@gridsuite/commons-ui`, so the TypeScript
build will fail. Update the imports in the line-type-segment-dialog component to
use only symbols actually exported by that package, and move
ComputedLineCharacteristics, SegmentSchema, LineSegmentsFormData,
SegmentFormData, and SegmentsFormData to the correct module or remove them if
they are unused. Keep CustomFormProvider and DeepNullable in place if they are
valid exports.

In `@src/components/dialogs/line-types-catalog/line-type-segment-form.tsx`:
- Around line 241-247: The early-return guards in the segment reset flow are
preventing stale state from being cleared when the dialog is reopened with no
segments. Update the reset logic in line-type-segment-form.tsx so the path that
handles empty edit/create data still calls arrayRef.current?.replaceItems([])
and resets APPLY_SEGMENTS_LIMITS, rather than returning before those cleanup
steps. Make sure the same fix is applied in both affected reset blocks so
reopening the mounted dialog always clears old rows, totals, and merged limits.
- Around line 35-54: `AreaTemperatureShapeFactorInfo` is being imported from the
wrong package in the line type segment form dialog. Update the imports in
`line-type-segment-form.tsx` so this type comes from the module that defines it,
while keeping the other `@gridsuite/commons-ui` imports unchanged; use the
`AreaTemperatureShapeFactorInfo` symbol to find both affected import statements.

In
`@src/components/dialogs/line-types-catalog/line-types-catalog-selector-dialog.tsx`:
- Around line 9-19: `AreaTemperatureShapeFactorInfo` is being imported from the
wrong module in `line-types-catalog-selector-dialog.tsx`. Update the import to
come from the package/module that actually exports
`AreaTemperatureShapeFactorInfo`, while keeping the other
`@gridsuite/commons-ui` imports unchanged. Verify the symbol is referenced
consistently in `LineTypesCatalogSelectorDialog` and related types so the file
type-checks again.

In
`@src/components/dialogs/network-modifications/two-windings-transformer/modification/two-windings-transformer-modification-dialog.tsx`:
- Around line 745-759: The LIMITS reset logic in
two-windings-transformer-modification-dialog.tsx is dropping the selected OLG
IDs, so the existing 2WT selections are lost after equipment fetch. Update the
LIMITS rebuild in the reset payload to carry through
SELECTED_OPERATIONAL_LIMITS_GROUP_ID1 and SELECTED_OPERATIONAL_LIMITS_GROUP_ID2
alongside ENABLE_OLG_MODIFICATION and OPERATIONAL_LIMITS_GROUPS, using the
existing LIMITS/convertToOperationalLimitsGroupFormSchema flow so the form
preserves the chosen operational limits groups.

In `@src/translations/en.json`:
- Around line 709-710: The translation values for PermanentCurrentLimitText1 and
PermanentCurrentLimitText2 in en.json are inconsistent with fr.json, so update
the en.json entries to match the same limit type labels used across locales. Use
the PermanentCurrentLimitText1/2 keys in the translation files to align the
wording with fr.json and keep the locale mappings consistent.

---

Outside diff comments:
In
`@src/components/dialogs/network-modifications/line/creation/line-creation-dialog.tsx`:
- Around line 195-205: The dialog still references translation keys that are
being removed, so update the line creation UI to use only existing IDs or
restore the removed ones. In line-creation-dialog.tsx, review the title setup
around titleId="CreateLine" and the error handling in onSubmit/snackWithFallback
with headerId: 'LineCreationError', then either switch both to translation keys
that still exist in the active locale files or keep those keys in the
translation resources. Also check the related usage around the other affected
block so the dialog title and snackbar do not fall back to missing-message
output.

In
`@src/components/dialogs/network-modifications/line/modification/line-modification-dialog.tsx`:
- Around line 335-346: The LIMITS rebuild in line-modification-dialog.tsx is
dropping the selected OLG IDs during equipment refresh, so preserve
SELECTED_OPERATIONAL_LIMITS_GROUP_ID1 and SELECTED_OPERATIONAL_LIMITS_GROUP_ID2
when constructing the limits object in the refresh/reset path. Update the logic
around the LIMITS mapping to carry forward any existing selected OLG values from
formValues.limits (or prior edit data) alongside OPERATIONAL_LIMITS_GROUPS, so
onSubmit can serialize the real selections instead of defaulting to None.

In `@src/components/utils/utils.ts`:
- Around line 91-112: The current limit formatter is coercing a missing
permanent limit into 0, which can serialize an empty value back as an explicit
zero. Update formatCompleteCurrentLimit in utils.ts so
CURRENT_LIMITS.permanentLimit preserves the empty form value when
elt.permanentLimit is absent, matching the TWT mapping behavior, and use the
normalized applicability value when building the row ID instead of the raw
field.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f0f27f83-2238-4fdc-9164-a0de4a159f61

📥 Commits

Reviewing files that changed from the base of the PR and between 5b7e66d and 3f3959d.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (56)
  • src/components/dialogs/limits/limits-constants.ts
  • src/components/dialogs/limits/limits-groups-contextual-menu.tsx
  • src/components/dialogs/limits/limits-pane-utils.ts
  • src/components/dialogs/limits/limits-pane.tsx
  • src/components/dialogs/limits/limits-properties-side-stack.tsx
  • src/components/dialogs/limits/limits-properties-stack.tsx
  • src/components/dialogs/limits/limits-side-pane.tsx
  • src/components/dialogs/limits/limits-tag-chip.tsx
  • src/components/dialogs/limits/limitsChart.tsx
  • src/components/dialogs/limits/operational-limits-group-tab-label.tsx
  • src/components/dialogs/limits/operational-limits-groups-styles.ts
  • src/components/dialogs/limits/operational-limits-groups-tabs.tsx
  • src/components/dialogs/limits/operational-limits-groups-types.ts
  • src/components/dialogs/limits/operational-limits-groups-utils.ts
  • src/components/dialogs/limits/selected-operational-limit-group.tsx
  • src/components/dialogs/limits/temporary-limits-table.tsx
  • src/components/dialogs/line-types-catalog/limit-custom-aggrid.tsx
  • src/components/dialogs/line-types-catalog/line-catalog.type.ts
  • src/components/dialogs/line-types-catalog/line-type-segment-dialog.tsx
  • src/components/dialogs/line-types-catalog/line-type-segment-form.tsx
  • src/components/dialogs/line-types-catalog/line-types-catalog-selector-dialog.tsx
  • src/components/dialogs/line-types-catalog/line-types-catalog-selector-form.tsx
  • src/components/dialogs/line-types-catalog/segment-utils.ts
  • src/components/dialogs/line-types-catalog/use-row-data.ts
  • src/components/dialogs/network-modifications/limit-sets/limit-sets-modification-dialog.tsx
  • src/components/dialogs/network-modifications/limit-sets/limit-sets-tabular-modification-utils.ts
  • src/components/dialogs/network-modifications/line-attach-to-voltage-level/line-attach-to-voltage-level-dialog.tsx
  • src/components/dialogs/network-modifications/line-attach-to-voltage-level/line-attach-to-voltage-level-form.tsx
  • src/components/dialogs/network-modifications/line/characteristics-pane/line-characteristics-pane-utils.ts
  • src/components/dialogs/network-modifications/line/characteristics-pane/line-characteristics-pane.tsx
  • src/components/dialogs/network-modifications/line/creation/line-creation-dialog-utils.ts
  • src/components/dialogs/network-modifications/line/creation/line-creation-dialog.tsx
  • src/components/dialogs/network-modifications/line/creation/line-creation-type.ts
  • src/components/dialogs/network-modifications/line/line-dialog-tabs.tsx
  • src/components/dialogs/network-modifications/line/modification/line-dialog-tabs.tsx
  • src/components/dialogs/network-modifications/line/modification/line-modification-dialog-header.tsx
  • src/components/dialogs/network-modifications/line/modification/line-modification-dialog-tabs.tsx
  • src/components/dialogs/network-modifications/line/modification/line-modification-dialog.tsx
  • src/components/dialogs/network-modifications/line/modification/line-modification-type.ts
  • src/components/dialogs/network-modifications/line/modification/line-utils.ts
  • src/components/dialogs/network-modifications/tabular/tabular-modification-utils.ts
  • src/components/dialogs/network-modifications/two-windings-transformer/creation/characteristics-pane/two-windings-transformer-creation-characteristics-pane.tsx
  • src/components/dialogs/network-modifications/two-windings-transformer/creation/two-windings-transformer-creation-dialog.tsx
  • src/components/dialogs/network-modifications/two-windings-transformer/modification/two-windings-transformer-modification-dialog.tsx
  • src/components/dialogs/network-modifications/two-windings-transformer/two-windings-transformer.types.ts
  • src/components/network/constants.ts
  • src/components/tooltips/branch/branch-utils.tsx
  • src/components/tooltips/equipment-popover-type.ts
  • src/components/utils/field-constants.ts
  • src/components/utils/utils.ts
  • src/services/network-modification-types.ts
  • src/services/network-modification.ts
  • src/services/study/network-map.type.ts
  • src/services/study/network-modifications.ts
  • src/translations/en.json
  • src/translations/fr.json
💤 Files with no reviewable changes (24)
  • src/components/dialogs/limits/limits-constants.ts
  • src/components/dialogs/network-modifications/line/line-dialog-tabs.tsx
  • src/components/dialogs/limits/operational-limits-groups-styles.ts
  • src/components/network/constants.ts
  • src/components/dialogs/network-modifications/line/creation/line-creation-type.ts
  • src/components/dialogs/limits/limits-pane.tsx
  • src/components/dialogs/limits/selected-operational-limit-group.tsx
  • src/components/dialogs/limits/operational-limits-group-tab-label.tsx
  • src/components/dialogs/limits/limits-side-pane.tsx
  • src/components/dialogs/network-modifications/line/characteristics-pane/line-characteristics-pane.tsx
  • src/components/dialogs/limits/limits-tag-chip.tsx
  • src/components/dialogs/limits/limits-properties-stack.tsx
  • src/components/dialogs/network-modifications/line/characteristics-pane/line-characteristics-pane-utils.ts
  • src/components/dialogs/limits/limits-properties-side-stack.tsx
  • src/components/dialogs/limits/operational-limits-groups-tabs.tsx
  • src/components/dialogs/limits/operational-limits-groups-types.ts
  • src/components/dialogs/limits/limits-groups-contextual-menu.tsx
  • src/components/dialogs/network-modifications/line/creation/line-creation-dialog-utils.ts
  • src/components/dialogs/line-types-catalog/segment-utils.ts
  • src/components/dialogs/limits/temporary-limits-table.tsx
  • src/components/dialogs/limits/operational-limits-groups-utils.ts
  • src/components/dialogs/limits/limitsChart.tsx
  • src/components/dialogs/line-types-catalog/line-catalog.type.ts
  • src/components/dialogs/limits/limits-pane-utils.ts

import { ColDef } from 'ag-grid-community';
import { RefObject, useMemo } from 'react';
import { CustomAGGrid } from '@gridsuite/commons-ui';
import { CATEGORIES_TABS, CustomAGGrid, LineTypeInfo } from '@gridsuite/commons-ui';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

PKG='`@gridsuite/commons-ui`'
VER='0.238.0'
ENCODED='`@gridsuite`%2fcommons-ui'

META_JSON="$(curl -fsSL "https://registry.npmjs.org/${ENCODED}/${VER}")"
TARBALL_URL="$(printf '%s' "$META_JSON" | jq -r '.dist.tarball')"

TMP_DIR="$(mktemp -d)"
trap 'rm -rf "$TMP_DIR"' EXIT

curl -fsSL "$TARBALL_URL" -o "$TMP_DIR/pkg.tgz"
tar -xzf "$TMP_DIR/pkg.tgz" -C "$TMP_DIR"

echo '--- package exports ---'
jq '.exports // "no exports field"' "$TMP_DIR/package/package.json"

echo '--- symbol search ---'
fd . "$TMP_DIR/package" -e d.ts -e ts -e js | xargs rg -n '\b(CATEGORIES_TABS|LineTypeInfo)\b' || true

Repository: gridsuite/gridstudy-app

Length of output: 397


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '--- symbol declarations/usages ---\n'
rg -n --hidden --glob '!node_modules' --glob '!dist' --glob '!build' '\b(CATEGORIES_TABS|LineTypeInfo)\b' src

printf '\n--- candidate files ---\n'
git ls-files 'src/components/dialogs/line-types-catalog/*'

printf '\n--- outlines ---\n'
for f in \
  src/components/dialogs/line-types-catalog/limit-custom-aggrid.tsx \
  src/components/dialogs/line-types-catalog/line-types-catalog-selector-form.tsx \
  src/components/dialogs/line-types-catalog/use-row-data.ts
do
  echo "### $f"
  ast-grep outline "$f" --view expanded || true
done

Repository: gridsuite/gridstudy-app

Length of output: 252


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- symbol declarations/usages ---'
rg -n --hidden --glob '!node_modules' --glob '!dist' --glob '!build' '\b(CATEGORIES_TABS|LineTypeInfo)\b' src || true

echo
echo '--- candidate files ---'
git ls-files 'src/components/dialogs/line-types-catalog/*'

echo
echo '--- outlines ---'
for f in \
  src/components/dialogs/line-types-catalog/limit-custom-aggrid.tsx \
  src/components/dialogs/line-types-catalog/line-types-catalog-selector-form.tsx \
  src/components/dialogs/line-types-catalog/use-row-data.ts
do
  echo "### $f"
  ast-grep outline "$f" --view expanded || true
done

Repository: gridsuite/gridstudy-app

Length of output: 8671


Import CATEGORIES_TABS and LineTypeInfo from the module that exports them. @gridsuite/commons-ui 0.238.0 doesn’t export either symbol, so this import breaks the build. The same fix is needed in line-types-catalog-selector-form.tsx and use-row-data.ts.

🧰 Tools
🪛 GitHub Actions: CI / 0_build _ build.txt

[error] 10-10: TypeScript (tsc) failed with TS2305: Module "@gridsuite/commons-ui" has no exported member "CATEGORIES_TABS".

🪛 GitHub Actions: CI / build _ build

[error] 10-10: TypeScript (tsc) failed: TS2305 Module "@gridsuite/commons-ui" has no exported member "CATEGORIES_TABS".

🪛 GitHub Check: build / build

[failure] 10-10:
Module '"@gridsuite/commons-ui"' has no exported member 'LineTypeInfo'.


[failure] 10-10:
Module '"@gridsuite/commons-ui"' has no exported member 'CATEGORIES_TABS'.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/dialogs/line-types-catalog/limit-custom-aggrid.tsx` at line
10, The import in limit-custom-aggrid and the same pattern in
line-types-catalog-selector-form and use-row-data is pulling CATEGORIES_TABS and
LineTypeInfo from `@gridsuite/commons-ui` even though that package does not export
them. Update those imports to use the module that actually exports
CATEGORIES_TABS and LineTypeInfo, while keeping CustomAGGrid imported from the
UI package where appropriate.

Source: Linters/SAST tools

Comment on lines +14 to +22
import {
ComputedLineCharacteristics,
CustomFormProvider,
DeepNullable,
SegmentSchema,
LineSegmentsFormData,
SegmentFormData,
SegmentsFormData,
} from '@gridsuite/commons-ui';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
cd "$tmpdir"

tarball="$(npm pack `@gridsuite/commons-ui`@0.238.0 --silent)"
tar -xzf "$tarball"

rg -n --glob '*.{d.ts,ts,tsx,js,mjs,cjs}' '\b(ComputedLineCharacteristics|SegmentSchema|LineSegmentsFormData|SegmentFormData|SegmentsFormData)\b' package

Repository: gridsuite/gridstudy-app

Length of output: 161


Fix the @gridsuite/commons-ui imports

ComputedLineCharacteristics, SegmentSchema, LineSegmentsFormData, SegmentFormData, and SegmentsFormData are not exported from @gridsuite/commons-ui@0.238.0, so this import block will break the TypeScript build until those types come from an actual exporting module.

🧰 Tools
🪛 GitHub Check: build / build

[failure] 21-21:
Module '"@gridsuite/commons-ui"' has no exported member 'SegmentsFormData'.


[failure] 20-20:
'"@gridsuite/commons-ui"' has no exported member named 'SegmentFormData'. Did you mean 'emptyFormData'?


[failure] 19-19:
Module '"@gridsuite/commons-ui"' has no exported member 'LineSegmentsFormData'.


[failure] 18-18:
Module '"@gridsuite/commons-ui"' has no exported member 'SegmentSchema'.


[failure] 15-15:
Module '"@gridsuite/commons-ui"' has no exported member 'ComputedLineCharacteristics'.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/dialogs/line-types-catalog/line-type-segment-dialog.tsx`
around lines 14 - 22, The import block in line-type-segment-dialog is pulling
several types that are not exported by `@gridsuite/commons-ui`, so the TypeScript
build will fail. Update the imports in the line-type-segment-dialog component to
use only symbols actually exported by that package, and move
ComputedLineCharacteristics, SegmentSchema, LineSegmentsFormData,
SegmentFormData, and SegmentsFormData to the correct module or remove them if
they are unused. Keep CustomFormProvider and DeepNullable in place if they are
valid exports.

Source: Linters/SAST tools

Comment on lines +35 to +54
AreaTemperatureShapeFactorInfo,
CurrentLimitsInfo,
CustomAGGrid,
DefaultCellRenderer,
emptyLineSegment,
ExpandableInput,
ExpandableInputHandle,
fetchStudyMetadata,
LimitSelectedRowData,
LineTypeInfo,
type MuiStyles,
ReadOnlyInput,
SegmentFormData,
LineSegmentsFormData,
snackWithFallback,
SwitchInput,
useSnackMessage,
SegmentInfoFormData,
SegmentsFormData,
FieldConstants,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
cd "$tmpdir"

tarball="$(npm pack `@gridsuite/commons-ui`@0.238.0 --silent)"
tar -xzf "$tarball"

rg -n --glob '*.{d.ts,ts,tsx,js,mjs,cjs}' '\bAreaTemperatureShapeFactorInfo\b' package

Repository: gridsuite/gridstudy-app

Length of output: 161


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== repo occurrences =="
rg -n "AreaTemperatureShapeFactorInfo" . || true

echo
echo "== candidate files around imports =="
for f in \
  src/components/dialogs/line-types-catalog/line-type-segment-form.tsx \
  src/components/dialogs/line-types-catalog/line-types-catalog-selector-dialog.tsx
do
  if [ -f "$f" ]; then
    echo "--- $f ---"
    sed -n '1,120p' "$f"
    echo
  fi
done

echo "== commons-ui package metadata inspection =="
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
cd "$tmpdir"
tarball="$(npm pack `@gridsuite/commons-ui`@0.238.0 --silent)"
tar -xzf "$tarball"
echo "--- package.json ---"
cat package/package.json
echo
echo "--- export-related declarations mentioning commons-ui export names near AreaTemperatureShapeFactorInfo absence ---"
rg -n '"exports"|export .*AreaTemperatureShapeFactorInfo|AreaTemperatureShapeFactorInfo' package || true

Repository: gridsuite/gridstudy-app

Length of output: 16714


Import AreaTemperatureShapeFactorInfo from its defining module AreaTemperatureShapeFactorInfo isn’t exported by @gridsuite/commons-ui, so both dialog imports need to point at the module that actually declares this type.

🧰 Tools
🪛 GitHub Check: build / build

[failure] 35-35:
Module '"@gridsuite/commons-ui"' has no exported member 'AreaTemperatureShapeFactorInfo'.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/dialogs/line-types-catalog/line-type-segment-form.tsx` around
lines 35 - 54, `AreaTemperatureShapeFactorInfo` is being imported from the wrong
package in the line type segment form dialog. Update the imports in
`line-type-segment-form.tsx` so this type comes from the module that defines it,
while keeping the other `@gridsuite/commons-ui` imports unchanged; use the
`AreaTemperatureShapeFactorInfo` symbol to find both affected import statements.

Source: Linters/SAST tools

Comment on lines +241 to 247
if (isModification && !editDataModificationCase?.[FieldConstants.LINE_SEGMENTS]?.length) {
return;
}
if (!isModification && !editDataCreationCase?.length) {
return;
}
arrayRef.current?.replaceItems([]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Empty edit data no longer clears the previous segment state.

These early returns happen before replaceItems([]) and before resetting APPLY_SEGMENTS_LIMITS, so reopening the mounted dialog with zero segments preserves the old rows, totals, and merged limits. Saving from that state can re-submit segments the parent already cleared.

Suggested fix
     useEffect(() => {
-        if (isModification && !editDataModificationCase?.[FieldConstants.LINE_SEGMENTS]?.length) {
-            return;
-        }
-        if (!isModification && !editDataCreationCase?.length) {
-            return;
-        }
         arrayRef.current?.replaceItems([]);
+        setCurrentLimitResult([]);
+
+        const sourceSegments = isModification
+            ? (editDataModificationCase?.[FieldConstants.LINE_SEGMENTS] ?? [])
+            : (editDataCreationCase ?? []);
+        const applyLimits = isModification ? (editDataModificationCase?.applySegmentsLimits ?? true) : true;
+        setValue(APPLY_SEGMENTS_LIMITS, applyLimits);
+
+        if (!sourceSegments.length) {
+            setValue(FINAL_CURRENT_LIMITS, []);
+            updateTotals();
+            return;
+        }
+
         const updateSegmentsLimits = async () => {
-            let promises;
-            if (!isModification && editDataCreationCase) {
-                promises = editDataCreationCase.map((segment) => getSegmentLimits(segment));
-            }
-            if (isModification && editDataModificationCase) {
-                promises = editDataModificationCase[FieldConstants.LINE_SEGMENTS]?.map((segment) =>
-                    getSegmentLimits(segment)
-                );
-            }
+            const promises = sourceSegments.map((segment) => getSegmentLimits(segment));
 
             try {
                 if (promises) {
@@
         updateSegmentsLimits().then(() => {
             updateTotals();
             keepMostConstrainingLimits();
-            const applyLimits = isModification ? (editDataModificationCase?.applySegmentsLimits ?? true) : true;
-            setValue(APPLY_SEGMENTS_LIMITS, applyLimits);
         });

Also applies to: 272-277

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/dialogs/line-types-catalog/line-type-segment-form.tsx` around
lines 241 - 247, The early-return guards in the segment reset flow are
preventing stale state from being cleared when the dialog is reopened with no
segments. Update the reset logic in line-type-segment-form.tsx so the path that
handles empty edit/create data still calls arrayRef.current?.replaceItems([])
and resets APPLY_SEGMENTS_LIMITS, rather than returning before those cleanup
steps. Make sure the same fix is applied in both affected reset blocks so
reopening the mounted dialog always clears old rows, totals, and merged limits.

Comment on lines +9 to +19
import {
AreaTemperatureShapeFactorInfo,
CATEGORIES_TABS,
CurrentLimitsInfo,
CustomFormProvider,
DeepNullable,
LineTypeInfo,
Option,
snackWithFallback,
useSnackMessage,
} from '@gridsuite/commons-ui';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
cd "$tmpdir"

tarball="$(npm pack `@gridsuite/commons-ui`@0.238.0 --silent)"
tar -xzf "$tarball"

rg -n --glob '*.{d.ts,ts,tsx,js,mjs,cjs}' '\bAreaTemperatureShapeFactorInfo\b' package

Repository: gridsuite/gridstudy-app

Length of output: 161


Move AreaTemperatureShapeFactorInfo to the module that exports it. @gridsuite/commons-ui does not expose this symbol, so this import will fail type-check until it comes from the package that actually defines it.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/components/dialogs/line-types-catalog/line-types-catalog-selector-dialog.tsx`
around lines 9 - 19, `AreaTemperatureShapeFactorInfo` is being imported from the
wrong module in `line-types-catalog-selector-dialog.tsx`. Update the import to
come from the package/module that actually exports
`AreaTemperatureShapeFactorInfo`, while keeping the other
`@gridsuite/commons-ui` imports unchanged. Verify the symbol is referenced
consistently in `LineTypesCatalogSelectorDialog` and related types so the file
type-checks again.

Source: Linters/SAST tools

Comment on lines +745 to +759
[LIMITS]: ((formValues?.limits as any)?.[ENABLE_OLG_MODIFICATION]
? {
[ENABLE_OLG_MODIFICATION]: formValues.limits[ENABLE_OLG_MODIFICATION],
[ENABLE_OLG_MODIFICATION]: (formValues.limits as any)[
ENABLE_OLG_MODIFICATION
],
[OPERATIONAL_LIMITS_GROUPS]:
getOpLimitsGroupInfosFromBranchModification(
formValues as LineModificationFormSchema
),
formValues.limits?.operationalLimitsGroups ?? [],
}
: {
[ENABLE_OLG_MODIFICATION]: false,
[OPERATIONAL_LIMITS_GROUPS]:
convertToOperationalLimitsGroupFormSchema(
(twt?.currentLimits ?? []) as CurrentLimitsData[]
),
}) as LimitsFormSchema,
}) as LimitsSchemaType,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Keep the selected OLG IDs in the reset payload.

Lines 745-759 rebuild LIMITS without SELECTED_OPERATIONAL_LIMITS_GROUP_ID1/2. After the equipment fetch, the form loses those selections and the submit path emits cleared values instead of the existing 2WT choices.

Proposed fix
                                         [LIMITS]: ((formValues?.limits as any)?.[ENABLE_OLG_MODIFICATION]
                                             ? {
                                                   [ENABLE_OLG_MODIFICATION]: (formValues.limits as any)[
                                                       ENABLE_OLG_MODIFICATION
                                                   ],
                                                   [OPERATIONAL_LIMITS_GROUPS]:
                                                       formValues.limits?.operationalLimitsGroups ?? [],
+                                                  [SELECTED_OPERATIONAL_LIMITS_GROUP_ID1]:
+                                                      formValues.limits?.[SELECTED_OPERATIONAL_LIMITS_GROUP_ID1] ??
+                                                      null,
+                                                  [SELECTED_OPERATIONAL_LIMITS_GROUP_ID2]:
+                                                      formValues.limits?.[SELECTED_OPERATIONAL_LIMITS_GROUP_ID2] ??
+                                                      null,
                                               }
                                             : {
                                                   [ENABLE_OLG_MODIFICATION]: false,
                                                   [OPERATIONAL_LIMITS_GROUPS]:
                                                       convertToOperationalLimitsGroupFormSchema(
                                                           (twt?.currentLimits ?? []) as CurrentLimitsData[]
                                                       ),
+                                                  [SELECTED_OPERATIONAL_LIMITS_GROUP_ID1]:
+                                                      formValues.limits?.[SELECTED_OPERATIONAL_LIMITS_GROUP_ID1] ??
+                                                      null,
+                                                  [SELECTED_OPERATIONAL_LIMITS_GROUP_ID2]:
+                                                      formValues.limits?.[SELECTED_OPERATIONAL_LIMITS_GROUP_ID2] ??
+                                                      null,
                                               }) as LimitsSchemaType,
📝 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
[LIMITS]: ((formValues?.limits as any)?.[ENABLE_OLG_MODIFICATION]
? {
[ENABLE_OLG_MODIFICATION]: formValues.limits[ENABLE_OLG_MODIFICATION],
[ENABLE_OLG_MODIFICATION]: (formValues.limits as any)[
ENABLE_OLG_MODIFICATION
],
[OPERATIONAL_LIMITS_GROUPS]:
getOpLimitsGroupInfosFromBranchModification(
formValues as LineModificationFormSchema
),
formValues.limits?.operationalLimitsGroups ?? [],
}
: {
[ENABLE_OLG_MODIFICATION]: false,
[OPERATIONAL_LIMITS_GROUPS]:
convertToOperationalLimitsGroupFormSchema(
(twt?.currentLimits ?? []) as CurrentLimitsData[]
),
}) as LimitsFormSchema,
}) as LimitsSchemaType,
[LIMITS]: ((formValues?.limits as any)?.[ENABLE_OLG_MODIFICATION]
? {
[ENABLE_OLG_MODIFICATION]: (formValues.limits as any)[
ENABLE_OLG_MODIFICATION
],
[OPERATIONAL_LIMITS_GROUPS]:
formValues.limits?.operationalLimitsGroups ?? [],
[SELECTED_OPERATIONAL_LIMITS_GROUP_ID1]:
formValues.limits?.[SELECTED_OPERATIONAL_LIMITS_GROUP_ID1] ??
null,
[SELECTED_OPERATIONAL_LIMITS_GROUP_ID2]:
formValues.limits?.[SELECTED_OPERATIONAL_LIMITS_GROUP_ID2] ??
null,
}
: {
[ENABLE_OLG_MODIFICATION]: false,
[OPERATIONAL_LIMITS_GROUPS]:
convertToOperationalLimitsGroupFormSchema(
(twt?.currentLimits ?? []) as CurrentLimitsData[]
),
[SELECTED_OPERATIONAL_LIMITS_GROUP_ID1]:
formValues.limits?.[SELECTED_OPERATIONAL_LIMITS_GROUP_ID1] ??
null,
[SELECTED_OPERATIONAL_LIMITS_GROUP_ID2]:
formValues.limits?.[SELECTED_OPERATIONAL_LIMITS_GROUP_ID2] ??
null,
}) as LimitsSchemaType,
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/components/dialogs/network-modifications/two-windings-transformer/modification/two-windings-transformer-modification-dialog.tsx`
around lines 745 - 759, The LIMITS reset logic in
two-windings-transformer-modification-dialog.tsx is dropping the selected OLG
IDs, so the existing 2WT selections are lost after equipment fetch. Update the
LIMITS rebuild in the reset payload to carry through
SELECTED_OPERATIONAL_LIMITS_GROUP_ID1 and SELECTED_OPERATIONAL_LIMITS_GROUP_ID2
alongside ENABLE_OLG_MODIFICATION and OPERATIONAL_LIMITS_GROUPS, using the
existing LIMITS/convertToOperationalLimitsGroupFormSchema flow so the form
preserves the chosen operational limits groups.

Comment thread src/translations/en.json
Comment on lines +709 to +710
"PermanentCurrentLimitText1": "IST 1",
"PermanentCurrentLimitText2": "IST 2",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

These labels now disagree with fr.json.

PermanentCurrentLimitText1/2 are IST 1/2 here, but PATL 1/2 in src/translations/fr.json. The same keys should not point to different limit types across locales.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/translations/en.json` around lines 709 - 710, The translation values for
PermanentCurrentLimitText1 and PermanentCurrentLimitText2 in en.json are
inconsistent with fr.json, so update the en.json entries to match the same limit
type labels used across locales. Use the PermanentCurrentLimitText1/2 keys in
the translation files to align the wording with fr.json and keep the locale
mappings consistent.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

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

⚠️ Outside diff range comments (1)
src/components/dialogs/network-modifications/line/creation/line-creation-dialog.tsx (1)

188-190: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Keep the selected limit-group IDs in sync with regenerated limits. Lines 188-190 replace limits.operationalLimitsGroups but leave selectedOperationalLimitsGroupId1/2 untouched; after a search-copy/edit, those IDs can still point to groups that no longer exist in the payload. Reset them or recompute them from the new groups when rebuilding limits.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/components/dialogs/network-modifications/line/creation/line-creation-dialog.tsx`
around lines 188 - 190, The limit-group selection state in the line creation
flow is getting out of sync when limits are regenerated. In
line-creation-dialog.tsx, update the logic around setValue and
convertLimitsToOperationalLimitsGroupFormSchema so that
selectedOperationalLimitsGroupId1 and selectedOperationalLimitsGroupId2 are
reset or recomputed whenever FieldConstants.OPERATIONAL_LIMITS_GROUPS is
replaced. Make sure the selected IDs always match the newly built operational
limit groups after a search-copy/edit.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In
`@src/components/dialogs/network-modifications/line/creation/line-creation-dialog.tsx`:
- Around line 188-190: The limit-group selection state in the line creation flow
is getting out of sync when limits are regenerated. In line-creation-dialog.tsx,
update the logic around setValue and
convertLimitsToOperationalLimitsGroupFormSchema so that
selectedOperationalLimitsGroupId1 and selectedOperationalLimitsGroupId2 are
reset or recomputed whenever FieldConstants.OPERATIONAL_LIMITS_GROUPS is
replaced. Make sure the selected IDs always match the newly built operational
limit groups after a search-copy/edit.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c2f3732d-fb1d-4e5b-b310-51d450695640

📥 Commits

Reviewing files that changed from the base of the PR and between 3f3959d and 2986cd8.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • src/components/dialogs/network-modifications/line/creation/line-creation-dialog.tsx
  • src/components/utils/utils.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/utils/utils.ts

dbraquart and others added 3 commits July 3, 2026 16:04
…eation-form-from-commons-UI

# Conflicts:
#	src/components/dialogs/limits/limits-pane.tsx
#	src/components/dialogs/limits/limits-side-pane.tsx
#	src/components/dialogs/limits/operational-limits-groups-tabs.tsx
#	src/components/dialogs/limits/temporary-limits-table.tsx
#	src/components/dialogs/line-types-catalog/line-type-segment-form.tsx
#	src/components/dialogs/line-types-catalog/line-types-catalog-selector-form.tsx
#	src/components/dialogs/network-modifications/line/characteristics-pane/line-characteristics-pane.tsx
#	src/components/dialogs/network-modifications/line/creation/line-creation-dialog.tsx
#	src/components/dialogs/network-modifications/line/line-dialog-tabs.tsx
#	src/components/dialogs/network-modifications/line/modification/line-modification-dialog-header.tsx
…eation-form-from-commons-UI

# Conflicts:
#	src/components/dialogs/network-modifications/line/creation/line-creation-dialog.tsx
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