Author SHA1 Message Date
PeymanHonarjoo 102ce9b909 Merge branch 'feat/backend-changes' of http://git.raymandcti.com/p.honarjoo/faq_chatbot_frontend into feat/backend-changes 2026-10-13 09:32:29 +03:30
PeymanHonarjoo 3dddf1f12b 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.
2026-10-13 09:23:41 +03:30
3 changed files with 25 additions and 3 deletions
+3 -1
View File
@@ -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;
}
+1 -1
View File
@@ -556,7 +556,7 @@
<td class="px-3 py-2.5 align-top">
@if (doc.status === 'ready' && !isReviewNeeded(doc) && isAdmin()) {
@if (togglingDocId() === doc.id) {
<div class="flex items-center gap-1.5 text-xs text-[var(--text-muted)]">
<div class="flex items-center justify-center gap-1.5 text-xs text-[var(--text-muted)]">
<svg
class="w-3 h-3 animate-spin"
viewBox="0 0 24 24"
@@ -166,6 +166,26 @@ describe('SettingsPage — document filters', () => {
}
});
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();