Skip to content

Fix visible_if support for resource-based settings #1015

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yergneb
Copy link

@yergneb yergneb commented Jul 25, 2025

Problem

The schema validation incorrectly flagged visible_if as not allowed on resource-based settings (article, blog, collection, collection_list, metaobject, metaobject_list, page, product, product_list), causing the CLI to show "Property visible_if is not allowed" errors. However, these settings actually do support visible_if and function correctly when used in Shopify themes.

This may have prevented developers from using this functionality where valid as working code was being flagged as invalid by the tooling.

Solution

Updated all resource-based settings to support visible_if by:

  • Adding conditionalSetting reference to their schema definitions
  • Adding visible_if: true to their properties
  • Updated test constants to reflect the correct behaviour
  • All tests pass

Testing

Verified that visible_if works correctly on all resource-based settings in actual Shopify themes.

- Add visible_if support to article, blog, collection, collection_list, metaobject, metaobject_list, page, product, and product_list settings
- Update schema definitions to include conditionalSetting reference
- Remove resource-based settings from SETTINGS_TYPES_NOT_SUPPORTING_VISIBLE_IF test constant

Fixes issue where CLI incorrectly rejected valid visible_if usage on resource-based settings
@yergneb yergneb requested a review from a team as a code owner July 25, 2025 10:52
@yergneb
Copy link
Author

yergneb commented Jul 25, 2025

I have signed the CLA!

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.

1 participant