Mark the tile comment with an icon and drop the italic - #1682
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a comment icon to device-card comments so they are distinct from filenames.
Changes:
- Registers and renders the MDI comment icon.
- Updates comment layout and truncation styling.
- Adds test coverage for the icon.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Summary |
|---|---|
test/components/device-card-comment.test.ts |
Verifies the comment icon. |
src/components/device-card/styles.ts |
Styles the icon and comment layout. |
src/components/device-card.ts |
Registers and renders the icon. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The header was a two-column flex row, so the filename and comment truncated at the badge's left edge with dead space beneath it. A grid keeps the name beside the badge and spans the two lines below it.
|
|
esphbot
left a comment
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
…dy styles Merges the grid placement into each element's existing rule block, drops the flex-only declarations and the stale flex comment, keeps the comment icon at full quiet colour since it is the distinguishing cue, and gives the comment paragraph a localized aria-label so a screen reader can tell it from the filename.
|
All five handled: the badge tooltip is pinned to the badge cell so it can never auto-place (its host is display: contents anyway, so this is documentation as much as insurance), the grid placement is merged into each element's single rule block with the flex-only declarations and stale comment removed, the icon opacity is gone, the comment paragraph carries a localized aria-label (new dashboard.device_comment key), and the description now covers the header grid rework with the tested box ticked. |
|
Correction to my last note: wa-tooltip's host is position: absolute (inline-block), not display: contents. Same outcome, an absolutely positioned child never auto-places in the grid, and the CSS comment now says so. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Suppressed comments (3)
src/components/device-card.ts:254
aria-labelis on a<p>with its native paragraph role, which does not reliably accept an author-provided accessible name, so assistive technology may announce only the raw comment and not distinguish it from the filename. Give this metadata rowrole="note"(the established pattern insrc/components/device/config-entry-renderers-shared.ts:151-170) so the localized label is exposed.
? html`<p
class="device-comment"
title=${this.comment}
aria-label="${this._localize("dashboard.device_comment")}: ${this.comment}"
src/components/device-card.ts:256
- This icon is decorative because the parent supplies the localized accessible name, but it is not marked
aria-hiddenhere.wa-iconcan therefore be exposed as a separate graphic (and potentially add an unhelpful icon name) before the comment label; mark it hidden like the other decorative icons in this codebase.
<wa-icon library="mdi" name="comment-text-outline"></wa-icon>
src/components/device-card/styles.ts:121
.device-configis now a grid item spanning the flexible text track and theautostatus track, but it keeps the defaultmin-width: auto. Because.truncatesetswhite-space: nowrap, a long configuration filename can contribute its min-content width and prevent the grid from shrinking, causing the card to overflow instead of ellipsizing; give this rowmin-width: 0as the comment row already has.
.device-config,
.device-comment {
grid-column: 2 / -1;
Checked each against the tree. Tooltip pinned r1c3. Checkbox, name-wrap, badge each back to one rule block; Also confirmed placement math: config and comment carry a definite column with auto rows, so they land rows 2 and 3. |
Cannot confirm locally — |
PR Review — Mark the tile comment with an icon and drop the italicAll five prior findings are genuinely fixed in the working tree; two non-blocking nits remain, neither in the layout itself. Verified in the checkout rather than from the diff: the grid geometry is sound. On the prior round's findings: the tooltip is pinned to r1c3;
✅ Resolved since last review (3)Previously-flagged issues verified fixed
🟢 Suggestions
1. Composite aria-label built by concatenation rather than a parameterized key
|
esphbot
left a comment
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
|
Took the parameterized key: dashboard.device_comment is now "Comment: {comment}" and the template passes the comment in, so translators own the separator and the duplicate bare "Comment" string is gone. The archived dialog's italic is a follow-up as noted. |
What does this implement/fix?
#1671 put the device comment on the tile under the filename, but the only cue separating the two lines was italic, at the same size and quiet colour; on a grid of cards the comment read as a second filename. This sets the line as a standard metadata row: a leading comment icon, upright text, same size and colour as before, with the full text in the title tooltip and a localized aria-label so screen readers can tell the note from the path.
While checking it on real cards two layout problems showed up and are fixed here too: wa-icon boxes its glyph in a 1.25em centred host, which indented the text past the icon; and the header was a two-column flex row, so the filename and comment truncated at the status badge's left edge with dead space beneath it. The header is now a three-column grid (checkbox, text, badge) where only the name row shares its line with the badge and the two lines below span the full width.
Related issue or feature (if applicable):
Types of changes
bugfixnew-featureenhancementbreaking-changerefactordocsmaintenancecidependenciesChecklist
pnpm run lintpasses.pnpm run testpasses.