Repository navigation
fix(worlds): keep an emoji whole on agent nameplates - #33352
Conversation
UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)UX-level review of UX-Verdict: PASS cannot evaluate: missing an admissible screenshot of the clipped nameplate and kanban card. The four before/after images point at evidence commit 3dbeebd, which is outside this PR, so the blind read was not performed. Evidence gaps
[UX-REVIEWED] 1018b35 Description read[DESCRIPTION-READ] 987cc5eefab2b1d6887fb44568f84efe1677b1bbc7601d063df81e9ed8fec1b8 That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks: this is a point fix for issue #33349 that reuses the existing helper What this change shipsInventory (3 items) — 3 justifiedIntent: someone watching Agent Worlds sees a session name on a nameplate or whiteboard card with no broken half-emoji. FIX.
[FIRST-PRINCIPLES-REVIEWED] 1018b35 Description read[DESCRIPTION-READ] 03888d57bbd7d2ed7545367cf4047ad66eaf495b8944a84a93ed03946fab9176 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the change reuses the existing Notes
[DESIGN-REVIEWED] 1018b35 Description read[DESCRIPTION-READ] b1e1231e4c26a7d7860f0930e35138cd2ceeb3efcf30214c536f834478472355 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
3dbeebd to
1d3f6ef
Compare
The Office, Panda Office, Underwater Lab and Wizard Tower scenes clip a session name to 8 characters for the desk nameplate and the whiteboard card with a plain UTF-16 slice. An emoji across that cut lost half of its surrogate pair, so "Deploy 🚀 now" showed "Deploy �". Each cut now uses sliceCodePoints, the helper the rest of the dashboard already truncates with, so an emoji is kept whole or left out.
1d3f6ef to
1018b35
Compare
bolichen97
left a comment
There was a problem hiding this comment.
Approving. The four scenes (Office, Panda Office, Underwater Lab and Wizard Tower) clip nameplates and kanban task cards with the existing sliceCodePoints helper instead of String.slice. An eight-character cut no longer splits an emoji into a lone surrogate. Only the clip changes, not the length or the drawing. The two new tests check that no drawn label holds a lone surrogate. The regex in them is test-only, and the product change adds none. All checks are green.
The Office, Panda Office, Underwater Lab and Wizard Tower scenes clip a session name to 8 characters for the desk nameplate and the whiteboard card with a plain UTF-16 slice. An emoji across that cut lost half of its surrogate pair, so "Deploy 🚀 now" showed "Deploy �". Each cut now uses sliceCodePoints, the helper the rest of the dashboard already truncates with, so an emoji is kept whole or left out. (cherry picked from commit e9a44c0)
The Office, Panda Office, Underwater Lab and Wizard Tower scenes clip a session name to 8 characters for the desk nameplate and the whiteboard card with a plain UTF-16 slice. An emoji across that cut lost half of its surrogate pair, so "Deploy 🚀 now" showed "Deploy �". Each cut now uses sliceCodePoints, the helper the rest of the dashboard already truncates with, so an emoji is kept whole or left out. (cherry picked from commit e9a44c0)
Problem / Motivation
Goal: In Agent Worlds, a desk nameplate or whiteboard card never shows half an emoji from a session name.
The Office, Panda Office, Underwater Lab and Wizard Tower scenes clip a session name to 8 characters for the nameplate (and, in the two offices, the whiteboard card) with a plain UTF-16 slice. When an emoji sits across that cut, half of its surrogate pair is drawn, so "Deploy 🚀 now" shows "Deploy �".
Why it matters
Session names often carry an emoji. Anyone watching Agent Worlds sees a broken glyph on the very label that tells them which desk belongs to which session.
Not a goal
What changed (motivation → approach → change)
Symptom: a broken glyph on nameplates and cards. Cause:
name.slice(0, 8)counts UTF-16 units, and can stop between the two halves of an emoji. Change: the six cuts inwebsite/src/pages/scenes/usesliceCodePointsfromwebsite/src/utils/codePoints.ts, the helper the rest of the dashboard already truncates with (#24796), so an emoji is kept whole or left out.Backwards compatibility
Compatible: only the text drawn on a canvas changes, and only for a name whose 8th unit falls inside an emoji.
Removes nothing: every name that cut cleanly before draws the same text.
Tests
website/src/test/OfficeSceneCoverage.test.tsxandwebsite/src/test/PandaOfficeSceneCoverage.test.tsx:keeps an emoji whole when the nameplate and kanban card clip a nameseats a running agent named "Deploy 🚀 now" and checks that no text on the overlay holds a lone surrogate and that the nameplate reads "Deploy". Both fail on main (run in a separate main worktree) and pass with the fix, along with the other 162 scene and Worlds tests.Proof: not provable -- frontend test (prove.py runs Python only)
Manual verification
Rendered the real Office and Wizard Tower scenes with two seated agents ("Deploy 🚀 now", "Release 🎉 notes") from a build of main and from this branch. On main the Office nameplate and kanban card read "Deploy �"; with the fix they read "Deploy".
Screenshots / video
Evidence commit 3dbeebd (not part of the final commit).
Office nameplate, before (main) and after (this branch):
Wizard Tower nameplate, before (main) and after (this branch):
Related Issues
Fixes #33349
Sibling sweep
Swept: git grep -nE ".slice(0, ?[0-9]+)" -- website/src/pages/scenes
Sibling: website/src/pages/scenes/OfficeScene.tsx -- changed here
Sibling: website/src/pages/scenes/PandaOfficeScene.tsx -- changed here
Sibling: website/src/pages/scenes/UnderwaterLabScene.tsx -- changed here
Sibling: website/src/pages/scenes/WizardTowerScene.tsx -- changed here
Sibling: website/src/pages/scenes/mission-control/parts.ts:146 -- not affected -- its pixel font skips any glyph it lacks, emoji included
Pattern harvest
Rule candidate: lint
Pattern: a
.slice(0, N)on a display name or label, wheresliceCodePointskeeps an emoji wholeChecklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributions are accepted under the project Apache-2.0 license.