Skip to content

Give every Bot a Profile banner - #1224

Merged
DoodleBears merged 6 commits into
mainfrom
claude/festive-planck-zr224p
Oct 8, 2026
Merged

DoodleBears merged 6 commits into
mainfrom
claude/festive-planck-zr224p

Conversation

@DoodleBears

Copy link
Copy Markdown
Contributor

#1092 | claim | parent #1083 | ADR-0138

Closes #1092 · Agent task: claude-code/cloud/session_01BQpR15vEqLoFoMKRRFypEW

Why the change

Until now the Profile header had an empty grey banner strip. With @botharness/pixel-banner 0.1.0 (BotHarness/BotPixel#8) now on npm, every Bot gets a pixel nature scene there and in the popover. Users can pick a scene, reroll it, upload their own 3:1 image or reset it, and the banner travels with the Bot through bot.json, Bot Zip and Git import.

Special things to note

  • Merge risk: this is a two-way door. The new optional banner field in the record and bot.json is ignored by older builds, and reverting leaves only an unused .botharness/banner.png. The blast radius is medium: every Bot gets one extra Memory commit, either at its next Host start or when it is created. Review focus:
    • registry.ts: seeding in create, setBanner, and dropping a damaged banner in decode;
    • bot-descriptor-sync.ts: always writes banner.png;
    • the new botBannerSet RPC.
  • "First open" means the next Host start. Existing Bots get their name-seeded banner from backfillBotBanners at startup, next to the existing descriptor backfill, instead of on first open in the client. This happens once, deterministically, and leaves no write-on-read path.
  • Rename and Reset: a rename keeps the banner. Reset re-seeds from the Bot's current name, so after a rename, Reset can pick a different scene than creation did.
  • Uploads:
    • The crop always produces a PNG: 1500×500, or stepped down to 1200 / 900 / 600 wide to stay within 2 MB.
    • The Host checks the PNG magic bytes and an exact 3:1 IHDR, and stores the data URL in the record.
    • /api/botharness/bot-banner?slug=&v= serves it the same way the avatar route serves avatars.
    • Recipe banners are drawn in the client (a 150×50 canvas with image-rendering: pixelated), so they need no request.
  • banner.png for recipes: the Host renders it at 1500×500 with a small zlib PNG encoder in bot-banner.ts. That keeps bot.json the only source of truth while still always writing the file the issue asks for.
  • Guide images: docs/share-bot now points at /guides/share-bot/05-banner-{zh,en}.webp. The source images are docs/assets/pr/1092-profile-banner/guide-05-banner-*.webp. They still need copying into the site (03- is already taken there), which belongs with Marketplace Worker and site show the Profile Banner and Bio #1093.
  • Checked on a real Host:
    • Startup backfill gave the existing Bot Ada a seeded autumn banner, written in a new Memory commit.
    • Creating "Banner QA" over RPC saved seededBannerRecipe('Banner QA'), and renaming it kept that banner.
    • Uploading a 1600×900 image saved { image: '.botharness/banner.png' } and a 1500×500 PNG.
    • A Bot Zip export and import produced a byte-identical banner.png.

Change outline

 packages/core/src/
+  bots/bot-banner.ts           BotBanner type, isBotBanner (3:1 PNG ≤ 2 MB or known scene), seeding, PNG encoder
+  bots/banner-http.ts          GET /api/botharness/bot-banner, botBannerSummary
   bots/persona-bot.ts          record.banner
   bots/registry.ts             create seeds banner · setBanner · decode drops a damaged banner · import reads bot.json banner
   bots/bot-descriptor-sync.ts  bot.json banner + always write .botharness/banner.png · backfillBotBanners
   bots/shared-presentation.ts  readSharedBanner (zip / Git import)
   bots/bot-zip.ts              banner.png always included in export
   marketplace/descriptor.ts    parse `banner` ({recipe:{scene,seed}} | {image})
   bridge/methods.ts, rpc.ts    summary.banner · botBannerSet(channelId, banner | null)
   plugin.ts                    banner route · startup backfill
 packages/client/src/client/
+  bot-banner.tsx               BotBannerArt: canvas for recipes, <img> for uploads
   profile-header.tsx           banner + Change banner → BannerModal (scenes, Reroll, Upload, Reset)
   personabot-avatar-crop.tsx   ImageCropModal shared by avatar (1:1) and BannerCropModal (3:1)
   personabot-profile.tsx       popover banner
   bridge.ts, actions.ts, store.ts, locale.ts, styles.ts
 docs/share-bot, docs/bot-zip (en + zh) · CHANGELOG.md / CHANGELOG.zh.md
<ProfileHeader>
  <div .bh-profile-banner>
    <BotBannerArt banner={bot.banner ?? seeded(name)} />
    <button>Change banner</button>
  <BannerModal>
    <preview/> [Reroll] [Upload] [Reset]
    <radiogroup> 10 × scene thumbnails (same seed) </radiogroup>
    <BannerCropModal/>          3:1 crop → PNG data URL → draft
    Save → actions.setBotBanner(channelId, draft)

Profile, 1440 × 900

Before: an empty banner strip.

Before: empty banner strip

After:

zh en
Light screenshot screenshot
Dark screenshot screenshot

Change banner

zh en
Light screenshot screenshot
Dark screenshot screenshot

Upload: 3:1 crop, then the saved banner

Crop Uploaded

Popover

zh en
Light screenshot screenshot
Dark screenshot screenshot

All captures are in docs/assets/pr/1092-profile-banner.

Verification

  • pnpm typecheck, pnpm lint and pnpm changelog:check pass.
  • Core and market: 1,595 tests pass. That includes the new bot-banner.test.ts (7 tests), which covers seeding, rename, recipe and upload storage, invalid input, the zip round trip, startup backfill, the HTTP route and dropping a damaged banner. The bridge test covers botBannerSet.
  • Client: 992 tests pass, including the new profile-banner.test.ts. As on main, client-observer.test.ts fails to load on local Node 22; CI uses Node 24.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BQpR15vEqLoFoMKRRFypEW


Generated by Claude Code

claude added 6 commits October 8, 2026 13:02
…reation (#1089)

`profileActivity` accepts an optional `before` day and `weeks` (1–104)
and returns that earlier window plus the Bot's `createdDay`. The event
and Memory commit heatmaps size their week columns from the card width,
newest week on the right, and load older weeks as the user scrolls left
until the creation week; popover heatmaps fill their width without
scrolling. The per-reason event list moves into the day tooltip.
Counting is unchanged: Bot Inbox Admissions and Memory commits.

Issue: #1089
Agent-Task: claude-code/cloud/session_01BQpR15vEqLoFoMKRRFypEW

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQpR15vEqLoFoMKRRFypEW
The day tooltip shifts with its cell's position so a cell near either
edge no longer pushes the tooltip outside the card.

Issue: #1089
Agent-Task: claude-code/cloud/session_01BQpR15vEqLoFoMKRRFypEW

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQpR15vEqLoFoMKRRFypEW
Interface strings no longer show Human, PersonaBot, Source Event or
Attention in Chinese or English. The stored default human name "Human"
is displayed as "你 / You", the connector section is always
"External connectors", and docs quoting those labels follow. A locale
test fails if the internal terms come back.

Issue: #1090
Agent-Task: claude-code/cloud/session_01BQpR15vEqLoFoMKRRFypEW

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQpR15vEqLoFoMKRRFypEW
New Bots save a pixel-banner recipe seeded from their name; renames keep
it and existing Bots get one at Host startup. The Profile header and
popover render it, and Change banner picks a scene, rerolls, uploads an
image cropped to 3:1, or resets to the generated scene. bot.json
records the banner, .botharness/banner.png is always written, and Bot
Zip export/import and Git import keep it. An uploaded banner is served
from /api/botharness/bot-banner.

Issue: #1092
Agent-Task: claude-code/cloud/session_01BQpR15vEqLoFoMKRRFypEW

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQpR15vEqLoFoMKRRFypEW
@coderabbitai

coderabbitai Bot commented Oct 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 44 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 56e47225-811f-4d34-8cd7-0c5b32f7d9ef
📥 Commits

Reviewing files that changed from the base of the PR and between fe08fd9 and b898617.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (56)
  • CHANGELOG.md
  • CHANGELOG.zh.md
  • docs/assets/pr/1092-profile-banner/README.md
  • docs/assets/pr/1092-profile-banner/before-profile-zh-light.webp
  • docs/assets/pr/1092-profile-banner/crop-en-light.webp
  • docs/assets/pr/1092-profile-banner/crop-zh-light.webp
  • docs/assets/pr/1092-profile-banner/editor-en-dark.webp
  • docs/assets/pr/1092-profile-banner/editor-en-light.webp
  • docs/assets/pr/1092-profile-banner/editor-zh-dark.webp
  • docs/assets/pr/1092-profile-banner/editor-zh-light.webp
  • docs/assets/pr/1092-profile-banner/guide-05-banner-en.webp
  • docs/assets/pr/1092-profile-banner/guide-05-banner-zh.webp
  • docs/assets/pr/1092-profile-banner/popover-en-dark.webp
  • docs/assets/pr/1092-profile-banner/popover-en-light.webp
  • docs/assets/pr/1092-profile-banner/popover-zh-dark.webp
  • docs/assets/pr/1092-profile-banner/popover-zh-light.webp
  • docs/assets/pr/1092-profile-banner/profile-en-dark.webp
  • docs/assets/pr/1092-profile-banner/profile-en-light.webp
  • docs/assets/pr/1092-profile-banner/profile-zh-dark.webp
  • docs/assets/pr/1092-profile-banner/profile-zh-light.webp
  • docs/assets/pr/1092-profile-banner/uploaded-zh-light.webp
  • docs/bot-zip.md
  • docs/bot-zip.zh.md
  • docs/share-bot.md
  • docs/share-bot.zh.md
  • packages/client/package.json
  • packages/client/src/client/actions.ts
  • packages/client/src/client/bot-banner.tsx
  • packages/client/src/client/bridge.ts
  • packages/client/src/client/locale.ts
  • packages/client/src/client/personabot-avatar-crop.tsx
  • packages/client/src/client/personabot-profile.tsx
  • packages/client/src/client/profile-header.tsx
  • packages/client/src/client/store.ts
  • packages/client/src/client/styles.ts
  • packages/client/test/bot-sidebar.test.ts
  • packages/client/test/profile-banner.test.ts
  • packages/core/package.json
  • packages/core/src/bots/banner-http.ts
  • packages/core/src/bots/bot-banner.ts
  • packages/core/src/bots/bot-descriptor-sync.ts
  • packages/core/src/bots/bot-zip.ts
  • packages/core/src/bots/persona-bot.ts
  • packages/core/src/bots/registry.ts
  • packages/core/src/bots/shared-presentation.ts
  • packages/core/src/bridge/methods.ts
  • packages/core/src/bridge/rpc.ts
  • packages/core/src/marketplace/descriptor.ts
  • packages/core/src/plugin.ts
  • packages/core/test/bot-banner.test.ts
  • packages/core/test/bot-descriptor-sync.test.ts
  • packages/core/test/bot-zip.test.ts
  • packages/core/test/bridge-methods.test.ts
  • packages/core/test/bridge-rpc.test.ts
  • packages/core/test/plugin.test.ts
  • pnpm-workspace.yaml
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@DoodleBears
DoodleBears merged commit be30f31 into main Oct 8, 2026
2 checks passed
DoodleBears added a commit that referenced this pull request Oct 9, 2026
sync-docs generates the Share a Bot and Update DeepSeekBot guide pages
from docs/*.md, but unlike every other generated guide they were
committed. #1224 changed the Share a Bot sources without regenerating
them, so the committed pair went stale, and the in-place astro build in
changelog-public-surfaces.test.ts rewrote them on every full test run.

Untrack and ignore the four outputs, and fail a test whenever any
sync-docs page output is tracked.

Issue: #1255
Agent-Task: claude/local/docs-generated-drift

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Profile Banner in the Profile view, popover, editor and bot.json

2 participants