Skip to content

v0.3.0

Choose a tag to compare

@github-actions github-actions released this 21 Nov 16:49
· 27 commits to main since this release
c8c0d05

Changes since v0.2.0.

API and migration

  • Breaking: Rename the optional windows-chrome Cargo feature and gpui_material::windows_chrome module to window-chrome and gpui_material::window_chrome across gpui-material-extras, gpui-material, and gpui-material-gallery, and remove the Windows-only compilation gate.
  • Breaking: IconName adds IconName::Visibility and IconName::VisibilityOff. Update exhaustive IconName matches to cover the new variants, or add a fallback arm.

Window chrome and cross-platform defaults

  • Add cross-platform window_chrome support covering Windows native hit testing and Snap Layouts, macOS native traffic-light centering (title_bar_window_options_with_height) and leading inset spacing, and Linux Decorations::Client / Decorations::Server + WindowControls integration.
  • Expand TitleBar and CaptionButtons with customizable .height(...), .title(...), .title_role(...), .title_font(...), .title_font_family(...), .title_font_size(...), .leading(...), .trailing(...), .traffic_light_padding(...), .colors(TitleBarColors), .caption_colors(CaptionButtonColors), .caption_button_width(...), .show_caption_buttons(...), .on_close(...), and .platform(ChromePlatform), replacing hardcoded "Segoe UI" and "Segoe Fluent Icons" with Material theme typography and vector caption icons.
  • Update FontFamilies::default() in gpui-material-theme with cross-platform Latin and CJK fallbacks (SF Pro Text, Segoe UI, Noto Sans, PingFang SC, Microsoft YaHei UI, Noto Sans CJK SC) and enable cargo gallery --window-chrome on all desktop targets.

Components

  • Add ButtonTone (Default, Danger, Success, Warning, Info) semantic shortcuts to Button, ToggleButton, IconButton, and IconToggleButton while preserving per-instance ButtonColors and ButtonBorder precedence.
  • Promote SemanticTone to core (retaining pub type ButtonTone = SemanticTone;) and propagate .tone(SemanticTone) across Badge, Chip, Dialog (.confirm_tone), MenuItem (plus .destructive()), Snackbar, LinearProgress, and CircularProgress; add Badge::{standalone_label, standalone_count, color_role}, Dialog::{alert, on_confirm}, MenuItem::{shortcut, divider}, SnackbarHost::{push_message, replace}, Tooltip::shortcut, variant/typography shorthands on Button, IconButton, Card, Chip, TextField, and Text (including .muted()), and the fluent postfix MaterialElementExt trait (.badge_dot(), .badge_label(...), .badge_count(...), and with feedback: .tooltip(...), .context_menu(...)).
  • Add .track_focus(&FocusHandle) to Chip, Checkbox, Radio, Switch, and Card, preserve ThemeScope in toggle and selection/list/card action callbacks, match disabled label opacity and single-line truncation across Checkbox, Radio, and Switch, clip split Chip primary and removal action feedback along the interior seam, and keep overlapping range Slider thumb selection responsive after zero-delta drag moves.
  • Add core Avatar display component (initials, icon, image with .fallback, custom, AvatarSize, AvatarShape, AvatarColors) and overlapping AvatarGroup stack with uniform sizing, surface-matched cutout rings, +N overflow truncation, RTL mirroring, and summary accessibility labels.
  • Add core presentational EmptyState layout shell with an optional decorative icon container (MaterialShape polygon or CornerShape backdrop) or custom .visual, title, supporting copy/content, centered RTL-aware primary/secondary action slots, and configurable .max_width / .title_role.
  • Add four M3E convenience components without new feature-group dependency edges: in-flow Banner (feedback, with SemanticTone, actions, dismiss, and Role::Status/Role::Alert), controlled ChipGroup (selection, with Single/SingleRequired/Multiple selection, .single_select, wrapping/scrollable layout, and roving focus), core Skeleton (rect/text_line/circle/shape placeholders on LoopClock + is_bounds_visible with zero offscreen/reduced-motion frames), and width-responsive Breadcrumbs (navigation, collapsing middle segments into an anchored Material Menu).
  • Add ButtonGroup::connected, .single_select, and .single_optional_select ergonomics shortcuts to gpui-material-extras (expressive-groups).
  • Add DropTarget (surfaces feature) for external OS file drops (ExternalPaths) and typed in-app GPUI drag payloads with validation feedback and optional click/keyboard activation.
  • Add Stepper (navigation feature) with horizontal and vertical orientations, StepStatus, .active_step, .non_linear, RTL mirroring, and roving keyboard navigation.
  • Add standalone NavigationDrawer (navigation feature) with Standard and Modal (side-sheet) modes, sections, headers, dividers, 56 dp pill indicators, and roving vertical navigation.
  • Add BottomAppBar (navigation feature) with 80 dp Material styling, action and trailing FAB slots, Scaffold::bottom_bar compatibility, and AppBarScrollBehavior / AppBarScrollState hide-on-scroll support.
  • Add settings convenience tiles SwitchTile, CheckboxTile, RadioTile, SliderTile (surfaces + selection), ChoiceTile / ChoiceOption (surfaces + feedback), and ListSection / ListSectionItem (surfaces) with optional LabelMedium section headings, true M3E Segmented grouped corner geometry (16/4, 2 dp gap), and unified vertical roving focus.
  • Add Button::loading(bool) and IconButton::loading(bool) (actions feature, no dependency on feedback) with busy accessibility semantics, activation suppression, resting-width preservation, and an inline Material circular spinner respecting is_bounds_visible and reduced_motion.
  • Bundle official Material Symbols Outlined IconName::Visibility and IconName::VisibilityOff (both fill variants) from the pinned upstream revision.
  • Fix Sheet::expandable drag handle creating an unlabeled keyboard tab stop, delay Tooltip motion sampling until its trigger anchor is measured, prevent SnackbarHost first-frame zero-width layout and bound exiting queue growth under reduced motion, and defer render-time transition notifications across NavigationRail, AdaptiveNavigation, and AdaptivePaneState.

Inputs

  • Add TextFieldObfuscationMode (Hidden, Visible) and TextField::obfuscation_mode(...) for TextField::secure visibility toggles, re-export TextFieldMaskPattern through the inputs feature facade, and add Gallery examples and tests covering password visibility toggling, structured mask patterns, and pre-commit validation.
  • Add TextField::clearable(bool) (.clear_label(...)) and TextField::visibility_toggle(visible, on_toggle) (.visibility_labels(show, hide)) inside the inputs feature without adding a dependency on actions, automatically syncing secure obfuscation mode and preserving focus.
  • Add ExposedDropdown::with_shared_options for O(1) Rc<[DropdownOption]> option sharing, accelerate dropdown filtering with zero-allocation ASCII case-insensitive matching and cached active indices, reserve trailing inset for TextField resting labels when .trailing(...) is present, and cache per-frame character counts.

Performance, theme, foundation, and symbols

  • Store all 61 Material color roles inline in ColorScheme for allocation-free O(1) lookups and blending, expose ColorScheme::baseline, appearance, and color as const fn, and preserve the compact { appearance, overrides } serde format.
  • Cache resolved system and custom Font family descriptors and letter-spaced LineLayout runs in gpui-material-foundation, cache tessellated Shape stroke paths and transparent Surface rounded feedback geometry, prune finished ripples before Escape cancel checks, and expose elevation_shadow_pair for allocation-free canvas shadow painting.
  • Accelerate clipped_ripple with precomputed 64-gon unit-circle normals and inscribed-disk / triangle-AABB fast paths.
  • Add const fn constructors and accessors SymbolAxes::new, SymbolAxes::is_filled, and SymbolAxes::get_weight in gpui-material-design-symbols, and cache outlined SVG bytes by (codepoint, axes) in SymbolFont::svg_data so repeated lookups and alias symbols share a single Arc<[u8]>.
  • Snapshot Menu exit rows lazily, short-circuit AdaptivePaneState history resolution once all three pane roles are assigned, replace per-frame multi-pane geometry Vec allocations with stack arrays, and avoid redundant root layout passes and focus map clones in AdaptiveNavigation, AppBar, Scaffold, and NavigationItems.
  • Binary-search single-line ellipsis truncation in Text, deduplicate ExtendedFab label shaping, reuse cached rounded feedback geometry and stack-allocated elevation_shadow_pair shadows across Button, Chip, Card, ListItem, and selection ripples, add static corner and line-count fast paths in ListItem, reuse active DisplayScrollbar fade wake timers across intermediate scroll frames, predefine const Progress easing curves, and skip redundant SwipeToDismiss width notifications when settled at rest.
  • Optimize gpui-material-extras runtime hot paths: release SearchState result focus handles when returning to idle, replace O(N) search result focus scans with O(1) scope checks, skip redundant SearchView and DatePicker state updates when idle, cache monthly calendar day IDs and accessible labels alongside static day, two-digit, and dial-mark tables, reuse active ScrollField settle timers across rapid scroll events, precompute contained Carousel keylines once per layout and share measured layouts without extra next-frame re-renders, skip zero-radius CarouselParallax corner paths, preserve ButtonGroup focus handles and cached label widths across unchanged renders, and gate Toolbar footprint animation frame requests on exit_direction.is_some().

Gallery

  • Lazily instantiate Gallery story views on first visit while retaining visited story state, scope ModalExamples entity creation to the active story (Dialog vs Sheets), exclude the desktop Gallery shell from wasm32 builds, and consolidate Gallery tests into a single test binary.

Contributors

Full Changelog v0.2.0...v0.3.0