• v0.4.0 1ac9a4b6e5

    v0.4.0
    Some checks failed
    ci / check (push) Has been cancelled
    ci / cross (push) Has been cancelled
    ci / android (push) Has been cancelled
    Stable

    gntx released this 2026-11-02 20:54:30 +01:00 | 81 commits to main since this release

    0.4 takes forma past the desktop window. The app API moves into a crate of
    its own, forma-app, so that one App runs under more than one runner:
    forma-winit on the desktop and now in a browser (WebGPU, else WebGL2), and
    the new forma-android on Android phones. A phone gets the touch-first UI it
    needs - momentum and overscroll, long presses, text selected by touch,
    swipes and swipe actions, a bottom sheet, a page stack, an app bar, bottom
    navigation, a pager, pull to refresh, wheel pickers - and the pieces of a
    password manager: a screen kept out of screenshots, incognito keyboards, a
    secret copied for a while, keys unlocked by a fingerprint, and filling
    other apps' logins. Themes are made from a few colors or a theme file,
    checked by a contrast report, and get variants, text roles, named styles
    and themes for part of a window; the bundled themes pass the report.
    forma's controls, overlays, sections and trees move by default, jumps of a
    view glide, and charts move to new data, all of it on the theme's times
    and with reduced motion keeping fades. There are a property grid, a
    navigation list and a log viewer, and behind the new editors feature a
    zoomable canvas, a node graph editor, curve and gradient editors and a diff
    viewer. On Linux files drop onto windows on Wayland and at the right place
    on X11, files and text are dragged out to other apps, dock panels float
    into windows of their own, an open window is raised on Wayland, and a whole
    app is tested with AppHarness. It breaks the API, so that later releases
    need not: the migration guide shows every
    break with code before and after. 0.2's names, deprecated since 0.3.0, are
    gone. The minimum Rust version stays 1.90 for the libraries; the
    repository's examples need 1.92, for their profiler (puffin 0.20).

    0.4 is tested by hand on Linux under KDE Plasma on Wayland, and on Android
    on a phone; the rest of what docs/hand-checks-0.4.md lists - X11, other
    desktops, browsers, older Android versions - was checked only as far as
    each change's own work went. It compiles for macOS and Windows, and CI
    checks that it does, but nothing has been run there.

    forma-android is experimental: its own API - what only Android has - may
    change in a minor version until 1.0. It runs from Android 10 (API 29), on
    android-activity 0.6 with GameActivity 4.4.0. An app starts from the
    template in crates/forma-android/template/, whose README names the files
    an app copies again with each forma version.

    New dependencies, under MIT or Apache-2.0:

    • forma-wgpu: wgpu's noop feature off the web (for Gpu::noop) and its
      webgl feature on wasm32, which adds wgpu-core-deps-wasm.
    • forma-app: forma-ui, forma-wgpu and thiserror, all in the tree before;
      serde_json, dirs and resvg move here from forma-winit, behind the
      same features, and image (PNG only) behind clipboard. On wasm32
      web-sys.
    • forma-android, on Android only (elsewhere it only re-exports forma-app):
      android-activity 0.6 with game-activity, ndk 0.9, jni 0.22,
      raw-window-handle, libc, serde and serde_json, which winit and
      forma had in the tree already, and accesskit_android 0.9 with
      accesskit, for TalkBack. accesskit_android brings cesu8 and a second
      jni (0.21). The crate embeds the DEX of its own Java helper, compiled
      from crates/forma-android/java/ under forma's license.
    • forma-winit: forma-app, whatever its features; with run on Linux and
      the BSDs wayland-client 0.31 and wayland-protocols 0.32, in the tree
      already through winit; on wasm32 wasm-bindgen, wasm-bindgen-futures
      and web-sys, the versions winit and wgpu have.

    With every feature on, on every target, that makes three crates 0.3.1 did
    not have - accesskit_android, cesu8 and wgpu-core-deps-wasm - and two
    second versions, jni 0.21 and windows-sys 0.45, both through
    accesskit_android.

    Not in 0.4: running on macOS and Windows and the fixes it brings, among
    them watching the clipboard and keeping a window out of screenshots there;
    a pass with a real screen reader on the desktop, Orca included; the
    upgrade to winit 0.31.
    Drags between the app's windows work on X11 only: Wayland tells an app
    nothing of where its windows are. In a browser there is no screen reader
    (AccessKit has no web adapter), no input method composition, and the
    system's reduced motion, high contrast and accent color are not read. On
    Android an emoji needs forma's bundled-emoji (the system's emoji font is
    COLRv1, which forma cannot draw yet); autofill offers no inline
    suggestions in the keyboard; a mouse wheel scrolls at once rather than
    gliding. A heatmap and a sparkline do not move to new data, a grouped
    table's groups open and close at once, and folds in a text area do not
    move. The README lists what else is known.

    forma-ui

    Changed (breaking)

    • Event::Command carries modifiers, the keys held when the claimed key
      was pressed, as Event::Clicked does: a pattern that names the
      variant's fields adds modifiers or ... Ui::command_modifiers and
      Ui::command_modifiers_each, new in 0.3.1, are gone: the event says the
      same.
    • Theme, TreeNode, MarkdownStyle and DockLayout are
      #[non_exhaustive], so later releases add to them without a break.
      Their fields stay public to read and assign, but outside forma none is
      built with a struct literal: a Theme starts from a bundled one
      (Theme::dark() and the others, or Default) and has its parts
      assigned; a TreeNode comes from TreeNode::leaf, branch or lazy, a
      MarkdownStyle from Default, a DockLayout from DockLayout::new or
      Default.
    • 0.2's names, deprecated since 0.3.0, are gone: CalendarParts (use
      DateCalendarParts), EditorEvent and EditorParts
      (MarkdownEditorEvent, MarkdownEditorParts), ViewerEvent and
      ViewerParts (ImageViewerEvent, ImageViewerParts), RangeEvent and
      RangeParts (RangeSliderEvent, RangeSliderParts), SplitEvent and
      SplitParts (SplitButtonEvent, SplitButtonParts), in widgets and
      in their widget's module. planning::CalendarParts, the calendar view's
      parts, stays.

    Changed

    • Motion by default (ADR 0116, 0117). forma's widgets look as before
      at rest, but move on the way: all of it on the theme's times
      (Metrics::motion_short, motion_medium and motion_long, 100, 200
      and 300 ms), slowed by the motion scale, turned off by Style::still on
      a subtree or by Metrics::STILL, and with reduced motion only fading.
      Only the drawing moves: what a click hits, what the accessibility tree
      says and what the getters return is the new state at once (ADR 0039).
      An app that wants none of it sets Metrics::STILL on its theme, or
      Style::still() on its root panel. A test that reads the draw list, an
      offset or next_wakeup right after a change lets the manual clock run
      past the motion (Harness::advance), or uses Metrics::STILL; the
      migration guide says which waits.
      • Reduced motion keeps fades. Ui::set_reduced_motion(true) made every
        change immediate; now only movement is - an offset, a slide, a widget
        sliding in or out. Colors and opacities still fade, in the theme's
        motion_short at most, and an entrance that slides and fades keeps
        its fade. Turning it on still ends what is moving, at its target.
      • The controls: hover and press fade in (Pace::Short) and out in one
        and a half times as long, on buttons of every variant, flat rows,
        clickable panels, checkboxes, switches, slider thumbs and splitters; a
        switch's knob slides; a checkbox's mark and a radio button's dot grow
        and fade in; a slider's thumb, a range slider's knobs and a progress
        bar's fill glide to a value set by a press on the track, a key or a
        rebuild (a drag follows at once); the selected tab's, a segmented
        control's and a navigation bar's marker slides to the one chosen.
        Hover and press are no longer drawn at once.
      • The overlays fade and move a few pixels as they come (Pace::Medium)
        and fade as they go (Pace::Short): menus and submenus, list popups,
        completion, the chooser, the command palette, the date picker's
        calendar, the color picker, the find bar, a popover, tooltips, a
        dialog or sheet (its scrim fades, its card rises), and toasts, which
        slide in from the window's edge while those above slide up for them.
        An overlay takes input at its place from the frame it appears. An
        app's own popups do not move unless given Style::enter and
        Style::leave.
      • Sections and trees open and close by drawing: a Collapsible's body
        and a PropertyGrid group's are uncovered while what follows slides
        down, a tree's or a tree table's new rows fade in under the rows
        sliding away, and their chevrons crossfade between the closed and the
        open icon. A chevron is two icons now, one at opacity 0, and a tree's
        rows are keyed by their nodes rather than their index, so a node's row
        stays the same widget when rows open above it; the rows of a tree view
        and a tree table slide when they move.
      • Jumps of the view glide over Pace::Medium: a list's, a table's, a
        tree's and a log viewer's selection moved out of view, a text area's
        page keys and Ctrl+Home and Ctrl+End, VirtualList::scroll_to,
        LogViewer::scroll_to, FindBar::reveal, a screen reader's "scroll
        into view", the keyboard coming up over the focused field, and Tab,
        which now scrolls the focus into view. The offset itself moves, so
        hit testing sees where the view is. A trackpad, a finger, the scroll
        bar and Ui::set_scroll_offset move at once, as before, and stop a
        glide where it is. Ui::scroll_into_view is public, and glides.
      • forma's widgets that moved before take the theme's paces: a drawer
        (300 ms, was 220), a popover and a wizard's page (200 ms, were 150),
        a page stack's and a pager's slides (300 ms, were 250), a tab bar's
        and a kanban board's moves (200 and 300 ms eased, were a spring). A
        widget's Style::transition also fades a change of its border color
        and of its new Style::opacity.
      • A layout with nothing to lay out again lays nothing out, so a frame
        where only a color or an opacity fades costs its drawing (1.19 ms to
        0.02 ms for 6000 widgets on the benchmark's machine). A widget a
        layout slide moves is culled where it is drawn instead of not at all
        (a sliding list of 6000 widgets: 5.21 ms to 1.33 ms a frame). A widget
        drawn at opacity 0 is not drawn at all. Ui::request_redraw makes the
        next layout a full one.
      • The toast stack's root spans the window's height, the toasts at its
        foot, and lets the pointer through where there is no toast.
    • The bundled themes pass the contrast report (ADR 0114, amended). The
      dark theme draws the text and ticks on its accent in its background
      color instead of white (5.41:1 on the accent, was 3.28:1): a primary
      button's text, a checked box's tick, a chosen radio's dot and an on
      switch's knob are dark. Both themes have a stronger field outline,
      which a standard button, a checkbox, a radio and an unchecked switch
      share (dark #646871, was #3F434D; light #90949C, was #C5C9D2),
      and placeholders a step stronger (dark #717683, light #7F848E); the
      light theme's accent is a step deeper (#2568D7, was #2B6EDE), with
      its hover, focus ring, selection and selected row. An app that wants the
      old look sets the old colors on its theme.
    • The text on a fill - on_accent, control_mark and the new on_danger
      • is white or the theme's background (in a light theme its text),
        whichever holds more against the fill, in Theme::from_colors,
        Theme::high_contrast and for a palette saved without on_danger.
    • Theme::with_accent derives the accent's states as the bundled themes
      have them: the hover shade keeps the accent's hue, the dark theme's
      focus ring is the hover shade at 90 %, its selected rows take 24 % of
      the accent instead of 28 %. An app that sets its own accent sees a
      slightly different hover, focus ring and selected row.
    • forma's components use variants instead of colors of their own: a
      dialog's default button and a wizard's Next and Finish are Primary, a
      dialog's destructive answer Danger, a toolbar's and an app bar's
      buttons Subtle, and Toolbar::with_emphasis maps to them. So the text
      on a danger fill is on_danger (dark in the dark theme), a primary
      button under the pointer is accent_hover rather than the accent with
      the hover overlay, and so is a segment that is on. Ui::foreground_of
      reports a variant's text color.
    • The shadows forma's widgets draw take the theme's levels
      (Metrics::shadow_small, shadow_medium, shadow_large) in the new
      Palette::shadow: a dialog, a sheet and the chooser the large one, a
      popover, toasts, completion and menus the medium one (menus were 4/10,
      now 4/12), the floating button and lifted planning entries the small
      one. A theme with a level at strength 0 turns its shadows off.
    • forma's widgets take their text from the theme's text roles where the
      size and weight they set are a role's: a dialog's title is Heading, an
      app bar's Title, tooltips, error messages, the command palette's
      descriptions and a wizard's step numbers Caption, Markdown code blocks
      Code. The look is unchanged, but an app that sets only
      theme.text.size no longer changes these: it sets the roles too
      (theme.text.heading.size and the others). The small texts' floor of
      10 px is gone with it.
    • The Highlighter colors code by the theme's syntax colors
      (Palette::syntax), not syntect's base16-eighties.dark and
      InspiredGitHub; follow_ui_theme (the default) means the palette's
      colors, and a new UI theme recolors the text at the next update.
      highlight_str takes the bundled dark or light theme's, by the
      background. Every color is still held to 7:1 against the background.
      For the old look, set_theme("base16-eighties.dark") or
      set_theme("InspiredGitHub").
    • In a high-contrast theme a track is drawn as an outline around the
      surface, with its fill solid over it, so the filled part stands out by
      its own contrast against the surface (12.53:1 in the dark one, was
      1.60:1 against the track): a slider, a range slider (now 8 px tall
      there), a progress bar and a busy bar. A spinner's ring is a third as
      wide as its arc there. The standard themes draw as before.
    • The focus ring shows only while the user drives with the keyboard (ADR
      0096): Tab, an arrow, Home, End, Page Up or Page Down turn it on, a
      press of the pointer or a touch turns it off, and every other key and
      way the focus moves (Ui::focus, a dialog opening, refocus) leaves it
      as it was. Before, Ui::focus always showed it, and a dialog opened by
      a shortcut after a click showed it on its default button. A range
      slider's knob, the date picker's cursor day and the editors' current
      item are marked only while the keys drive too, and a table's column
      chooser opens on its first entry only then.
    • Lists, tables, trees, tree tables, the kanban board, the calendar and
      the timeline no longer shade their whole area under the pointer: only
      the row, card or entry under it shows it.
    • forma's widgets build with the theme of the place they are built into
      (Ui::theme_of) and its popups with the theme of where they were
      opened from, which is the window's unless a scoped theme is used.
    • Popups - menus, toasts, a selection's toolbar - are placed inside the
      part of the window the system does not cover (Ui::set_insets). With no
      insets, as on the desktop, nothing changes.
    • A finger outside an open popup puts it away and does nothing else: no
      tap, no scroll of what is under it, as on Android.
    • A finger dragged along a focused single-line field whose text runs past
      its width scrolls the text sideways.
    • A Drawer from Side::Bottom without with_size or with_detents is
      as tall as its content (up to the window), not 280 pixels;
      .with_size(280.0) keeps the old size. A finger on a modal drawer's
      scrim waits to see whether it taps (and closes the drawer) or drags it,
      instead of closing it at once.
    • TagInput is 220 pixels wide unless set otherwise, as PasswordField
      and SearchField are; it was 320.
    • Toasts show by their kind unless set otherwise: info and success for
      four seconds as before, warnings for six and errors for eight;
      Toasts::with_duration(d) still sets one time for every kind.
    • Toasts::push and push_message take &impl Timekeeper instead of
      &mut Ui, so a callback with no window open pushes a toast with its
      Context; calls with a &mut Ui compile as before. A toast asks to be
      woken when it goes, so it goes on time in whichever window shows it.

    Added

    • PropertyGrid<K> and Property<K>: an app's properties as names and
      editors in two columns, in groups that open and close (ADR 0094). Each
      property is made by its value's type - text, number, integer,
      bool, color, choice, date - and edited with forma's own field,
      number field, checkbox, color picker, select or date picker; text is
      checked with a form's rules and the app refuses a value with
      set_error. It reports PropertyGridEvent::Changed { key, value } with
      a PropertyValue, and Toggled. Tab goes through headers and editors,
      Up and Down from row to row, Left and Right close and open a group; a
      screen reader hears each editor by its property's name.
    • NavigationList<K> and NavigationItem<K>: the sections of a settings
      window down its side, in groups, one selected by a click, the arrows,
      Home, End or typing; heard as a list box. NavigationList::compact() is
      a rail, icons over short labels in a column 72 pixels wide.
      NavigationItem::badge and Badge (Dot, Count) mark an item there
      and on the navigation bar.
    • LogViewer: the lines of a log the app pushes (push, push_level),
      on a virtual list, so a million lines cost what a screenful does, with
      a cap that drops the oldest (ADR 0097). ANSI escape codes color and
      style them, every color held to 4.5:1 against what is behind it; it
      follows new lines while at the end, with a "Jump to latest" button;
      set_filter and set_min_level narrow it; lines are selected by
      pointer and keys and copied as plain text; lines keep their numbers
      through drops. Palette::ansi: the 16 colors escape codes name.
    • Table::with_striped_rows() and Palette::row_stripe; Style::unshaded()
      for a clickable container that shows no hover or press;
      PaintCx::is_focus_visible() for a custom widget.
    • The editors feature and forma::editors (ADR 0095): components that
      show data the app owns and report what the user does for the app to
      apply, each reporting a drag once, when it is let go, so one undo step
      per report is one per drag.
      • ZoomCanvas<K> and CanvasItem: the app's items as boxes on an
        unbounded plane that the user pans, zooms (the wheel, a pinch, +,
        -), fits, selects (with a rectangle too) and drags, snapping to a
        Grid, with a minimap. CanvasEvent::{Selected, Activated, Moved, Deleted}.
      • NodeEditor<K>, with EditorNode, Port, Wire and PortRef: a
        node graph on the same canvas, ports joined by dragging or clicking
        one and then the other (only of the same kind), wires with reroute
        points; from the keyboard too, and to a screen reader as nodes and
        their ports. NodeEditorEvent::{Selected, Activated, Moved, Connected, Deleted, Rerouted}.
      • CurveEditor and CurveKey: a cubic Hermite curve through keys with
        tangent handles (curve_value reads it); GradientEditor and
        GradientStop: color stops on a strip (gradient_color reads it).
      • DiffViewer: what changed from one text to another, side by side or
        inline, the words that changed marked, diff_lines working the
        changes out with Myers' algorithm (no new crate), n and p going
        from change to change.
      • Viewport: a view onto an unbounded plane, for an app's own custom
        widget.
    • Files dragged in from outside: InputEvent::FileHoverMoved(position),
      for a platform that says where the drag is while it holds the pointer;
      it moves the drop's target, not the hover.
    • Dragging out of the window (ADR 0099): DragData (files, text, any
      MIME type, whether the other app may move it) and Ui::offer_drag(source, data) on Event::DragStarted let a drag leave the window, and
      Event::DraggedOut { source, action } says how it ended. For runners:
      Ui::take_drag_out() and InputEvent::DragOutEnded.
    • Floating dock panels (ADR 0109): DockLayout::floating, saved with the
      layout (a layout saved by 0.3 loads with none), turned on with
      DockArea::set_floating. A panel floats from its tab's new menu (Float,
      Dock, Close), with DockArea::float, or by letting its tab go outside
      the window, and docks back from the menu, with dock_back, or by
      dragging the tab back (X11); the app opens a window per float and builds
      it with DockArea::build_float. DockArea::dropped_from_window moves a
      tab let go over another window. Ui::last_drop, and for runners
      Ui::live_drag, set_visiting_drag and drop_visiting_drag.
    • Timekeeper: what tells a component the time outside a frame,
      implemented by Ui, Clock and forma-app's Context.
    • What a phone's system tells a window: Ui::set_insets(Insets) (the
      bars, a cutout, the keyboard, and with Insets::gestures the edges the
      system takes swipes from) and Ui::insets; Style::safe_area() and
      safe_area_sides, which keep a panel's content clear of them, the
      focused field scrolled above the keyboard with 16 px to spare;
      Ui::set_text_scale for the user's font size; Ui::back() and
      takes_back(), Back closing the topmost popup first.
      Fonts::load_system_font_files loads fonts from a list of files.
    • Touch first (ADR 0106, 0107). Metrics::for_touch(), Metrics::TOUCH
      and Theme::for_touch(): controls 48 pixels tall, larger checkboxes, a
      wider splitter, longer scrollbar thumbs, menu rows a finger tells apart,
      and with them Metrics::scrollbars_fade (scrollbars only while
      scrolling) and Metrics::min_touch_target (a finger beside a widget
      presses the nearest one).
      • A long press asks for the context menu (Event::ContextRequested) or
        shows the tooltip of what it holds; Ui::take_long_press tells a
        runner to vibrate.
      • Momentum: a flick goes on scrolling and slows down; a finger stops it
        and taps nothing. A finger lifted after resting 40 ms flicks nothing.
        Overscroll: past the end the content pulls against a rubber band and
        springs back. A row a finger rests on shows pressed after a tenth of a
        second, and nothing is drawn hovered under a finger.
      • Text selected by touch: a long press or a double tap selects a word,
        with forma's two handles and a toolbar that cuts, copies, pastes and
        selects all; a tap puts a handle under the caret for a few seconds.
        Handles show only where the field shows.
      • Swipes: Style::touch_swipe(Axes), the first move past the tap slop
        deciding who gets the touch, reported as Event::Swipe with a
        SwipePhase (and WidgetInput::Swipe); Ui::feel_tick() and
        take_tick() for a tick as a swipe crosses a threshold.
      • SwipeActions<A>: a row with actions on either side, uncovered by a
        swipe; past half the row and past the actions the first action
        stretches over the row and runs when let go, a flick only opens or
        closes. Each action is as wide as its label needs, and the same
        actions are the row's context menu.
      • Style::pull_to_refresh(), Event::RefreshRequested,
        Ui::set_refreshing and is_refreshing: a list pulled down past
        64 pixels asks to refresh, with forma's spinner until the app is done.
      • The bottom sheet: Drawer::with_detents (Detent::Height,
        Fraction, Content) with detent() and set_detent; an open
        drawer follows a finger and settles on a detent or closes;
        Drawer::with_handle(); Drawer::with_edge_swipe() opens a side
        drawer from its edge where the system leaves it to the app;
        DrawerEvent::Detent and Opened. A toast is swiped away sideways
        (ToastEvent::Dismissed). Edges, for Insets::gestures.
      • PageStack<K>: pages pushed and popped with a slide, replaced or
        reset to one (reset_to, for a navigation bar's destinations) with a
        fade, the pages under the top kept built with their state, answering
        Back.
      • AppBar<A> with Navigation (None, Menu, Back): the bar at the
        top, with a title, a toolbar for its actions, the status bar's inset
        (and a strip in its color while it moves away), moving away and back
        with a scroll container, pixel for pixel, and with
        with_search(SearchField) a search that opens in the bar.
      • NavigationBar<K>: up to five items along the bottom, above the
        navigation bar's inset, heard as tabs.
      • Pager<K>: pages side by side, swiped one at a time with a rubber
        band at the ends, with dots, the neighbors built and hidden.
      • FloatingButton: the screen's main action, a round accent button in
        the end corner, moving above the navigation bar and the keyboard;
        extended() shows its label.
      • TimePicker::with_wheel() and DatePicker::with_wheel(): columns a
        finger scrolls and flicks, snapping to an item; each a spin button to
        a screen reader.
      • Toasts::set_bottom_room(px): room under the toasts for an app's own
        navigation bar or floating button. Toasts keep clear of the insets.
      • Style::private_input() and Ui::ime_private(): a field that asks
        the on-screen keyboard not to learn from it; Ui::edit_as_user(edit)
        for a runner that hands a field an input method's edits.
    • Theming (ADR 0114).
      • forma::contrast(a, b) and Theme::contrast_report(): every pair of
        colors forma draws text or a mark with that falls short of WCAG 2
        (4.5:1 for text, 3:1 for marks and placeholders; 7:1 and 4.5:1 in a
        high-contrast theme), as ContrastIssues.
      • Theme::from_colors(ThemeColors): a whole theme from a background, a
        text color and an accent (and the status colors), by the recipe the
        bundled themes are made with. Theme::high_contrast(): a theme lifted
        to the high-contrast themes' promise, each color moved only as far as
        it has to.
      • With serde, ThemeFile: a theme as a designer writes it - a base
        and only what differs (colors as hex, metrics, text and its roles,
        fonts, named styles, high_contrast), unknown keys refused -
        resolved with ThemeFile::resolve into the theme and its report, or a
        ThemeError saying where.
      • Variant (Standard, Primary, Danger, Subtle, Outline) and
        Style::variant: how a button is filled and its text colored, from the
        palette. Palette::on_danger and Palette::shadow.
      • The theme's tokens: Metrics::shadow_small, shadow_medium and
        shadow_large (ShadowToken), motion_short, motion_medium and
        motion_long, spacing and Metrics::space(step); Metrics::COMPACT,
        a denser preset. A theme saved before 0.4 reads with the default
        tokens and the bundled colors that fit it.
      • Text roles: TextRole (Body, Caption, Label, Heading,
        Title, Code), RoleStyle (size, line height, weight, font) for
        each in TextStyle, and Style::text_role.
      • SyntaxColors and Palette::syntax: twelve colors code is
        highlighted in, at 7:1 in every bundled theme;
        Highlighter::highlight_with.
      • Named styles (ADR 0115): StylePatch, StyleSheet, Ui::set_styles,
        forma's 23 names in forma::style_names (button, toolbar.button,
        table.row, ...), and Style::class("app.card") for an app's own; a
        theme file's styles.
      • Scoped themes: Ui::add_theme, set_scoped_theme, remove_theme,
        scoped_theme and Style::theme(id): a widget and what is inside it
        drawn and laid out in another theme; Ui::theme_of and theme_id_of.
    • Motion (ADR 0116, 0117).
      • Pace and Metrics::transition(pace), an ease-out over the theme's
        times; Metrics::STILL, a theme whose own widgets do not move.
      • Ui::set_motion_scale(scale): every motion takes that many times as
        long; 0 makes every change immediate.
      • Ui::animate and PaintCx::animate: a value a component, an app or
        a custom widget's drawing moves toward a target, asking for frames
        itself; Change (Movement, Fade) says what reduced motion does
        with it.
      • Style::opacity, Style::children_stagger(step), Style::still()
        and Style::reveal(pace), which draws a widget's height changing,
        what follows it sliding.
      • Ui::scroll_to(id, offset) and Ui::scroll_target(id);
        InputEvent::WheelSteps(delta), a notched wheel's steps, which glide
        and add up; Harness::wheel.
      • Plot::with_transition and PieChart::with_transition: a chart's
        bars, points and slices move to new data, the axes with them.
      • Stats::skipped_layouts.
    • Phrases: ChooseColor, Sections, JumpToLatest, FloatPanel,
      DockPanel, Cut, Copy, Paste, SelectAll, OpenMenu,
      Navigation, BadgeDot, BadgeCount, DrawerHandle, Pages,
      PageOf, Day, Month, Year, DayPeriod.

    Fixed

    • A scroll container under a hidden widget (Style::hidden,
      Ui::set_visible(id, false)) lost its scroll offset; it keeps it for
      when it is shown again.
    • With frozen columns, the outline of the cell the keyboard is on had no
      left side in the first column that scrolls.
    • A click on a navigation list's row drew the focus ring around the whole
      list.
    • forma::from_hex panicked on non-ASCII text cut inside a character; it
      returns None for any non-ASCII text.

    forma-wgpu

    Changed (breaking)

    • Gpu::request (and Gpu::headless, Gpu::for_surface and
      SurfaceRenderer::new) asks for WebGL2's limits, raised to the
      adapter's texture size and alignments, instead of wgpu's defaults, so a
      device with only those - OpenGL ES on Android phones and the emulator,
      WebGL2 in a browser - is taken instead of refused. An app that runs its
      own pipelines on forma's device and needs more (compute, storage
      buffers) requests its own device and builds the Gpu from it.

    Added

    • Gpu::noop(): a device that needs no graphics adapter and draws
      nothing, for tests of an app that registers images.
    • WebGL2 on wasm32, beside WebGPU.

    Fixed

    • The quad shader took a derivative after branches that return, which
      browsers' WebGPU refuses: with WebGPU the page stayed black.

    forma-app

    New: the app API out of forma-winit (ADR 0098), so that more than one
    runner runs the same app. forma-winit re-exports all of it under the
    names it had (see forma-winit for what breaks). It depends on forma-ui
    and forma-wgpu and on no platform crate, and builds for the web and
    Android.

    Added

    • App, Frame, Context, Settings, WindowSettings, WindowState,
      WindowIcon, WindowKey, ExitWhen, Waker, Task, SettingsFile,
      OsClipboard, and the services' types - notifications, the tray,
      hotkeys, printing, watching the clipboard, file dialogs, recent
      documents, one instance at a time, the system's settings - behind
      features of the same names as forma-winit's.
    • testing::AppHarness<A: App> (ADR 0092): runs an app as run does -
      launched, start, the builds, update, woken, the windows opening
      and closing, in the same order - with every window a forma Harness, on
      a manual clock. It opens windows, feeds input, asks to close, resizes,
      advances the clock (stopping at each wakeup), answers file dialogs
      (dialog, close_dialog), sends Back, suspends and resumes, hands drags
      between windows, and reports titles, attention, activation and whether a
      window is kept out of screenshots.
    • Context::now, clock, with_clock, advance_clock and dispatch:
      the app's clock, the system's in run. Context implements
      Timekeeper.
    • FileRef (ADR 0108): a file the user handed to the app, read and
      written the same way on the desktop, Android and the web - name,
      path (on the desktop), read, read_bytes, read_to_string,
      write (a FileWriter that puts what was written in the file's place
      as it finishes), write_bytes, keep; FileRef::from_path, and
      FileRef::memory for tests. KeptFile and Context::restore_file: a
      file reached again in a later run.
    • App::suspended, resumed and save_state (ADR 0102): the app went
      into the background, where the system may stop it without exiting,
      came back, and should save now. Desktop runners never call them.
    • App::back_requested and BackResponse (ADR 0104): the platform's
      Back while the app says it can go back (Context::set_can_go_back).
    • App::dropped_from_window(frame, WindowDrop): a drag let go over
      another window of the app; Frame::screen_point(at).
    • Context::data_dir() and cache_dir(): the app's own directories.
      Context::open_url(url), with OpenError, which moved here and has an
      Unsupported case. Context::keep_screen_on, set_orientation
      (Orientation), multiple_windows, touch_first and haptic(Haptic)
      (Press, LongPress, Tick). Context::rebuild_window(key): one
      window built again, not all. Frame::set_title.
    • Screens kept out of screenshots, recordings and the app switcher:
      WindowSettings::secure, Settings::secure and Frame::set_secure,
      failing with SecureError where the platform cannot.
    • Watching the clipboard reads any type a copy offers as it is
      (ClipboardFormat::Bytes(type), ClipboardOffer::bytes) and says how
      large each type read was (ClipboardOffer::size).
    • Secrets copied for a while (ADR 0112):
      OsClipboard::set_secret_text_until(text, at) takes the copy off the
      clipboard at at if it still holds it (cleared all the same where the
      clipboard cannot be read to tell), also while the app is stopped on
      Android; OsClipboard::secret_expiry(); App::clipboard_expiry_failed.
    • The device-keys feature (ADR 0110): Context::device_key(name), a
      DeviceKey that the system keeps and uses only right after the user's
      fingerprint or PIN, sealing a small secret (create, delete, seal,
      open, each prompt's texts the app's), answered through
      App::device_key_done as a KeyOutcome; Context::device_keys_ready;
      Sealed, the sealed secret's format; Opened, zeroed when dropped;
      MemoryDeviceKeys for tests.
    • The autofill feature (ADR 0111): AutofillHandler, plain Rust that
      an app implements to fill other apps' and web pages' login forms from
      its vault and save what is typed - FillRequest (with login(),
      forma's guess at the login form), FillAnswer, Dataset, Locked and
      Unlock, SaveRequest, SaveAnswer - built and tested on Linux with
      FillRequest::for_test.
    • SystemSettings::motion_scale, which the default
      App::system_settings_changed passes on with Ui::set_motion_scale.
    • For runners, forma_app::host: Host (every method defaulting to "the
      platform does not have it"), WindowHost, RunnerContext, Sink and
      HostEvent, the app's directories (set_app_dirs, AppDirs::new),
      files, clipboard (timed secrets), device_keys, and the accessors a
      runner shows a file dialog, a tray icon or a notification with.

    Changed

    • The default App callbacks that report a failure start their line with
      forma:, not forma-winit:, and write it to the browser's console on
      wasm32.
    • SettingsFile is documented to load in App::launched (on Android the
      runner says where the app's files are only as it starts) and to save in
      App::save_state as well as exiting.

    forma-android

    New and experimental: runs forma apps on Android, on android-activity with
    GameActivity, from Android 10 (API 29) (ADR 0101). On other targets it
    only re-exports forma-app.

    Added

    • forma_android::run(android, settings, app) runs an App in an
      activity, as forma_winit::run runs it on the desktop; AndroidApp and
      the app API are re-exported, and android_app(&frame) reaches the
      activity. One screen: another window never opens, and
      App::window_closed says so.
    • Drawing with Vulkan, or OpenGL ES where Vulkan is missing and on the
      emulator, following rotation and split screen; the display's density as
      the scale; light and dark mode; the system's fonts, for every script.
    • Touch, a pen with its pressure, a mouse and a hardware keyboard. The app
      is touch first: the standard themes come with the touch metrics, and a
      long press or a swipe's tick vibrates.
    • The app's lifecycle: suspended and save_state going to the
      background, resumed coming back, the screen and its state kept while
      there is no window.
    • Edge to edge on every version, the bars transparent: the screen's Ui
      hears the insets - the bars, a cutout, the keyboard, the system's
      gesture edges - and the bars' icons follow the theme's background.
    • The on-screen keyboard, through a Java helper embedded in the library:
      shown for a field that takes text, with its hints (digits for a number,
      no learning and no suggestions for a password or a private field, a
      line break in a text area), typing, composing, swipe typing and
      corrections reaching the field, the keyboard's caret saying where an
      edit is.
    • Back: the topmost popup first, then the app while it can go back
      (App::back_requested), then the system, from Android 10 on. The volume
      keys, a headset's and the media keys go to the system.
    • The clipboard, as Context::clipboard and in the fields - text, HTML,
      and secrets marked sensitive - and timed secret copies, cleared by an
      alarm also while the app is in the background or stopped.
    • The user's font size and the system's settings: reduced motion, high
      contrast (the theme follows), the accent color from Android 12 on, and
      the animator duration scale as the motion scale.
    • File dialogs show the system's picker (the Storage Access Framework):
      open, open many, save and a folder, a document kept across restarts with
      FileRef::keep.
    • Context::data_dir, cache_dir and SettingsFile in the app's own
      storage; Context::open_url through an intent; keep_screen_on and
      set_orientation.
    • TalkBack: forma's accessibility tree, through accesskit_android.
    • A screen kept out of screenshots (FLAG_SECURE) from its settings and
      Frame::set_secure; a screen asked to be kept out that cannot be is not
      shown, and run stops with RunError::Secure.
    • Device keys, in the Android Keystore with the system's
      BiometricPrompt.
    • Autofill: an autofill service and its unlock activity, which hand
      Android's requests to the app's AutofillHandler, named with
      forma_android::autofill_handler!; autofill::is_enabled(frame) and
      autofill::ask_to_enable(frame) (AutofillSettingsError).
    • template/: an app that runs on the desktop (cargo run) and on
      Android, with a Gradle project that builds it with cargo-ndk and takes
      the app's id and name as properties. Its manifest keeps the app out of
      backups, declares USE_BIOMETRIC, the clipboard's receiver and, with
      -Pforma.autofill=true, the autofill service; its README names what an
      app keeps and copies again with each version.
    • examples/mobile/, forma-mobile: one app for a phone and the desktop
      that shows every phone feature of 0.4, autofill included.
    • scripts/dex.sh compiles the Java helper into the committed DEX, and
      --check fails if it differs.

    forma-winit

    Changed (breaking)

    • The app API is forma-app's, re-exported under the names it had: an app
      that imports from forma_winit keeps compiling, apart from what
      follows. forma-app, and with it forma-wgpu, is a dependency whatever the
      features, so forma-winit without run builds wgpu.
    • App::unhandled gets an Unhandled instead of winit's WindowEvent:
      event.input is the event in forma's words, and
      forma_winit::window_event(event) is winit's.
    • Frame::window() is forma_winit::window(&frame), an Option (None
      for a window that is not winit's). Frame::set_title sets a title
      without it.
    • OsClipboard::new and for_display come from the trait
      OsClipboardExt, and Context::recent_documents from
      RecentDocumentsExt: each has to be in scope.
    • App::dialog_closed hands out Option<Vec<FileRef>> instead of paths.
      A save through a FileRef replaces the file at once (written beside it
      and renamed over it), where std::fs::write wrote it in place.
    • Attention is non-exhaustive: a match on it needs a _ arm. A level
      added later asks as strongly as winit can.

    Changed

    • Context::activate raises an open window on Wayland, with the
      activation token it is given, through xdg-activation on a connection of
      forma's own beside winit's (ADR 0093). It fails with
      ActivateError::Unsupported only without a token or without
      xdg-activation.
    • Frame::print_pdf gives the print dialog its window as the parent on
      Wayland too, through xdg-foreign.
    • A notched mouse wheel's steps are sent as InputEvent::WheelSteps, which
      glide; a trackpad's pixels stay InputEvent::Scroll. Code of an app's
      own that matches Scroll in WinitInput's events sees a wheel as
      WheelSteps now.
    • OpenError is there without the open feature too.

    Added

    • forma_winit::window(&frame), window_event(&event), OsClipboardExt,
      RecentDocumentsExt, and forma_winit::forma_app, the app API with its
      host module.
    • Files dragged in from other apps drop onto windows on Wayland, through a
      data device of forma's own on its connection.
    • Drags out of a window to other apps (ADR 0099), on Wayland and X11 (the
      source side of XDND), once a drag with an offer leaves the window;
      Escape calls it off.
    • Drags between the app's own windows on X11 (ADR 0109), calling
      App::dropped_from_window; Frame::screen_point on X11, Windows and
      macOS.
    • run in a browser (ADR 0100): it draws into the page's canvas (or one
      it adds), with WebGPU or WebGL2, one window, the window's title the
      page's. The clipboard feature there is the browser's clipboard, text
      only; open_url opens a new tab; file dialogs show the browser's chooser
      and save as a download; the other services say they are not there.
      stderr and panics go to the console. tools/web/build.sh builds an
      example for the browser and serves it.
    • run takes a timed secret off the clipboard at its time, with or
      without a window, and as the app ends.
    • The editors and device-keys features, forma-ui's and forma-app's;
      device keys answer Unsupported on the desktop and in a browser.
    • A window opened with WindowSettings::secure opens as before and says
      on stderr that it cannot be kept out of screenshots there.
    • The gallery: a Settings page (the property grid and navigation list), a
      Log page, Canvas, Nodes, Curves and Diff pages (with undo), a Styles
      page, a Theme page (a theme editor with a live preview, the contrast
      report and theme files), a Text roles page, a Motion page with a speed
      factor and reduced motion, button variants on the Controls page, and on
      the System page a drop zone, a file and text to drag out, and a secret
      copied for 10 seconds. Its panels float, and it runs in a browser.

    Fixed

    • On X11 files dragged in from another app drop on the widget they are
      let go over, and its highlight follows them; before, they dropped where
      the pointer was before the drag.
    • forma-winit builds for macOS and Windows with the print feature
      again.
    Downloads