From 4737a02bba14fb1ac4f69ea80310a797a5a3fb2b Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 18 Nov 2026 08:09:16 -0500 Subject: [PATCH] combine pdf-forms-workflows-fw: collect the exclusive toggle's others before emitting (owning source borrows self); auto_scroll_mark_look from style (moved by pdf-canvas-w2) Co-Authored-By: Claude Opus 5.5 --- Cargo.lock | 1 + crates/ui-contract/src/contract/items/drag.rs | 4 +++- crates/ui-contract/src/contract/items/hooks.rs | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dc1c3daa1..2d152b21d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3571,6 +3571,7 @@ dependencies = [ name = "craft-review" version = "0.1.0" dependencies = [ + "base64 0.23.1", "craft-behavior", "craft-host", "craft-i18n", diff --git a/crates/ui-contract/src/contract/items/drag.rs b/crates/ui-contract/src/contract/items/drag.rs index 84535baaa..bf72d87e7 100644 --- a/crates/ui-contract/src/contract/items/drag.rs +++ b/crates/ui-contract/src/contract/items/drag.rs @@ -401,7 +401,9 @@ impl ItemsHooks<'_, '_, C> { let mods = crate::runtime::pointer::frame(&cx.core.ctx).mods; self.emit_toggle(cx, at, &column, on, mods); if toggle.exclusive && on { - for other in (0..self.source.len()).filter(|&other| other != at && self.source.toggled(other, &column)) { + // Collected first: emitting needs `self` mutably while the source is read through it. + let others: Vec = (0..self.source.len()).filter(|&other| other != at && self.source.toggled(other, &column)).collect(); + for other in others { self.emit_toggle(cx, other, &column, false, mods); } } diff --git a/crates/ui-contract/src/contract/items/hooks.rs b/crates/ui-contract/src/contract/items/hooks.rs index 54b4bf2d1..521378417 100644 --- a/crates/ui-contract/src/contract/items/hooks.rs +++ b/crates/ui-contract/src/contract/items/hooks.rs @@ -14,13 +14,14 @@ use crate::contract::cx::{BodyCx, Pointer as _}; use crate::contract::run::{Measuring, ShapeHooks, ShowAt}; use crate::contract::steps::ShapeKind; use crate::contract::{Bind, Collection, Cx, Internal, ItemCx, ItemOutput as _, PartsCx, Props, Show as _, Sizing}; -use crate::primitives::{AutoScrollMark, HiddenContent, ScrollBar, SurfaceSlot, auto_scroll_mark_look}; +use crate::primitives::{AutoScrollMark, HiddenContent, ScrollBar, SurfaceSlot}; use crate::runtime::access::{self, Role, SetPosition}; use crate::runtime::egui::{alloc, areas, child, response}; use crate::runtime::env::WheelScope; use crate::runtime::env::{AppValues, ArenaId, Env, ItemFacts}; use crate::runtime::memory::{MemoryStage, sub}; use crate::runtime::{focus, keys, layout_memory, lazy, overlay, wheel}; +use crate::style::auto_scroll_mark_look; use crate::style::{ComponentStyle as _, StyleCx, SurfaceKind, UiTokens, scroll_bar_look, surface_style}; use craft_behavior::{ Axis, Buttons, CancelReason, EditEvent, Intent, ItemLayout, MiddleButton, MiddleScroll, Mixed, PointerButton, PressPhase, Proposal, ScrollPos,