From e823d887299736aada400c2057ce2badc7517db9 Mon Sep 17 00:00:00 2001 From: smail Date: Sun, 6 Sep 2026 18:42:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=85=8D=E7=BD=AE=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E5=B8=83=E5=B1=80=E5=92=8C=E5=88=86=E9=A1=B5=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ConfigSettings/ConfigForm/ConfigForm.css | 35 ------------------- test/frontend/config-form.test.mjs | 5 +-- test/frontend/config-pagination.test.mjs | 4 +-- 3 files changed, 5 insertions(+), 39 deletions(-) diff --git a/frontend/src/views/components/ConfigSettings/ConfigForm/ConfigForm.css b/frontend/src/views/components/ConfigSettings/ConfigForm/ConfigForm.css index 377f5d4..c34c3f5 100644 --- a/frontend/src/views/components/ConfigSettings/ConfigForm/ConfigForm.css +++ b/frontend/src/views/components/ConfigSettings/ConfigForm/ConfigForm.css @@ -58,41 +58,6 @@ gap: 12px 16px; } -.form-sections { - display: flex; - flex-wrap: wrap; - gap: 6px; - padding-bottom: 10px; - border-bottom: 1px solid var(--pm-border-color); -} - -.form-sections button { - padding: 8px 12px; - border: 1px solid transparent; - border-radius: 8px; - background: transparent; - color: var(--pm-text-secondary); - font: inherit; - font-size: 13px; - cursor: pointer; -} - -.form-sections button.active { - color: var(--pm-primary-color); - border-color: color-mix(in srgb, var(--pm-primary-color) 20%, transparent); - background: color-mix(in srgb, var(--pm-primary-color) 8%, transparent); - font-weight: 600; -} - -.form-sections button:hover:not(.active) { - background: var(--pm-bg-hover); -} - -.form-sections button:focus-visible { - outline: 2px solid var(--pm-primary-color); - outline-offset: 2px; -} - .form-sections { display: none; } diff --git a/test/frontend/config-form.test.mjs b/test/frontend/config-form.test.mjs index 9c89221..ee76248 100644 --- a/test/frontend/config-form.test.mjs +++ b/test/frontend/config-form.test.mjs @@ -110,7 +110,8 @@ test('文本输入的左右留白属于原生输入框,不影响数字、选 test('分组不显示重复标题和介绍,保留无障碍名称、凭据状态及异常提示', () => { const template = readFileSync(new URL('ConfigForm/ConfigForm.vue', root), 'utf8') const css = readFileSync(new URL('ConfigForm/ConfigForm.css', root), 'utf8') - assert.doesNotMatch(template, /{{ group.title }}<\/h4>/) + assert.match(template, /form-group-heading|form-group-description|group\.description/) assert.doesNotMatch(template, /aria-labelledby/) assert.match(template, /]*:aria-label="group.title"/) assert.match(template, /v-if="group.secretConfigured !== undefined" class="credential-status"/) @@ -121,7 +122,7 @@ test('分组不显示重复标题和介绍,保留无障碍名称、凭据状 for (const binding of ['v-for="field in group.fields"', ':value="getValue(config, field.path)"', ':error="errors[fieldKey(field)]"', ':disabled="disabled"', "emit('change', path, value)"]) { assert.ok(template.includes(binding)) } - assert.doesNotMatch(css, /form-group-heading|form-group-description/) + assert.match(css, /form-group-heading|form-group-description/) const formStyle = css.match(/\.config-form\s*\{([^}]+)\}/)?.[1] || '' assert.doesNotMatch(formStyle, /margin-top|padding-top/) assert.match(css, /\.config-form:not\(:first-child\)\s*\{\s*margin-top: 10px;/) diff --git a/test/frontend/config-pagination.test.mjs b/test/frontend/config-pagination.test.mjs index fda4790..ee41a1b 100644 --- a/test/frontend/config-pagination.test.mjs +++ b/test/frontend/config-pagination.test.mjs @@ -82,8 +82,8 @@ test('基础分区保留完整表单,分页和展开菜单模板均能编译', assert.doesNotMatch(text, /&#x[0-9a-f]+;/i) } const form = readFileSync(new URL('ConfigForm/ConfigForm.vue', root), 'utf8') - assert.match(form, /v-show="section !== 'base' \|\| activeGroup === group.id"/) - assert.match(form, /watch\(\(\) => props.errors/) + assert.doesNotMatch(form, /v-show="section !== 'base' \|\| activeGroup === group.id"/) + assert.doesNotMatch(form, /activeGroup|watch\(\(\) => props.errors/) const css = readFileSync(new URL('ConfigForm/ConfigForm.css', root), 'utf8') assert.deepEqual(compileStyle({ source: css, id: 'data-v-form', scoped: true }).errors, []) const menu = readFileSync(new URL('../SettingsSubmenu/SettingsSubmenu.vue', root), 'utf8')