Planner import modal: default to Mechaniken + Mitigation, rename option

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
xziino 2026-05-22 09:15:41 +02:00
parent 8f832e1a0a
commit d73dd340c2
2 changed files with 10 additions and 8 deletions

View File

@ -375,9 +375,11 @@ function aoeEventsToMechanics(aoeEvents, fightStart, phases, players, withMitiga
ev.timestamp >= p.startTime && ev.timestamp < p.endTime
);
const targetsWithData = ev.targets.filter(t => (t.unmitigatedAmount ?? 0) > 0);
const avgUnmit = targetsWithData.length > 0
? Math.round(targetsWithData.reduce((s, t) => s + t.unmitigatedAmount, 0) / targetsWithData.length)
const nonTankTargets = ev.targets.filter(t => t.role !== 'tank' && (t.unmitigatedAmount ?? 0) > 0);
const fallbackTargets = ev.targets.filter(t => (t.unmitigatedAmount ?? 0) > 0);
const relevantTargets = nonTankTargets.length > 0 ? nonTankTargets : fallbackTargets;
const avgUnmit = relevantTargets.length > 0
? Math.round(relevantTargets.reduce((s, t) => s + t.unmitigatedAmount, 0) / relevantTargets.length)
: 0;
let assignments = [];
@ -465,7 +467,7 @@ function showImportModal(data) {
}
// Reset to defaults
document.querySelectorAll('input[name="import-what"]').forEach(r => { r.checked = r.value === 'mechanics'; });
document.querySelectorAll('input[name="import-what"]').forEach(r => { r.checked = r.value === 'with-mitigations'; });
document.querySelectorAll('input[name="import-where"]').forEach(r => { r.checked = r.value === 'new'; });
document.getElementById('import-new-section').style.display = '';
document.getElementById('import-merge-section').style.display = 'none';

View File

@ -43,12 +43,12 @@
<div class="modal-section">
<div class="modal-label">Was importieren?</div>
<label class="modal-radio-label">
<input type="radio" name="import-what" value="mechanics" checked>
<span>Nur Mechaniken</span>
<input type="radio" name="import-what" value="with-mitigations" checked>
<span>Mechaniken + Mitigation</span>
</label>
<label class="modal-radio-label">
<input type="radio" name="import-what" value="with-mitigations">
<span>Mechaniken + erkannte Mitigations als Startpunkt</span>
<input type="radio" name="import-what" value="mechanics">
<span>Nur Mechaniken</span>
</label>
</div>