Skip to content

Commit 6f28a0e

Browse files
committed
merge main and preserve CI test gates
2 parents 8a47074 + 8f8a19c commit 6f28a0e

26 files changed

Lines changed: 563 additions & 228 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ jobs:
9090
run: pnpm i18n:check
9191
- name: Skill Market tests
9292
run: pnpm --filter @dmwork/skillmarket test
93+
- name: Unified import/export unit tests
94+
run: >-
95+
pnpm --filter @octo/docs exec vitest run
96+
src/editor/EditorShell.test.tsx
97+
src/editor/fontFamilies.verify.test.ts
98+
src/editor/importFlow.markdown.test.ts
99+
src/pages/docsApi.export.test.ts
100+
src/pages/docsApi.import.test.ts
93101
- name: Build
94102
run: pnpm build
95103
- name: Lint
21 KB
Loading
42.3 KB
Loading

packages/dmworkbase/src/Components/GroupManagement/MemberPicker.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
flex: 0 0 auto;
1515
align-items: center;
1616
gap: var(--wk-sp-2);
17-
margin: var(--wk-sp-1) var(--wk-sp-4) var(--wk-sp-1);
17+
margin: var(--wk-sp-3) var(--wk-sp-4) var(--wk-sp-2);
1818
padding: 0 var(--wk-sp-3);
1919
border: 1px solid var(--wk-border-subtle);
2020
border-radius: var(--wk-r-sm);

packages/dmworkbase/src/ui/channelSetting/GroupManagementView/index.css

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@
242242

243243
.wk-group-management-remove {
244244
display: inline-flex;
245-
width: var(--wk-sp-7);
246-
height: var(--wk-sp-7);
245+
width: var(--wk-sp-6);
246+
height: var(--wk-sp-6);
247247
flex: 0 0 auto;
248248
align-items: center;
249249
justify-content: center;
@@ -253,10 +253,35 @@
253253
background: transparent;
254254
color: var(--wk-text-tertiary);
255255
cursor: pointer;
256+
line-height: 0;
256257
transition: background-color var(--wk-dur-fast) var(--wk-ease),
257258
color var(--wk-dur-fast) var(--wk-ease);
258259
}
259260

261+
.wk-group-management-remove-icon {
262+
position: relative;
263+
display: inline-flex;
264+
width: calc(var(--wk-sp-3) + var(--wk-sp-0-5));
265+
height: calc(var(--wk-sp-3) + var(--wk-sp-0-5));
266+
align-items: center;
267+
justify-content: center;
268+
border: 1px solid currentColor;
269+
border-radius: var(--wk-r-full);
270+
box-sizing: border-box;
271+
}
272+
273+
.wk-group-management-remove-icon::after {
274+
position: absolute;
275+
top: 50%;
276+
left: 50%;
277+
width: var(--wk-sp-2);
278+
height: 1px;
279+
border-radius: var(--wk-r-full);
280+
background: currentColor;
281+
content: "";
282+
transform: translate(-50%, -50%);
283+
}
284+
260285
.wk-group-management-remove:hover,
261286
.wk-group-management-remove:focus-visible {
262287
background: var(--wk-color-error-bg);

packages/dmworkbase/src/ui/channelSetting/GroupManagementView/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React from "react";
22
import { Switch } from "@douyinfe/semi-ui";
3-
import { Trash2 } from "lucide-react";
43
import WKButton from "../../../Components/WKButton";
54
import "./index.css";
65

@@ -103,7 +102,7 @@ function GroupManagementMemberRow({
103102
aria-label={`${labels.removeMember} ${labelText}`}
104103
title={labels.removeMember}
105104
>
106-
<Trash2 size={15} aria-hidden="true" />
105+
<span className="wk-group-management-remove-icon" aria-hidden="true" />
107106
</button>
108107
)}
109108
</li>

packages/dmworkmcp/src/api/mcpService.ts

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import type {
1212
McpQuickStart,
1313
UpdateMcpParams,
1414
} from "../types/mcp";
15+
import { toWireParams } from "./mcpWireParams";
1516
import {
1617
MCP_CATEGORY_LABELS,
1718
MCP_CATEGORY_ORDER,
@@ -237,6 +238,7 @@ async function updateMcpMock(
237238
next.createdByType = prev.createdByType;
238239
next.createdByBotUid = prev.createdByBotUid;
239240
next.createdByBotName = prev.createdByBotName;
241+
next.visibility = prev.visibility;
240242
MOCK_MCP_DETAILS[idx] = next;
241243
const listIdx = MOCK_MCP_LIST.findIndex((it) => it.id === id);
242244
if (listIdx !== -1) MOCK_MCP_LIST[listIdx] = projectListItem(next);
@@ -632,30 +634,6 @@ function mapDetail(raw: McpDetailWire): McpDetail {
632634
};
633635
}
634636

635-
function toWireParams(params: CreateMcpParams | UpdateMcpParams) {
636-
return {
637-
name: params.name,
638-
slug: params.slug,
639-
slogan: params.slogan,
640-
category: params.category,
641-
icon: params.icon,
642-
tags: params.tags,
643-
transport: params.transport,
644-
url: params.url,
645-
command: params.command,
646-
args: params.args,
647-
env: params.env,
648-
env_user_supplied: params.envUserSupplied,
649-
headers: params.headers,
650-
headers_user_supplied: params.headersUserSupplied,
651-
tools: params.tools,
652-
usage_examples: params.usageExamples,
653-
faqs: params.faqs,
654-
notes: params.notes,
655-
visibility: params.visibility,
656-
};
657-
}
658-
659637
async function fetchMcpListReal(
660638
params: ListMcpParams
661639
): Promise<ListMcpResponse> {
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { describe, expect, it } from "vitest";
2+
import { toWireParams } from "./mcpWireParams";
3+
import type { CreateMcpParams } from "../types/mcp";
4+
5+
const form: CreateMcpParams = {
6+
name: "GitHub MCP",
7+
slug: "github-mcp",
8+
category: "dev",
9+
icon: "",
10+
tags: [],
11+
slogan: "Issues and pull requests",
12+
transport: "streamable-http",
13+
url: "https://mcp.example.com/github",
14+
tools: [],
15+
usageExamples: [],
16+
faqs: [],
17+
notes: [],
18+
};
19+
20+
describe("toWireParams visibility", () => {
21+
it("omits visibility from create and edit payloads", () => {
22+
const payload = toWireParams(form);
23+
24+
expect(payload).not.toHaveProperty("visibility");
25+
expect(payload).toMatchObject({
26+
name: "GitHub MCP",
27+
slug: "github-mcp",
28+
transport: "streamable-http",
29+
});
30+
});
31+
});
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import type { CreateMcpParams, UpdateMcpParams } from "../types/mcp";
2+
3+
export function toWireParams(params: CreateMcpParams | UpdateMcpParams) {
4+
return {
5+
name: params.name,
6+
slug: params.slug,
7+
slogan: params.slogan,
8+
category: params.category,
9+
icon: params.icon,
10+
tags: params.tags,
11+
transport: params.transport,
12+
url: params.url,
13+
command: params.command,
14+
args: params.args,
15+
env: params.env,
16+
env_user_supplied: params.envUserSupplied,
17+
headers: params.headers,
18+
headers_user_supplied: params.headersUserSupplied,
19+
tools: params.tools,
20+
usage_examples: params.usageExamples,
21+
faqs: params.faqs,
22+
notes: params.notes,
23+
};
24+
}

packages/dmworkmcp/src/components/McpCreateModal.tsx

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import type {
2626
McpFaq,
2727
McpProbeRequest,
2828
McpTransport,
29-
McpVisibility,
3029
} from "../types/mcp";
3130
import { isImageIcon } from "../utils/icon";
3231

@@ -97,7 +96,6 @@ const EMPTY: CreateMcpParams = {
9796
usageExamples: [],
9897
faqs: [],
9998
notes: [],
100-
visibility: "public",
10199
};
102100

103101
const TRANSPORT_OPTIONS: McpTransport[] = ["stdio", "streamable-http", "sse"];
@@ -194,7 +192,6 @@ function detailToForm(detail: McpDetail): CreateMcpParams {
194192
usageExamples: detail.usageExamples,
195193
faqs: detail.faqs,
196194
notes: detail.notes,
197-
visibility: detail.visibility ?? "public",
198195
};
199196
}
200197

@@ -991,11 +988,6 @@ const McpCreateModal: React.FC<McpCreateModalProps> = ({
991988
label: t(`mcp.create.transport.${tr}`),
992989
}));
993990

994-
const visibilitySegments = [
995-
{ value: "public" as McpVisibility, label: t("mcp.create.visPublic") },
996-
{ value: "private" as McpVisibility, label: t("mcp.create.visPrivate") },
997-
];
998-
999991
// Preview src: the freshly-picked file's object URL wins; otherwise the
1000992
// stored icon (a persisted storage URL, or a legacy base64 icon on edit).
1001993
const iconSrc = iconPreview || form.icon;
@@ -1684,15 +1676,6 @@ const McpCreateModal: React.FC<McpCreateModalProps> = ({
16841676
)}
16851677
</Section>
16861678

1687-
{/* 7. 可见范围 */}
1688-
<Section full title={t("mcp.create.sectionVisibility")}>
1689-
<Segments
1690-
full
1691-
value={form.visibility}
1692-
options={visibilitySegments}
1693-
onChange={(v) => update("visibility", v)}
1694-
/>
1695-
</Section>
16961679
</>
16971680
)}
16981681
</>

0 commit comments

Comments
 (0)