fix(ui): use square corners for all detail drawers
This commit is contained in:
parent
24fad19a4b
commit
a4eacf44b8
|
|
@ -1,7 +1,7 @@
|
|||
# 界面样式约定
|
||||
|
||||
主应用的公共样式位于 `web/static/css/design-system.css`,在模块与移动端 CSS 后加载。
|
||||
颜色沿用现有主题变量;卡片圆角 16px,控件圆角 10px,桌面正文内边距 24px,移动端 16px。
|
||||
颜色沿用现有主题变量;抽屉外框统一为直角,卡片圆角 16px,控件圆角 10px,桌面正文内边距 24px,移动端 16px。
|
||||
状态色、选中态、图表、终端和工作流画布保留各自的业务语义。
|
||||
|
||||
## 容器选择
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@
|
|||
<link rel="stylesheet" href="/static/css/vulnerability-list.css?v=20261115-timestamps">
|
||||
<script src="/static/js/router.js?v=20261114-assessment-links"></script>
|
||||
<link rel="stylesheet" href="/static/css/deep-assessments.css?v=20261115-intents">
|
||||
<link rel="stylesheet" href="/static/css/design-system.css?v=20261115-3">
|
||||
<link rel="stylesheet" href="/static/css/design-system.css?v=20261115-square-drawers">
|
||||
</head>
|
||||
<body>
|
||||
<div id="login-overlay" class="login-overlay" style="display: none;">
|
||||
|
|
|
|||
Loading…
Reference in New Issue