Skip to content

feat(client): anchor companion bubbles to the displayed bust - #1183

Merged
DoodleBears merged 10 commits into
mainfrom
codex/1177-companion-bubble-anchors
Oct 9, 2026
Merged

DoodleBears merged 10 commits into
mainfrom
codex/1177-companion-bubble-anchors

Conversation

@DoodleBears

@DoodleBears DoodleBears commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Refs #1177 · Spec #1135 · Agent claim · Task codex/local/01a11734-bb09-7f01-9d45-adc0f5df6269

Why the change

Window Companion bubbles stay connected to the displayed bust as it tilts and stretches while displaced cards remain upright and clearly identify their originating Bot.

Special things to note

  • Merge risk: two-way door — revert this Client presentation change; small blast radius — companion geometry and decorative connectors, with no Host, permissions or saved-appearance change. Review displayed-pose coordinates, Avatar replacement cleanup and card bounds.
  • Avatar owns a disposable geometry reader: local head bounds are captured once per replacement, and the existing visible-frame loop reads the local screen matrix. Images/unsupported geometry use the visible box top; pixel tool covers use a stable head-region anchor. There is no whole-SVG bounds loop or per-frame RPC.
  • Draft: visual qualification remains partial. Actual pointer drag/re-grab, release, focused arrow-key movement and resize have now been recorded on the corrected build. Matched idle light/dark pairs remain below. Focused reading and settled reduced-motion release are now separately recorded; Image-fallback and real tool-cover scenes are now qualified against integrated main in both themes; held/reversal, moving-hover/grace, reduced-motion message reading and background checks remain pending. Earlier control timeouts and message-listener errors retain unproven attribution; this is not full runtime acceptance.

Change outline

Avatar (current recipe/image)
  └─ anchorRef → disposable reader
       head bounds once → current displayed group matrix
       tool cover → SVG-root matrix; image/unknown rig → box top
                          ↓
WindowCompanionView's existing visible frame
  screen point → overlay-local point (account for overlay offset/resize)
                          ↓
CompanionBubbles
  preserve origin → toolbar clearance / viewport clamp / multi-Bot avoidance
                          ↓
upright status + stack/reading list ← pixel connector ← actual bust anchor

Real DSH messages and projected anchors — 1559 × 865, Chinese

Captured at implementation 37154dab, retained unchanged in main-sync head 1ed6dcbd. Actual channel_send replies from two QA PersonaBots; paused autonomous walking keeps the interaction target stable. These are after states, not matched before/after comparisons. Published capture record.

Dark: concurrent stack Dark: expanded reading
Actual two-Bot message stack Actual expanded reading
Light: displaced status with origin connectors Dark: released fall
Actual light idle connectors Actual released fall

The release recording contains 14 actual browser screenshots with recorded elapsed intervals, showing fall → land → rest; it does not capture a held/reversing grab, provide audio or measure performance. Read-only DOM observations retain each connector path and upright card-container transform.

anchor-release.mp4

Matched idle comparisons — both themes

Before: original parent 89515335; after: final head 1ed6dcbd. Same isolated Profile, Ada/Grace identities and history, paused autonomous walking, Chinese and explicit 1559 × 865 viewport. The same two nearby busts displace their status cards; the after state preserves the connection to each originating bust. Small subpixel position differences remain after resizing. No historical message cards replayed after either restart. Theme and viewport overrides were restored and task-owned DSH tabs closed. Quiet-idle presentation is independently implemented in PR #1180 and is not part of this anchor-only comparison.

Theme Before: displaced cards without origin connectors After: cards connected to their busts
Light Anchor idle before light Anchor idle after light
Dark Anchor idle before dark Anchor idle after dark

Resize correction — real DSH recording

A real drag/re-grab and resize recording at 1ed6dcbd exposed a transient 588.694px mismatch between the clamped bust and its connector. The mounted regression now checks both positions before another frame; correction f9fad41a updates them together. Build c946a749 integrates main 8940165f; evidence-only head 5c16fab9 retains the same implementation.

Settled narrow viewport before Settled narrow viewport after
Actual settled resize before Actual settled resize after

Both captures use the same isolated Profile, Ada/Grace identities, Chinese, dark theme and 1559×865 → 600×700 → 1559×865 interaction. Main integration adds onboarding content in the center chat, so these are not fully matched screen comparisons. Settled screenshots do not show the transient defect. An independent QA observer sampled displayed head/connector geometry every50ms: after correction, all101 narrow samples were within0.012px; maximum across1,200 samples was0.710px. This is a sampled geometry check, not a performance measurement or proof about unsampled frames.

Continuous silent recordings: Before · After. The after video contains rest/drag/fall/land, 11trusted pointer events and actual focused-character keyboard movement. These are repository-hosted downloadable WebM files; no inline GitHub video-player claim is made. Capture details and limitations. Console showed no JavaScript error; the existing form-field id/name issue remains.

Focused reading and settled reduced-motion release

Real DSH c946a74 (evidence head5c16fab9), Chinese/dark1559×865. Three new native Bot replies were independently checked against canonical messages. Native pause buttons stopped autonomous walking; normal public character focus entered reading as three cards arrived, before capture latency consumed their lifetime. Subsequent actual hover retained Ada's two upright cards. This setup does not qualify mouse hover on a roaming character.

Initial focused arrivals: Ada2/Grace1 Later reading: Ada2/Grace expired Reduced-motion post-release: no cards
Three actual newly arrived cards Two retained upright Ada cards Both companions settled at viewport bottom after reduced drag

The real Bot Settings menu selected reduced motion; after native drag/release, all22post-release samples place both companions at bottom865. Cards have expired by then, so that scene is not reduced-motion message-reading acceptance. Sampled connector error is0px in this stationary/settled workload (80msobserver), not a frame-cost measurement, first-release-frame timing or guarantee about unsampled motion. Continuous silent WebM · Sanitized qualification · Setup, failures and limits. Remux only, no invented replies/events or card/store injection. Two earlier attempts are excluded and retained privately: moving-target hover timeout; then cards expired during tool latency. Console shows no JavaScript error.

Earlier evidence-only commits1d1cb1aa/e282b906 passed their own CI37844661877. Runtime d1dde91 now integrates main04da6093 and formal pixel-avatar0.6.0; its full CI37845666688 passed. Mandatory Standards/Spec re-review found0 new code defects.

Integrated-main image fallback and native tool cover — both themes

Real DSH d1dde91, Chinese1559×865. Grace uses the PNG saved by its own native avatar editor, switched through the owning avatar API; a new canonical DM exercises the image box-top anchor. Ada sends a new canonical explanation and enters a real pending ask_user_question; its Activity tool symbol uses the preserved head-region anchor. Walking is paused through native controls, and normal public character focus retains each real card before capture latency consumes TTL. These are after-state qualification scenes, not new matched baseline comparisons.

Scene Light Dark
Own saved PNG, image fallback Actual image fallback light Actual image fallback dark
Native pending tool cover Actual native tool cover light Actual native tool cover dark

Continuous image fallback WebM · Continuous tool-cover WebM · Sanitized qualification. Official MCP captures, silent/remux-only; native drag/release is visible. Every connector-bearing sample in five stationary/post-release phases has0px origin error (25samples each at80ms); this is not first-frame/held/reversal or performance evidence. Both QA questions created during setup/capture were answered through the native Chat form, with actual canonical Bot continuations. Grace's original absent avatar/appearance/seed fields were restored and checked; console has0JSerrors; all owned pages/browser closed. Existing quiet-idle presentation belongs to independent PR1180.

This media-only head 3361996 retains the tested runtime code. Its own full CI37847542872 passed, including repository tests, build and generated-output checks; this result is distinct from d1's runtime CI.

Validation and remaining runtime review

Focused regressions cover displayed matrices/interruption, cover/fallback, Avatar replacement/disposal, offset overlay/resize, hidden-frame suspension and card bounds. After integrating main04da6093 into d1dde91, Client143files/1,029tests, typecheck, lint/source policy, format, bilingual ledgers and build passed. Full repository CI37845666688 passed at that exact runtime commit. Mandatory Standards and Spec reviews against that pinned main found0new code findings; remaining acceptance gaps are explicit above. Historical CI/captures remain attributed to their own commits. No local Windows full-suite pass is claimed; the earlier Host-cleanup failure also reproduced on clean main.

Runtime review path: build the branch and start an isolated DSH with scripts/dev-instance.mjs; select two pixel Bots as companions and send real DMs. Capture matched main/branch states while idle, dragging right then reversing left, holding, releasing, walking and expanding the message stack. Check the connector at viewport edges, resize and crowd the two companions, then verify held/reversal, moving hover/grace, background and reduced-motion message reading. Image/tool-cover after states are now recorded above. Repeat in light/dark and capture a short drag/tilt/stack recording before promoting this PR. Related #1173 remains an independent PR rather than a functional dependency.

Issue: #1177
Agent-Task: codex/local/01a11734-bb09-7f01-9d45-adc0f5df6269
@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 20 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: e49e1a92-62ef-48a8-a6f4-9b171967dd34
📥 Commits

Reviewing files that changed from the base of the PR and between 66d2767 and 4dbaa0a.

⛔ Files ignored due to path filters (17)
  • docs/assets/pr/1177-companion-anchors/expanded-reading-dark.png is excluded by !**/*.png
  • docs/assets/pr/1177-companion-anchors/focused-arrivals-dark.png is excluded by !**/*.png
  • docs/assets/pr/1177-companion-anchors/image-fallback-dark.png is excluded by !**/*.png
  • docs/assets/pr/1177-companion-anchors/image-fallback-light.png is excluded by !**/*.png
  • docs/assets/pr/1177-companion-anchors/image-fallback.webm is excluded by !**/*.webm
  • docs/assets/pr/1177-companion-anchors/image-released-dark.png is excluded by !**/*.png
  • docs/assets/pr/1177-companion-anchors/reading-reduced.webm is excluded by !**/*.webm
  • docs/assets/pr/1177-companion-anchors/reduced-released-dark.png is excluded by !**/*.png
  • docs/assets/pr/1177-companion-anchors/resize-after-dark.png is excluded by !**/*.png
  • docs/assets/pr/1177-companion-anchors/resize-after.webm is excluded by !**/*.webm
  • docs/assets/pr/1177-companion-anchors/resize-before-dark.png is excluded by !**/*.png
  • docs/assets/pr/1177-companion-anchors/resize-before.webm is excluded by !**/*.webm
  • docs/assets/pr/1177-companion-anchors/tool-completed-dark.png is excluded by !**/*.png
  • docs/assets/pr/1177-companion-anchors/tool-cover-dark.png is excluded by !**/*.png
  • docs/assets/pr/1177-companion-anchors/tool-cover-light.png is excluded by !**/*.png
  • docs/assets/pr/1177-companion-anchors/tool-cover.webm is excluded by !**/*.webm
  • docs/assets/pr/1177-companion-anchors/tool-released-dark.png is excluded by !**/*.png
📒 Files selected for processing (16)
  • CHANGELOG.md
  • CHANGELOG.zh.md
  • docs/architecture/botharness-architecture.en.md
  • docs/architecture/botharness-architecture.md
  • docs/assets/pr/1177-companion-anchors/README.md
  • docs/assets/pr/1177-companion-anchors/reading-reduced-qualification.json
  • docs/assets/pr/1177-companion-anchors/variants-qualification.json
  • packages/client/src/client/avatar-anchor.ts
  • packages/client/src/client/avatar.tsx
  • packages/client/src/client/companion-bubbles.ts
  • packages/client/src/client/window-companion-styles.ts
  • packages/client/src/client/window-companion-view.tsx
  • packages/client/test/avatar-anchor.test.ts
  • packages/client/test/companion-bubbles.test.ts
  • packages/client/test/window-companion-view.test.ts
  • packages/client/test/window-companions-view.test.ts
  • 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.

Preserve the companion anchor and upstream bilingual release entries.

Issue: #1177
Agent-Task: codex/local/01a11734-bb09-7f01-9d45-adc0f5df6269
@DoodleBears

Copy link
Copy Markdown
Contributor Author

Real DSH partial visual qualification for #1177 at 37154da (2026-10-08): Chinese, 1559 × 865, two actual QA PersonaBots with native model channel_send replies. Dark stack, expanded reading, light idle and released-fall screenshots below; timed actual browser screenshot video retains capture intervals, without audio or performance claims. Matched base/branch pairs, reversing grab, resize, keyboard/reduced-motion and fallback eye checks remain pending. Browser control timed out on the original DSH page and again after a fresh task-owned page; this does not establish a product crash. Four browser message-listener errors were observed and retained; attribution remains unproven. No DOM presentation mutation or mocked Host used.
after-stack-dark
after-reading-dark-settled
after-idle-light
drag-000

anchor-release.mp4

@DoodleBears

Copy link
Copy Markdown
Contributor Author

Matched real DSH idle comparisons for #1177 (2026-10-08): original parent 8951533 → final head 1ed6dcb. Same isolated Profile, Ada/Grace identities and history, paused walking, Chinese, explicit 1559 × 865 viewport. Before images have no projected connectors; after images identify each displaced status card with its actual bust anchor. No historical messages replayed after either restart. Original follow-system theme and viewport restored; DSH test tabs closed. These pairs qualify idle light/dark only: reversing/held grab, resize, keyboard/reduced-motion and fallback eye checks remain open. Quiet-idle behavior requested later is separately implemented in PR #1180, not mixed into this independent anchor comparison.

before-idle-light after-idle-light before-idle-dark after-idle-dark

Recalculate placement with the clamped character in the same update, avoiding the observed one-frame origin left at its old horizontal position.

Issue: #1177

Agent-Task: codex/local/01a11734-bb09-7f01-9d45-adc0f5df6269
Preserve independent release entries and qualify the resize correction against the current Client.

Issue: #1177
Agent-Task: codex/local/01a11734-bb09-7f01-9d45-adc0f5df6269
Keep actual before/after DSH recordings and qualified geometry observations reviewable without authenticated attachment upload.

Issue: #1177
Agent-Task: codex/local/01a11734-bb09-7f01-9d45-adc0f5df6269
Issue: #1177

Agent-Task: codex/local/01a11734-bb09-7f01-9d45-adc0f5df6269
Issue: #1177

Agent-Task: codex/local/01a11734-bb09-7f01-9d45-adc0f5df6269
…ication

Merge origin/main 04da609; preserve projected Avatar anchors and canonical avatarSeed while retaining current owner APIs. Client143files/1029tests, typecheck, lint, format, ledger and build pass.

Issue: #1177

Agent-Task: codex/local/01a11734-bb09-7f01-9d45-adc0f5df6269
Record latest-main runtime, native avatar fallback and tool-cover scenes with exact restoration and bounded geometry sampling.

Issue: #1177

Agent-Task: codex/local/01a11734-bb09-7f01-9d45-adc0f5df6269
Issue: #1177

Agent-Task: codex/local/01a11734-bb09-7f01-9d45-adc0f5df6269
@DoodleBears
DoodleBears marked this pull request as ready for review October 9, 2026 03:21
@DoodleBears
DoodleBears merged commit 85e9dfb into main Oct 9, 2026
2 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.

1 participant