Fix BusMenu : show SC dynamic simulation optionaly#3934
Conversation
…mulationEventMenuItem` in the menu, like it's done for SC using `shortCircuitAvailability` Signed-off-by: sBouzols <sylvain.bouzols@gmail.com>
📝 WalkthroughWalkthroughThe 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. ChangesBus Menu Dynamic Simulation Gating
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ 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. Comment |
There was a problem hiding this comment.
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
📒 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); |
There was a problem hiding this comment.
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.
| 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.
|
|
|
||
| const shortCircuitAvailability = useOptionalServiceStatus(OptionalServicesNames.ShortCircuit); | ||
| const dynamicSimulationAvailability = useOptionalServiceStatus(OptionalServicesNames.DynamicSimulation); | ||
| console.log('SBO dynamicSimulationAvailability', dynamicSimulationAvailability); |
There was a problem hiding this comment.
| console.log('SBO dynamicSimulationAvailability', dynamicSimulationAvailability); |



PR Summary
fix(BusMenu): check
dynamicSimulationAvailabilityto addDynamicSimulationEventMenuItemin the menu, like it's done for SC usingshortCircuitAvailability