From 6f81bcb8138da6b252753eb4c3449716e2ea47ef Mon Sep 17 00:00:00 2001 From: xmanrui <841206367@qq.com> Date: Mon, 17 Aug 2026 18:20:07 +0800 Subject: [PATCH] feat: refine plugin branding and settings layout --- README.md | 1 + assets/logo-icon.png | Bin 0 -> 7445 bytes lib/client.js | 36 +++++++++++++++++++++++++----------- plugin-src/client/build.mjs | 7 ++++++- plugin-src/client/i18n.js | 2 +- plugin-src/client/index.js | 12 +++++++++++- plugin-src/client/styles.js | 20 +++++++++++--------- test/client-ui.test.mjs | 21 ++++++++++++++------- 8 files changed, 69 insertions(+), 30 deletions(-) create mode 100644 assets/logo-icon.png diff --git a/README.md b/README.md index 6642e41..30789db 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@

让聊天机器人轻松接入 DeepSeek Harness

+

Connect IM bots to DeepSeek Harness with ease

## 中文 diff --git a/assets/logo-icon.png b/assets/logo-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..d9f7f5f0fd3bc41b6d18719a7bd511c93687874e GIT binary patch literal 7445 zcmV+w9qQtVP)BI5*CXbK~4NH_na!ABRlFBlgs8v#N((c z8cwbf{?_7`DN5mj{A;QRf)-yXEK#D@*9lN44gW08AALPP zuLSd|q9~bc7RPZJ8y#lFiseny&TZzyyLRovbtPD^DvKA-XYbxaouJczZh-_6kRVF$ z;D&-bmyjWq84$dpH5mXRS|k)&nE@0DTVQH&86hKrdxSw=W0_1YlgV!OJny^K_kZHLv5|R8=dfqn0TwRoJ9`Y+wrw}Q@6p=Yg6DY) zVs7lqsZ`>5K`-b1rQ-}eAv zL4%rL8o6l8*6k$YDdMp>*-UnIJRZBJv$K6gs--gVRVRKUas~{mX0sN zN882mc>McT?bVJO<11gkn=M;*Or8ep+j{_2u&RBrnET_-&i0jwM7$O~C#GH#FjJFh z`>V}W2xq17rR8!SgM-7{bJ^@4i!r-IgucGn&1=A}oqJFetA5ILoxf^pYpqHAJmDuq zBdN{EQYmlXq6Q|b#YmAz?xBsTL@egg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QH^ZU z&Y$cn`A68A;0vXQtNLL`t5&h<=awzIB)f0li{W)(9EbGq5O2Ell0SU1{@iohNu?~l z@8CER>{EA4bdzxSg^Cn channel.id === selected) ?? CHANNELS[0]; return h('section', { className: 'dim-page', 'aria-label': 'IM机器人设置' }, h('header', { className: 'dim-title' }, - h('p', null, '让聊天机器人轻松接入 DeepSeek Harness'), + h('div', { className: 'dim-brand' }, + h('img', { + className: 'dim-brandLogo', + src: IM_PLUGIN_LOGO_URL, + alt: 'dsh-im', + width: 48, + height: 48, + }), + h('p', null, '让聊天机器人轻松接入 DeepSeek Harness')), h('span', { className: 'dim-githubAction' }, h('a', { className: 'dim-githubLink', diff --git a/plugin-src/client/styles.js b/plugin-src/client/styles.js index 9271b1a..b296b11 100644 --- a/plugin-src/client/styles.js +++ b/plugin-src/client/styles.js @@ -11,8 +11,10 @@ const CSS = String.raw` box-sizing: border-box; } .dim-page *, .dim-page *::before, .dim-page *::after { box-sizing: border-box; } -.dim-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 26px; } -.dim-title p { margin: 0; color: var(--dsw-alias-label-primary, #1f2329); font-size: 14px; line-height: 20px; font-weight: 700; white-space: nowrap; } +.dim-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 18px; } +.dim-brand { min-width: 0; display: flex; align-items: center; gap: 12px; } +.dim-brandLogo { width: 48px; height: 48px; flex: 0 0 48px; display: block; object-fit: contain; filter: grayscale(1) contrast(1.08); } +.dim-title p { margin: 0; color: var(--dsw-alias-label-primary, #1f2329); font-size: 14px; line-height: 20px; font-weight: 600; white-space: nowrap; } .dim-githubAction { position: relative; display: inline-flex; flex: none; } .dim-githubLink { min-height: 30px; display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 0 10px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 8px; color: var(--dsw-alias-label-secondary, #646a73); background: var(--dsw-alias-bg-layer-1, #fff); font-size: 12px; line-height: normal; font-weight: 560; text-decoration: none; transition: border-color .15s ease, color .15s ease, background .15s ease; } .dim-githubLink:hover { border-color: #aeb3bb; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-interactive-bg-hover, #f7f8fa); } @@ -64,7 +66,7 @@ const CSS = String.raw` .dim-panel .dim-credentialButton:hover:not(:disabled) { border-color: #4e5969; background: var(--dsw-alias-interactive-bg-hover, #f7f8fa); } .dim-panel .dim-credentialButton[aria-pressed="true"] { border-color: #4e5969; background: var(--dsw-alias-bg-module-platform, #f2f3f5); box-shadow: inset 0 0 0 1px rgb(78 89 105 / 8%); } .dim-panel .bxf-headingTools .dim-onlineBadge, .dim-panel .dxw-tools .dim-onlineBadge, .dim-panel .ddt-tools .dim-onlineBadge { min-height: 30px; display: inline-flex; align-items: center; justify-self: end; gap: 0; padding: 0 11px; border: 0; border-radius: 999px; color: var(--dsw-alias-label-secondary, #646a73); background: var(--dsw-alias-bg-module-platform, #f2f3f5); font: inherit; font-size: 12px; font-weight: 400; line-height: normal; white-space: nowrap; } -.dim-panel .dim-channelPage { width: 100%; max-width: none; display: flex; flex-direction: column; gap: 18px; padding: 0 0 24px; color: var(--dsw-alias-label-primary, #1f2329); box-sizing: border-box; } +.dim-panel .dim-channelPage { width: 100%; max-width: none; display: flex; flex-direction: column; gap: 12px; padding: 0 0 24px; color: var(--dsw-alias-label-primary, #1f2329); box-sizing: border-box; } .dim-panel .dim-surfaceCard { position: relative; overflow: hidden; border: 1px solid var(--dsw-alias-border-l2, #e5e6eb); border-radius: 14px; background: var(--dsw-alias-bg-layer-1, #fff); box-shadow: 0 1px 2px rgb(31 35 41 / 3%); } .dim-panel .dim-surfaceCard::before { display: none; } .dim-panel .dim-surfaceBody { padding: 24px; } @@ -80,9 +82,9 @@ const CSS = String.raw` .dim-panel .dim-credentialError { margin: 0; color: var(--dsw-alias-state-error-primary, #d54941); font-size: 12px; line-height: 1.5; } .dim-panel .dim-credentialActions { margin-top: 0; } .dim-panel .dim-listSection { display: flex; flex-direction: column; gap: 0; } -.dim-panel .dim-listHeading { min-height: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 2px 0 9px; padding: 0; } +.dim-panel .dim-listHeading { min-height: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 6px; padding: 0; } .dim-panel .dim-listHeading h3 { margin: 0; color: var(--dsw-alias-label-primary, #1f2329); font-size: 14px; line-height: normal; font-weight: 650; } -.dim-panel .dim-botList { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; } +.dim-panel .dim-botList { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; } .dim-panel .dim-loadingView { padding: 38px; color: var(--dsw-alias-label-secondary, #646a73); text-align: center; } .dim-panel .dim-loadingView h3 { margin: 0 0 7px; color: var(--dsw-alias-label-primary, #1f2329); font-size: 17px; line-height: normal; font-weight: 650; } .dim-panel .dim-loadingView p { margin: 0; line-height: 1.6; } @@ -130,7 +132,7 @@ const CSS = String.raw` .dim-panel .dim-confirm { padding: 18px 24px; border-top: 1px solid var(--dsw-alias-border-l1, #eef0f3); background: var(--dsw-alias-interactive-bg-hover, #f7f8fa); } .dim-panel .dim-confirm strong, .dim-panel .dim-confirm h4 { margin: 0; color: var(--dsw-alias-label-primary, #1f2329); font-size: 14px; line-height: 1.4; font-weight: 650; } .dim-panel .dim-confirm p { margin: 7px 0 0; color: var(--dsw-alias-label-secondary, #646a73); line-height: 1.6; } -.dim-panel .dim-cardFooter { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-top: 12px; border-top: 1px solid var(--dsw-alias-border-l1, #eef0f3); } +.dim-panel .dim-cardFooter { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-top: 8px; border-top: 1px solid var(--dsw-alias-border-l1, #eef0f3); } .dim-panel .dim-cardSummary { min-width: 0; color: var(--dsw-alias-label-secondary, #646a73); font: inherit; font-size: 12px; font-weight: 400; line-height: normal; } .dim-panel .dim-cardActions { flex: none; display: flex; align-items: center; flex-wrap: nowrap; gap: 8px; margin: 0 0 0 auto; } .dim-panel .dim-cardActions .dim-cardAction { flex: none; min-height: 34px; padding: 0 13px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 8px; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-bg-layer-1, #fff); font: inherit; font-size: 13px; font-weight: 560; line-height: normal; white-space: nowrap; } @@ -138,7 +140,7 @@ const CSS = String.raw` .dim-panel .dim-cardActions .dim-cardAction[data-kind="danger"] { color: var(--dsw-alias-state-error-primary, #d54941); } .dim-panel .dim-botCard { position: relative; overflow: hidden; border: 1px solid var(--dsw-alias-border-l2, #e5e6eb); border-radius: 14px; background: var(--dsw-alias-bg-layer-1, #fff); box-shadow: 0 1px 2px rgb(31 35 41 / 3%); } .dim-panel .dim-botCard::before { display: none; } -.dim-panel .dim-botCardBody { position: relative; padding: 16px; } +.dim-panel .dim-botCardBody { position: relative; padding: 14px; } .dim-panel .dim-botCardTop { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; } .dim-panel .dim-botIdentity { min-width: 0; display: flex; align-items: center; gap: 12px; } .dim-panel .dim-botAvatar { flex: none; width: 42px; height: 42px; display: grid; place-items: center; overflow: hidden; border-radius: 12px; box-shadow: none; } @@ -151,8 +153,8 @@ const CSS = String.raw` .dim-panel .dim-botCard .dim-healthDot[data-tone="success"] { background: var(--dsw-alias-state-success-primary, #20a162); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dsw-alias-state-success-primary, #20a162) 14%, transparent); } .dim-panel .dim-botCard .dim-healthDot[data-tone="warning"] { background: var(--dsw-alias-state-warn-primary, #d97706); } .dim-panel .dim-botCard .dim-healthDot[data-tone="error"] { background: var(--dsw-alias-state-error-primary, #d54941); } -.dim-panel .dim-botMetrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 0; } -.dim-panel .dim-botMetric { min-width: 0; padding: 10px; border: 0; border-radius: 9px; background: var(--dsw-alias-interactive-bg-hover, #f7f8fa); } +.dim-panel .dim-botMetrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 8px 0; } +.dim-panel .dim-botMetric { min-width: 0; padding: 8px; border: 0; border-radius: 9px; background: var(--dsw-alias-interactive-bg-hover, #f7f8fa); } .dim-panel .dim-botMetric dt { margin: 0; color: var(--dsw-alias-label-tertiary, #8f959e); font-size: 11px; font-weight: 400; line-height: normal; } .dim-panel .dim-botMetric dd { overflow: hidden; margin: 5px 0 0; color: var(--dsw-alias-label-primary, #1f2329); font-size: 13px; font-weight: 400; line-height: normal; text-overflow: ellipsis; white-space: nowrap; } .dim-panel .dim-botCard .dim-cardFooter { margin-top: 0; } diff --git a/test/client-ui.test.mjs b/test/client-ui.test.mjs index cb8d0ec..0f69fd0 100644 --- a/test/client-ui.test.mjs +++ b/test/client-ui.test.mjs @@ -112,13 +112,18 @@ test('IM settings renders nine compact logo channel tabs without enable switches assert.match(markup, /IM机器人/); assert.match(markup, /让聊天机器人轻松接入 DeepSeek Harness/); + assert.match(markup, /class="dim-brand"/); + assert.match(markup, //); assert.match(markup, /href="https:\/\/github\.com\/xmanrui\/dsh-im"/); assert.match(markup, /target="_blank"/); assert.match(markup, /rel="noopener noreferrer"/); assert.match(markup, /aria-label="dsh-im GitHub"/); assert.match(markup, /aria-describedby="[^"]+"/); assert.match(markup, /role="tooltip"[^>]*>帮助与反馈 · 前往 GitHub } } - assert.match(styles, /\.dim-panel \.dim-channelPage \{[^}]*flex-direction: column;[^}]*gap: 18px;/); + assert.match(styles, /\.dim-panel \.dim-channelPage \{[^}]*flex-direction: column;[^}]*gap: 12px;/); + assert.match(styles, /\.dim-panel \.dim-listHeading \{[^}]*margin: 0 0 6px;/); + assert.match(styles, /\.dim-panel \.dim-botList \{[^}]*gap: 8px;/); assert.match(styles, /\.dim-panel \.dim-surfaceCard \{[^}]*border-radius: 14px;[^}]*box-shadow: 0 1px 2px/); assert.match(styles, /\.dim-panel \.dim-loadingView \{[^}]*padding: 38px;[^}]*text-align: center;/); assert.match(styles, /\.dim-panel \.dim-emptyView \{[^}]*grid-template-columns: minmax\(0, 1fr\) 180px;[^}]*gap: 30px;/); @@ -490,7 +497,7 @@ test('all channel card action buttons stay on one row', async () => { assert.match(feishuStyles, /\.bxf-botActions \{[^}]*flex-wrap: nowrap;/); assert.match(weixinStyles, /\.dxw-accountFooter \.dxw-actions \{[^}]*flex-wrap: nowrap;/); assert.match(dingtalkStyles, /\.ddt-accountFooter \.ddt-actions \{[^}]*flex-wrap: nowrap;/); - assert.match(imStyles, /\.dim-panel \.dim-cardFooter \{[^}]*gap: 15px;[^}]*padding-top: 12px;[^}]*border-top: 1px solid/); + assert.match(imStyles, /\.dim-panel \.dim-cardFooter \{[^}]*gap: 15px;[^}]*padding-top: 8px;[^}]*border-top: 1px solid/); assert.match(imStyles, /\.dim-panel \.dim-cardActions \.dim-cardAction \{[^}]*min-height: 34px;[^}]*border-radius: 8px;[^}]*font-size: 13px;/); assert.match(imStyles, /\.dim-panel \.dim-cardActions \.dim-cardAction\[data-kind="danger"\] \{[^}]*#d54941/); assert.doesNotMatch(feishuStyles, /\.bxf-connectedFooter \{[^}]*flex-direction: column/); @@ -502,13 +509,13 @@ test('all channel bot cards use the DingTalk card treatment', async () => { const styles = await readFile(STYLES_URL, 'utf8'); assert.match(styles, /\.dim-panel \.dim-botCard \{[^}]*border-radius: 14px;[^}]*background: var\(--dsw-alias-bg-layer-1, #fff\);[^}]*box-shadow: 0 1px 2px/); - assert.match(styles, /\.dim-panel \.dim-botCardBody \{[^}]*padding: 16px;/); + assert.match(styles, /\.dim-panel \.dim-botCardBody \{[^}]*padding: 14px;/); assert.match(styles, /\.dim-panel \.dim-botCardTop \{[^}]*align-items: flex-start;[^}]*gap: 16px;/); assert.match(styles, /\.dim-panel \.dim-botAvatar \{[^}]*width: 42px;[^}]*height: 42px;[^}]*border-radius: 12px;/); assert.match(styles, /\.dim-panel \.dim-botName h3 \{[^}]*font-size: 15px;/); assert.match(styles, /\.dim-panel \.dim-botCard \.dim-botHealth \{[^}]*background: transparent;[^}]*font-size: 12px;[^}]*font-weight: 400;/); - assert.match(styles, /\.dim-panel \.dim-botMetrics \{[^}]*grid-template-columns: repeat\(2, minmax\(0, 1fr\)\);[^}]*gap: 10px;[^}]*margin: 12px 0;/); - assert.match(styles, /\.dim-panel \.dim-botMetric \{[^}]*padding: 10px;[^}]*border: 0;[^}]*border-radius: 9px;/); + assert.match(styles, /\.dim-panel \.dim-botMetrics \{[^}]*grid-template-columns: repeat\(2, minmax\(0, 1fr\)\);[^}]*gap: 10px;[^}]*margin: 8px 0;/); + assert.match(styles, /\.dim-panel \.dim-botMetric \{[^}]*padding: 8px;[^}]*border: 0;[^}]*border-radius: 9px;/); assert.match(styles, /\.dim-panel \.dim-botMetric dd \{[^}]*margin: 5px 0 0;[^}]*font-size: 13px;[^}]*font-weight: 400;/); }); @@ -599,7 +606,7 @@ test('client registers a live bilingual locale seat for the IM settings tab', () registrations[0].component, registrations[0].options.inject(), )); - assert.match(markup, /Connect chatbots to DeepSeek Harness with ease/); + assert.match(markup, /Connect IM bots to DeepSeek Harness with ease/); assert.match(markup, /Help & feedback · Open GitHub/); assert.match(markup, />WeChat<|>Feishu<|>DingTalk<|>WeComQQ<[^]*>Slack<[^]*>Telegram<[^]*>Discord<[^]*>WhatsApp