Skip to content

Conversation

@sascha-karnatz
Copy link
Contributor

What is this pull request for?

Add a new ingredient type to select a color. By default only a color input will be shown. It is possible to provide predefined colors as settings and then the color ingredient will show a select of all colors. Furthermore it has a second option 'custom_color' which adds the possibility to select a color which is not predefined, if necessary.

Screenshots

With predefined colors and custom_color option:
Aufnahme 2025-09-30 at 14 43 48@2x
Aufnahme 2025-09-30 at 14 43 55@2x

Without any settings:
Aufnahme 2025-09-30 at 14 44 19@2x

Checklist

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have added tests to cover this change

@sascha-karnatz sascha-karnatz requested a review from a team as a code owner September 30, 2025 12:45
@codecov
Copy link

codecov bot commented Sep 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.13%. Comparing base (c28b955) to head (b3b3623).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3385   +/-   ##
=======================================
  Coverage   97.13%   97.13%           
=======================================
  Files         279      281    +2     
  Lines        7363     7376   +13     
=======================================
+ Hits         7152     7165   +13     
  Misses        211      211           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sascha-karnatz sascha-karnatz marked this pull request as draft September 30, 2025 12:56
@tvdeyen tvdeyen added this to the 8.0 milestone Sep 30, 2025
@sascha-karnatz sascha-karnatz marked this pull request as ready for review October 1, 2025 10:05
Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

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

Very nice addition and perfectly crafted

module Alchemy
module Ingredients
# A Color value
#
Copy link
Member

Choose a reason for hiding this comment

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

Maybe explain the settings here?

Copy link
Member

Choose a reason for hiding this comment

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

And add this to the guides as well

<%= color_field_tag(color_editor.form_field_name, color_editor.value, disabled:) %>
</alchemy-color-select>
<% end %>
<% end %>
Copy link
Member

Choose a reason for hiding this comment

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

This could have been a ViewComponent ;)

@tvdeyen
Copy link
Member

tvdeyen commented Oct 1, 2025

There is a null style value on the color-indicator

CleanShot 2025-10-01 at 15 36 29

@tvdeyen
Copy link
Member

tvdeyen commented Oct 1, 2025

We should not use --color as global property, because it will inherit from root.

CleanShot 2025-10-01 at 15 39 34

We should either use a more specific name or add a default value in the class

.color-indicator {
  --color: linear-gradient(90deg, red 5%, yellow, blue 95%);
  background: var(--color);
}

@tvdeyen tvdeyen force-pushed the new-color-ingredient branch from 034b4d9 to d37e21f Compare October 1, 2025 13:57
@tvdeyen
Copy link
Member

tvdeyen commented Oct 1, 2025

@sascha-karnatz I added two commits that adjust styling. Please pull before push :)

Add a new ingredient type to select a color. By default only a color input will be shown. It is possible to provide predefined colors as settings and then the color ingredient will show a select of all colors. Furthermore it has a second option 'custom_color' which adds the possibility to select a color which is not predefined, if necessary.
@tvdeyen tvdeyen modified the milestones: 8.0, 8.1 Oct 13, 2025
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