Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

fix(dashboard): align API key headers and chips in RTL

Yudhi Armyndharis4abbb14fd2b8
diff --git a/dashboard/src/pages/ApiKeys.css b/dashboard/src/pages/ApiKeys.css
index 7c7cbe3f1..57dcb60b1 100644
--- a/dashboard/src/pages/ApiKeys.css
+++ b/dashboard/src/pages/ApiKeys.css
@@ -41,7 +41,7 @@
letter-spacing: 0.05em;
border-bottom: 1px solid var(--border);
padding: 1.125rem 1.5rem;
- text-align: left;
+ text-align: start;
}
.api-keys-page .keys-table tbody tr.table-row td {
@@ -562,7 +562,7 @@
.api-keys-page .keys-table tbody tr.table-row td:has(.status-badge) {
display: inline-block;
order: 3;
- margin-right: 0.5rem;
+ margin-inline-end: 0.5rem;
}
.api-keys-page .sessions-cell {
diff --git a/dashboard/src/pages/rtl-sides.test.ts b/dashboard/src/pages/rtl-sides.test.ts
new file mode 100644
index 000000000..839312aab
--- /dev/null
+++ b/dashboard/src/pages/rtl-sides.test.ts
@@ -0,0 +1,23 @@
+import { test } from 'node:test';
+import assert from 'node:assert/strict';
+import { readFileSync } from 'node:fs';
+
+// i18n/index.ts sets <html dir="rtl"> for Hebrew and Arabic. A physical left or right side in a
+// margin, padding, border, corner radius or text alignment stays put when the layout mirrors, so a
+// divider or accent bar lands on the wrong edge and a header detaches from its column.
+const PHYSICAL_SIDE =
+ /(?:margin|padding|border)-(?:left|right)\b|border-(?:top|bottom)-(?:left|right)-radius|text-align:\s*(?:left|right)/;
+
+function physicalSides(file: string): string[] {
+ const css = readFileSync(new URL(file, import.meta.url), 'utf8')
+ // Blank out comments but keep their line breaks, so a reported line number matches the file.
+ .replace(/\/\*[\s\S]*?\*\//g, comment => comment.replace(/[^\n]/g, ''));
+ return css
+ .split('\n')
+ .map((line, i) => `${file}:${i + 1}: ${line.trim()}`)
+ .filter(line => PHYSICAL_SIDE.test(line));
+}
+
+test('the API keys stylesheet uses logical sides only', () => {
+ assert.deepEqual(physicalSides('./ApiKeys.css'), []);
+});