Skip to content

feat(themes): channel visibility for home blocks - #1019

Draft
eslamoo wants to merge 7 commits into
masterfrom
feature/TD-13969-channel-visibility
Draft

feat(themes): channel visibility for home blocks#1019
eslamoo wants to merge 7 commits into
masterfrom
feature/TD-13969-channel-visibility

Conversation

@eslamoo

@eslamoo eslamoo commented Aug 3, 2026

Copy link
Copy Markdown
Member

What

Adds channel visibility to theme-raed home blocks. A merchant can now show a component on Desktop only, Mobile web only, or both, without writing custom CSS.

Jira: https://salla-dev.atlassian.net/browse/TD-13969

How

  • New s-hide-on-mobile / s-hide-on-desktop utility pair in src/assets/styles/05-utilities/channel-visibility.scss, breaking at 768px (Tailwind md).
  • Every home block root <section> derives its class inline from component.channel_visibility: { mobile, desktop }, which the backend injects.

Notes

  • Plain CSS rather than Tailwind md:hidden. The class comes from a variable, so Tailwind's JIT content scan would purge it.
  • The component.channel_visibility and not ... guard means a missing object emits no class, so legacy blocks stay visible everywhere.
  • not flag rather than flag == false: Twig's loose == matches null, which would hide every legacy block.
  • CSS is used instead of server-side omission so the theme editor's device switcher works. It only resizes the preview iframe, it does not reload it.

Test

  1. Set a home component to Desktop only, save.
  2. Resize across 768px: the block appears and disappears with no leftover gap.
  3. Repeat with a s-block--full-bg block (brands, featured-products-style2) to confirm no empty coloured strip.
  4. In the editor, toggle the device switcher: the block reacts without a save or reload.
  5. Confirm the existing Hide toggle still hides on both channels.

Stack

Part of the TD-13969 / TD-15122 home-blocks stack. Main PR: Dashboard #27853.

  • Components-Module #539
  • form-builder-module #233
  • ThemeCustomization-Module #626
  • Store #11986

This PR carries only the TD-13969 channel-visibility styling; the TD-15122 versions work is backend-only.

@sallainternalbot
sallainternalbot Bot marked this pull request as draft August 3, 2026 22:19
@codacy-production

Copy link
Copy Markdown
Contributor

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

AI Reviewer: run a review on demand. To trigger the first review automatically, go to your organization or repository integration settings. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@bakrimoharram
bakrimoharram force-pushed the feature/TD-13969-channel-visibility branch from ddf9d6d to 8eb2e89 Compare August 6, 2026 08:15
@bakrimoharram

Copy link
Copy Markdown
Contributor

@greptile-apps review

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