Skip to content

Draw Bot avatars as Hi-bit pixel sprites with live activity states - #925

Open
sambitcreate wants to merge 5 commits into
mainfrom
claude/hibit-sprite-avatars
Open

sambitcreate wants to merge 5 commits into
mainfrom
claude/hibit-sprite-avatars

Conversation

@sambitcreate

@sambitcreate sambitcreate commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Problem

Bot avatars were eight smooth "semantic" bodies that looked the same whether a Bot was idle, thinking, running a tool or stuck. The owner chose Sprite · Hi-bit as the only Bot avatar direction: a 16×16 mirrored pixel sprite. Each Bot's face should also show what it is doing.

Change

  • Hi-bit sprites on desktop, iOS and Android. Each of the eight existing shapes (wisp, orb, drop, hex, cloud, peak, squircle, capsule) now names one curated Hi-bit body, and color still picks the tint.
  • No protocol change. The saved record stays { version: 1, shape, color }, so every saved Bot keeps its identity, older phones read the same fields, and there's no Remote protocol revision bump.
  • One shared spec. botAvatarSprite in protocol/aiden-remote/v1/fixtures/contract.json holds the bodies, tones and expected 16×16 grids for both the full and small cuts. Each platform's expansion is tested against those grids, and the test doesn't copy the algorithm.
  • Pixel-exact drawing. No rotation, anti-aliasing or smoothing. Motion moves in quarter- or half-cell steps, or changes opacity only.
  • Eyes. Eyes are dark (deep) at every size and in every pose.
    • Full-size faces keep the light glint.
    • The small cut (≤ 24 px/pt/dp) gets a small white #FFFFFF glint at each eye's top-left, shown only while the eyes are open. Blink-shut, happy ^ and wince > < have no glint.
  • Nine live states: idle, thinking, reading, tool, writing, editing, waiting, done and error.
    • Each state maps from the signal that already drives the platform's "working" indicator.
    • Working states are debounced about 250 ms. Done and error show at once and return to idle after about 1.5 s.
    • A Stop or pause settles quietly, with no done or error moment.
    • Error drops the rig in Y only, while the odd-pair rows glitch sideways once.
    • Reduce Motion shows the still pose only.
  • Where the states show.
    • Desktop: the chat header, sidebar rows, the pinned card, and the Bot computer tab's face, which shows the tool pose.
    • Phones: home rows and the chat header.
    • Pickers, onboarding art and small lists stay static at idle.
    • Idle avatars don't blink, except while waiting.
  • Docs. The plan is docs/plans/hibit-sprite-avatars-plan.md, and .memory/bot-chat-activity.md, the plans index and the iOS/Android changelogs are updated.

Known limits

  • Phone home rows never show done. Phones get only the session state, needsYou and lastReplyAt, so a Stop or a failed turn can't be told from a normal end without a wire change. An ordinary failed turn therefore settles to idle there. interrupted and needs_model show error, and done shows in the phone chat header only.
  • model_error is desktop-only. The desktop treats it as a failed session, and phones never receive it.
  • The iOS legacy chat has no plan data, so it shows the phase-mapped states only.

Screenshots

Desktop

Light Dark
Before
After
States

Small-cut zoom (dark eyes with the white glint):

iOS

Light Dark
Before
After
States

Small-cut zoom:

Android

Light Dark
Before
After
States

Small-cut zoom:

Scope

There is no linked issue. The work follows the owner's choice of Sprite · Hi-bit in the 2026-11-24 avatar study.

Verification

  • Desktop:
    • npm run type-check and npm run lint: clean.
    • Bot suites: 550/550 passed.
    • npm run test:ci-policy: 123/123 passed.
    • Onboarding suite: 83/83 passed.
    • Bots starter E2E spec through npm run test:e2e:space: 3/3 passed in a Cua Space. This ran before a final CSS-only change that restored the error row glitch.
  • iOS: AidenOnTheGoTests: 2596 passed, 0 failed, 8 skipped. Screenshots were taken on the simulator.
  • Android:
    • ./gradlew testDebugUnitTest: 1428 passed.
    • assembleDebug and lintDebug: clean.
    • Screenshots were taken on a headless AVD.
  • Flaky test: main/services/bot-memory/review.test.ts ("a review past its time limit keeps the answer already on its way…") failed once in a full run and passed when rerun alone. This PR doesn't touch that file.

AI disclosure

Claude Code wrote this PR, and the owner directed and reviewed the design.

Checklist

  • I tested these changes locally and reviewed the diff myself.
  • Related docs and tests are updated: the plan, the plans index, .memory/, and the iOS and Android changelogs. New tests are registered in package.json and scripts/ci-test-registry.json.
  • No unrelated refactors or changes are included.

Flaky test noted

Replace the eight smooth semantic avatar bodies with curated 16x16 Hi-bit
sprites on desktop, iOS and Android. The saved v1 avatar record is
unchanged: each shape names one sprite body and color picks its tones, so
there is no Remote protocol revision. The shared spec lives in the
botAvatarSprite fixture section and each platform's expansion is tested
against its grids.

Avatars now show nine states (idle, thinking, reading, tool, writing,
editing, waiting, done, error) mapped from each platform's existing
activity signal, debounced 250 ms, with done and error held about 1.5 s.
A Stop or pause settles quietly. Reduce Motion shows still poses only.
Eyes are dark at every size; the small cut (24 px and below) adds a
white glint while the eyes are open.

@pullfrog pullfrog Bot 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.

Important

The iOS release gate currently fails, and four state/rendering regressions should be addressed before merge.

Reviewed changes This initial review covered the full cross-platform sprite-avatar implementation and its release/test integration.

  • Shared sprite contract — Adds the eight mirrored bodies, twelve tone sets, full/small expansion grids, and parity tests in the Remote fixture.
  • Live activity states — Maps desktop, iOS, and Android Bot activity into nine poses with debounce, outcome holds, quiet Stop/pause endings, and reduced-motion behavior.
  • Cross-platform rendering — Replaces fallback avatar shapes and editor swatches with pixel sprites while retaining canonical-photo precedence and native accessibility values.
  • Surface integration — Wires live states into chat headers, desktop sidebar/pinned rows, phone home rows, and the Bot computer pointer, with docs and changelogs updated.

⚠️ New iOS files are outside the reviewed source inventories

npm run test:ios-release fails 2 of 33 checks because the Xcode project now contains three new Swift files that the shipping-policy allowlists do not know about. This leaves the PR unable to pass the required iOS release gate.

Technical details
# Register the new iOS sources in release policy

## Affected sites
- `scripts/check-ios-shipping-target.test.mjs:43` — `appSourcePaths` omits `AidenOnTheGo/Features/Bots/AidenBotSprite.swift` and `AidenOnTheGo/Features/Bots/AidenBotSpriteView.swift`.
- `scripts/check-ios-shipping-target.test.mjs:288` — `testSources` omits `AidenBotSpriteTests.swift`.
- `scripts/check-ios-shipping-target.test.mjs:371` — the shipping/test source-phase allowlist check fails.
- `scripts/check-ios-shipping-target.test.mjs:392` — the orphan-source inventory check fails.

## Required outcome
- Register all three new files in the matching reviewed inventories and make `npm run test:ios-release` pass.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏

Comment thread renderer/styles.css Resolved

@pullfrog pullfrog Bot 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.

ℹ️ No new issues in the incremental commit; the required findings in the preceding review remain outstanding.

Reviewed changes This delta review covered the policy-only commit pushed after the initial review.

  • Motion policy inventory — Lowers the renderer/styles.css literal-motion cap from 13 to 12 and removes the stale Bot-face-loop rationale after the old cubic-bezier glance CSS was deleted; npm run test:ci-policy passes 123/123.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix it ➔ | View workflow run | Using GPT Sol | 𝕏

@pullfrog pullfrog Bot 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.

ℹ️ No new issues in the latest commit; the four required behavioral findings from the initial review remain open.

Reviewed changes This incremental review covered the iOS release-policy fix added since the prior Pullfrog review.

  • Registered sprite sources — Added AidenBotSprite.swift and AidenBotSpriteView.swift to appSourcePaths, and AidenBotSpriteTests.swift to testSources, restoring parity with the Xcode source phases and iOS tree inventory.
  • Verified release policy — Confirmed npm run test:ios-release passes 33/33 and npm run test:ci-policy passes 123/123 on the current head.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix it ➔ | View workflow run | Using GPT Sol | 𝕏

…ch, rest race, shut-eye glint

- iOS: a loaded photo wears the glance mark for any active settled state, so chat headers that pass only the state keep their cue.
- iOS: the avatar signal carries the run identity, so a queued turn that starts after a stopped one with no idle gap clears the Stop latch and can end with done.
- Android: an outcome's rest timer no longer emits idle while new work waits out its debounce; an expired moment still settles to idle if that work ends unseen.
- Desktop: the glint hides for the blink's shut frame instead of showing as a squashed stripe.

@pullfrog pullfrog Bot 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.

✅ No new issues found.

Reviewed changes This incremental review covered the behavioral fixes added in cb9643f since the prior Pullfrog review.

  • Restored iOS photo activity cues — Made canonical photos show the glance mark from either the explicit working flag or a settled working avatar state, while idle, done, and error remain unmarked.
  • Separated queued iOS runs — Carried the activity startedAt into the avatar signal so a queued run that starts without an idle gap clears the preceding turn's Stop latch and can finish with done.
  • Closed the Android outcome race — Kept a done or error pose from flashing idle while new work waits out its debounce, with virtual-time coverage for work arriving in the final interval of the hold.
  • Removed shut-eye glints — Synchronized idle and waiting glint opacity with the stepped blink so the closed frame contains no white or light stripe.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | View workflow run | Using GPT Sol | 𝕏

…vatars

# Conflicts:
#	ios/AidenOnTheGo/Features/Bots/AidenBotSessionChatView.swift
#	ios/AidenOnTheGo/Features/Chat/AidenChatDetailView.swift
#	ios/CHANGELOG.md

@pullfrog pullfrog Bot 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.

Important

The iOS header merge drops VoiceOver exposure for transient Bot outcome states; this should be restored before merging.

Reviewed changes This incremental review covered the merge of main into the sprite-avatar branch and the conflict resolution in the iOS chat headers.

  • Adopted the centered iOS chat header — Moved durable and legacy Bot avatars into the Telegram-style AidenChatHeaderAvatar above the shared title capsule.
  • Retained visual activity states — Kept each header's settled sprite state, including live phases and transient done/error poses, in the new 52-point avatar.
  • Reconciled release notes — Preserved both the chat-title-bar and Hi-bit-avatar entries in the iOS changelog.
  • Verified merge policy — Confirmed the merged Swift sources parse, npm run test:ios-release passes 33/33, and npm run test:ci-policy passes 123/123.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using GPT Sol | 𝕏

name: bot.name,
size: AidenChatHeaderAvatar<EmptyView>.size
)
AidenBotSettledAvatarState(signal: avatarSignal) { state in

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.

This settled state now reaches only AidenChatHeaderAvatar, which is hidden from VoiceOver, while the merge removed the former accessibilityValue(state.accessibilityValue ?? ""). The title capsule derives a separate status and falls back to the Bot purpose when done/error is showing, so expose the settled value through an accessible element in both durable and legacy headers.

Technical details
# Restore spoken Bot outcome states

## Affected sites
- `ios/AidenOnTheGo/Features/Bots/AidenBotSessionChatView.swift:611` — durable header renders the settled state only inside the hidden avatar.
- `ios/AidenOnTheGo/Features/Chat/AidenChatDetailView.swift:1306` — legacy header has the same hidden-state path.
- `ios/AidenOnTheGo/Features/Conversation/AidenChatTitleBar.swift:260` — `AidenChatHeaderAvatar` applies `.accessibilityHidden(true)`.
- `ios/AidenOnTheGo/Features/Bots/AidenBotSprite.swift:156` — the intended spoken values include `Done` and `Something went wrong`, but they no longer reach an exposed element.

## Required outcome
- VoiceOver must observe the same settled state as the visible sprite in both iOS Bot chat headers, including transient done and error outcomes, without creating a duplicate focus target.

## Suggested approach
- Feed the settled avatar value into the existing accessible title capsule, or expose an equivalent state on another single accessibility element while keeping the decorative avatar hidden.

This branch has not been deployed

No deployments
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.

1 participant