Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add spacing card #24403

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open

Add spacing card #24403

wants to merge 4 commits into from

Conversation

wendevlin
Copy link
Contributor

@wendevlin wendevlin commented Feb 26, 2025

Proposed change

  • Add spacing card to add separators between your cards

image

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@piitaya
Copy link
Member

piitaya commented Feb 26, 2025

Can we have 1x1 default size on the grid? Also, can we color it in preview mode so it appears in edit mode?

Comment on lines +269 to +271
.filter((card: Card) =>
this.isSectionsView ? true : !card.sectionsViewOnly
)
Copy link
Member

@bramkragten bramkragten Feb 26, 2025

Choose a reason for hiding this comment

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

Can we instead just skip the filter? It will still iterate over all the items now

const viewCards = this.isSectionsView ? coreCards : coreCards.filter(card => !card.sectionsViewOnly);
let cards = viewCards.map(...)

@@ -66,6 +66,7 @@ export interface Card {
showElement?: boolean;
isCustom?: boolean;
isSuggested?: boolean;
sectionsViewOnly?: boolean;
Copy link
Member

@bramkragten bramkragten Feb 26, 2025

Choose a reason for hiding this comment

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

Should this instead be a list of allowed (or disallowed?) view types?

@@ -146,6 +146,10 @@ export class HuiCreateDialogCard
.lovelace=${this._params.lovelaceConfig}
.hass=${this.hass}
@config-changed=${this._handleCardPicked}
.isSectionsView=${this._isSectionsView(
Copy link
Member

Choose a reason for hiding this comment

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

I would rather do this by just passing the view type

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants