fix: filter snapshot prices to only show items used in run
CI / Build Native (push) Failing after 47s
CI / Build Native (push) Failing after 47s
- Add filteredSnapshotCristales/Ores/Venta getters that filter based on modalDetails.items - Cristales: only show grados that appear in items - Ores: only show Soul/Spirit Ore based on item tipos - Venta: only show tipo-grado combos in items - Backward compatible: old runs with 15 items show full snapshot
This commit is contained in:
@@ -295,7 +295,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<p class="text-xs uppercase tracking-wide text-muted mb-2">Cristales</p>
|
<p class="text-xs uppercase tracking-wide text-muted mb-2">Cristales</p>
|
||||||
<div class="snapshot-grid">
|
<div class="snapshot-grid">
|
||||||
<template x-for="[grado, precio] in Object.entries(snapshotCristales())" :key="grado">
|
<template x-for="[grado, precio] in filteredSnapshotCristales" :key="grado">
|
||||||
<div class="snapshot-row">
|
<div class="snapshot-row">
|
||||||
<span class="text-xs text-muted" x-text="'Cristal ' + grado"></span>
|
<span class="text-xs text-muted" x-text="'Cristal ' + grado"></span>
|
||||||
<span class="text-mono text-xs" x-text="fmtAdena(precio)"></span>
|
<span class="text-mono text-xs" x-text="fmtAdena(precio)"></span>
|
||||||
@@ -310,28 +310,22 @@
|
|||||||
<div>
|
<div>
|
||||||
<p class="text-xs uppercase tracking-wide text-muted mb-2">Ores</p>
|
<p class="text-xs uppercase tracking-wide text-muted mb-2">Ores</p>
|
||||||
<div class="snapshot-grid">
|
<div class="snapshot-grid">
|
||||||
<div class="snapshot-row">
|
<template x-for="ore in filteredSnapshotOres" :key="ore.key">
|
||||||
<span class="text-xs text-muted">Soul Ore</span>
|
<div class="snapshot-row">
|
||||||
<span class="text-mono text-xs" x-text="fmtAdena(snapshotOre('soulOre'))"></span>
|
<span class="text-xs text-muted" x-text="ore.label"></span>
|
||||||
<template x-if="currentOre('soulOre') !== null">
|
<span class="text-mono text-xs" x-text="fmtAdena(ore.precio)"></span>
|
||||||
<span class="diff-badge" :class="currentOre('soulOre') > snapshotOre('soulOre') ? 'diff-up' : currentOre('soulOre') < snapshotOre('soulOre') ? 'diff-down' : 'diff-same'"
|
<template x-if="currentOre(ore.key) !== null">
|
||||||
x-text="currentOre('soulOre') !== snapshotOre('soulOre') ? (currentOre('soulOre') > snapshotOre('soulOre') ? '+' : '') + pctDiff(currentOre('soulOre'), snapshotOre('soulOre')) : '=='"></span>
|
<span class="diff-badge" :class="currentOre(ore.key) > ore.precio ? 'diff-up' : currentOre(ore.key) < ore.precio ? 'diff-down' : 'diff-same'"
|
||||||
</template>
|
x-text="currentOre(ore.key) !== ore.precio ? (currentOre(ore.key) > ore.precio ? '+' : '') + pctDiff(currentOre(ore.key), ore.precio) : '=='"></span>
|
||||||
</div>
|
</template>
|
||||||
<div class="snapshot-row">
|
</div>
|
||||||
<span class="text-xs text-muted">Spirit Ore</span>
|
</template>
|
||||||
<span class="text-mono text-xs" x-text="fmtAdena(snapshotOre('spiritOre'))"></span>
|
|
||||||
<template x-if="currentOre('spiritOre') !== null">
|
|
||||||
<span class="diff-badge" :class="currentOre('spiritOre') > snapshotOre('spiritOre') ? 'diff-up' : currentOre('spiritOre') < snapshotOre('spiritOre') ? 'diff-down' : 'diff-same'"
|
|
||||||
x-text="currentOre('spiritOre') !== snapshotOre('spiritOre') ? (currentOre('spiritOre') > snapshotOre('spiritOre') ? '+' : '') + pctDiff(currentOre('spiritOre'), snapshotOre('spiritOre')) : '=='"></span>
|
|
||||||
</template>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<p class="text-xs uppercase tracking-wide text-muted mb-2">Precios de venta</p>
|
<p class="text-xs uppercase tracking-wide text-muted mb-2">Precios de venta</p>
|
||||||
<div class="snapshot-grid" style="font-size:0.7rem">
|
<div class="snapshot-grid" style="font-size:0.7rem">
|
||||||
<template x-for="[key, precio] in Object.entries(snapshotVenta())" :key="key">
|
<template x-for="[key, precio] in filteredSnapshotVenta" :key="key">
|
||||||
<div class="snapshot-row">
|
<div class="snapshot-row">
|
||||||
<span class="text-xs text-muted" x-text="tipoShort(key.split('-')[0]) + ' ' + key.split('-')[1]"></span>
|
<span class="text-xs text-muted" x-text="tipoShort(key.split('-')[0]) + ' ' + key.split('-')[1]"></span>
|
||||||
<span class="text-mono text-xs" x-text="fmtAdena(precio)"></span>
|
<span class="text-mono text-xs" x-text="fmtAdena(precio)"></span>
|
||||||
@@ -594,6 +588,46 @@
|
|||||||
return this.modalDetails.items.reduce((s, i) => s + (i.crafteosPosibles || 0), 0);
|
return this.modalDetails.items.reduce((s, i) => s + (i.crafteosPosibles || 0), 0);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
snapshotCristalesUsed() {
|
||||||
|
const items = this.modalDetails?.items || [];
|
||||||
|
return new Set(items.map(i => i.grado));
|
||||||
|
},
|
||||||
|
|
||||||
|
snapshotOreUsed() {
|
||||||
|
const items = this.modalDetails?.items || [];
|
||||||
|
const used = new Set();
|
||||||
|
for (const item of items) {
|
||||||
|
if (item.tipo === 'Soulshot') used.add('soulOre');
|
||||||
|
else if (item.tipo === 'Spiritshot' || item.tipo === 'Blessed Spiritshot') used.add('spiritOre');
|
||||||
|
}
|
||||||
|
return used;
|
||||||
|
},
|
||||||
|
|
||||||
|
snapshotVentaUsed() {
|
||||||
|
const items = this.modalDetails?.items || [];
|
||||||
|
return new Set(items.map(i => i.tipo + '-' + i.grado));
|
||||||
|
},
|
||||||
|
|
||||||
|
filteredSnapshotCristales() {
|
||||||
|
const used = this.snapshotCristalesUsed();
|
||||||
|
const all = this.snapshotCristales();
|
||||||
|
return Object.entries(all).filter(([grado]) => used.has(grado));
|
||||||
|
},
|
||||||
|
|
||||||
|
filteredSnapshotOres() {
|
||||||
|
const used = this.snapshotOreUsed();
|
||||||
|
const result = [];
|
||||||
|
if (used.has('soulOre')) result.push({ key: 'soulOre', label: 'Soul Ore', precio: this.snapshotOre('soulOre') });
|
||||||
|
if (used.has('spiritOre')) result.push({ key: 'spiritOre', label: 'Spirit Ore', precio: this.snapshotOre('spiritOre') });
|
||||||
|
return result;
|
||||||
|
},
|
||||||
|
|
||||||
|
filteredSnapshotVenta() {
|
||||||
|
const used = this.snapshotVentaUsed();
|
||||||
|
const all = this.snapshotVenta();
|
||||||
|
return Object.entries(all).filter(([key]) => used.has(key));
|
||||||
|
},
|
||||||
|
|
||||||
snapshotCristales() {
|
snapshotCristales() {
|
||||||
if (!this.modalDetails?.snapshot?.insumos?.cristales) return {};
|
if (!this.modalDetails?.snapshot?.insumos?.cristales) return {};
|
||||||
return this.modalDetails.snapshot.insumos.cristales;
|
return this.modalDetails.snapshot.insumos.cristales;
|
||||||
|
|||||||
Reference in New Issue
Block a user