Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidate classic FX #4573

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

DedeHai
Copy link
Collaborator

@DedeHai DedeHai commented Feb 22, 2025

This PR removes some of the classic FX "aliases" and moves them into the main FX to be used with checkmarks.

cherry picked from @blazoncek's branch, updated, cleaned and tested.

Removed effects:

  • Dynamic Smooth -> use Danamic with check3
  • Candle Multi -> use Candle with check 3
  • Solid Glitter -> use Glitter (alternative: PS Sparkler)
  • Ripple Rainbow -> use Ripple with check 1
  • Sinelon Dual -> use Sinelon with check 2
  • Sinelon Rainbow -> use Sinelon with check 1
  • Meteor Smooth -> use Meteor
  • Scanner Dual -> use Scanner with check 3
  • Running Dual -> use Running with with check 2
  • Chase 2 -> use Theater without check 3
  • Dissolve Rnd -> use Dissolve with with check 1
  • Saw -> use Running with with check 3
  • Theater Rainbow -> use Theater with check
  • Scan Dual -> use Scan with check 3

Summary by CodeRabbit

  • New Features

    • Introduced a new “sparkle” lighting effect to provide a fresh, dynamic option for your display.
  • Refactor

    • Streamlined the selection of lighting effects by removing several older modes. This update simplifies the effect menu, making it easier to navigate and enhancing your overall visual experience.

Copy link

coderabbitai bot commented Feb 22, 2025

Walkthrough

This pull request updates the FX module by removing several legacy LED effect modes and their corresponding exported declarations. In the source file, multiple outdated effect functions are removed while a new mode_sparkle function is added. In the header file, the associated macro definitions for these legacy effects are commented out, with inline suggestions provided for alternative effect modes.

Changes

File(s) Change Summary
wled00/FX.cpp Removed legacy effect functions: mode_dynamic_smooth, mode_dual_scan, mode_theater_chase_rainbow, mode_saw, mode_dissolve_random, mode_running_dual, mode_sinelon_dual, mode_sinelon_rainbow, mode_running_color, mode_ripple_rainbow, mode_candle_multi; Added mode_sparkle.
wled00/FX.h Commented out legacy effect macros: FX_MODE_DUAL_SCAN, FX_MODE_THEATER_CHASE_RAINBOW, FX_MODE_SAW, FX_MODE_DISSOLVE_RANDOM, FX_MODE_RUNNING_COLOR, FX_MODE_RUNNING_DUAL, FX_MODE_DUAL_LARSON_SCANNER, FX_MODE_RIPPLE_RAINBOW, FX_MODE_CANDLE_MULTI, FX_MODE_SOLID_GLITTER; provided alternative usage notes.
✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

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

🧹 Nitpick comments (1)
wled00/FX.h (1)

255-264: Consider grouping 2D effects together.

While the 2D effects are well-named and properly sequenced, consider grouping all 2D effects together in the code for better organization and maintainability. This would make it easier to:

  1. Find and manage 2D effects
  2. Add new 2D effects in the future
  3. Maintain clear separation between 1D and 2D effects
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6641508 and 14f55cd.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • wled00/FX.cpp (39 hunks)
  • wled00/FX.h (5 hunks)
🔇 Additional comments (10)
wled00/FX.h (2)

146-252: Well-documented effect mode consolidation!

The commented-out effects with their replacement suggestions are clear and consistent. The migration paths align perfectly with the PR objectives.


183-225: Helpful alternative effect suggestions!

Good practice to suggest modern particle system alternatives while keeping the original effects. This helps users discover newer, potentially more feature-rich implementations.

wled00/FX.cpp (8)

403-408: LGTM! Scan effect now supports dual mode.

The addition of check3 parameter for dual mode successfully consolidates the functionality of the removed mode_dual_scan.


473-494: LGTM! Theater chase effect now supports animation and theatre modes.

The addition of check1 for animation and check3 for theatre mode successfully consolidates multiple theater chase effects into one.


510-537: LGTM! Running lights effect now supports moving, dual, and saw modes.

The addition of check1 for moving, check2 for dual, and check3 for saw mode successfully consolidates multiple running effects into one.


631-648: LGTM! New sparkle effect with moving and overlay options.

The new mode_sparkle function with check1 for moving and check2 for overlay provides a good base implementation for sparkle effects.


3173-3176: LGTM! Candle effect now supports multi-candle mode.

The addition of check3 for multi-candle mode successfully consolidates the functionality of the removed mode_candle_multi.


3025-3031: LGTM! Sinelon effect now supports rainbow and dual modes.

The addition of check1 for rainbow and check2 for dual mode successfully consolidates the functionality of the removed mode_sinelon_rainbow and mode_sinelon_dual.


10046-10160: LGTM! Effect registrations updated to reflect consolidation.

The following effects have been correctly commented out as they are now consolidated into other effects:

  • FX_MODE_DUAL_SCAN (consolidated into Scan with check3)
  • FX_MODE_THEATER_CHASE_RAINBOW (consolidated into Theater with check)
  • FX_MODE_SAW (consolidated into Running with check3)
  • FX_MODE_DISSOLVE_RANDOM (consolidated into Dissolve with check1)
  • FX_MODE_RUNNING_COLOR
  • FX_MODE_RUNNING_DUAL (consolidated into Running with check2)
  • FX_MODE_DUAL_LARSON_SCANNER
  • FX_MODE_METEOR_SMOOTH (merged with mode_meteor)
  • FX_MODE_SOLID_GLITTER (consolidated into Glitter)
  • FX_MODE_SINELON_DUAL (consolidated into Sinelon with check2)
  • FX_MODE_SINELON_RAINBOW (consolidated into Sinelon with check1)
  • FX_MODE_RIPPLE_RAINBOW (consolidated into Ripple with check1)
  • FX_MODE_CANDLE_MULTI (consolidated into Candle with check3)
  • FX_MODE_DYNAMIC_SMOOTH (consolidated into Dynamic with check3)

3085-3091: LGTM! Solid Glitter effect correctly removed.

The mode_solid_glitter function has been correctly commented out as its functionality is now part of the mode_glitter effect.

@netmindz
Copy link
Member

I've move away from trying to track all changes in the changelog.md file, but for breaking changes like, it's probably our best place to record these changes, so it's then easy to find when we put out the release notes

@netmindz netmindz added this to the 0.16.0 candidate milestone Feb 22, 2025
@blazoncek
Copy link
Collaborator

I've move away from trying to track all changes in the changelog.md file

I usually did it once in a while by checking commit messages and writing down changes.

return running_base(true);
}
static const char _data_FX_MODE_SAW[] PROGMEM = "Saw@!,Width;!,!;!";
static const char _data_FX_MODE_RUNNING_LIGHTS[] PROGMEM = "Running@!,Width,,,,Rainbow,Dual,Saw;L,!,R;!";
Copy link
Contributor

Choose a reason for hiding this comment

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

The first checkbox doesn't produce any rainbows. In the code, the value is called moving, but it doesn't have anything to do with movement either. It's color_from_palette's wrap argument (which isn't a super self-explanatory name to a user either...). Both the variable and the UI string should be renamed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Moving in the instance of palette means if the palette itself is moving (i.e. hue of the palette is changing).
Some palettes wrap at the end and some don't. This "moving" parameter tells that palette should wrap as it is changing so that transition from ent to start is smooth.

Hmm. Not the best explanation, I know.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the reason it is named 'rainbow' is legacy: some FX use(d) this exactly for that: moving the palette, creating a rainbow effect when using rainbow palette (i.e. colowheel). I agree that is now a bit nonsensical since many palettes are available, I am open to suggestions for renaming all "move palette" checkmarks into something more meaningful. in other places, such behaviour is also called "move" or "shift".

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.

4 participants