Text chat 8: Inline-flow text and emoji images (spike → production) #258

Closed
opened 2026-11-12 11:07:37 +00:00 by charles · 0 comments
Owner

Plan: docs/superpowers/plans/2026-11-12-textchat.md, section "Task 8". Spec: docs/superpowers/specs/2026-11-12-fluxer-native-textchat-design.md.

Task 8: Inline-flow text and emoji images (spike → production)

Issue: #TBD

Files:

  • Create: crates/fluxer-ui/src/widgets/inline_flow.rs, crates/fluxer-ui/src/widgets/emoji.rs, crates/fluxer-ui/tests/inline_flow.rs, docs/superpowers/research/2026-11-12-textchat-spikes.md (§1)
  • Modify: crates/fluxer-ui/src/widgets/rich_text/{mod.rs,ast_to_spans.rs}, crates/fluxer-ui/src/widgets/mod.rs, crates/fluxer-ui/{Cargo.toml,README.md} (depend on fluxer-emoji), crates/fluxer-core/src/media_urls.rs (custom_emoji(&endpoints, id, animated, size), sticker(&endpoints, id, animated, size), twemoji(&endpoints, surrogates)) — serialised: core URL builders first
  • Test: as above + screenshots rich_text_emoji, rich_text_jumbo

Interfaces:

  • Produces: inline_flow::InlineFlow::new(runs: Vec<Run>) with Run::{Text { text, font, size, color, background: Option<Pill> }, Box { width, height, baseline_shift, content: Element } , Break}, wrapping at word boundaries, caching layout per width; emoji::view(&EmojiRef, size, &Images, animate) -> Element with EmojiRef::{Unicode(String), Custom { id, name, animated }} (Twemoji SVG / emoji WebP, the system glyph until loaded); rich_text builds an EmojiContext from fluxer-emoji (so :name: and Unicode emoji become Node::Emoji), draws emoji at 1.5 em inline and 3 rem jumbo (fluxer_emoji::is_jumbo), mention pills with background, and lists the emoji URLs it needs (rich_text::wanted(&nodes, &endpoints) -> Vec<Url>) for screens::main::media::wanted.

  • Spike part (spikes §1): layout cost per message (median and p99 on the basic scenario's 120 messages), whether iced's Paragraph can measure word runs fast enough, behaviour with RTL and CJK. Fallback (spec §16): emoji images only for jumbo messages and emoji-only lines, the system glyph elsewhere; say so in the PR and open a follow-up.

  • #40: confirm LinkClicked/SpoilerToggled are wired on the base; close #40 with a comment, or finish it here.

  • Step 1: Write failing tests: wraps_text_and_boxes_at_width, box_baseline_aligns_with_text, layout_cached_per_width, custom_and_unicode_emoji_become_boxes, shortcode_in_text_becomes_emoji_node, jumbo_only_for_emoji_only_messages, wanted_lists_twemoji_and_custom_urls, mention_pill_has_background; screenshots rich_text_emoji, rich_text_jumbo.

  • Step 2–5: FAIL → implement → PASS → commit feat(ui): inline-flow text with emoji images.

🤖 Generated with Claude Code

Plan: `docs/superpowers/plans/2026-11-12-textchat.md`, section "Task 8". Spec: `docs/superpowers/specs/2026-11-12-fluxer-native-textchat-design.md`. ### Task 8: Inline-flow text and emoji images (spike → production) **Issue:** #TBD **Files:** - Create: `crates/fluxer-ui/src/widgets/inline_flow.rs`, `crates/fluxer-ui/src/widgets/emoji.rs`, `crates/fluxer-ui/tests/inline_flow.rs`, `docs/superpowers/research/2026-11-12-textchat-spikes.md` (§1) - Modify: `crates/fluxer-ui/src/widgets/rich_text/{mod.rs,ast_to_spans.rs}`, `crates/fluxer-ui/src/widgets/mod.rs`, `crates/fluxer-ui/{Cargo.toml,README.md}` (depend on `fluxer-emoji`), `crates/fluxer-core/src/media_urls.rs` (`custom_emoji(&endpoints, id, animated, size)`, `sticker(&endpoints, id, animated, size)`, `twemoji(&endpoints, surrogates)`) — serialised: core URL builders first - Test: as above + screenshots `rich_text_emoji`, `rich_text_jumbo` **Interfaces:** - Produces: `inline_flow::InlineFlow::new(runs: Vec<Run>)` with `Run::{Text { text, font, size, color, background: Option<Pill> }, Box { width, height, baseline_shift, content: Element } , Break}`, wrapping at word boundaries, caching layout per width; `emoji::view(&EmojiRef, size, &Images, animate) -> Element` with `EmojiRef::{Unicode(String), Custom { id, name, animated }}` (Twemoji SVG / emoji WebP, the system glyph until loaded); `rich_text` builds an `EmojiContext` from `fluxer-emoji` (so `:name:` and Unicode emoji become `Node::Emoji`), draws emoji at 1.5 em inline and 3 rem jumbo (`fluxer_emoji::is_jumbo`), mention pills with background, and lists the emoji URLs it needs (`rich_text::wanted(&nodes, &endpoints) -> Vec<Url>`) for `screens::main::media::wanted`. - Spike part (*spikes §1*): layout cost per message (median and p99 on the `basic` scenario's 120 messages), whether iced's `Paragraph` can measure word runs fast enough, behaviour with RTL and CJK. **Fallback** (spec §16): emoji images only for jumbo messages and emoji-only lines, the system glyph elsewhere; say so in the PR and open a `follow-up`. - #40: confirm `LinkClicked`/`SpoilerToggled` are wired on the base; close #40 with a comment, or finish it here. - [ ] **Step 1: Write failing tests**: `wraps_text_and_boxes_at_width`, `box_baseline_aligns_with_text`, `layout_cached_per_width`, `custom_and_unicode_emoji_become_boxes`, `shortcode_in_text_becomes_emoji_node`, `jumbo_only_for_emoji_only_messages`, `wanted_lists_twemoji_and_custom_urls`, `mention_pill_has_background`; screenshots `rich_text_emoji`, `rich_text_jumbo`. - [ ] **Step 2–5:** FAIL → implement → PASS → commit `feat(ui): inline-flow text with emoji images`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
charles added this to the Text chat milestone 2026-11-12 11:07:37 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/fluxer-native#258
No description provided.