Skip to content

Conversation

@tvdeyen
Copy link
Member

@tvdeyen tvdeyen commented Nov 3, 2025

What is this pull request for?

Instead of rendering partials and having logic splattered
across helpers and a decorator that has methods for all
ingredients, we now have self contained component classes
for each individual ingredient.

Notable changes

Deprecates the Alchemy::Admin::IngredientsHelper and the Alchemy::IngredientEditor decorator.

Upgrade notes

Custom ingredient editor partials are deprecated - Apps with custom app/views/alchemy/ingredients/_*_editor.html.erb partials will see deprecation warnings. Migrate to ViewComponent-based editors by creating a class inheriting from Alchemy::Ingredients::BaseEditor.

Example migration:

# app/components/alchemy/ingredients/color_editor.rb
module Alchemy
  module Ingredients
    class ColorEditor < BaseEditor
      def input_field(form)
        # your custom input
      end
    end
  end
end

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

@tvdeyen tvdeyen added this to the 8.1 milestone Nov 3, 2025
@tvdeyen tvdeyen self-assigned this Nov 3, 2025
@tvdeyen tvdeyen changed the title Ingredient editor view components WIP: Ingredient editor view components Nov 3, 2025
@tvdeyen tvdeyen force-pushed the ingredient-editor-view-components branch 7 times, most recently from ddecf85 to 62137b4 Compare November 3, 2025 12:00
@codecov
Copy link

codecov bot commented Nov 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.35%. Comparing base (a0ca3f9) to head (d1c2bad).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3457      +/-   ##
==========================================
+ Coverage   97.26%   97.35%   +0.08%     
==========================================
  Files         291      308      +17     
  Lines        7721     8011     +290     
==========================================
+ Hits         7510     7799     +289     
- Misses        211      212       +1     

☔ 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.

@tvdeyen tvdeyen mentioned this pull request Nov 24, 2025
3 tasks
@tvdeyen tvdeyen force-pushed the ingredient-editor-view-components branch from 62137b4 to 41da114 Compare November 26, 2025 18:08
@tvdeyen tvdeyen force-pushed the ingredient-editor-view-components branch 12 times, most recently from f709612 to 6d20e39 Compare December 31, 2025 14:47
@tvdeyen tvdeyen changed the title WIP: Ingredient editor view components Add ingredient editor components Dec 31, 2025
@tvdeyen tvdeyen force-pushed the ingredient-editor-view-components branch from 6d20e39 to 160a095 Compare December 31, 2025 14:56
@tvdeyen tvdeyen marked this pull request as ready for review December 31, 2025 14:56
@tvdeyen tvdeyen requested a review from a team as a code owner December 31, 2025 14:56
@tvdeyen tvdeyen added the enhancement New feature or enhancement label Dec 31, 2025
@tvdeyen tvdeyen removed their assignment Dec 31, 2025
@tvdeyen tvdeyen force-pushed the ingredient-editor-view-components branch 6 times, most recently from 5e5a34c to dabc262 Compare January 2, 2026 10:47
Copy link
Contributor

@mamhoff mamhoff left a comment

Choose a reason for hiding this comment

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

Nice work!

@tvdeyen tvdeyen force-pushed the ingredient-editor-view-components branch 2 times, most recently from 2bba31c to 3bc4489 Compare January 5, 2026 15:59
Some labels and spacings are off.

Signed-off-by: Thomas von Deyen <vondeyen@blish.cloud>
Instead of rendering partials and having logic splattered
across helpers and a decorator that has methods for all
ingredients, we now have self contained component classes
for each individual ingredient.

Deprecates the IngredientsHelper and the IngredientEditor
decorator.

Signed-off-by: Thomas von Deyen <vondeyen@blish.cloud>
If an extension or app still uses ingredient editor partials
we render it but log a deprecation warning.

Signed-off-by: Thomas von Deyen <vondeyen@blish.cloud>
This can be used outside of the ingredient editor decorator
and simply delegates to the already existing class method.
The generator now creates ViewComponent-based editor components
instead of deprecated editor partials.
This allows to replace ingredient editors with
Turbo Stream.

Signed-off-by: Thomas von Deyen <vondeyen@blish.cloud>
Ingredient editor components no longer require element_form to be passed.
This enables rendering individual ingredient editors independently,
which is useful for Turbo Frame updates.
This fixes an issue with css class label not
appearing if it is not yet present.

Signed-off-by: Thomas von Deyen <vondeyen@blish.cloud>
@tvdeyen tvdeyen force-pushed the ingredient-editor-view-components branch from 3bc4489 to d1c2bad Compare January 8, 2026 15:13
@tvdeyen tvdeyen merged commit 8e4cf6e into main Jan 8, 2026
19 checks passed
@tvdeyen tvdeyen deleted the ingredient-editor-view-components branch January 8, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants