Emoji picker (Super+.): search, tabs, skin tones, recents, text-input-v3 insertion
CI / test (push) Canceled after 0s

Compositor-drawn Win+. style picker. The focused app keeps keyboard focus so
its text-input-v3 field stays enabled; the emoji goes in with commit_string,
or onto the clipboard with a visible notice when the app has no text field.
Shortcut lives in the shortcut table (rebindable in Settings > Shortcuts).

- compositor/wayland/text_input.mbt: zwp_text_input_manager_v3 (global 12)
- compositor/emoji: Emoji 18.0 + CLDR 49 data (Unicode License), search,
  picker model, CBDT/CBLC + GSUB reader for Noto Color Emoji
- Chandra's own pinned bitmap Noto Color Emoji (scripts/fetch-emoji-font.sh,
  just emoji-font); Fedora's COLRv1 copy can't be drawn. Missing font shows
  an error panel.
- raster WIT: emoji-font, emoji-has, emoji-image; served by wasmhost
- state.edn :emoji {:recent [...] :skin-tone n}
- tests incl. a fake text-input client; docs/emoji-picker.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hkABDGJixotaqFv2X2
This commit is contained in:
Claude committed 2026-11-26 07:00:22 +00:00
1 parent 738928352e
commit 27252a97ab
39 files changed
+4942 -41

No files matched your search

+1
View File
@@ -6,6 +6,7 @@ import {
"chandra/desktop/compositor/sys" @sys,
"chandra/desktop/compositor/font" @font,
"chandra/desktop/compositor/renderer" @renderer,
"chandra/desktop/compositor/emoji" @emoji,
"chandra/desktop/compositor/wasm" @wasm,
"chandra/desktop/compositor/kms" @kms,
"chandra/desktop/interface/chandra/desktop/types" @types,
+28 -1
View File
@@ -848,6 +848,21 @@ fn load_image(path : String) -> Int {
h
}
///| The colour emoji font, for the emoji picker (`emoji-*`).
let emoji_source : @emoji.EmojiSource = @emoji.EmojiSource::new()
///| Handles of the emoji pictures made so far (shared, like path images: never overwritten).
let emoji_handles : Array[Int] = []
///|
fn emoji_image(text : String, px : Int) -> UInt {
emoji_source.image(text, px, p => {
let h = rs_image_put(0, p.width, p.height, p.data)
emoji_handles.push(h)
h.reinterpret_as_uint()
})
}
///|
fn is_path_image(h : Int) -> Bool {
for _, v in image_paths {
@@ -855,7 +870,7 @@ fn is_path_image(h : Int) -> Bool {
return true
}
}
false
emoji_handles.contains(h)
}
// ---------------------------------------------------------------- the interfaces
@@ -918,6 +933,18 @@ fn raster_funcs() -> Array[(String, (Array[@wt.Val]) -> Array[@wt.Val])] {
},
),
("load-image", a => [U32(load_image(a[0].to_string()).reinterpret_as_uint())]),
(
"emoji-font",
_ => match emoji_source.font() {
Ok(path) => [Result(true, Some(Str(path)))]
Err(why) => [Result(false, Some(Str(why)))]
},
),
(
"emoji-has",
a => [List(emoji_source.has(a[0].to_list().map(v => v.to_string())).map(b => Bool(b)))],
),
("emoji-image", a => [U32(emoji_image(a[0].to_string(), a[1].to_int()))]),
(
"image-pixels",
a => {