From 3dddf1f12b370881b9af7f473f17b7f94fe473b0 Mon Sep 17 00:00:00 2001 From: PeymanHonarjoo Date: Tue, 13 Oct 2026 09:23:41 +0330 Subject: [PATCH] fix(settings): center document table alignment and actions The documents table headers and cells were inheriting text-align: right from the RTL context, causing visual skewing. This change ensures they are centered. Additionally, document actions are now centered within their container. --- src/app/pages/settings/settings.page.css | 4 +++- src/app/pages/settings/settings.page.html | 4 ++-- src/app/pages/settings/settings.page.spec.ts | 20 ++++++++++++++++++++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/app/pages/settings/settings.page.css b/src/app/pages/settings/settings.page.css index 5592fbf..e4d7bc8 100644 --- a/src/app/pages/settings/settings.page.css +++ b/src/app/pages/settings/settings.page.css @@ -484,7 +484,8 @@ .documents-table th, .documents-table td { padding: 0.6rem 0.75rem; - text-align: right; + /* Every column — labels and row content alike — is centred in the RTL table. */ + text-align: center; vertical-align: top; border-bottom: 1px solid var(--color-card-border); /* Fixed layout fits the card; wrap long tokens so a cell never widens the table. */ @@ -509,6 +510,7 @@ */ .documents-actions { align-items: flex-start; + justify-content: center; flex-wrap: wrap; } diff --git a/src/app/pages/settings/settings.page.html b/src/app/pages/settings/settings.page.html index dd354d3..fb229cc 100644 --- a/src/app/pages/settings/settings.page.html +++ b/src/app/pages/settings/settings.page.html @@ -555,8 +555,8 @@ @if (doc.status === 'ready' && !isReviewNeeded(doc) && isAdmin()) { - @if (togglingDocId() === doc.id) { -
+ @if (togglingDocId() === doc.id) { +
{ } }); + it('centres the documents table headers and row cells', () => { + // Regression: headers and cells both inherited the `text-align: right` of the + // RTL table, leaving the whole table visually skewed to one side. + const fixture = TestBed.createComponent(SettingsPage); + fixture.detectChanges(); + const el = fixture.nativeElement as HTMLElement; + + const headers = Array.from(el.querySelectorAll('.documents-table thead th')); + expect(headers.length).toBe(6); + for (const header of headers) { + expect(getComputedStyle(header).textAlign).toBe('center'); + } + + const cells = Array.from(el.querySelectorAll('.documents-table tbody td')); + expect(cells.length).toBe(6); + for (const cell of cells) { + expect(getComputedStyle(cell).textAlign).toBe('center'); + } + }); + it('confirms before removing: the bin button opens a modal, cancel keeps the doc, confirm shows the MVP notice', () => { const fixture = TestBed.createComponent(SettingsPage); fixture.detectChanges();