Emoji isn't used for Project icon #9007

Closed
opened 2026-02-16 18:11:22 -05:00 by yindo · 5 comments
Owner

Originally created by @aaranmcguire on GitHub (Feb 10, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

While I could upload a pic for the Project icon, I want to change the Project title to be "🦀 Rust Project" and it automatically use the 🦀 as the icon (as it uses the first letter normally). However it just shows an invalid character.

AI describes the issue as:

"🦀"[0] // Returns "\uD83E" (broken - first half of surrogate pair)

Plugins

No response

OpenCode version

1.1.54

Steps to reproduce

  1. Set the Project name to something like "🦀 Rust" or "🙂 Test"

Screenshot and/or share link

Image

Operating System

macOS 26.2

Terminal

No response

Originally created by @aaranmcguire on GitHub (Feb 10, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description While I could upload a pic for the Project icon, I want to change the Project title to be "🦀 Rust Project" and it automatically use the 🦀 as the icon (as it uses the first letter normally). However it just shows an invalid character. AI describes the issue as: "🦀"[0] // Returns "\uD83E" (broken - first half of surrogate pair) ### Plugins _No response_ ### OpenCode version 1.1.54 ### Steps to reproduce 1. Set the Project name to something like "🦀 Rust" or "🙂 Test" ### Screenshot and/or share link <img width="483" height="517" alt="Image" src="https://github.com/user-attachments/assets/3f9be16e-aca4-4901-bfe8-8785276824a8" /> ### Operating System macOS 26.2 ### Terminal _No response_
yindo added the bug label 2026-02-16 18:11:22 -05:00
yindo closed this issue 2026-02-16 18:11:22 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 10, 2026):


This issue appears to be a duplicate of #12441: Project avatar fallback doesn't support emoji characters, which was recently closed.

Both issues describe the same root cause: JavaScript string indexing returns individual UTF-16 code units, but emojis use surrogate pairs. When using code like [0] to get the first character of an emoji, it returns only the first half of the surrogate pair, resulting in a broken character display.

Since #12441 was already closed, please check if the fix has been deployed or if this remains an open issue.

@github-actions[bot] commented on GitHub (Feb 10, 2026): --- This issue appears to be a duplicate of #12441: [Project avatar fallback doesn't support emoji characters](https://github.com/anomalyco/opencode/issues/12441), which was recently closed. Both issues describe the same root cause: JavaScript string indexing returns individual UTF-16 code units, but emojis use surrogate pairs. When using code like `[0]` to get the first character of an emoji, it returns only the first half of the surrogate pair, resulting in a broken character display. Since #12441 was already closed, please check if the fix has been deployed or if this remains an open issue.
Author
Owner

@aaranmcguire commented on GitHub (Feb 10, 2026):

This issue appears to be a duplicate of #12441: Project avatar fallback doesn't support emoji characters, which was recently closed.

Both issues describe the same root cause: JavaScript string indexing returns individual UTF-16 code units, but emojis use surrogate pairs. When using code like [0] to get the first character of an emoji, it returns only the first half of the surrogate pair, resulting in a broken character display.

Since #12441 was already closed, please check if the fix has been deployed or if this remains an open issue.

I created and closed this issues in order to get the eyes by a human (as my assumption is humans only look when bug label is assigned).

I also created a PR, but it was closed as "already supported" when it's clearly not. So I would appreciate a second look.

@aaranmcguire commented on GitHub (Feb 10, 2026): > This issue appears to be a duplicate of [#12441](https://github.com/anomalyco/opencode/issues/12441): [Project avatar fallback doesn't support emoji characters](https://github.com/anomalyco/opencode/issues/12441), which was recently closed. > > Both issues describe the same root cause: JavaScript string indexing returns individual UTF-16 code units, but emojis use surrogate pairs. When using code like `[0]` to get the first character of an emoji, it returns only the first half of the surrogate pair, resulting in a broken character display. > > Since [#12441](https://github.com/anomalyco/opencode/issues/12441) was already closed, please check if the fix has been deployed or if this remains an open issue. I created and closed this issues in order to get the eyes by a human (as my assumption is humans only look when bug label is assigned). I also created a PR, but it was closed as "already supported" when it's clearly not. So I would appreciate a second look.
Author
Owner

@EliaSupernova commented on GitHub (Feb 11, 2026):

Traced this to packages/ui/src/components/avatar.tsx:39:

<Show when={src} fallback={split.fallback?.[0]}>

"🦀"[0] returns "\uD83E" (first half of a UTF-16 surrogate pair) instead of the full emoji. Fix is to use Array.from() which splits by Unicode code points:

<Show when={src} fallback={Array.from(split.fallback ?? "")[0]}>

Happy to open a PR if helpful.
@EliaSupernova commented on GitHub (Feb 11, 2026): Traced this to `packages/ui/src/components/avatar.tsx:39`: ```tsx <Show when={src} fallback={split.fallback?.[0]}> "🦀"[0] returns "\uD83E" (first half of a UTF-16 surrogate pair) instead of the full emoji. Fix is to use Array.from() which splits by Unicode code points: <Show when={src} fallback={Array.from(split.fallback ?? "")[0]}> Happy to open a PR if helpful.
Author
Owner

@aaranmcguire commented on GitHub (Feb 11, 2026):

I did this PR (which worked): https://github.com/anomalyco/opencode/pull/12442

So you can also try your version and see if they prefer that.

@aaranmcguire commented on GitHub (Feb 11, 2026): I did this PR (which worked): https://github.com/anomalyco/opencode/pull/12442 So you can also try your version and see if they prefer that.
Author
Owner

@aaranmcguire commented on GitHub (Feb 13, 2026):

It's been fixed. 1.1.65 it's working. commit: dec304a273

@aaranmcguire commented on GitHub (Feb 13, 2026): It's been fixed. 1.1.65 it's working. commit: dec304a2737b7accb3bf8b199fb58e81d65026e9
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9007