feat(blend-percentage-visibility): hide percentage field for non-blend beans#1106
Merged
graphefruit merged 5 commits intographefruit:developfrom Apr 3, 2026
Merged
Conversation
…c locations - Move generic mock factories from aiBeanImport/test-utils to src/test-utils - Move generic bean helpers to src/test-utils/bean-test-helpers.ts - Rename misnamed data factories: createMockBean -> createBean, createMockBeanParams -> createBeanParams, createMockSettings -> createSettings, createMockExamples -> createExamples - Move 3 colocated specs into __tests__/ folders for consistency - Keep AI-specific helpers in aiBeanImport/test-utils - Update all affected imports
- Add template rendering tests for blend percentage visibility feature - BeanSortInformationComponent: 4 tests (create + 3 visibility scenarios) - BeanDetailSortInformationComponent: 5 tests (create + 3 visibility + GreenBean) - Add createMockUISettingsStorage and createMockUIBeanHelper factories - First DOM-level component tests in the project
Contributor
Author
|
Oh wait, I wanted to make this a PR in my own fork for final review before I open that PR. Stupid me! If it is ok for you @graphefruit I will leave it here open and let you know if I think it is ready for review by you. |
silasg
commented
Mar 31, 2026
...onents/beans/detail/bean-detail-sort-information/bean-detail-sort-information.component.html
Outdated
Show resolved
Hide resolved
…iew feedback - Extract isBlend() on detail component encapsulating isBean() type guard + BLEND check - Replace inline blend checks in detail template with isBlend() - Remove redundant smoke tests from both component specs - Revert Prettier-induced line break changes in ai-field-prompts.spec.ts
Contributor
Author
|
@graphefruit so far, I am done. Please have a look. |
graphefruit
requested changes
Apr 2, 2026
...onents/beans/detail/bean-detail-sort-information/bean-detail-sort-information.component.html
Outdated
Show resolved
Hide resolved
…beanFunctionPipe Use pipe-based template evaluation instead of direct method calls to avoid triggering evaluation on every change detection cycle (upstream review feedback). - Add Bean.isBlend() method - Add IS_BLEND to BEAN_FUNCTION_PIPE_ENUM and beanFunctionPipe - Widen pipe input type to Bean | GreenBean with instanceof guard - Replace all isBlend() template calls with pipe usage in both bean-sort-information and bean-detail-sort-information components - Remove component-level isBlend() and isBean() methods
Owner
|
Thanks for the changes. Merged |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Hide the blend percentage field in bean information when the bean is not a blend. The percentage field now requires both conditions to be visible:
settings.bean_manage_parameters.percentageis enabledBLENDChanges
&& isBlend()to percentage@ifguard&& isBean(data) && data.beanMix.toString() === 'BLEND'' to percentage@if` guardsrc/test-utils/, consolidated spec file locations into__tests__/folders