From 244f59904c14b2fb7e9ce5ac27a5db0d718cfab4 Mon Sep 17 00:00:00 2001 From: krisf Date: Fri, 9 Oct 2026 12:44:32 -0400 Subject: [PATCH] =?UTF-8?q?Fix=20PS=20card=20blank-body=20bug:=20table=20c?= =?UTF-8?q?lass=20cards=20collided=20with=20.cards=20display:grid=20(gap-c?= =?UTF-8?q?ards)=20=E2=80=94=20grid-on-a-table=20collapses=20rows=20to=20z?= =?UTF-8?q?ero=20height.=20Renamed=20to=20ps-tbl=20+=20smoke=20guard=20(sm?= =?UTF-8?q?oke=2088->90)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- site/app.js | 2 +- site/style.css | 10 ++++++---- tests/ui.smoke.js | 3 +++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/site/app.js b/site/app.js index 844b8ba..bde8ba3 100644 --- a/site/app.js +++ b/site/app.js @@ -681,7 +681,7 @@ }), '']); rows.push(['' + t('ps.card.atRet', { age: fmtInt(ps.startAge) }) + '', '' + m(ps.pensionAtRetirement) + t('unit.yr') + ' · ' + m(ps.pensionAtRetirement / 12) + t('unit.mo') + '']); rows.push(['' + t('ps.card.from65') + '', '' + m(ps.pensionFrom65) + t('unit.yr') + ' · ' + m(ps.pensionFrom65 / 12) + t('unit.mo') + '']); - var h = '
' + t('ps.card.title') + '
' + + var h = '
' + t('ps.card.title') + '
' + rows.map(function (r) { return ''; }).join('') + '
' + r[0] + '' + r[1] + '
'; var notes = []; if (ps.notes.indexOf('lt2') >= 0) notes.push(t('ps.card.lt2')); diff --git a/site/style.css b/site/style.css index ea22e10..d7dda59 100644 --- a/site/style.css +++ b/site/style.css @@ -155,10 +155,12 @@ input[type=range]{width:100%;accent-color:var(--blue)} .tbl-wrap{overflow:auto;max-height:340px;border:1px solid var(--line);border-radius:8px;margin-top:8px} table{border-collapse:collapse;font-size:12.5px;width:100%} th,td{padding:5px 8px;border-bottom:1px solid var(--line);text-align:right;white-space:nowrap} -/* Card-style 2-col breakdown tables (PS pension card): wrap text, fixed layout → fits 320px. */ -table.cards{table-layout:fixed} -table.cards td{white-space:normal;word-wrap:break-word;text-align:left;vertical-align:top} -table.cards td:last-child{text-align:right} +/* PS pension card breakdown table: wrap text, fixed layout → fits 320px. + NOTE: class is ps-tbl, NOT cards — .cards is display:grid (gap-cards stat grid) + and grid-on-a-table collapses the rows to zero height (invisible card body). */ +table.ps-tbl{table-layout:fixed} +table.ps-tbl td{white-space:normal;word-wrap:break-word;text-align:left;vertical-align:top} +table.ps-tbl td:last-child{text-align:right} th{position:sticky;top:0;background:var(--bg);text-align:right} td:first-child,th:first-child{position:sticky;left:0;background:var(--bg)} tr.dep td{color:var(--red)} diff --git a/tests/ui.smoke.js b/tests/ui.smoke.js index cc53457..a19a023 100644 --- a/tests/ui.smoke.js +++ b/tests/ui.smoke.js @@ -195,6 +195,9 @@ function runPs(lang, M, done) { ok('PS card bridge line (13,987.50)', M.psBridge.test(h), (h.match(M.psBridge) || [''])[0]); ok('PS card sources link PSPC canada.ca', /href="https:\/\/www\.canada\.ca/.test(h)); ok('PS card IT agreement source (2024-12-22)', /2024-12-22/.test(h)); + ok('PS card table uses non-colliding class ps-tbl (grid-on-table would blank the card)', + //.test(h) && (h.match(//g) || []).length >= 7, + 'rows=' + (h.match(//g) || []).length); ok('PS series in G2 chart', M.psSeries.test(N(q('#g2')._html)), N(q('#g2')._html).slice(0, 40)); ok('PS insight in live panel', M.psInsight.test(N(q('#panel-insight')._html)), N(q('#panel-insight')._html).slice(0, 70)); done();