feat: show unique entity progress in award summary
Summary cards now display unique entity counts (e.g., unique DXCC countries) instead of per-band/mode slot counts. This shows actual award progress: Total entities worked, confirmed, and needed to reach the award target. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -29,6 +29,29 @@
|
||||
? entities
|
||||
: entities.filter(e => e.mode === selectedMode);
|
||||
|
||||
// Calculate unique entity progress (for DXCC, DLD, etc.)
|
||||
$: uniqueEntityProgress = (() => {
|
||||
const uniqueEntities = new Map();
|
||||
|
||||
filteredEntities.forEach(e => {
|
||||
const entityName = e.entityName || e.entity || 'Unknown';
|
||||
|
||||
if (!uniqueEntities.has(entityName)) {
|
||||
uniqueEntities.set(entityName, { worked: false, confirmed: false });
|
||||
}
|
||||
|
||||
const status = uniqueEntities.get(entityName);
|
||||
if (e.worked) status.worked = true;
|
||||
if (e.confirmed) status.confirmed = true;
|
||||
});
|
||||
|
||||
return {
|
||||
total: uniqueEntities.size,
|
||||
worked: Array.from(uniqueEntities.values()).filter(s => s.worked).length,
|
||||
confirmed: Array.from(uniqueEntities.values()).filter(s => s.confirmed).length
|
||||
};
|
||||
})();
|
||||
|
||||
onMount(async () => {
|
||||
await loadAwardData();
|
||||
});
|
||||
@@ -423,20 +446,18 @@
|
||||
<span class="summary-value">{targetPoints}</span>
|
||||
</div>
|
||||
{:else}
|
||||
{@const workedCount = filteredEntities.filter((e) => e.worked).length}
|
||||
{@const confirmedCount = filteredEntities.filter((e) => e.confirmed).length}
|
||||
{@const neededCount = award.target ? Math.max(0, award.target - workedCount) : filteredEntities.filter((e) => !e.worked).length}
|
||||
{@const neededCount = award.target ? Math.max(0, award.target - uniqueEntityProgress.worked) : uniqueEntityProgress.total - uniqueEntityProgress.worked}
|
||||
<div class="summary-card">
|
||||
<span class="summary-label">Total:</span>
|
||||
<span class="summary-value">{filteredEntities.length}</span>
|
||||
<span class="summary-value">{uniqueEntityProgress.total}</span>
|
||||
</div>
|
||||
<div class="summary-card confirmed">
|
||||
<span class="summary-label">Confirmed:</span>
|
||||
<span class="summary-value">{confirmedCount}</span>
|
||||
<span class="summary-value">{uniqueEntityProgress.confirmed}</span>
|
||||
</div>
|
||||
<div class="summary-card worked">
|
||||
<span class="summary-label">Worked:</span>
|
||||
<span class="summary-value">{workedCount}</span>
|
||||
<span class="summary-value">{uniqueEntityProgress.worked}</span>
|
||||
</div>
|
||||
<div class="summary-card unworked">
|
||||
<span class="summary-label">Needed:</span>
|
||||
|
||||
Reference in New Issue
Block a user