Skip to content

gpuicn v0.9.0

Choose a tag to compare

@github-actions github-actions released this 03 Nov 22:54
· 29 commits to main since this release
7329d1e

gpuicn v0.9.0

The consistency release. Every component now reads every color, size, radius,
shadow and duration from the theme through one set of primitives, a lint keeps
it that way, and setting up a themed app is one command. The runtime pins are
unchanged: GPUI Kit 0.9.0 on gpui-pre 0.3.11 and gpui-icons 0.6.0.

One-command setup

cargo install gpuicn-cli --version 0.9.0 --locked
gpuicn new my-app --base-color zinc --appearance dark
cd my-app && cargo run
  • ui::app::run: the starter main.rs is a window title, a theme pair and
    a root view. app::run(AppConfig::new("My App").themes(light, dark), |_, _| Root)
    opens the platform with the Lucide assets, loads the bundled Geist fonts,
    installs the pair, follows the operating system's appearance and opens the
    window. AppConfig::install does the same without a window.
  • Theme pairs: UiTheme::set_pair, UiTheme::set_appearance with
    Appearance::{Light, Dark, System}, and theme::follow_system.
  • shadcn's base colors: gpuicn init writes assets/theme.css from
    neutral, stone, zinc, mauve, olive, mist or taupe and generates
    src/ui/app_theme.rs. gpuicn theme set --base-color stone --radius 0.5rem --appearance dark changes it; gpuicn theme import theme.css takes a theme
    from the shadcn theme editor or tweakcn; gpuicn theme preview prints every
    token.
  • gpuicn update moves an app to a release (config, Cargo pins, fonts,
    theme files, then status); gpuicn doctor checks everything against
    the CLI's release and prints a fix per finding; gpuicn remove --unused
    deletes components your code never names.
  • gpuicn.toml is version 2 with a [theme] table. Version 1 files still load.

Consistent by construction

  • Primitives in theme::primitives: text, icon, focus, disabled,
    surface, control, clipped_image, dismiss, hover_reveal_in_group.
    Every component uses them; the registry lint in crates/ui/tests fails a
    change that reintroduces a raw color, text size, opacity, mode branch,
    popover background, hover state, key glyph or pub(crate) item.
  • Focus is one 3px outer ring in ring at 50%, shown through
    focus_visible, on every control.
  • Tokens: status colors (success, warning, info, with foregrounds),
    destructive_foreground, typography (xs to xl with line heights),
    breakpoints, and derived control() colors per mode. Every GPUI Kit
    component color follows a token (a test enumerates them).
  • Motion: transition_with and presence_with over the theme durations,
    UiEasing::Emphasized; dialogs fade in and no longer scroll themselves.
  • Input and Textarea share one InputCore; Message hover actions use a group
    instead of state.

Reliability

  • MessageList has a position-based scrollbar (MessageListScrollbar)
    that estimates unmeasured rows from the measured average, so the thumb
    tracks position in long histories instead of jumping as rows are measured
    (#83). Pass scrollbar_handle to share one across re-renders.
  • Toast schedules on deadlines instead of polling every 50ms.
  • Tooltip installs one Escape interceptor for the application.
  • Every component is drawn in both themes by a test; interactive ones have
    behavior tests in crates/ui/tests/catalog.rs.

Message

  • density(MessageDensity::Compact): one line per post, the time always in
    the gutter, the name inline, half the row padding (#88).

For contributors

  • One preview file per component under site/src/previews/;
    cargo xtask new-component <name> scaffolds a component everywhere the
    catalog expects one. docs/design.md states the rules.
  • Releases ship catalog-screenshots-<tag>.zip, the light and dark sheet of
    every preview, and docs/screenshots/v0.9.0 holds this release's.

Breaking changes

  • UiTheme::shadows entries are Arc<[BoxShadow]>; call .to_vec() where a
    Vec is needed.
  • sidebar_is_mobile(window, cx) takes the window.
  • UiColors::slot is public but #[doc(hidden)].

Upgrading

cargo install gpuicn-cli --version 0.9.0 --locked --force
gpuicn update --to 0.9.0     # config, pins, fonts, theme files; then `gpuicn diff`
gpuicn update --overwrite    # replace installed files once your edits are reviewed
gpuicn doctor

Apps that keep their own main.rs can switch to ui::app::run or keep
calling ui::theme::init(cx); doctor accepts both.