4.3 KiB
iris: known problems and things still to build
Only open Iris framework work lives here. Delete an item when it lands.
Build (for the port)
Framework capabilities needed by RUST.md's port plan:
- Overflow ellipsis with an explicit retained end.
TextAttrscan only wrap or clip, so a tool summary is cut with no mark. Parley has no ellipsis primitive; use its line breaker to find the cut, but keep source and displayed strings distinct with one byte mapping shared by spans, links, selection and editing. Replacewrap: boolwith an enum that can say wrap, clip, head ellipsis and tail ellipsis—the caller must choose because a command is identified by its head and a path by its tail. - Expose the distance from a
LazySpanviewport to its unloaded edge. (P1.)viewport_lenand the visible extents are already measured internally, but a paging caller cannot ask whether it is within the Compose app's six-viewportHISTORY_SCREENScushion. The API should answer in pixels or viewport multiples, never rows: a row ranges from one line to a screen, so a fixed row count is not a distance. - Let an image fit a bounded box while preserving its aspect ratio.
(P1.)
Imagecurrently always reports and draws the decoded texture's natural pixel size. Decoding and fetching a server-produced attachment belong inapp-rust; iris only owes the generic fit/scale widget used to draw its thumbnail. - Per-range backgrounds for rich text. (P1.) Inline code is
already monospace and coloured, but matching Compose's chip also needs
the glyph run's boxes so a surface can be drawn behind exactly that byte
range. The shared
TextSelectionengine already computes the same geometry for selection highlights; expose one shared primitive rather than giving the app a second text-layout path. - A horizontal gauge/bar widget. (P1.) For
SessionUsageBar's equivalent — a bounded fill reflecting a fraction, nothing fancier. - A toggle switch. (P3.) For the delete dialog's
deleteForeigncontrol; iris has no switch/checkbox widget yet as far as this pass found.
Later
-
Intern independently constructed solid paint definitions. Inline
rect(Srgba8::...)values currently receive a newPaintIdeach time. Cache them by canonical linear RGBA bits, but keepPaints::addexplicitly unique so two semantic theme roles that start with the same value can later change independently. Cache entries must be weak and disappear when the last real handle releases the slot; gradients and texture paints need their own identity rules rather than inheriting solid-value interning blindly. -
Property/content animations. Cosmetic, so after correctness and parity. Keep them modular, like input; scrolling already animates through
Widget::tickandUiData::animate. A widget that does not opt in must pay nothing and import nothing for them. -
Remove
WidgetViewunless a real composite adopts it. Every composite inapp-rust/src/uiuses ordinary child handles plus a root;WidgetViewand its derive are used only byiris/examples/view.rs. It currently demonstrates itself rather than shortening production code. -
A
Stackthat chooses its mask the way it chooses its size should replacemasked_by. For a square-cornered surface,.background(rect(BAR_FILL)).masked()was measured against.masked_by(rect(BAR_FILL))on the composer at the phone's own size and density and the two are identical to the pixel. What the pair cannot express is a clip that is not a box:Painter::set_maskwrites aRectPrimitive::colorusingPaintId::NONEat the widget's own region, with no radius, so.background(rect(fill).radius(r)).masked()draws a rounded panel and then cuts its content square. Both other call sites (row.rs's fence,tool.rs's raw output) are rounded, which is why the method stands for now. LetStackname the mask child the wayStackSize::Child(n)names the sizing child. Then.background(x)remains the one way to add a surface and clipping to it is a stack property; the named mask child must have drawn before any child that uses it. Once that exists, deletemasked_byandMasked::shaperather than retaining two APIs.