Skip to content

Respect "make auto segments" when resetting segments#5696

Open
DedeHai wants to merge 1 commit into
wled:mainfrom
DedeHai:fix_segment_reset
Open

Respect "make auto segments" when resetting segments#5696
DedeHai wants to merge 1 commit into
wled:mainfrom
DedeHai:fix_segment_reset

Conversation

@DedeHai

@DedeHai DedeHai commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

fix for #4136

Summary by CodeRabbit

  • Improvements
    • Optimized segment reset functionality with simplified request handling, improving system performance and reliability during segment management operations without affecting user experience.

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5357a179-76e3-45be-9ac1-04e8ccfc7d93

📥 Commits

Reviewing files that changed from the base of the PR and between 221964e and 79913d3.

📒 Files selected for processing (2)
  • wled00/data/index.js
  • wled00/json.cpp

Walkthrough

The "Reset segments" action in rSegs() now sends {"rSeg": true} to the backend instead of a manually constructed segment array. In deserializeState, a new rSeg root-flag handler suspends the LED strip, calls makeAutoSegments(true), resumes, and sets stateChanged.

Changes

rSeg Reset-Segments API

Layer / File(s) Summary
rSeg flag: UI sender and backend handler
wled00/json.cpp, wled00/data/index.js
deserializeState now checks root["rSeg"] and, when truthy, suspends the strip, calls strip.makeAutoSegments(true), resumes, and sets stateChanged. rSegs() in the UI is simplified to post {"rSeg": true} instead of building a full segment-array payload.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding support for respecting the 'make auto segments' setting during segment reset operations, which is the core purpose of the modifications in both the UI and backend code.
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.

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.

Reset Segments does not respect 'Make a segment for each output'

2 participants