Repository navigation
fix(ui): take session owner chip initials by code point - #117350
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 2:07 PM ET / 18:07 UTC. ClawSweeper reviewWhat this changesThe PR replaces UTF-16 code-unit initial extraction in the session owner chip with the shared grapheme helper and adds sidebar regression cases for emoji and ZWJ display names. Merge readinessThis PR correctly fixes a current Control UI Unicode rendering bug by using the existing grapheme-boundary helper. It applies cleanly to current Priority: P2 Review scores
Verification
How this fits togetherControl UI session rows and headers receive a creator identity from gateway session data. The owner chip derives a short visible initial from that display name for multi-user attribution. flowchart LR
A[Gateway creator identity] --> B[Session creator projection]
B --> C[Owner chip]
C --> D[Grapheme-safe initials]
D --> E[Sidebar row]
D --> F[Session header]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +36. Total +36 across 2 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Merge the focused shared-helper repair once exact-head CI is green, retaining one canonical Unicode-initial implementation across Control UI surfaces. Do we have a high-confidence way to reproduce the issue? Yes. Current Is this the best way to solve the issue? Yes. Reusing AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against fd343ca8cc95. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
b47de67 to
17ebd51
Compare
Maintainer actual Chrome 150 Unicode-rendering verificationPreserved original contributor @zenglingbiao, original human Git author/email/first authored date, and the original two-file patch. Exact refreshed head Started the real Control UI Vite server, launched real installed Google Chrome 150, mounted production Before: {"browser":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/150.0.0.0 Safari/537.36","intlSegmenter":true,"results":[{"case":"lobster","label":"🦞小明","visible":"\ud83e","expected":"🦞","codePoints":["U+d83e"],"pass":false},{"case":"family-zwj","label":"👨👩👧👦Family","visible":"\ud83d","expected":"👨👩👧👦","codePoints":["U+d83d"],"pass":false},{"case":"flag","label":"🇺🇸Flag","visible":"\ud83c","expected":"🇺🇸","codePoints":["U+d83c"],"pass":false},{"case":"skin-tone","label":"👍🏽Thumbs","visible":"\ud83d","expected":"👍🏽","codePoints":["U+d83d"],"pass":false},{"case":"astral-cjk","label":"𠀀Creator","visible":"\ud840","expected":"𠀀","codePoints":["U+d840"],"pass":false},{"case":"combining-accent","label":"éclair","visible":"E","expected":"É","codePoints":["U+45"],"pass":false},{"case":"ascii-two-part","label":"Ada Lovelace","visible":"AL","expected":"AL","codePoints":["U+41","U+4c"],"pass":true}]}After: {"browser":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/150.0.0.0 Safari/537.36","intlSegmenter":true,"results":[{"case":"lobster","label":"🦞小明","visible":"🦞","expected":"🦞","codePoints":["U+1f99e"],"pass":true},{"case":"family-zwj","label":"👨👩👧👦Family","visible":"👨👩👧👦","expected":"👨👩👧👦","codePoints":["U+1f468","U+200d","U+1f469","U+200d","U+1f467","U+200d","U+1f466"],"pass":true},{"case":"flag","label":"🇺🇸Flag","visible":"🇺🇸","expected":"🇺🇸","codePoints":["U+1f1fa","U+1f1f8"],"pass":true},{"case":"skin-tone","label":"👍🏽Thumbs","visible":"👍🏽","expected":"👍🏽","codePoints":["U+1f44d","U+1f3fd"],"pass":true},{"case":"astral-cjk","label":"𠀀Creator","visible":"𠀀","expected":"𠀀","codePoints":["U+20000"],"pass":true},{"case":"combining-accent","label":"éclair","visible":"É","expected":"É","codePoints":["U+45","U+301"],"pass":true},{"case":"ascii-two-part","label":"Ada Lovelace","visible":"AL","expected":"AL","codePoints":["U+41","U+4c"],"pass":true}]}Six previously broken visible initial types now render their complete grapheme: lobster, family ZWJ, flag, skin tone, astral CJK, and combining accent. The two-part ordinary ASCII control remains unchanged. node --import tsx --input-type=module -e 'import {chromium} from "playwright";import {startControlUiE2eServer} from "./ui/src/test-helpers/control-ui-e2e.ts";const server=await startControlUiE2eServer();let browser;try{browser=await chromium.launch({executablePath:"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",headless:true});const page=await browser.newPage({viewport:{width:1100,height:500}});await page.route(server.baseUrl,route=>route.fulfill({status:200,contentType:"text/html",body:"<!doctype html><html><body><main id=proof></main></body></html>"}));await page.goto(server.baseUrl,{waitUntil:"domcontentloaded",timeout:60000});const report=await page.evaluate(async()=>{await import("/src/components/session-owner-chip.ts");const cases=[{name:"lobster",label:"🦞小明",expected:"🦞"},{name:"family-zwj",label:"👨👩👧👦Family",expected:"👨👩👧👦"},{name:"flag",label:"🇺🇸Flag",expected:"🇺🇸"},{name:"skin-tone",label:"👍🏽Thumbs",expected:"👍🏽"},{name:"astral-cjk",label:"𠀀Creator",expected:"𠀀"},{name:"combining-accent",label:"e\u0301clair",expected:"E\u0301"},{name:"ascii-two-part",label:"Ada Lovelace",expected:"AL"}];const outputs=[];for(const item of cases){const node=document.createElement("openclaw-session-owner-chip");node.createdActor={type:"human",id:"profile-"+item.name,label:item.label};document.body.append(node);await node.updateComplete;const visible=node.querySelector(".session-owner-chip")?.textContent?.trim()??"";outputs.push({case:item.name,label:item.label,visible,expected:item.expected,codePoints:Array.from(visible).map(value=>"U+"+value.codePointAt(0).toString(16)),pass:visible===item.expected});}return {browser:navigator.userAgent,intlSegmenter:typeof Intl.Segmenter==="function",results:outputs}});process.stdout.write(JSON.stringify(report)+"\n")}finally{await browser?.close();await server.close()}'
OPENCLAW_VITEST_FS_MODULE_CACHE_PATH=/private/tmp/openclaw-vitest-s02-117350-ui node scripts/run-vitest.mjs ui/src/components/app-sidebar.test.ts ui/src/lib/avatar.test.ts
.agents/skills/autoreview/scripts/autoreview --mode uncommitted --engine codex --thinking xhighBoth focused sidebar/avatar suites pass: 231 tests. Targeted formatter and diff checks pass; fresh Codex Sol xhigh autoreview is clean. |
|
Merged via squash.
|
* origin/main: (491 commits) feat(gateway): advertise chat attachment limits on hello-ok (#116188) fix(ui): preserve full graphemes in session owner initials (#117350) refactor(tui): consolidate runtime ownership (#117368) fix(update): return failure when dirty checkout blocks update (#117452) fix(auto-reply): apply mixed chat directives in one session transaction (#117542) refactor(ui): unify channel status and setup controls (#117499) fix(doctor): preserve surviving lint selections (#117543) fix(media): keep an unquoted MEDIA path with spaces as one media item (#112464) refactor(channels): consolidate lightweight plugin discovery (#117541) fix(imessage): prevent duplicate messages after delayed sends (#110853) refactor(memory): unify authoritative dreaming state and presentation (#117538) refactor(agents): consolidate main-session recovery ownership (#117383) fix(proxy-capture): make path-based session cleanup atomic (#98852) refactor(agents): consolidate compaction and context-engine ownership (#117482) fix(gateway): preserve Responses usage details (#117533) perf(gateway): skip empty session recovery stores (#117498) fix(ci): update canonical Kova performance pin (#117508) fix(system-agent): emit the wizard cancel hint once per message (#113731) refactor: dedupe secrets runtime snapshot fixtures (#117502) test(google): cover ready callback close precedence ...
* origin/main: (325 commits) fix(skills): preserve profile in ClawHub command hints (#117555) fix(cli): explain filtered plugin policy without unsafe recovery (#117556) fix(irc): strip markdown from outbound text (#112961) refactor(plugins): consolidate registry snapshots (#117561) fix(plugins): fail blocked enable commands (#117536) test(secrets): dedupe runtime state fixtures (#117563) feat(gateway): advertise chat attachment limits on hello-ok (#116188) fix(ui): preserve full graphemes in session owner initials (#117350) refactor(tui): consolidate runtime ownership (#117368) fix(update): return failure when dirty checkout blocks update (#117452) fix(auto-reply): apply mixed chat directives in one session transaction (#117542) refactor(ui): unify channel status and setup controls (#117499) fix(doctor): preserve surviving lint selections (#117543) fix(media): keep an unquoted MEDIA path with spaces as one media item (#112464) refactor(channels): consolidate lightweight plugin discovery (#117541) fix(imessage): prevent duplicate messages after delayed sends (#110853) refactor(memory): unify authoritative dreaming state and presentation (#117538) refactor(agents): consolidate main-session recovery ownership (#117383) fix(proxy-capture): make path-based session cleanup atomic (#98852) refactor(agents): consolidate compaction and context-engine ownership (#117482) ... # Conflicts: # extensions/xai/realtime-voice-bridge.ts
* origin/main: (491 commits) feat(gateway): advertise chat attachment limits on hello-ok (openclaw#116188) fix(ui): preserve full graphemes in session owner initials (openclaw#117350) refactor(tui): consolidate runtime ownership (openclaw#117368) fix(update): return failure when dirty checkout blocks update (openclaw#117452) fix(auto-reply): apply mixed chat directives in one session transaction (openclaw#117542) refactor(ui): unify channel status and setup controls (openclaw#117499) fix(doctor): preserve surviving lint selections (openclaw#117543) fix(media): keep an unquoted MEDIA path with spaces as one media item (openclaw#112464) refactor(channels): consolidate lightweight plugin discovery (openclaw#117541) fix(imessage): prevent duplicate messages after delayed sends (openclaw#110853) refactor(memory): unify authoritative dreaming state and presentation (openclaw#117538) refactor(agents): consolidate main-session recovery ownership (openclaw#117383) fix(proxy-capture): make path-based session cleanup atomic (openclaw#98852) refactor(agents): consolidate compaction and context-engine ownership (openclaw#117482) fix(gateway): preserve Responses usage details (openclaw#117533) perf(gateway): skip empty session recovery stores (openclaw#117498) fix(ci): update canonical Kova performance pin (openclaw#117508) fix(system-agent): emit the wizard cancel hint once per message (openclaw#113731) refactor: dedupe secrets runtime snapshot fixtures (openclaw#117502) test(google): cover ready callback close precedence ...
* origin/main: (325 commits) fix(skills): preserve profile in ClawHub command hints (openclaw#117555) fix(cli): explain filtered plugin policy without unsafe recovery (openclaw#117556) fix(irc): strip markdown from outbound text (openclaw#112961) refactor(plugins): consolidate registry snapshots (openclaw#117561) fix(plugins): fail blocked enable commands (openclaw#117536) test(secrets): dedupe runtime state fixtures (openclaw#117563) feat(gateway): advertise chat attachment limits on hello-ok (openclaw#116188) fix(ui): preserve full graphemes in session owner initials (openclaw#117350) refactor(tui): consolidate runtime ownership (openclaw#117368) fix(update): return failure when dirty checkout blocks update (openclaw#117452) fix(auto-reply): apply mixed chat directives in one session transaction (openclaw#117542) refactor(ui): unify channel status and setup controls (openclaw#117499) fix(doctor): preserve surviving lint selections (openclaw#117543) fix(media): keep an unquoted MEDIA path with spaces as one media item (openclaw#112464) refactor(channels): consolidate lightweight plugin discovery (openclaw#117541) fix(imessage): prevent duplicate messages after delayed sends (openclaw#110853) refactor(memory): unify authoritative dreaming state and presentation (openclaw#117538) refactor(agents): consolidate main-session recovery ownership (openclaw#117383) fix(proxy-capture): make path-based session cleanup atomic (openclaw#98852) refactor(agents): consolidate compaction and context-engine ownership (openclaw#117482) ... # Conflicts: # extensions/xai/realtime-voice-bridge.ts
Summary
Take session owner-chip initials by grapheme cluster (the Control UI's canonical
takeGraphemeshelper) instead of UTF-16 code-unit indexing, so emoji display names no longer render a lone surrogate (tofu) in the sessions list, and ZWJ emoji sequences render as the complete visible initial.What Problem This Solves
The session owner chip (
ui/src/components/session-owner-chip.ts) shows one- or two-character initials derived from the creator's display name.ownerInitialstook those "characters" withparts[0]?.[0]andsource[0]— UTF-16 code-unit indexing. Any display name starting with an astral character (emoji such as 🦞, 🚀, or CJK ext-B) yields the lone high surrogate, which renders as tofu/invalid glyph in the chip on every sessions list row.The same bug class was already fixed for identity avatars in #104912 (
ui/src/lib/identity-avatar.ts:209now usesArray.from(word)[0]); this chip is the remaining display-name initial extraction that still indexes code units. Sibling audit: every othercharAt(0)/[0]initial site inui/srceither capitalizes internal ASCII constants while keeping the rest of the string (surrogate pairs stay intact) or handles non-user text — this file is the only user-controlled display name affected.Code evidence:
session-owner-chip.ts:69-70built initials via(parts[0]?.[0] ?? "") + (parts[1]?.[0] ?? "")and fell back tosource[0]— all code-unit indexing.Root Cause
ownerInitialswith code-unit indexing.string[0]as "the first visible character", which only holds for BMP text; astral characters occupy two UTF-16 units, so[0]returns half a character.Why This Fix
takeGraphemes(value, 1)(ui/src/lib/graphemes.ts) —Intl.Segmenterwhen available,Array.fromas fallback. This is the established Control UI contract for Unicode-safe initials (ui/src/lib/avatar.ts:58,provider-icon.ts:143): it keeps astral characters whole and keeps multi-code-point grapheme clusters (ZWJ family emoji, flags, skin-tone sequences) as one visible initial.Array.from(value)[0](code points only). Review feedback correctly flagged that this still splits ZWJ sequences —👨👩👧👦Familywould render only👨— so the fix now routes throughtakeGraphemes, matching the sibling avatar initializer that already tests complete ZWJ clusters.@-strip, two-part initials, uppercase) untouched; the helper only changes how a "first character" is read.User Impact
Evidence
openclaw-session-owner-chipcomponent with display name "🦞小明" produces chip text\ud83e— a lone high surrogate → FAIL; "👨👩👧👦Family" likewise produces\ud83d→ FAIL🦞as one whole code point → PASS, and👨👩👧👦as the complete ZWJ grapheme cluster → PASSReal Behavior Proof
Before (on main)
After (with fix)
Tests and Validation
pnpm checkpassedui/src/test-helpers/app-sidebar-cases/session-ownership.ts: creators labeled "🦞小明" and "👨👩👧👦Family" must render chip text exactly "🦞" and "👨👩👧👦" through the full sidebar render path; all 226 app-sidebar cases passopenclaw-session-owner-chipcustom element and reads the DOM text users see; no external services involvedMaintainer Exact-Head Real Browser Verification
Original contributor @zenglingbiao, original Git author/email, and original first authored timestamp are preserved. Refreshed exact head
17ebd51c8d9a56c8e355aa48d9da515f781ca1c4changes only the two original owner/sidebar-regression files, for +4 net production lines. There is no linked issue, config, storage, migration, protocol, or dependency change.The actual Vite-served production
openclaw-session-owner-chipcustom element was mounted in real Google Chrome 150 and its visible.session-owner-chipDOM text was read for seven Unicode/BMP cases.Before, current main:
{ "browser": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/150.0.0.0 Safari/537.36", "intlSegmenter": true, "results": [ { "case": "lobster", "label": "🦞小明", "visible": "\ud83e", "expected": "🦞", "codePoints": [ "U+d83e" ], "pass": false }, { "case": "family-zwj", "label": "👨👩👧👦Family", "visible": "\ud83d", "expected": "👨👩👧👦", "codePoints": [ "U+d83d" ], "pass": false }, { "case": "flag", "label": "🇺🇸Flag", "visible": "\ud83c", "expected": "🇺🇸", "codePoints": [ "U+d83c" ], "pass": false }, { "case": "skin-tone", "label": "👍🏽Thumbs", "visible": "\ud83d", "expected": "👍🏽", "codePoints": [ "U+d83d" ], "pass": false }, { "case": "astral-cjk", "label": "𠀀Creator", "visible": "\ud840", "expected": "𠀀", "codePoints": [ "U+d840" ], "pass": false }, { "case": "combining-accent", "label": "éclair", "visible": "E", "expected": "É", "codePoints": [ "U+45" ], "pass": false }, { "case": "ascii-two-part", "label": "Ada Lovelace", "visible": "AL", "expected": "AL", "codePoints": [ "U+41", "U+4c" ], "pass": true } ] }After, exact refreshed original-contributor head:
{ "browser": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/150.0.0.0 Safari/537.36", "intlSegmenter": true, "results": [ { "case": "lobster", "label": "🦞小明", "visible": "🦞", "expected": "🦞", "codePoints": [ "U+1f99e" ], "pass": true }, { "case": "family-zwj", "label": "👨👩👧👦Family", "visible": "👨👩👧👦", "expected": "👨👩👧👦", "codePoints": [ "U+1f468", "U+200d", "U+1f469", "U+200d", "U+1f467", "U+200d", "U+1f466" ], "pass": true }, { "case": "flag", "label": "🇺🇸Flag", "visible": "🇺🇸", "expected": "🇺🇸", "codePoints": [ "U+1f1fa", "U+1f1f8" ], "pass": true }, { "case": "skin-tone", "label": "👍🏽Thumbs", "visible": "👍🏽", "expected": "👍🏽", "codePoints": [ "U+1f44d", "U+1f3fd" ], "pass": true }, { "case": "astral-cjk", "label": "𠀀Creator", "visible": "𠀀", "expected": "𠀀", "codePoints": [ "U+20000" ], "pass": true }, { "case": "combining-accent", "label": "éclair", "visible": "É", "expected": "É", "codePoints": [ "U+45", "U+301" ], "pass": true }, { "case": "ascii-two-part", "label": "Ada Lovelace", "visible": "AL", "expected": "AL", "codePoints": [ "U+41", "U+4c" ], "pass": true } ] }Lobster emoji, a complete family ZWJ sequence, a flag, skin-tone emoji, astral CJK, and combining-accent graphemes are now all intact; ordinary two-word ASCII initials remain
AL. ExistingIntl.Segmenterownership remains in the canonical shared Control UI helper.Both focused suites pass: 231 tests. Targeted formatter and
git diff --checkpass; fresh Codex Sol xhigh structured autoreview is clean. The old unrelated failing CI baseline was removed by refreshing current main; exact-head hosted CI must finish green before landing.