Skip to content

Commit 575d7c4

Browse files
committed
fix(ui): preserve automatic filter matching guidance
1 parent a111afc commit 575d7c4

3 files changed

Lines changed: 10 additions & 11 deletions

File tree

packages/ui/src/components/ui/form-controls.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,22 +51,21 @@ describe("composed form controls", () => {
5151
{
5252
id: "exclude-regex",
5353
label: "排除正则",
54-
description: "每行一条,匹配到的节点会被全局排除,关闭后恢复。",
54+
description: "每行一条,按节点导入时的原始名称匹配。",
5555
descriptionPlacement: "before-control",
5656
},
5757
React.createElement(Input)
5858
)
5959
);
6060
const labelIndex = html.indexOf("排除正则");
6161
const descriptionIndex = html.indexOf(
62-
"每行一条,匹配到的节点会被全局排除,关闭后恢复。"
62+
"每行一条,按节点导入时的原始名称匹配。"
6363
);
6464
const controlIndex = html.indexOf("<input");
6565

6666
expect(labelIndex).toBeGreaterThanOrEqual(0);
6767
expect(descriptionIndex).toBeGreaterThan(labelIndex);
6868
expect(controlIndex).toBeGreaterThan(descriptionIndex);
69-
expect(html).toContain('class="space-y-1"');
7069
expect(html).toContain('aria-describedby="exclude-regex-description"');
7170
});
7271

packages/ui/src/product/converter/advanced-mode/sections/node-management/auto-processing-dialog.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,25 +127,25 @@ describe("NodeManagementAutoProcessingDialog", () => {
127127

128128
it("renders the compact wording, counts, and matching display/origin names", () => {
129129
const { html } = renderDialog();
130+
const helperText =
131+
"每行一条,按节点导入时的原始名称匹配;命中节点会在生成配置时全局排除,关闭后恢复。";
130132

131133
expect(html).toContain("自动处理");
132134
expect(html).toContain("启用");
133135
expect(html).toContain("排除正则");
134-
expect(html).toContain("每行一条,匹配到的节点会被全局排除,关闭后恢复。");
136+
expect(html).toContain(helperText);
135137
expect(html).toContain("剩余流量|套餐到期|注意事项");
136-
expect(html.indexOf("排除正则")).toBeLessThan(
137-
html.indexOf("每行一条,匹配到的节点会被全局排除,关闭后恢复。")
138+
expect(html.indexOf("排除正则")).toBeLessThan(html.indexOf(helperText));
139+
expect(html.indexOf(helperText)).toBeLessThan(
140+
html.indexOf("剩余流量|套餐到期|注意事项")
138141
);
139-
expect(
140-
html.indexOf("每行一条,匹配到的节点会被全局排除,关闭后恢复。")
141-
).toBeLessThan(html.indexOf("剩余流量|套餐到期|注意事项"));
142142
expect(html).toContain("导入 2 · 排除 1 · 保留 1");
143143
expect(html).toContain("[HK] Alpha");
144144
expect(html).toContain("原名:Alpha");
145145
expect(html).not.toContain("原名:Beta");
146146
expect(mocks.formField).toEqual(
147147
expect.objectContaining({
148-
description: "每行一条,匹配到的节点会被全局排除,关闭后恢复。",
148+
description: helperText,
149149
descriptionPlacement: "before-control",
150150
label: "排除正则",
151151
})

packages/ui/src/product/converter/advanced-mode/sections/node-management/auto-processing-dialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export function NodeManagementAutoProcessingDialog({
118118

119119
<FormField
120120
label="排除正则"
121-
description="每行一条,匹配到的节点会被全局排除,关闭后恢复。"
121+
description="每行一条,按节点导入时的原始名称匹配;命中节点会在生成配置时全局排除,关闭后恢复。"
122122
descriptionPlacement="before-control"
123123
error={validationMessage}
124124
>

0 commit comments

Comments
 (0)