P1a (docs/RUST.md). A transcript row's blocks are drawn the way Markdown.kt draws them rather than as one flat span list: - transcript-ui/src/markdown.rs is a *block* renderer now. `BlockFrame` is the whole widget vocabulary -- Plain, Verbatim (a dark rounded panel that pans sideways) and Quote (a bar and an indent) -- so a new markdown feature costs spans, not widgets. `frame_of` is the one place the BlockKind -> appearance mapping is written. - Fences take `client_core::highlight`'s spans by language, in the same Catppuccin palette Theme.kt's `catppuccinSyntax()` uses, with the char->byte offset conversion the two index spaces need. - Lists get the bullet ladder and coloured markers MarkdownPieces.kt draws, ordered lists count from the number they were written with, headings take Material's own ladder (24/22/16/14/12/11). - Tables are padded monospace columns measured from the cells, with the header bold and a rule under it -- see docs/DECISIONS.md for what that trades against a real grid. - Links carry their URL through to a tap. `GestureOutcome::Tapped` is new: a press that never committed to a pan or a selection, so a finger that flung the list past a link does not also open it. `iris::platform::OpenUrl` is the capability, implemented by each backend (xdg-open/open/start on the desktop, an ACTION_VIEW intent deferred to `after_input` on Android, the same shape `pending_show_keyboard` uses). - `DragArbiter`/`DragGesture` take an axis, so a code fence pans across its own long lines through the same machine a list pans down its rows -- and a vertical drag starting on a fence still reaches the list. - `TextEditCtx::byte_at` answers which byte a tap landed on without exposing the parley layout; `Rect::radius` takes a `Len`, so a corner can be written in dp. Tests: 31 in transcript-ui (11 new, covering the frame mapping, highlighting including a multibyte fence and an unknown language, list markers, table padding and wrapping, link hit-testing), 85 in iris (4 new on the tap-vs-drag rule and the two axes). cargo fmt clean, clippy warning-free. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
iris
My experimental attempt at a rust ui library (also my first ui library).
It's currently designed around using retained data structures (widgets), rather than diffing generated trees from data like xilem or iced. This is an experiment and I'm not sure if it's a good idea or not.
Examples are in examples, eg. cargo run --example tabs.
Goals, in general order:
- does what I want it to (text, images, video, animations)
- very easy to use ignoring ergonomic ref counting
- reasonably fast / efficient (a lot faster than electron, save battery life, try to beat iced and xilem)
dev details
not targeting web rn cause wanna use actual nice gpu features & entire point of this is to make desktop apps / not need a web browser
general ideas trynna use rn / experiment with:
- retained mode
- specifically designed around wgpu so there's no translation
- postfix functions for most things to prevent unreadable indentation (going very well)
- events can be done directly where you draw the widgets
- almost no macros in user code & actual LSP typechecking (variadic generics if you can hear me please save us)
- relative anchor + absolute offset coord system (+ "rest" / leftover during widget layout)
- single threaded ui & pass context around to make non async usage straightforward (pretty unsure about this)
- widgets store outside of the actual rendering so they can be moved around and swapped easily (unsure about this but seems to work good for now)
under heavy initial development so not gonna try to explain status, maybe check TODO for that; sizable chance it gets a rewrite once I know everything I need and what seems to work best
it's called iris because it's the structure around what you actually want to display and colorful