Skip to content

Add Corbit avatars with deterministic human fallbacks - #636

Merged
TheGreatAxios merged 18 commits into
corbitsdev:mainfrom
pratikbuilds:cursor/corbit-avatar-pastel-fallback-92f0
Sep 6, 2026
Merged

TheGreatAxios merged 18 commits into
corbitsdev:mainfrom
pratikbuilds:cursor/corbit-avatar-pastel-fallback-92f0

Conversation

@pratikbuilds

@pratikbuilds pratikbuilds commented Sep 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • add the Corbit SVG avatar for agent identities and deterministic pastel initials for people without an image
  • centralize avatar palette, fallback, SVG, and public types in packages/chat-ui/src/avatar.tsx
  • use Tailwind utilities for avatar presentation and a color-only agent picker

Validation

  • bun test packages/chat-ui/src/avatar.test.tsx packages/chat-ui/test/avatar-composition.test.tsx
  • bunx tsc --noEmit -p packages/chat-ui/tsconfig.json
  • bun run --cwd apps/web build
  • bun run check is blocked before lint/tests by pre-existing vendored @intx type mismatches in the hub and sidecar

Follow-up CL-7478 moves the pastel palette into react-ui tokens and removes the DESIGN.md exception added here.

@TheGreatAxios

Copy link
Copy Markdown
Contributor

@pratikbuilds csn you drop some screenshots here pls?

@pratikbuilds
pratikbuilds force-pushed the cursor/corbit-avatar-pastel-fallback-92f0 branch from 99b6ad4 to 1b8ea26 Compare September 4, 2026 15:53
@pratikbuilds

Copy link
Copy Markdown
Collaborator Author

yes doing it now

@pratikbuilds
pratikbuilds marked this pull request as draft September 4, 2026 16:23
@pratikbuilds

Copy link
Copy Markdown
Collaborator Author
Screenshot 2026-09-04 at 10 19 42 PM

@TheGreatAxios

TheGreatAxios commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Looks good @pratikbuilds , rebase to main as needed. Please see what's going on re why it's not passing CI and make sure to open into full PR (non draft) once ready

@TheGreatAxios
TheGreatAxios marked this pull request as ready for review September 4, 2026 17:40

@TheGreatAxios TheGreatAxios left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Make sure it passes CI please
  • Will need to think about where this avatar code should best live for Corbits but this is a great start

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Self-review

Verdict: implementation is sound — the Corbit avatar is an inline SVG (no binary asset, no license question), the pastel fallback color and its readable-text pairing are pure functions with deterministic-by-construction tests, and the human/agent split is consistently threaded through chat-ui, settings-ui, and apps/web. No code changes were needed.

Findings:

  • CONFIRMED-OPEN: resolveAvatarFill's image branch renders via a plain <img> in packages/settings-ui/src/account-section.tsx with no onerror/reportError path if the stored avatar URL 404s or fails to load. Not introduced by this PR (pre-existing <img>, only its className line changed here), so left as-is rather than widening this PR's scope — worth its own ticket.
  • DISMISSED: avatar assets are hand-authored inline SVG paths/colors in packages/chat-ui/src/avatar.tsx, not an imported binary — no license provenance concern.
  • DISMISSED: avatarColorForPrincipal/generatedAvatarStyle/readableTextOn are pure (string hash → palette index → luminance check), covered by determinism/stability tests in src/avatar.test.tsx and test/avatar-composition.test.tsx across repeated calls and multiple principals.
  • DISMISSED: packages/inbox/test/bulk-report-error.test.ts mock update is a rebase fix (error-sink's mock needed makeErrorEnvelope/parseErrorEnvelope after a since-merged main-branch change), not scope creep.
  • DISMISSED: CorbitAvatar living in packages/chat-ui rather than corbitsdev/react-ui — it's Corbit-specific agent identity, not a generic primitive, so package-level ownership is defensible; apps/web only composes it.
  • DISMISSED: no bare catch {}, no new as T on untrusted input, no exactOptionalPropertyTypes hazard in the diff.

Tests run (from packages/chat-ui):

  • bun test src/avatar.test.tsx test/avatar-composition.test.tsx test/chat-workspace.test.tsx test/team-avatar-stack.test.tsx src/chat-workspace.test.ts — 88 pass, 0 fail
  • bunx tsc --noEmit -p packages/chat-ui/tsconfig.json — clean
  • bunx tsc --noEmit -p apps/web/tsconfig.json — clean

@TheGreatAxios
TheGreatAxios force-pushed the cursor/corbit-avatar-pastel-fallback-92f0 branch from 1b8ea26 to 9af3679 Compare September 4, 2026 19:22
cursoragent and others added 10 commits September 4, 2026 12:52
…names

The pastel-fallback avatar classNames (chat-sender-avatar, chat-mention-avatar,
chat-member-avatar, chat-thread-avatar-chip) combined with Tailwind override
utilities on one line, which broke the check's class-list heuristic and let
"chat" match as banned copy. Renamed the classes (and their styles.css rules)
to drop the chat- prefix everywhere they're used.
The prior commit dropped the retired chat- prefix from the avatar
className (chat-member-avatar -> member-avatar) to satisfy
check:ui-vocabulary, but left these tests querying the old class,
so they matched zero elements.
@TheGreatAxios
TheGreatAxios force-pushed the cursor/corbit-avatar-pastel-fallback-92f0 branch from dad346e to 997d3de Compare September 4, 2026 19:52
@TheGreatAxios
TheGreatAxios merged commit 7d9d2f3 into corbitsdev:main Sep 6, 2026
7 checks passed
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.

3 participants