Fix preview popover styling and icon preservation

- Preserve icon structure when updating total count in trait badge
- Add gap between title and count in preview popover header
- Style the count badge with background, padding, and rounded corners

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-02 09:34:14 +01:00
parent cd714d8400
commit 7d4d1ec618
7 changed files with 28 additions and 6 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -7642,7 +7642,15 @@
var $totalBadge = this.$wrapper.find('.trait-total-count'); var $totalBadge = this.$wrapper.find('.trait-total-count');
if (total > 0) { if (total > 0) {
$totalBadge.text(total).show(); // Update count while preserving icon structure
var $countValue = $totalBadge.find('.count-value');
if ($countValue.length) {
$countValue.text(total);
} else {
// Fallback: set HTML with icon
$totalBadge.html('<i class="icon-eye"></i> <span class="count-value">' + total + '</span>');
}
$totalBadge.show();
} else { } else {
$totalBadge.hide(); $totalBadge.hide();
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -31,7 +31,15 @@
var $totalBadge = this.$wrapper.find('.trait-total-count'); var $totalBadge = this.$wrapper.find('.trait-total-count');
if (total > 0) { if (total > 0) {
$totalBadge.text(total).show(); // Update count while preserving icon structure
var $countValue = $totalBadge.find('.count-value');
if ($countValue.length) {
$countValue.text(total);
} else {
// Fallback: set HTML with icon
$totalBadge.html('<i class="icon-eye"></i> <span class="count-value">' + total + '</span>');
}
$totalBadge.show();
} else { } else {
$totalBadge.hide(); $totalBadge.hide();
} }

View File

@@ -436,6 +436,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
gap: $es-spacing-md;
padding: $es-spacing-sm $es-spacing-md; padding: $es-spacing-sm $es-spacing-md;
background: $es-bg-header; background: $es-bg-header;
border-bottom: 1px solid $es-border-color; border-bottom: 1px solid $es-border-color;
@@ -447,8 +448,13 @@
} }
.preview-popover-count { .preview-popover-count {
flex-shrink: 0;
font-size: $es-font-size-xs; font-size: $es-font-size-xs;
font-weight: $es-font-weight-medium;
color: $es-text-muted; color: $es-text-muted;
background: $es-slate-200;
padding: 0.125rem 0.5rem;
border-radius: $es-radius-sm;
} }
} }