Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,12 @@ const handleEditSettings = () => {
<ToggleSwitch
:model-value="isActive(option.mode)"
class="flex-shrink-0"
@update:model-value="handleToggle(option.mode)"
@update:model-value="
(v) =>
v
? handleToggle(option.mode)
: handleToggle(NumberControlMode.FIXED)
"
/>
Comment on lines 150 to 159
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

Logic correctly implements the toggle behavior to fix issue #7468.

The conditional handler properly addresses the reported issue where the randomize seed option was turning itself back on:

  • When toggling ON: activates the selected control mode
  • When toggling OFF: explicitly switches to FIXED mode instead of remaining in the previous state

This creates proper mutual exclusivity among options and provides a clear "off" state (FIXED) when no special control is active.

Optional: Consider extracting to a named handler for clarity.

While the current inline ternary is functional, extracting it could improve maintainability:

const handleControlToggle = (mode: NumberControlMode, enabled: boolean) => {
  handleToggle(enabled ? mode : NumberControlMode.FIXED)
}

Then in the template:

@update:model-value="(v) => handleControlToggle(option.mode, v)"

This would make the intent more explicit and the logic more testable, though the current implementation is acceptable for this focused bug fix.

🤖 Prompt for AI Agents
In src/renderer/extensions/vueNodes/widgets/components/NumberControlPopover.vue
around lines 150 to 159, extract the inline ternary used in the ToggleSwitch
@update:model-value handler into a named method to improve clarity and
testability: create a small method (e.g., handleControlToggle) that accepts
(mode, enabled) and calls handleToggle(enabled ? mode :
NumberControlMode.FIXED), then replace the inline arrow function in the template
with a call to that method passing option.mode and the value; keep existing
behavior unchanged.

</div>
</div>
Expand Down