Skip to content

Use the available width for compact names - #94

Open
SeoFood wants to merge 1 commit into
custom-cards:mainfrom
SeoFood:seofood/slider-hidden-action-width
Open

SeoFood wants to merge 1 commit into
custom-cards:mainfrom
SeoFood:seofood/slider-hidden-action-width

Conversation

@SeoFood

@SeoFood SeoFood commented Oct 3, 2026

Copy link
Copy Markdown

Compact cards reserve 3.5em beside the name even when the state, attribute, and action button are hidden. A name can be truncated despite fitting in the available text area.

Allow the name to use that space when all three are hidden. The action-button condition requires show: false, since a partially configured button remains visible by default.

Fixes #90.

Tested the built card in Chromium at 180px and 300px, with short and long names, every combination of state/attribute/action visibility, and configuration changes. Five checks fail on the original bundle; all 47 pass with the fix. The 34 control layouts retain identical geometry. Lint and the production build pass in Docker.

Also reproduced in an isolated Home Assistant 2026.9.4 instance. In the 242px-wide card below, the name needs 161px and has 187px of text space available. The original limits it to 133px; the patched card shows it in full at the same width.

Before After
Compact card unnecessarily truncates the test name Compact card shows the full test name at the same width

The screenshots use a synthetic helper and contain no production data.

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.

When action button is hidden, space is not used for Name-value

1 participant