From b7bdeab5869a78758274ff7206d64171935d37ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E5=90=89=E6=B5=A9?= <1625567290@qq.com> Date: Sun, 16 Aug 2026 22:15:09 +0800 Subject: [PATCH 1/3] fix(ui): govern icon sizes with an icon-aware check --- .github/workflows/ci.yml | 1 + .../renderer/settings/about-settings-page.tsx | 4 +- .../settings/request-customization-editor.tsx | 4 +- package-lock.json | 1 + package.json | 2 + packages/ui/stories/icons.stories.tsx | 2 +- scripts/check-icon-size.mjs | 222 ++++++++++++++++++ scripts/check-icon-size.test.mjs | 63 +++++ 8 files changed, 294 insertions(+), 5 deletions(-) create mode 100644 scripts/check-icon-size.mjs create mode 100644 scripts/check-icon-size.test.mjs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 79f7a0b236..b25d493393 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,6 +73,7 @@ jobs: - run: npm ci - run: npm run lint - run: npm run format:check + - run: npm run check:icon-size - run: npm run build - run: npm run typecheck # Generated-artifact governance. astryx-theme/maka.{css,js} are built diff --git a/apps/desktop/src/renderer/settings/about-settings-page.tsx b/apps/desktop/src/renderer/settings/about-settings-page.tsx index 75a7d58dfd..a5fad5d3b3 100644 --- a/apps/desktop/src/renderer/settings/about-settings-page.tsx +++ b/apps/desktop/src/renderer/settings/about-settings-page.tsx @@ -1,6 +1,6 @@ import { useEffect, useId, useState } from 'react'; import { Badge, Link, List, ListItem } from '@astryxdesign/core'; -import { Sparkles } from '@maka/ui/icons'; +import { ICON_SIZE, Sparkles } from '@maka/ui/icons'; import { Banner, Button, @@ -174,7 +174,7 @@ export function AboutSettingsPage(props: { onOpenKeyboardHelp?(): void }) { as_wrapper="div" className="settingsAboutHero" as="h2" - icon={ /* 64% of the 48px plate, matching .providerLogo's fill */} + icon={ /* plate glyph inside the About hero mark */} iconClassName="settingsAboutLogo" headingRowClassName="settingsAboutHeading" title="Maka" diff --git a/apps/desktop/src/renderer/settings/request-customization-editor.tsx b/apps/desktop/src/renderer/settings/request-customization-editor.tsx index 29101030e5..064b6b0c61 100644 --- a/apps/desktop/src/renderer/settings/request-customization-editor.tsx +++ b/apps/desktop/src/renderer/settings/request-customization-editor.tsx @@ -7,7 +7,7 @@ import { } from '@maka/core/runtime-policy'; import { type RequestHeaderUpdate } from '@maka/core/llm-connections'; import { Button, IconButton, TextArea, TextInput } from '@maka/ui'; -import { Trash2 } from '@maka/ui/icons'; +import { ICON_SIZE, Trash2 } from '@maka/ui/icons'; import { PasswordInput } from './password-input'; export interface RequestHeaderDraft { @@ -148,7 +148,7 @@ export function RequestHeadersEditor(props: { variant="ghost" size="sm" label={props.copy.removeHeader} - icon={