Skip to content

Prevent composite creation when nesting limit is reached#3924

Merged
Meklo merged 9 commits into
mainfrom
marcellinh/prevent-composite-creation-nesting-limit-reached
May 6, 2026
Merged

Prevent composite creation when nesting limit is reached#3924
Meklo merged 9 commits into
mainfrom
marcellinh/prevent-composite-creation-nesting-limit-reached

Conversation

@Meklo
Copy link
Copy Markdown
Contributor

@Meklo Meklo commented Apr 28, 2026

PR Summary

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 28, 2026

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: 7f3bc28c-c4e7-42ad-ab33-a313bbf11d20

📥 Commits

Reviewing files that changed from the base of the PR and between 09f357c and 8faf3f1.

📒 Files selected for processing (3)
  • src/components/graph/menus/network-modifications/network-modification-node-editor-utils.ts
  • src/components/graph/menus/network-modifications/network-modification-node-editor.tsx
  • src/translations/en.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/translations/en.json

📝 Walkthrough

Walkthrough

Retypes selected rows to ComposedModificationMetadata[], adds a memo isCompositeNestingLimitReached that checks selected items' maxDepth against MAX_COMPOSITE_NESTING_DEPTH, disables the composite-save action and changes its tooltip/badge when the limit is reached, and adds a badge style and i18n keys for the new message.

Changes

Composite Save / Nesting Limit

Layer / File(s) Summary
Data Shape
src/components/graph/menus/network-modifications/network-modification-node-editor.tsx
Selection state and handler retyped from NetworkModificationMetadata[] to ComposedModificationMetadata[].
Core Logic
src/components/graph/menus/network-modifications/network-modification-node-editor.tsx
Adds isCompositeNestingLimitReached memo that tests (row.maxDepth ?? 0) >= MAX_COMPOSITE_NESTING_DEPTH across selected rows (imports MAX_COMPOSITE_NESTING_DEPTH).
UI Wiring
src/components/graph/menus/network-modifications/network-modification-node-editor.tsx
Composite "SaveToGridexplore" toolbar: tooltip switches to CompositeNestingLimitReached (with {limit}) when limit reached; error Badge shown only when limit reached; composite-save IconButton disabled includes isCompositeNestingLimitReached.
Styling
src/components/graph/menus/network-modifications/network-modification-node-editor-utils.ts
Adds badgeStyle to styles to customize .MuiBadge-badge size, padding, font and transform.
Localization
src/translations/en.json, src/translations/fr.json
Adds CompositeNestingLimitReached translation key in English and French with {limit} placeholder.

Suggested reviewers

  • Mathieu-Deharbe
  • souissimai
  • sBouzols
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The pull request description is empty—only a template header is present with no actual content describing the changes. Add a description explaining what the nesting limit validation does, why it was added, and the user-visible impact of this change.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: preventing composite creation when a nesting limit is reached, which is directly reflected in the code changes that add nesting limit validation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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


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.

Copy link
Copy Markdown

@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: 1

🧹 Nitpick comments (1)
src/components/graph/menus/network-modifications/network-modification-node-editor.tsx (1)

1227-1253: LGTM!

The tooltip correctly shows additional information when the nesting limit is reached, and the button is properly disabled in that case.

Minor formatting fix needed per static analysis at line 1232:

🧹 Fix formatting
-                                <Box component="span" sx={{ display: 'block'}}>
+                                <Box component="span" sx={{ display: 'block' }}>
🤖 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-node-editor.tsx`
around lines 1227 - 1253, Fix the minor JSX formatting around the Tooltip title
fragment: tidy up the spacing/indentation and remove any stray blank line or
trailing space inside the fragment that contains FormattedMessage and the
conditional Box; ensure the Box component usage (Box component="span" sx={{
display: 'block'}}) and surrounding JSX are consistently indented and formatted
so the file passes the project's auto-formatter/linter (affects Tooltip, the
inner FormattedMessage, Box, and the
IconButton/OpenCreateCompositeModificationDialog block).
🤖 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-node-editor.tsx`:
- Line 17: Replace the hardcoded nesting limit (currently "5") with the imported
constant MAX_COMPOSITE_NESTING_DEPTH in network-modification-node-editor.tsx;
locate the conditional that enforces composite nesting depth (the check that
compares currentDepth or similar to 5) and use MAX_COMPOSITE_NESTING_DEPTH
instead so the module uses the single source-of-truth constant.

---

Nitpick comments:
In
`@src/components/graph/menus/network-modifications/network-modification-node-editor.tsx`:
- Around line 1227-1253: Fix the minor JSX formatting around the Tooltip title
fragment: tidy up the spacing/indentation and remove any stray blank line or
trailing space inside the fragment that contains FormattedMessage and the
conditional Box; ensure the Box component usage (Box component="span" sx={{
display: 'block'}}) and surrounding JSX are consistently indented and formatted
so the file passes the project's auto-formatter/linter (affects Tooltip, the
inner FormattedMessage, Box, and the
IconButton/OpenCreateCompositeModificationDialog block).
🪄 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: 755601ce-5ffc-4219-bf8b-50f5ee246cf3

📥 Commits

Reviewing files that changed from the base of the PR and between b357253 and 816b168.

📒 Files selected for processing (3)
  • src/components/graph/menus/network-modifications/network-modification-node-editor.tsx
  • src/translations/en.json
  • src/translations/fr.json

@Mathieu-Deharbe Mathieu-Deharbe self-requested a review May 5, 2026 09:08
Copy link
Copy Markdown
Contributor

@Mathieu-Deharbe Mathieu-Deharbe left a comment

Choose a reason for hiding this comment

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

Only the correction of the typo is requested. Other things are suggestions.

Comment thread src/translations/en.json Outdated
@Meklo Meklo requested a review from Mathieu-Deharbe May 5, 2026 13:50
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 6, 2026

@Meklo Meklo merged commit cc09446 into main May 6, 2026
5 checks passed
@Meklo Meklo deleted the marcellinh/prevent-composite-creation-nesting-limit-reached branch May 6, 2026 09:44
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