fix(admin): correct two design-system mismatches found by looking at the pages
Screenshotting the pages under dark mode and compact density (rather than trusting that design tokens were enough) turned up two mistakes repeated across every page this feature set added: - `.card` carries only the surface, border and radius — padding comes from the separate `.card-pad`. Fifteen cards were rendering with their content flush against the edges. - `.field` *is* the input box, a 40px-tall flex row. Wrapping a label plus a control in it produced a joined addon rather than a label above its field. `.field-block` is the label-above layout, and thirty-seven wrappers now use it. Both were invisible to type-checking and to the tests, which is exactly why the visual pass was worth running. Numbers in the new UI now go through formatNumber so they render as Persian digits, and the utilization page's header no longer repeats the sentence that appears under its filters verbatim. The QA driver gained a `--ui` flag: theme and density live in localStorage['clinicpro-ui'], so without seeding them dark mode and compact density cannot be screenshotted at all. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -227,9 +227,16 @@ async function withPage(url, opts, fn) {
|
||||
state: { token: access_token, refreshToken: refresh_token, isAuthenticated: true },
|
||||
version: 0,
|
||||
};
|
||||
// `--ui '{"darkMode":true,"density":"compact"}'` تم را پیش از اولین رندر میکارد.
|
||||
const ui = opts.ui
|
||||
? `localStorage.setItem('clinicpro-ui', ${JSON.stringify(
|
||||
JSON.stringify({ state: JSON.parse(opts.ui), version: 0 }),
|
||||
)});`
|
||||
: '';
|
||||
|
||||
await S('Runtime.evaluate', {
|
||||
expression: `localStorage.setItem('clinicpro-auth', ${JSON.stringify(JSON.stringify(auth))});
|
||||
localStorage.setItem('pwa-dismissed','1');`,
|
||||
localStorage.setItem('pwa-dismissed','1');${ui}`,
|
||||
});
|
||||
|
||||
// Errors before this point belong to the login page, not the page under test.
|
||||
@@ -458,6 +465,9 @@ const opts = {
|
||||
wait: Number(flag('wait', 4000)),
|
||||
full: argv.includes('--full'),
|
||||
body: flag('body', null),
|
||||
// تم و چگالی در `localStorage['clinicpro-ui']` مینشینند و بدون seed کردنشان
|
||||
// دارکمود و حالت فشرده اصلاً قابل اسکرینشات نیستند.
|
||||
ui: flag('ui', null),
|
||||
};
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user