fix: card hover preview broken for example cards in theme browser
Some checks are pending
CI / build (push) Waiting to run

This commit is contained in:
mwisnowski 2026-04-05 20:07:40 -07:00 committed by GitHub
parent 33aced3c97
commit 1554212bc4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 3 deletions

View file

@ -15,7 +15,7 @@ _No unreleased changes yet_
_No unreleased changes yet_
### Fixed
_No unreleased changes yet_
- **Card hover preview in theme browser (#70)**: Example card thumbnails in the theme detail/browser page were showing the wrong card image (a fuzzy search for "Card") when hovered. The `<img>` elements inside `.ex-card` containers lacked `data-card-name` attributes, so the hover system fell back to the literal string "Card". Added `data-card-name`, `data-original-name`, `data-role`, and `data-tags` to example card `<img>` elements in `detail_fragment.html` to match the existing commander image pattern.
### Removed
_No unreleased changes yet_

View file

@ -8,7 +8,7 @@ _No unreleased changes yet_
_No unreleased changes yet_
### Fixed
_No unreleased changes yet_
- Card hover preview now works correctly for example cards in the theme browser
### Removed
_No unreleased changes yet_

View file

@ -185,7 +185,7 @@
{% for c in theme.example_cards %}
{% set base_c = (c.split(' - Synergy (')[0] if ' - Synergy (' in c else c) %}
<div class="ex-card text-center" style="position:relative" data-card-name="{{ base_c }}" data-role="example_card" data-tags="{{ theme.synergies|join(', ') }}" data-original-name="{{ c }}">
<img class="card-thumb w-full h-auto border border-[var(--border)] rounded-[10px]" loading="lazy" decoding="async" alt="{{ c }} image" src="{{ base_c|card_image('small') }}" />
<img class="card-thumb w-full h-auto border border-[var(--border)] rounded-[10px]" loading="lazy" decoding="async" alt="{{ c }} image" src="{{ base_c|card_image('small') }}" data-card-name="{{ base_c }}" data-original-name="{{ c }}" data-role="example_card" data-tags="{{ theme.synergies|join(', ') }}" />
<div class="card-price-overlay" data-price-for="{{ base_c }}" aria-hidden="true"></div>
<div class="text-[11px] mt-1 whitespace-nowrap overflow-hidden text-ellipsis font-semibold card-ref" data-card-name="{{ base_c }}" data-tags="{{ theme.synergies|join(', ') }}" data-original-name="{{ c }}">{{ c }}</div>
</div>