From f71b8ab73f56853341a77befd52ce02970ab05aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D1=82=D0=BE=D0=BD=20=D0=A2=D1=80=D0=BE=D1=88?= =?UTF-8?q?=D0=B8=D0=BD?= Date: Fri, 2 Oct 2026 11:05:58 +0300 Subject: [PATCH] v3.11.0 editor polish: fixed TAR table layout, ADM placeholder The TAR table used the default auto layout with w-full, so the browser distributed the surplus width across all columns and TAR/MSL/description looked evenly spread. table-fixed with explicit column widths (TAR w-28, MSL w-20, action w-12; the description column takes the remainder) and w-full inputs keep the first two columns tight and left-packed. The ADM placeholder is just "ADM" now. sw cache simple-v365. Tests: 665 Python + 787 frontend green; the whole inline PWA script syntax-checked. --- frontend/index.html | 14 +++++++------- frontend/style.css | 4 ++++ frontend/sw.js | 2 +- frontend/tests/cards_form.test.js | 4 ++-- frontend/tests/html.test.js | 8 +++++++- 5 files changed, 21 insertions(+), 11 deletions(-) diff --git a/frontend/index.html b/frontend/index.html index b5c2010..9a855de 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -1659,19 +1659,19 @@
- +

All codes are optional

TAR - +
- - + + - +
TARMSLTARMSL Description
@@ -11897,8 +11897,8 @@ const CARDS_TAR_ROLE_DESC = { function cardsTarRowHtml(e, i) { const cls = 'border border-gray-300 dark:border-slate-600 text-sm rounded px-2 py-1.5 dark:bg-slate-800 font-mono'; const role = CARDS_TAR_ROLES[i] || ''; - let cells = '' + - ''; + let cells = '' + + ''; if (role) { cells += '' + esc(CARDS_TAR_ROLE_DESC[role] || '') + '' + ''; diff --git a/frontend/style.css b/frontend/style.css index f2fce41..4198c55 100644 --- a/frontend/style.css +++ b/frontend/style.css @@ -1024,6 +1024,10 @@ video { flex-shrink: 0; } +.table-fixed { + table-layout: fixed; +} + .border-collapse { border-collapse: collapse; } diff --git a/frontend/sw.js b/frontend/sw.js index 71b8107..2e0a30f 100644 --- a/frontend/sw.js +++ b/frontend/sw.js @@ -1,4 +1,4 @@ -const CACHE = 'simple-v364'; +const CACHE = 'simple-v365'; const URLS = [ 'index.html', 'help.html', diff --git a/frontend/tests/cards_form.test.js b/frontend/tests/cards_form.test.js index 3199906..dd3777c 100644 --- a/frontend/tests/cards_form.test.js +++ b/frontend/tests/cards_form.test.js @@ -535,8 +535,8 @@ test('packing without a selected preset uses the spec default TAR', () => { test('the TAR row values are left-aligned like the headers', () => { const out = cardsTarRowHtml({ tar: 'AF4D01', msl: '0A', desc: 'x' }, 3); assert.doesNotMatch(out, /text-center/); - assert.match(out, /]*class="w-10 shrink-0/); + // the TAR table is fixed-layout so the columns hug their content and the + // description absorbs the rest (no even spreading) + assert.match(row, //); + assert.match(row, /
<\/th>/); // the hint is the short form assert.match(row, /data-l10n="All codes are optional"/); assert.ok(!row.includes('not consumed yet'), 'the long codes hint is gone'); @@ -230,7 +236,7 @@ test('the ADM field sits in the PIN/ADM fieldset of the editor', () => { const fieldsets = [...html.matchAll(//g)].map(m => m[0]); const pinAdm = fieldsets.find(f => /data-l10n="PIN\/ADM"/.test(f)); assert.ok(pinAdm, 'PIN/ADM fieldset not found'); - assert.match(pinAdm, /id="cards-adm"[^>]*placeholder="ADM \(optional\)"/); + assert.match(pinAdm, /id="cards-adm"[^>]*placeholder="ADM"/); // the From card button sits in the editor header, above the code fields assert.ok(html.indexOf('id="cards-iccid-from-card"') < html.indexOf('id="cards-pin1"'), 'the From card button must precede the code fields');