From 22c0cbd009562c8c9d2e0801cdc42bad8a880689 Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Wed, 15 Jul 2026 12:47:15 -0700 Subject: [PATCH] gpui: Bump taffy from 0.10.1 to 0.12.1 (#60721) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Migrates the alignment conversions to taffy's new safe-alignment style types: `AlignItems`/`AlignContent` and friends are now structs pairing a keyword with a safety modifier, constructed via associated constants (e.g. `AlignItems::START`) instead of enum variants. The motivating change in this release is [taffy #911](https://github.com/DioxusLabs/taffy/commit/df2663aad35801f7522f6878a0300646dfe624f7) ("More correct caching logic"), which keys taffy's per-node measure cache on axis, parent size, and available space. Today GPUI is largely immune to the old cache-key conflation because text answers every sizing probe with the same width; the follow-up PR in this stack (honest min-content text measurement) returns different sizes for different constraints, which makes cache-key correctness a prerequisite. 0.12.1 additionally hotfixes two block layout/caching regressions in 0.12.0, and 0.11.0's grid fix (resolving item percentages against the grid area rather than the container) comes along as well. Stack: 1. **This PR** — taffy 0.12.1 2. #60722 — honest min-content text measurement 3. #60723 — CSS `auto` grid tracks for table-like column sizing Release Notes: - N/A --- Cargo.lock | 4 ++-- crates/gpui/Cargo.toml | 2 +- crates/gpui/src/style.rs | 32 ++++++++++++++++---------------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 76d35e51a5..56b62212f4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18274,9 +18274,9 @@ dependencies = [ [[package]] name = "taffy" -version = "0.10.1" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aea22054047c16c3f34d3ac473a2170be1424b1115b2a3adcf28cfb067c88859" +checksum = "73afc801dd6bd47529eaa7c7e90557f107527d1b7c9c7ed7d7803c7b8d0c357f" dependencies = [ "arrayvec", "grid", diff --git a/crates/gpui/Cargo.toml b/crates/gpui/Cargo.toml index bcf992a531..63e1814b50 100644 --- a/crates/gpui/Cargo.toml +++ b/crates/gpui/Cargo.toml @@ -91,7 +91,7 @@ async-channel.workspace = true stacksafe.workspace = true strum.workspace = true sum_tree.workspace = true -taffy = "=0.10.1" +taffy = "=0.12.1" thiserror.workspace = true gpui_util.workspace = true hdrhistogram = { workspace = true, optional = true } diff --git a/crates/gpui/src/style.rs b/crates/gpui/src/style.rs index 292b806347..0908a7ea4d 100644 --- a/crates/gpui/src/style.rs +++ b/crates/gpui/src/style.rs @@ -1245,13 +1245,13 @@ pub enum Position { impl From for taffy::style::AlignItems { fn from(value: AlignItems) -> Self { match value { - AlignItems::Start => Self::Start, - AlignItems::End => Self::End, - AlignItems::FlexStart => Self::FlexStart, - AlignItems::FlexEnd => Self::FlexEnd, - AlignItems::Center => Self::Center, - AlignItems::Baseline => Self::Baseline, - AlignItems::Stretch => Self::Stretch, + AlignItems::Start => Self::START, + AlignItems::End => Self::END, + AlignItems::FlexStart => Self::FLEX_START, + AlignItems::FlexEnd => Self::FLEX_END, + AlignItems::Center => Self::CENTER, + AlignItems::Baseline => Self::BASELINE, + AlignItems::Stretch => Self::STRETCH, } } } @@ -1259,15 +1259,15 @@ impl From for taffy::style::AlignItems { impl From for taffy::style::AlignContent { fn from(value: AlignContent) -> Self { match value { - AlignContent::Start => Self::Start, - AlignContent::End => Self::End, - AlignContent::FlexStart => Self::FlexStart, - AlignContent::FlexEnd => Self::FlexEnd, - AlignContent::Center => Self::Center, - AlignContent::Stretch => Self::Stretch, - AlignContent::SpaceBetween => Self::SpaceBetween, - AlignContent::SpaceEvenly => Self::SpaceEvenly, - AlignContent::SpaceAround => Self::SpaceAround, + AlignContent::Start => Self::START, + AlignContent::End => Self::END, + AlignContent::FlexStart => Self::FLEX_START, + AlignContent::FlexEnd => Self::FLEX_END, + AlignContent::Center => Self::CENTER, + AlignContent::Stretch => Self::STRETCH, + AlignContent::SpaceBetween => Self::SPACE_BETWEEN, + AlignContent::SpaceEvenly => Self::SPACE_EVENLY, + AlignContent::SpaceAround => Self::SPACE_AROUND, } } }