Skip to content

Allow hidden blocks#205

Merged
LZylstra merged 2 commits intomainfrom
hide-blocks
Nov 11, 2025
Merged

Allow hidden blocks#205
LZylstra merged 2 commits intomainfrom
hide-blocks

Conversation

@LZylstra
Copy link
Contributor

Add ability to hide blocks and quick fix for mobile styling issue with Columns with media showing as overlapping

@netlify
Copy link

netlify bot commented Nov 10, 2025

Deploy Preview for directus-website ready!

Name Link
🔨 Latest commit 463081c
🔍 Latest deploy log https://app.netlify.com/projects/directus-website/deploys/6913834f645f5e0008555066
😎 Deploy Preview https://deploy-preview-205--directus-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds the ability to hide blocks from pages and fixes a mobile styling issue where columns with media content were overlapping.

  • Adds a hidden boolean field to block interfaces and type definitions
  • Implements logic to skip rendering hidden blocks in the page builder
  • Fixes mobile column layout by reordering columns containing media to appear after text content

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
types/schema/routes/page.ts Adds hidden field to PageBlock interface
pages/[...permalink].vue Adds hidden field to data query and implements logic to skip hidden blocks
components/PageBuilder.vue Adds optional hidden field to PageSectionBlock interface
components/Block/Columns.vue Adds media detection logic and CSS reordering for mobile layout, removes vertical centering

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +114 to +125
// On mobile, reorder so text appears above media
@media (width <= 50rem) {
order: 1;

&.has-media {
order: 2;
}
}

@media (width > 50rem) {
grid-column: auto / span 1;
order: unset;
Copy link

Copilot AI Nov 11, 2025

Choose a reason for hiding this comment

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

[nitpick] The styling changes mix @container queries (lines 95, 110) with @media queries (lines 115, 123) in the same component. This inconsistency could lead to unexpected behavior since container queries are scoped to the container size while media queries are based on viewport size. Consider using @container queries consistently for both breakpoints to ensure the columns respond to their container's size rather than the viewport size.

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

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

@LZylstra Can we update to container queries to stay consistent here?

Copy link
Member

Choose a reason for hiding this comment

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

aside from that GTG

Copy link
Member

@bryantgillespie bryantgillespie left a comment

Choose a reason for hiding this comment

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

GTG - just update the @media queries to use @container queries so we stay consistent

@LZylstra LZylstra merged commit f3e8e66 into main Nov 11, 2025
5 of 6 checks passed
@LZylstra LZylstra deleted the hide-blocks branch November 11, 2025 18:42
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.

3 participants