You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🤖 fix: Handle emojis with variation selectors in status_set (#468)
Fixes two issues with the `status_set` tool:
## 1. Emoji Validation Failures
**Problem:** Emojis with variation selectors (like ✏️) were incorrectly
rejected by validation.
**Root Cause:** The validator used `[...str].length` to count
characters, which counts code points. Emojis with variation selectors
(U+FE0F) have 2 code points but represent a single grapheme cluster.
**Solution:** Use `Intl.Segmenter` (built-in API) to count grapheme
clusters - what users perceive as single characters. This properly
handles:
- Variation selectors (✏️, ☀️, ➡️)
- Skin tone modifiers (👋🏻, 👋🏽, 👋🏿)
- Complex emojis (flags, multi-person emojis)
**Example:**
```javascript
const segmenter = new Intl.Segmenter("en", { granularity: "grapheme" });
[...segmenter.segment("✏️")].length; // 1 (correct!)
[..."✏️"].length; // 2 (wrong - counts code points)
```
## 2. Error Message Styling
**Problem:** Error messages in `StatusSetToolCall` used `text-sm` class,
making them smaller than surrounding text in the tool header.
**Solution:** Removed `text-sm` class so errors use the same font size
as other header content.
---
_Generated with `cmux`_
0 commit comments