fix(explore): align viz type gallery thumbnails and Featured tag - #43373
fix(explore): align viz type gallery thumbnails and Featured tag#43373yousoph wants to merge 2 commits into
Conversation
The 'Select a visualization type' gallery had two layout problems: - Long chart names wrapped to multiple lines, changing tile height. Because the grid rows size to their tallest tile, a wrapped name pushed the thumbnails of neighbouring tiles in the same row upward, so thumbnails no longer lined up. - The 'Featured' badge was positioned with a hardcoded `top: sizeUnit * 19` offset anchored to the whole tile, so it landed in the wrong spot once tile height varied. Fixes: - Clamp the chart-name label to a fixed two-line block (ellipsis overflow) so every tile is the same height; the full name stays available via a title tooltip. Top-align grid items as a defensive measure. - Anchor the Featured badge to a position:relative wrapper around the thumbnail image (top-right corner) instead of the magic offset, so it sits consistently regardless of name length. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Code Review Agent Run #4ffac3Actionable Suggestions - 0Filtered by Review RulesBito filtered these suggestions based on rules created automatically for your feedback. Manage rules.
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
There was a problem hiding this comment.
Pull request overview
Fixes two UI layout issues in Explore’s “Select a visualization type” gallery so thumbnail tiles stay visually aligned regardless of visualization name length, and ensures the “Featured” badge consistently anchors to the thumbnail image area.
Changes:
- Top-aligns grid items and clamps visualization names to a fixed two-line label height (with tooltip via
title). - Re-anchors the “Featured” badge by introducing a relative-positioned wrapper around the thumbnail image.
- Adds a unit test to ensure each thumbnail label exposes the full name via a
titleattribute.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeGallery.tsx | Adjusts gallery grid alignment, clamps label height, and repositions the Featured badge relative to the thumbnail image. |
| superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeControl.test.tsx | Adds a regression test asserting thumbnail labels include a title attribute matching the full chart name. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| expect(labels.length).toBeGreaterThan(0); | ||
| labels.forEach(label => { | ||
| expect(label).toHaveAttribute('title', label.textContent); | ||
| }); |
|
The assertion superset-frontend/src/explore/components/controls/VizTypeControl/VizTypeControl.test.tsx |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #43373 +/- ##
==========================================
- Coverage 66.83% 66.83% -0.01%
==========================================
Files 2876 2876
Lines 164061 164065 +4
Branches 37860 37862 +2
==========================================
- Hits 109657 109654 -3
- Misses 52230 52237 +7
Partials 2174 2174
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
label.textContent is string | null; toHaveAttribute expects string | RegExp. Coerce with ?? '' to satisfy strictNullChecks. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
🎪 Showtime deployed environment on GHA for 4517f7d • Environment: http://54.213.164.192:8080 (admin/admin) |
Code Review Agent Run #d7e288Actionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
|
🎪 Showtime deployed environment on GHA for 59a53ed • Environment: http://34.211.208.130:8080 (admin/admin) |
SUMMARY
Two layout problems in the "Select a visualization type" gallery:
top: sizeUnit * 19offset (dating back to when the badge was introduced in feat(viz-gallery): add 'feature' tag and fuzzy search weighting #18662), so it drifted as tile height varied.Fix: clamp the chart-name label to a fixed two-line block with ellipsis overflow so every tile is the same height (full name preserved via a
titletooltip), top-align the grid items, and anchor the Featured badge to a newposition: relativewrapper around the thumbnail image so it sits consistently at the image's top-right.TESTING INSTRUCTIONS
Create a new chart and open the viz type gallery. Confirm all thumbnails in a row line up regardless of chart-name length, and the Featured badge sits at the thumbnail's top-right on every featured type. Long names truncate with an ellipsis and reveal the full name on hover.
A unit test asserts every label carries a
titlematching its full name.🤖 Generated with Claude Code