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

+3
View File
@@ -56,6 +56,8 @@ pub(all) enum ShortcutAction {
/// second to ninth (when the combo's key is 1). Like clicking the icon: start the app or bring
/// its windows forward. See `Shortcuts::dock_app`.
DockApps
/// The emoji picker (compositor/host/emoji_picker.mbt), like Windows' Win+.
EmojiPicker
} derive(Eq, Debug)
///| One row of the shortcut table.
@@ -85,6 +87,7 @@ pub let shortcut_table : Array[ShortcutDef] = [
{ id: "record-window", label: "Record a window", action: RecordWindow, default_text: "Super+Ctrl+R" },
{ id: "dock-apps", label: "Open dock app 1-9", action: DockApps, default_text: "Super+1" },
{ id: "overview", label: "Overview of all windows", action: Overview, default_text: "Super+W" },
{ id: "emoji-picker", label: "Emoji picker", action: EmojiPicker, default_text: "Super+Period" },
]
///| evdev code -> key name, for the keys a combo can end in (US layout names).
+65 -1
View File
@@ -21,8 +21,11 @@
/// :restore-session false ; don't reopen them (absent: reopen); the session settings module
/// ; or a hand edit sets it
/// :remember-windows false ; don't place windows where they were left (absent: do)
/// :auth-agent :system} ; passwords for run0/pkexec/polkit go to the system's polkit
/// :auth-agent :system ; passwords for run0/pkexec/polkit go to the system's polkit
/// ; agent instead of Chandra's own dialog (absent: :chandra)
/// :emoji {:recent ["👍🏽" "🍕"] :skin-tone 3}}
/// ; the emoji picker's recently used emoji (newest first, as
/// ; inserted) and skin tone, 0 default .. 5 dark (emoji_picker.mbt)
///
/// Saving merges into what is already in the file, so keys this build doesn't know (a future
/// widget's state, hand-written notes) survive. Everything is a no-op unless `persist` is on
@@ -577,6 +580,67 @@ pub fn DesktopShell::save_session(self : DesktopShell, session : Array[SessionEn
write_state_file(entries)
}
///| The emoji picker's saved state: recent emoji (newest first) and skin tone (0-5). Empty and 0
/// without `persist` or when state.edn doesn't say.
pub fn DesktopShell::load_emoji(self : DesktopShell) -> (Array[String], Int) {
if !self.persist {
return ([], 0)
}
let recent : Array[String] = []
let mut tone = 0
match lookup_key(read_state_file(), "emoji") {
Some(Mapping(m)) => {
match lookup_key(m, "recent") {
Some(Vector(vs)) =>
for v in vs {
match v {
Text(t) => recent.push(t)
_ => ()
}
}
_ => ()
}
match lookup_key(m, "skin-tone") {
Some(Integer(n)) =>
match parse_int_str(n) {
Some(t) if t >= 0 && t <= 5 => tone = t
_ => ()
}
_ => ()
}
}
_ => ()
}
(recent, tone)
}
///| Write the emoji picker's recent emoji and skin tone as `:emoji`, keeping every other key.
/// A no-op without `persist`.
pub fn DesktopShell::save_emoji(self : DesktopShell, recent : Array[String], tone : Int) -> Unit {
if !self.persist {
return
}
let value = @edn.Value::Mapping([
(@edn.Value::Keyword("recent"), @edn.Value::Vector(recent.map(r => @edn.Value::Text(r)))),
(@edn.Value::Keyword("skin-tone"), @edn.Value::Integer(tone.to_string())),
])
let entries : Array[(@edn.Value, @edn.Value)] = []
let mut placed = false
for e in read_state_file() {
match e.0 {
Keyword("emoji") => {
entries.push((e.0, value))
placed = true
}
_ => entries.push(e)
}
}
if !placed {
entries.push((@edn.Value::Keyword("emoji"), value))
}
write_state_file(entries)
}
///| Start the app whose windows carry `app_id` (see `resolve_app_id`), without counting it as
/// a recent launch. False when no installed app matches or it could not be started.
pub fn DesktopShell::launch_app_id(self : DesktopShell, app_id : String) -> Bool {