Skip to content

Add title tooltip and subText support to data-table cells - #91

Open
felippe-ch wants to merge 3 commits into
masterfrom
data-table-cell-title-and-subtext
Open

Add title tooltip and subText support to data-table cells#91
felippe-ch wants to merge 3 commits into
masterfrom
data-table-cell-title-and-subtext

Conversation

@felippe-ch

Copy link
Copy Markdown
Contributor

Summary

Adds two new per-cell options to zn-data-table:

  • title — sets a native tooltip (title attribute) on the cell content. Applied across the datetime, zn-style, link (<a>), chip, and icon templates.
  • subText — renders muted secondary text below the main cell content, styled via the new .table__cell--subtext class.

Changes

  • Extend the Cell interface with optional title and subText fields.
  • Refactor renderCell to build up content progressively rather than returning early, so title, subText, copyable, and hoverContent can layer together.
  • Reorder the hoverContent block to wrap the composed content (including any icon).
  • Add .table__cell--subtext styling.

Testing

Added 4 unit tests to data-table.test.ts (all passing on Chromium + Webkit):

  • subText renders as muted secondary text
  • title applies as a tooltip on link cells
  • title applies as a tooltip on styled cells
  • title attribute is omitted when no title is provided

Note: title is only wired on the styled/link/chip/icon render paths — a plain text-only cell does not carry a tooltip.

🤖 Generated with Claude Code

Extend the Cell interface with `title` and `subText` fields:
- `title` renders as a tooltip (title attribute) on the datetime,
  zn-style, link, chip, and icon cell templates
- `subText` renders muted secondary text below the cell content,
  styled via new .table__cell--subtext

Refactor cell rendering to compose `content` progressively instead of
early returns, so title, subText, copyable, and hover layers combine
correctly.

Add tests covering subText output and title tooltips on the link and
styled cell paths.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@felippe-ch
felippe-ch force-pushed the data-table-cell-title-and-subtext branch from b46bf50 to 0917895 Compare July 28, 2026 09:48
@felippe-ch
felippe-ch requested a review from Jonezzyboy July 28, 2026 09:58
Comment thread src/components/data-table/data-table.scss Outdated
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