diff --git a/CHANGELOG.md b/CHANGELOG.md index 757e1489c3..40b1a44ac2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -81,6 +81,8 @@ Pixel Avatars can be an elf, dwarf, orc or talking flower with beards, medieval ### Fixed +- Window Companions use a flatter full speech opening, preserving the half-open mouth, saved expression, portraits and speaking rhythm ([#1241](https://github.com/BotHarness/DeepSeekBot/issues/1241)). + - Window Companion bubbles update their origin together with the character during dragging, keyboard movement and reduced-motion release, without waiting for another animation frame ([#1248](https://github.com/BotHarness/DeepSeekBot/issues/1248)). - Reading a Window Companion bubble with the keyboard or resizing the window no longer scrolls the outer stage and leaves the character above the floor; the bubble itself still scrolls ([#1173](https://github.com/BotHarness/DeepSeekBot/issues/1173)). diff --git a/CHANGELOG.zh.md b/CHANGELOG.zh.md index 75cafd51d8..564d9ffae2 100644 --- a/CHANGELOG.zh.md +++ b/CHANGELOG.zh.md @@ -81,6 +81,8 @@ ### Fixed +- 窗口伙伴说话时全张嘴改为更平的开口,保留半张嘴、原有表情、头像和说话节奏([#1241](https://github.com/BotHarness/DeepSeekBot/issues/1241))。 + - 窗口伙伴在拖拽、键盘移动与减少动效下松手时,同步更新人物和气泡来源锚点,无需等待下一动画帧([#1248](https://github.com/BotHarness/DeepSeekBot/issues/1248))。 - 用键盘阅读窗口伙伴气泡或调整窗口尺寸时,不再滚动外层舞台、让人物悬在底部上方;气泡内部仍可滚动([#1173](https://github.com/BotHarness/DeepSeekBot/issues/1173))。 diff --git a/docs/assets/pr/1241-formal-mouth/README.md b/docs/assets/pr/1241-formal-mouth/README.md new file mode 100644 index 0000000000..5c9f0ab538 --- /dev/null +++ b/docs/assets/pr/1241-formal-mouth/README.md @@ -0,0 +1,40 @@ +# Formal package mouth comparison in actual DSH + +Before: source `50b44535a8180a138268c4f52a7fb5581f61de13`, formal +`@botharness/pixel-avatar@0.8.0`. After: source +`a009678599dcc7913e0c3a26de00a856a71f2e7d`, formal `0.10.1` and explicit +Companion-only `speechMouthVersion: 2`. No local tarball or distribution patch. + +Both runs use the same isolated Profile, Bot, saved default illustrated +recipe, Chinese/light theme and 1559 × 865 viewport. Each run sends the +same requested text through the real native model and `channel_send`; +canonical reply IDs are newly committed in each run. Earlier history is +retained between runs, so the ordinary Chat history and delivery timing +differ. The opening UI and speaking samples are comparable rather than +pixel-identical captures. Keyboard focus intentionally shows the toolbar. + +`qualification.json` records equal recipe, portrait and full-text hashes. +All five captured saved, closed and half-open SVG layers match exactly; +all five full-open layers change to the new flatter artwork. The public +renderer regression independently covers the five pre-rendered turns. +Actual DOM samples observe saved, closed, half-open and open in both runs. +The native bubble close restores the saved mouth in the same document. +Fresh mounts show no historical cards. There are no console errors. + +`before.webm` (44.633 seconds) and `after.webm` (40.600 seconds) are +continuous silent official Chrome DevTools MCP screencasts, container-remuxed +only. They show real text revelation, transitions and native dismissal. +Screenshots are unfrozen speaking samples: the filenames `half-open` and +`open` describe the requested capture targets, not a phase guarantee. +The mouth changes while the tool captures; observed states immediately +before/after are included in the qualification. Use the continuous videos +to judge the moving full opening rather than claiming phase-synchronized +screenshots. No interpolation, dubbing, fake text or forced animation state. + +Owned browsers are closed after both recordings. Failed onboarding and an +initial activity-dependent turn-count assumption are retained privately and +excluded. The successful runs have five layers in both captured snapshots; +the component normally reduces to its base pose when Activity becomes idle. +Human accepted the formal after recording on 2026-10-09, confirming the +new full opening, preserved half-open mouth and restored expression. Current +delivery status is tracked in Issue #1241 and PR #1254. diff --git a/docs/assets/pr/1241-formal-mouth/after-dismissed.png b/docs/assets/pr/1241-formal-mouth/after-dismissed.png new file mode 100644 index 0000000000..63703739cd Binary files /dev/null and b/docs/assets/pr/1241-formal-mouth/after-dismissed.png differ diff --git a/docs/assets/pr/1241-formal-mouth/after-half-open.png b/docs/assets/pr/1241-formal-mouth/after-half-open.png new file mode 100644 index 0000000000..0a2a9f6fbe Binary files /dev/null and b/docs/assets/pr/1241-formal-mouth/after-half-open.png differ diff --git a/docs/assets/pr/1241-formal-mouth/after-open.png b/docs/assets/pr/1241-formal-mouth/after-open.png new file mode 100644 index 0000000000..4c333d2423 Binary files /dev/null and b/docs/assets/pr/1241-formal-mouth/after-open.png differ diff --git a/docs/assets/pr/1241-formal-mouth/after-saved-before.png b/docs/assets/pr/1241-formal-mouth/after-saved-before.png new file mode 100644 index 0000000000..79a9edeeff Binary files /dev/null and b/docs/assets/pr/1241-formal-mouth/after-saved-before.png differ diff --git a/docs/assets/pr/1241-formal-mouth/after-speaking.png b/docs/assets/pr/1241-formal-mouth/after-speaking.png new file mode 100644 index 0000000000..c074d1b490 Binary files /dev/null and b/docs/assets/pr/1241-formal-mouth/after-speaking.png differ diff --git a/docs/assets/pr/1241-formal-mouth/after.webm b/docs/assets/pr/1241-formal-mouth/after.webm new file mode 100644 index 0000000000..02d7738253 Binary files /dev/null and b/docs/assets/pr/1241-formal-mouth/after.webm differ diff --git a/docs/assets/pr/1241-formal-mouth/before-dismissed.png b/docs/assets/pr/1241-formal-mouth/before-dismissed.png new file mode 100644 index 0000000000..0e942aba15 Binary files /dev/null and b/docs/assets/pr/1241-formal-mouth/before-dismissed.png differ diff --git a/docs/assets/pr/1241-formal-mouth/before-half-open.png b/docs/assets/pr/1241-formal-mouth/before-half-open.png new file mode 100644 index 0000000000..f3554cd7cf Binary files /dev/null and b/docs/assets/pr/1241-formal-mouth/before-half-open.png differ diff --git a/docs/assets/pr/1241-formal-mouth/before-open.png b/docs/assets/pr/1241-formal-mouth/before-open.png new file mode 100644 index 0000000000..2508e36ef0 Binary files /dev/null and b/docs/assets/pr/1241-formal-mouth/before-open.png differ diff --git a/docs/assets/pr/1241-formal-mouth/before-saved-before.png b/docs/assets/pr/1241-formal-mouth/before-saved-before.png new file mode 100644 index 0000000000..4dd2bd650e Binary files /dev/null and b/docs/assets/pr/1241-formal-mouth/before-saved-before.png differ diff --git a/docs/assets/pr/1241-formal-mouth/before-speaking.png b/docs/assets/pr/1241-formal-mouth/before-speaking.png new file mode 100644 index 0000000000..37ee485a16 Binary files /dev/null and b/docs/assets/pr/1241-formal-mouth/before-speaking.png differ diff --git a/docs/assets/pr/1241-formal-mouth/before.webm b/docs/assets/pr/1241-formal-mouth/before.webm new file mode 100644 index 0000000000..e544144f1b Binary files /dev/null and b/docs/assets/pr/1241-formal-mouth/before.webm differ diff --git a/docs/assets/pr/1241-formal-mouth/qualification.json b/docs/assets/pr/1241-formal-mouth/qualification.json new file mode 100644 index 0000000000..1744641c40 --- /dev/null +++ b/docs/assets/pr/1241-formal-mouth/qualification.json @@ -0,0 +1,55 @@ +{ + "before": { + "source": "50b44535a8180a138268c4f52a7fb5581f61de13", + "formalVersion": "0.8.0" + }, + "after": { + "source": "a009678599dcc7913e0c3a26de00a856a71f2e7d", + "formalVersion": "0.10.1" + }, + "viewport": { + "width": 1559, + "height": 865 + }, + "locale": "zh-CN", + "theme": "light", + "sameProfileAndBot": true, + "recipeHash": "3fab67b8fd87ba27e391eacee28ca87c1991c9cd58e1670d85ff13640378cb3b", + "portraitHash": "285a563c4c0114e7ef9bd08224c81b6481738096e525bf5eac3ecffbb8b17677", + "bodyHash": "2e87c36b8c19dc01ee18caeb3a57cd0a343dd9cf52ffaeb16b13597989e9f334", + "identicalPortrait": true, + "identicalSavedClosedHalfOpenAllFiveLayers": true, + "changedFullOpeningAllFiveLayers": true, + "capturesAreUnfrozenSpeakingSamples": true, + "speechStates": { + "before": ["saved", "half-open", "closed", "open"], + "after": ["saved", "closed", "half-open", "open"] + }, + "captureObservedStates": { + "before": { + "half-open": { + "before": ["closed"], + "after": ["closed"] + }, + "open": { + "before": ["half-open"], + "after": ["half-open"] + } + }, + "after": { + "half-open": { + "before": ["closed"], + "after": ["closed"] + }, + "open": { + "before": ["half-open"], + "after": ["closed"] + } + } + }, + "canonicalNewReplyBoth": true, + "dismissRestoresSavedSameDocument": true, + "historicalCardsOnFreshMount": [0, 0], + "consoleErrors": [0, 0], + "ownedBrowsersClosed": true +} diff --git a/packages/core/package.json b/packages/core/package.json index eff2b7fa51..cebc305e4e 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -14,7 +14,7 @@ "./package.json": "./package.json" }, "dependencies": { - "@botharness/pixel-avatar": "0.10.0", + "@botharness/pixel-avatar": "0.10.1", "@botharness/pixel-banner": "0.1.0", "@resvg/resvg-js": "2.6.2", "silk-wasm": "3.7.1" diff --git a/packages/core/src/bots/avatar-appearance.ts b/packages/core/src/bots/avatar-appearance.ts index d7017d110c..39c5337926 100644 --- a/packages/core/src/bots/avatar-appearance.ts +++ b/packages/core/src/bots/avatar-appearance.ts @@ -137,10 +137,10 @@ export function avatarSvg( if (recipe.family === 'illustrated' && options.surface === 'companion') { if (!isIllustratedAvatarRecipe(recipe)) throw new Error('invalid Avatar recipe'); const yaw = { front: 0, left: -25, right: 25 }[recipe.pose]; - const base = pixelFigure(recipe, yaw, options); + const base = pixelFigure(recipe, yaw, { ...options, speechMouthVersion: 2 }); const turns = (options.turns ?? []) .map((delta) => { - const pose = pixelFigure(recipe, yaw + delta, options); + const pose = pixelFigure(recipe, yaw + delta, { ...options, speechMouthVersion: 2 }); const layers = `${pose.body}${pose.head}`.replaceAll( 'class="bh-illustrated-', 'data-turn-part="', diff --git a/packages/core/test/companion-mouth-artwork.test.ts b/packages/core/test/companion-mouth-artwork.test.ts new file mode 100644 index 0000000000..b9b873e768 --- /dev/null +++ b/packages/core/test/companion-mouth-artwork.test.ts @@ -0,0 +1,34 @@ +import { expect, it } from 'vitest'; +import { + avatarSvg, + AVATAR_TURNS, + DEFAULT_ILLUSTRATED_RECIPE, + illustratedAvatarSvg, +} from '../src/bots/avatar-appearance.js'; + +it('uses the flatter opening only for Companion speech and preserves portraits and accepted mouth layers', () => { + const recipe = DEFAULT_ILLUSTRATED_RECIPE; + const saved = JSON.stringify(recipe); + const options = { mouthLayers: true, turns: AVATAR_TURNS }; + const portrait = avatarSvg(recipe, options); + const companion = avatarSvg(recipe, { ...options, surface: 'companion' }); + expect(portrait).toBe(illustratedAvatarSvg(recipe, options)); + expect(avatarSvg(recipe)).toBe(illustratedAvatarSvg(recipe)); + const layers = (svg: string, state: string) => + [ + ...svg.matchAll(new RegExp(`(.*?)`, 'gu')), + ].map((match) => match[1]); + for (const state of ['saved', 'closed', 'half-open']) { + expect(layers(companion, state)).toHaveLength(5); + expect(layers(companion, state)).toEqual(layers(portrait, state)); + } + expect(layers(companion, 'open')).toHaveLength(5); + expect( + layers(companion, 'open').every((layer, index) => layer !== layers(portrait, 'open')[index]), + ).toBe(true); + expect(layers(companion, 'open')[0]).toContain( + '', + ); + expect(avatarSvg(recipe, { surface: 'companion' })).not.toContain('data-avatar-mouth='); + expect(JSON.stringify(recipe)).toBe(saved); +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5c5f38c7e6..8b2ef84f52 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -568,8 +568,8 @@ importers: packages/core: dependencies: '@botharness/pixel-avatar': - specifier: 0.10.0 - version: 0.10.0 + specifier: 0.10.1 + version: 0.10.1 '@botharness/pixel-banner': specifier: 0.1.0 version: 0.1.0 @@ -1182,8 +1182,8 @@ packages: '@botharness/botui-core@0.3.0': resolution: {integrity: sha512-ZfuyXyAtxIijqxPb7zWKu3/aO3GKT8kTzQpCBYD08t9vOp858r/xL8BsQvwjswTTH2bTZ8saXBnUgjYBRnY8xQ==} - '@botharness/pixel-avatar@0.10.0': - resolution: {integrity: sha512-U3RLvVmrQwROvch7y7kaq/r4tHZTHt6hocf3PReVSRKj7gsZiAupU2nhOUeT7o3GrRtkyGHic0ZboZ8uIpTGoA==} + '@botharness/pixel-avatar@0.10.1': + resolution: {integrity: sha512-U4tEe1IYqu+APv2mU142miD/OyRcFhv6fvv4KZVu22Q+9QRaWP9VSVLGsXX6+JPFcbn7fLkw6DUAue0JNr97dQ==} '@botharness/pixel-banner@0.1.0': resolution: {integrity: sha512-2qzZK8O73u9m97sCeQh9s/4QaRsMwCTM42n2HLxCHQNiQp7dYYhulYiYNviasr/9eAGR4ARZr3B06yOCD/Ge1A==} @@ -10799,7 +10799,7 @@ snapshots: '@botharness/botui-core@0.3.0': {} - '@botharness/pixel-avatar@0.10.0': + '@botharness/pixel-avatar@0.10.1': dependencies: '@botharness/pixel-morph': 0.2.0 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 4b2b58b0ba..61b56c888d 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -308,7 +308,7 @@ minimumReleaseAgeExclude: - '@deepseek-ai/dsh-experimental-schedule-bundle@0.2.0-rc.1' - '@deepseek-ai/dsh-host-product-telemetry-otel@0.2.0-rc.1' - '@deepseek-ai/dsh-otel@0.2.0-rc.1' - - '@botharness/pixel-avatar@0.1.0 || 0.2.0 || 0.3.0 || 0.4.0 || 0.5.0 || 0.6.0 || 0.7.0 || 0.8.0 || 0.9.0 || 0.10.0' + - '@botharness/pixel-avatar@0.1.0 || 0.2.0 || 0.3.0 || 0.4.0 || 0.5.0 || 0.6.0 || 0.7.0 || 0.8.0 || 0.9.0 || 0.10.0 || 0.10.1' - '@botharness/pixel-banner@0.1.0' - '@botharness/pixel-morph@0.1.0 || 0.2.0'