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
|
||||||
: entities.filter(e => e.mode === selectedMode);
|
: 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 () => {
|
onMount(async () => {
|
||||||
await loadAwardData();
|
await loadAwardData();
|
||||||
});
|
});
|
||||||
@@ -423,20 +446,18 @@
|
|||||||
<span class="summary-value">{targetPoints}</span>
|
<span class="summary-value">{targetPoints}</span>
|
||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
{@const workedCount = filteredEntities.filter((e) => e.worked).length}
|
{@const neededCount = award.target ? Math.max(0, award.target - uniqueEntityProgress.worked) : uniqueEntityProgress.total - uniqueEntityProgress.worked}
|
||||||
{@const confirmedCount = filteredEntities.filter((e) => e.confirmed).length}
|
|
||||||
{@const neededCount = award.target ? Math.max(0, award.target - workedCount) : filteredEntities.filter((e) => !e.worked).length}
|
|
||||||
<div class="summary-card">
|
<div class="summary-card">
|
||||||
<span class="summary-label">Total:</span>
|
<span class="summary-label">Total:</span>
|
||||||
<span class="summary-value">{filteredEntities.length}</span>
|
<span class="summary-value">{uniqueEntityProgress.total}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="summary-card confirmed">
|
<div class="summary-card confirmed">
|
||||||
<span class="summary-label">Confirmed:</span>
|
<span class="summary-label">Confirmed:</span>
|
||||||
<span class="summary-value">{confirmedCount}</span>
|
<span class="summary-value">{uniqueEntityProgress.confirmed}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="summary-card worked">
|
<div class="summary-card worked">
|
||||||
<span class="summary-label">Worked:</span>
|
<span class="summary-label">Worked:</span>
|
||||||
<span class="summary-value">{workedCount}</span>
|
<span class="summary-value">{uniqueEntityProgress.worked}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="summary-card unworked">
|
<div class="summary-card unworked">
|
||||||
<span class="summary-label">Needed:</span>
|
<span class="summary-label">Needed:</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user