Keep diagnostic health cards compact beside database details
Magent CI/CD / verify (push) Canceled after 6m1s
Magent CI/CD / deploy-prod (push) Canceled after 0s
Magent CI/CD / deploy-beta (push) Canceled after 0s

This commit is contained in:
2026-09-06 22:39:59 +12:00
parent 212ac560ec
commit bd668715a3
2 changed files with 25 additions and 0 deletions
+3
View File
@@ -6634,11 +6634,14 @@ textarea {
.diagnostics-grid { .diagnostics-grid {
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
align-items: start;
gap: 1rem; gap: 1rem;
} }
.diagnostic-card { .diagnostic-card {
display: grid; display: grid;
align-content: start;
min-width: 0;
gap: 1rem; gap: 1rem;
padding: 1rem; padding: 1rem;
border-radius: 1rem; border-radius: 1rem;
+22
View File
@@ -0,0 +1,22 @@
// Layout regression fixture using the production styles; no network calls.
const assert = require('node:assert/strict')
const path = require('node:path')
const { chromium } = require(process.env.REVIEW_PLAYWRIGHT || 'playwright')
;(async () => {
const browser = await chromium.launch({ headless: true })
try {
const page = await browser.newPage()
await page.setContent(`<main class="page"><div class="diagnostics-grid">${['Application', 'API', 'Database'].map((name, i) => `<article class="diagnostic-card"><div class="diagnostic-card-top"><h3>${name}</h3></div><div class="diagnostic-meta-grid">${['Target', 'Latency', 'Mode', 'Last checked'].map(label => `<div class="diagnostic-meta-item"><span>${label}</span><strong>Test value</strong></div>`).join('')}</div><div class="diagnostic-message">Check passed</div>${i === 2 ? '<div class="diagnostic-detail-panel">' + '<div class="diagnostic-detail-item">Database statistics</div>'.repeat(20) + '</div>' : ''}</article>`).join('')}</div></main>`)
for (const file of ['globals.css', 'ops-redesign.css']) await page.addStyleTag({ path: path.join(__dirname, '../frontend/app', file) })
for (const width of [1440, 1000, 390]) {
await page.setViewportSize({ width, height: 1000 })
const cards = await page.locator('.diagnostic-card').all()
const boxes = await Promise.all(cards.map(card => card.boundingBox()))
assert.ok(boxes[0].height < boxes[2].height / 2, 'Simple checks must not stretch to database height')
const meta = await cards[0].locator('.diagnostic-meta-item').first().boundingBox()
assert.ok(meta.height < 100, 'Metadata must stay compact')
assert.ok(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth), 'No horizontal overflow')
}
console.log('Diagnostics layout passed at desktop, tablet and mobile widths.')
} finally { await browser.close() }
})().catch(error => { console.error(error); process.exitCode = 1 })