From 890b75f4dbc31b6a823edad1e284547e709eb8dc Mon Sep 17 00:00:00 2001 From: haranishi <223786623+haranishi@users.noreply.github.com> Date: Thu, 19 Nov 2026 21:36:09 +0900 Subject: [PATCH] Show slice warnings below Save for Web previews --- .../src/patterns/form_dialogs/save_for_web.rs | 32 ++++++++++++++++--- .../form_dialogs/save_for_web/hosted.rs | 11 +++++++ .../tests/it/form_dialogs/save_for_web.rs | 17 ++++++++++ 3 files changed, 56 insertions(+), 4 deletions(-) diff --git a/crates/ui-patterns/src/patterns/form_dialogs/save_for_web.rs b/crates/ui-patterns/src/patterns/form_dialogs/save_for_web.rs index 417d06a7e..800692283 100644 --- a/crates/ui-patterns/src/patterns/form_dialogs/save_for_web.rs +++ b/crates/ui-patterns/src/patterns/form_dialogs/save_for_web.rs @@ -9,9 +9,11 @@ use super::size_model::LinkedSize; use super::sizing::{Resample, SizingWords}; use crate::runtime::requests::{HostAnswer, PathFilter, PathRequest}; -use crate::contract::{Bind, Held, NoValue, Outcome, Props as _, ShowContainer as _}; +use crate::contract::{Bind, Held, NoValue, Outcome, Props as _, Show as _, ShowContainer as _}; +use crate::display::Text; use crate::layout_components::{Row, Stack}; +use crate::style::TypeRole; use crate::runtime::env::{Env, Label}; @@ -22,7 +24,7 @@ use crate::runtime::overlay::CloseReason; use craft_behavior::{PixelSize, Selection}; use craft_keymap::{Chord, Key, Mods}; -use craft_theme::Rgba; +use craft_theme::{Rgba, variant::Tone}; use egui::load::SizedTexture; use egui::{Response, Ui}; @@ -348,6 +350,9 @@ pub struct SaveForWebDialog<'a> { /// The document's slices, for the Slices choice. #[prop] slices: &'a [WebSlice], + /// A notice from the host about slices omitted from the preview and export. + #[prop] + slice_warning: Option