Drop duplicated card name from the slab inside the history modal

This commit is contained in:
Barely Removable 2026-08-22 09:51:30 -07:00
parent cc104e7e35
commit 5ef97ad4ad

View file

@ -124,7 +124,7 @@ const SEVERITY_LABEL = {
const gradeState = { files: [], result: null, busy: false }; const gradeState = { files: [], result: null, busy: false };
function renderGradeBlock(g) { function renderGradeBlock(g, opts = {}) {
if (!g) return ''; if (!g) return '';
const m = g.edge_measurements || null; const m = g.edge_measurements || null;
let measuredLine = ''; let measuredLine = '';
@ -160,7 +160,7 @@ function renderGradeBlock(g) {
<div class="note">A photo can't show surface scratches, print lines, or light edge wear the <div class="note">A photo can't show surface scratches, print lines, or light edge wear the
way a grader's raking light does — and a seller's listing photo is often lit to hide them. way a grader's raking light does — and a seller's listing photo is often lit to hide them.
Treat this as a rough screen, not a prediction of what it comes back as.</div> Treat this as a rough screen, not a prediction of what it comes back as.</div>
<div style="margin:14px 0">${renderSlab(g)}</div> <div style="margin:14px 0">${renderSlab(g, opts)}</div>
<div class="table-scroll"><table class="grid"><tbody>${rows}</tbody></table></div> <div class="table-scroll"><table class="grid"><tbody>${rows}</tbody></table></div>
${(g.limitations || []).length ? `<div style="margin-top:10px"><strong>Couldn't check:</strong> ${(g.limitations || []).length ? `<div style="margin-top:10px"><strong>Couldn't check:</strong>
<ul>${g.limitations.map((l) => `<li>${esc(l)}</li>`).join('')}</ul></div>` : ''} <ul>${g.limitations.map((l) => `<li>${esc(l)}</li>`).join('')}</ul></div>` : ''}
@ -194,7 +194,7 @@ function renderSlab(g, opts = {}) {
<div class="slab ${slabClass(grade)}"> <div class="slab ${slabClass(grade)}">
<div class="slab-main"> <div class="slab-main">
${g.card_type ? `<div><span class="card-type-tag">${esc(TYPE_LABEL[g.card_type] || 'Card')}</span></div>` : ''} ${g.card_type ? `<div><span class="card-type-tag">${esc(TYPE_LABEL[g.card_type] || 'Card')}</span></div>` : ''}
<div class="slab-title">${esc(title)}</div> ${opts.hideTitle ? '' : `<div class="slab-title">${esc(title)}</div>`}
<div class="slab-sub">${esc(bits)}</div> <div class="slab-sub">${esc(bits)}</div>
</div> </div>
<div class="slab-grade"> <div class="slab-grade">
@ -361,7 +361,7 @@ function renderEntryModal(g) {
</div> </div>
<div class="cardcell-meta" style="margin-bottom:10px">${esc(fmtWhen(g.created_at))} · <div class="cardcell-meta" style="margin-bottom:10px">${esc(fmtWhen(g.created_at))} ·
${g.usage && g.usage.model ? esc(g.usage.model) : ''}</div> ${g.usage && g.usage.model ? esc(g.usage.model) : ''}</div>
${renderGradeBlock(g)} ${renderGradeBlock(g, { hideTitle: true })}
<div class="drawer-actions"> <div class="drawer-actions">
<input class="input" id="entry-label" placeholder="Rename this card…" value="${esc(g.label || '')}" style="flex:1 1 200px"> <input class="input" id="entry-label" placeholder="Rename this card…" value="${esc(g.label || '')}" style="flex:1 1 200px">
<button class="btn btn-quiet btn-sm" id="entry-save-label">Save name</button> <button class="btn btn-quiet btn-sm" id="entry-save-label">Save name</button>