Skip to content

Fix BusMenu : show SC dynamic simulation optionaly#3934

Open
sBouzols wants to merge 1 commit into
mainfrom
fix_optionnaly_show_sc_dynamicsimulation_item_in_menu
Open

Fix BusMenu : show SC dynamic simulation optionaly#3934
sBouzols wants to merge 1 commit into
mainfrom
fix_optionnaly_show_sc_dynamicsimulation_item_in_menu

Conversation

@sBouzols
Copy link
Copy Markdown
Contributor

@sBouzols sBouzols commented May 6, 2026

PR Summary

fix(BusMenu): check dynamicSimulationAvailability to add DynamicSimulationEventMenuItem in the menu, like it's done for SC using shortCircuitAvailability

…mulationEventMenuItem` in the menu, like it's done for SC using `shortCircuitAvailability`

Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
@sBouzols sBouzols requested a review from thangqp May 6, 2026 12:43
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

📝 Walkthrough

Walkthrough

The PR adds a service availability check for the DynamicSimulation service to conditionally render the DynamicSimulationEventMenuItem in the bus menu. The component now queries the service status and gates the menu item rendering on availability alongside existing developer mode and event type checks.

Changes

Bus Menu Dynamic Simulation Gating

Layer / File(s) Summary
Service Status Integration
src/components/menus/bus-menu.tsx
useOptionalServiceStatus hook added to check DynamicSimulation service availability; console log outputs the status.
Conditional Rendering
src/components/menus/bus-menu.tsx
DynamicSimulationEventMenuItem rendering now gates on dynamicSimulationAvailability being "Up" in addition to existing isDeveloperMode and event type checks.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly references the specific change: adding optional display of dynamic simulation in BusMenu.
Description check ✅ Passed The description explains the change: adding dynamicSimulationAvailability check to conditionally render DynamicSimulationEventMenuItem, mirroring existing shortCircuitAvailability logic.
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

🤖 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/menus/bus-menu.tsx`:
- Line 111: Remove the debug console logging of internal state by deleting the
console.log('SBO dynamicSimulationAvailability', dynamicSimulationAvailability)
call in src/components/menus/bus-menu.tsx (or replace it with a dev-only
logger). Specifically, locate the usage in the component or function that
references dynamicSimulationAvailability and either remove the line or wrap it
with an environment/dev check (e.g., only log when process.env.NODE_ENV !==
'production' or using your app's debug logger) so production builds no longer
emit this runtime state to the console.
🪄 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: 34d11db1-f285-40e2-bef7-709c07a9972e

📥 Commits

Reviewing files that changed from the base of the PR and between cc09446 and c595385.

📒 Files selected for processing (1)
  • src/components/menus/bus-menu.tsx


const shortCircuitAvailability = useOptionalServiceStatus(OptionalServicesNames.ShortCircuit);
const dynamicSimulationAvailability = useOptionalServiceStatus(OptionalServicesNames.DynamicSimulation);
console.log('SBO dynamicSimulationAvailability', dynamicSimulationAvailability);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Remove debug console logging before merge.

Line 111 logs internal runtime state in production paths and will add noise in user consoles. Please remove it (or guard behind a dev-only logger).

Suggested change
-    console.log('SBO dynamicSimulationAvailability', dynamicSimulationAvailability);
📝 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
console.log('SBO dynamicSimulationAvailability', dynamicSimulationAvailability);
🤖 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/menus/bus-menu.tsx` at line 111, Remove the debug console
logging of internal state by deleting the console.log('SBO
dynamicSimulationAvailability', dynamicSimulationAvailability) call in
src/components/menus/bus-menu.tsx (or replace it with a dev-only logger).
Specifically, locate the usage in the component or function that references
dynamicSimulationAvailability and either remove the line or wrap it with an
environment/dev check (e.g., only log when process.env.NODE_ENV !== 'production'
or using your app's debug logger) so production builds no longer emit this
runtime state to the console.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 6, 2026


const shortCircuitAvailability = useOptionalServiceStatus(OptionalServicesNames.ShortCircuit);
const dynamicSimulationAvailability = useOptionalServiceStatus(OptionalServicesNames.DynamicSimulation);
console.log('SBO dynamicSimulationAvailability', dynamicSimulationAvailability);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
console.log('SBO dynamicSimulationAvailability', dynamicSimulationAvailability);

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