From a4eacf44b8a5666f061665dee3d70e2fb4fe1998 Mon Sep 17 00:00:00 2001 From: Sycun <165354365+Sycun@users.noreply.github.com> Date: Sun, 15 Nov 2026 11:11:28 +0800 Subject: [PATCH] fix(ui): use square corners for all detail drawers --- docs/ui-design-system.md | 2 +- scripts/check-ui-design-system.cjs | 9 ++++++++- scripts/ui-realistic-scenarios.cjs | 8 ++++++++ web/static/css/design-system.css | 7 ++----- web/templates/index.html | 2 +- 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/docs/ui-design-system.md b/docs/ui-design-system.md index 09155030..08c60043 100644 --- a/docs/ui-design-system.md +++ b/docs/ui-design-system.md @@ -1,7 +1,7 @@ # 界面样式约定 主应用的公共样式位于 `web/static/css/design-system.css`,在模块与移动端 CSS 后加载。 -颜色沿用现有主题变量;卡片圆角 16px,控件圆角 10px,桌面正文内边距 24px,移动端 16px。 +颜色沿用现有主题变量;抽屉外框统一为直角,卡片圆角 16px,控件圆角 10px,桌面正文内边距 24px,移动端 16px。 状态色、选中态、图表、终端和工作流画布保留各自的业务语义。 ## 容器选择 diff --git a/scripts/check-ui-design-system.cjs b/scripts/check-ui-design-system.cjs index e2f81f8f..c23a6b0e 100644 --- a/scripts/check-ui-design-system.cjs +++ b/scripts/check-ui-design-system.cjs @@ -107,6 +107,12 @@ const server = http.createServer((req, res) => { w: r.width, h: r.height, bg: s.backgroundColor, + corners: [ + s.borderTopLeftRadius, + s.borderTopRightRadius, + s.borderBottomRightRadius, + s.borderBottomLeftRadius, + ], overflow: b ? b.scrollWidth > b.clientWidth + 2 : false, footer: p .querySelector( @@ -134,7 +140,8 @@ const server = http.createServer((req, res) => { Math.abs(info.x + info.w - width) > 2 || Math.abs(info.h - height) > 2 || info.footer > height + 1 || - info.overflow + info.overflow || + info.corners.some((radius) => radius !== "0px") ) findings.push({ width, theme, ...info }); if ( diff --git a/scripts/ui-realistic-scenarios.cjs b/scripts/ui-realistic-scenarios.cjs index 85f7adaf..e175e989 100644 --- a/scripts/ui-realistic-scenarios.cjs +++ b/scripts/ui-realistic-scenarios.cjs @@ -387,9 +387,11 @@ module.exports = async function ({ page, width, height, theme, out }) { const native = await page.locator("#da-form-drawer").evaluate((e) => ({ rect: e.getBoundingClientRect().toJSON(), bg: getComputedStyle(e).backgroundColor, + radius: getComputedStyle(e).borderRadius, expand: !!e.querySelector(".app-drawer-expand"), })); assert(native.expand); + assert.equal(native.radius, "0px"); assert(Math.abs(native.rect.right - width) < 2, JSON.stringify(native)); assert(Math.abs(native.rect.height - height) < 2); assert.equal( @@ -427,6 +429,12 @@ module.exports = async function ({ page, width, height, theme, out }) { await page.locator("#da-inspector .app-drawer-expand").count(), 1, ); + assert.equal( + await page + .locator("#da-inspector") + .evaluate((e) => getComputedStyle(e).borderRadius), + "0px", + ); await shot("assessment-detail"); await page.keyboard.press("Escape"); await activate("page-vulnerabilities"); diff --git a/web/static/css/design-system.css b/web/static/css/design-system.css index ae822681..08c0d08c 100644 --- a/web/static/css/design-system.css +++ b/web/static/css/design-system.css @@ -93,7 +93,7 @@ html body [data-ui-surface="drawer"] > :is(.modal-content, .projects-modal-dialo padding: 0 !important; border: 0; border-inline-start: 1px solid var(--ui-border); - border-radius: var(--ui-radius-card) 0 0 var(--ui-radius-card) !important; + border-radius: 0 !important; display: flex; flex-direction: column; overflow: hidden !important; @@ -102,9 +102,6 @@ html body [data-ui-surface="drawer"] > :is(.modal-content, .projects-modal-dialo box-shadow: var(--ui-panel-shadow); animation: app-panel-in .18s ease-out !important; } -html[dir="rtl"] body [data-ui-surface="drawer"] > :is(.modal-content, .projects-modal-dialog, .c2-modal) { - border-radius: 0 var(--ui-radius-card) var(--ui-radius-card) 0 !important; -} html body [data-ui-surface="drawer"] :is(.modal-header, .projects-modal-header, .c2-modal-header, .vulnerability-inspector-header, .da-drawer-header) { display: flex; align-items: center; @@ -272,7 +269,7 @@ html body dialog.da-drawer[data-ui-surface="drawer"] { height: 100dvh; border: 0; border-inline-start: 1px solid var(--ui-border); - border-radius: var(--ui-radius-card) 0 0 var(--ui-radius-card); + border-radius: 0; background: var(--ui-surface) !important; box-shadow: var(--ui-panel-shadow); } diff --git a/web/templates/index.html b/web/templates/index.html index efb3daf3..c4dceea2 100644 --- a/web/templates/index.html +++ b/web/templates/index.html @@ -51,7 +51,7 @@ - +