diff --git a/.github/pr-assets/studio-companion/en-390.webp b/.github/pr-assets/studio-companion/en-390.webp new file mode 100644 index 0000000..ee310be Binary files /dev/null and b/.github/pr-assets/studio-companion/en-390.webp differ diff --git a/.github/pr-assets/studio-companion/zh-1440.webp b/.github/pr-assets/studio-companion/zh-1440.webp new file mode 100644 index 0000000..c91859f Binary files /dev/null and b/.github/pr-assets/studio-companion/zh-1440.webp differ diff --git a/package.json b/package.json index 4a1f576..42711d4 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "dependencies": { "@astryxdesign/core": "^0.6.5", "@astryxdesign/theme-neutral": "^0.6.5", - "@botharness/pixel-avatar": "^0.10.0", + "@botharness/pixel-avatar": "^0.10.2", "@botharness/pixel-banner": "^0.1.0", "@botharness/pixel-morph": "^0.2.0", "@fontsource/fusion-pixel-12px-proportional-sc": "^5.3.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1c2f4ee..46183ec 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -173,8 +173,8 @@ importers: specifier: ^0.6.5 version: 0.6.5(@astryxdesign/core@0.6.5(@stylexjs/stylex@0.19.1)(react-dom@19.3.0(react@19.3.0))(react@19.3.0))(@types/react@19.3.0)(react@19.3.0) '@botharness/pixel-avatar': - specifier: ^0.10.0 - version: 0.10.0 + specifier: ^0.10.2 + version: 0.10.2 '@botharness/pixel-banner': specifier: ^0.1.0 version: 0.1.0 @@ -451,8 +451,8 @@ packages: resolution: {integrity: sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==} engines: {node: '>=6.9.0'} - '@botharness/pixel-avatar@0.10.0': - resolution: {integrity: sha512-U3RLvVmrQwROvch7y7kaq/r4tHZTHt6hocf3PReVSRKj7gsZiAupU2nhOUeT7o3GrRtkyGHic0ZboZ8uIpTGoA==} + '@botharness/pixel-avatar@0.10.2': + resolution: {integrity: sha512-05HcqaiVOsKss4DHNn2eTsN8KdcmYNhPxCupvomSILqKtBWNSxov8OSMaRhvbvb+p8lEHCscE2zNLqiS+LBPGw==} '@botharness/pixel-banner@0.1.0': resolution: {integrity: sha512-2qzZK8O73u9m97sCeQh9s/4QaRsMwCTM42n2HLxCHQNiQp7dYYhulYiYNviasr/9eAGR4ARZr3B06yOCD/Ge1A==} @@ -2314,7 +2314,7 @@ snapshots: '@babel/helper-string-parser': 7.29.7 '@babel/helper-validator-identifier': 7.29.7 - '@botharness/pixel-avatar@0.10.0': + '@botharness/pixel-avatar@0.10.2': dependencies: '@botharness/pixel-morph': 0.2.0 diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 1f93b6f..37f927c 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -10,6 +10,6 @@ allowBuilds: # Our own BotPixel packages are trusted the day they are published. minimumReleaseAgeExclude: - - '@botharness/pixel-avatar@0.10.0' + - '@botharness/pixel-avatar@0.10.2' - '@botharness/pixel-morph@0.1.0 || 0.2.0' - '@botharness/pixel-banner@0.1.0' diff --git a/src/AvatarApp.tsx b/src/AvatarApp.tsx index de4379c..a48595e 100644 --- a/src/AvatarApp.tsx +++ b/src/AvatarApp.tsx @@ -1,6 +1,7 @@ import { Theme } from '@astryxdesign/core/theme'; import { useEffect, useState } from 'react'; import { useAvatarDesign } from './avatarDesign'; +import { BotCompanion } from './components/BotCompanion'; import { Playground } from './components/Playground'; import { SiteHeader } from './components/SiteHeader'; import { COPY, LINKS } from './content'; @@ -9,7 +10,8 @@ import { pixelTheme } from './theme'; /** * The Avatar Studio at /avatar: the stage, the part editor and the color and shape panel side by - * side. The design is the same one the home page shows, kept in this browser. + * side, with the companion walking along the bottom in the design being edited. The design is the + * same one the home page shows, kept in this browser. */ export function AvatarApp() { const lang = pathLang(); @@ -50,6 +52,8 @@ export function AvatarApp() { ยท {copy.footer.privacy}

+ {/* the same companion as on the home page, wearing the design as it is edited */} + ); } diff --git a/src/analytics.ts b/src/analytics.ts index b804980..81e4e0e 100644 --- a/src/analytics.ts +++ b/src/analytics.ts @@ -26,7 +26,8 @@ export function normalizeRef(url: URL): URL | null { export function pageKind(pathname: string) { const path = pathname.replace(/^\/en(?=\/|$)/, '') || '/'; if (path === '/') return 'home'; - const first = path.split('/')[1] ?? ''; + // dev and direct links may name the file (/avatar.html) where the site serves /avatar + const first = (path.split('/')[1] ?? '').replace(/\.html$/, ''); return ['market', 'avatar', 'docs', 'privacy', 'changelog'].includes(first) ? first : 'other'; } @@ -116,8 +117,8 @@ function consentBar(posthog: PostHog, register: () => void) { posthog.capture('$pageview', utm, { $set_once: initial }); }, ); - // The React homepage asks through its Bot; generated pages retain their consent region. - if (status !== 'pending' || pageKind(location.pathname) === 'home') return; + // The home page and the Avatar Studio ask through their Bot; other pages keep the consent bar. + if (status !== 'pending' || ['home', 'avatar'].includes(pageKind(location.pathname))) return; const t = CONSENT_COPY[pathLang()]; const bar = document.createElement('div'); bar.className = 'consent-bar frame'; diff --git a/src/components/FaceEditor.tsx b/src/components/FaceEditor.tsx index 84e7dc0..5b8a26b 100644 --- a/src/components/FaceEditor.tsx +++ b/src/components/FaceEditor.tsx @@ -219,9 +219,6 @@ function colorShown(recipe: Recipe, fields: Fields, key: string): boolean { const [field, slot] = piece; const value = fields[field] ?? (field === 'rightSideHair' ? fields.sideHair : undefined); if (field === 'strand') return value !== undefined && value !== 'none'; - // BotPixel 0.10 draws bun and odango back hair in the hair color, ignoring backHairColor - if (field === 'backHair' && (value === 'bun' || value === 'odango')) - return wornPart(recipe, slot) !== undefined; return (value !== undefined && value !== 'none') || wornPart(recipe, slot) !== undefined; }