SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.
Blur: keep themed backing and notice actions accessible (#9810)
Nathan Danec5bc849913e8
diff --git a/Cargo.lock b/Cargo.lockindex 469b790153..3cc0a3b160 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -4102,6 +4102,7 @@ dependencies = ["ureq","windows-sys 0.61.2","winit",+ "winreg","x11rb","zbus 5.19.0",]diff --git a/apps/solidcraft-web/src/main.rs b/apps/solidcraft-web/src/main.rsindex db6be82a5f..4509dffa3a 100644--- a/apps/solidcraft-web/src/main.rs+++ b/apps/solidcraft-web/src/main.rs@@ -171,6 +171,7 @@ mod web {use solidcraft_engine::Session;use solidcraft_engine::io::vfs;+ use solidcraft_ui_egui::ui_kit::BackingTooltipExt as _;use solidcraft_ui_egui::{Services, SolveApp, ui_kit};use wasm_bindgen::JsCast as _;@@ -500,7 +501,7 @@ mod web {files::pick_from_disk(&self.files, Intent::Open);}if ui_kit::button(ui, "Insert from computer…", ui_kit::Button::Normal)- .on_hover_text(solidcraft_ui_egui::i18n::tr("web.files.insert_drawings_hint"))+ .backing_on_hover_text(solidcraft_ui_egui::i18n::tr("web.files.insert_drawings_hint")).clicked(){files::pick_from_disk(&self.files, Intent::Insert);@@ -554,7 +555,7 @@ mod web {let design = solidcraft_engine::io::is_design_path(&e.name);if !design&& ui_kit::button(ui, "Insert", ui_kit::Button::Small)- .on_hover_text(solidcraft_ui_egui::i18n::tr("web.files.insert_stored_drawings_hint"))+ .backing_on_hover_text(solidcraft_ui_egui::i18n::tr("web.files.insert_stored_drawings_hint")).clicked(){act = Some(("insert", e.name.clone()));@@ -564,7 +565,7 @@ mod web {self.rename_focus = true;}if ui_kit::button(ui, "Save to computer…", ui_kit::Button::Small)- .on_hover_text("A copy in a file you choose; the stored design stays here")+ .backing_on_hover_text("A copy in a file you choose; the stored design stays here").clicked(){act = Some(("save_copy", e.name.clone()));diff --git a/apps/solidcraft/Cargo.toml b/apps/solidcraft/Cargo.tomlindex 094f8ae79c..7182d7af1c 100644--- a/apps/solidcraft/Cargo.toml+++ b/apps/solidcraft/Cargo.toml@@ -81,6 +81,7 @@ windows-sys = { version = "0.61", features = ["Win32_UI_HiDpi","Win32_UI_WindowsAndMessaging",] }+winreg = "0.56"[target.'cfg(target_os = "macos")'.dependencies]muda = { version = "0.21.2", default-features = false }@@ -92,7 +93,7 @@ hidapi = { version = "2.6.7", default-features = false, features = ["macos-share# Files opened from Finder and the Dock (src/open_documents.rs), and the fullscreen title-bar# inset (src/main.rs); all already come with eframe and rfd.objc2 = "0.6"-objc2-app-kit = { version = "0.3", default-features = false, features = ["std", "NSApplication", "NSResponder", "NSWindow"] }+objc2-app-kit = { version = "0.3", default-features = false, features = ["std", "NSAccessibility", "NSApplication", "NSResponder", "NSWindow", "NSWorkspace"] }objc2-foundation = { version = "0.3", default-features = false, features = ["std", "block2", "NSArray", "NSNotification", "NSOperation", "NSProcessInfo", "NSString", "NSURL"] }block2 = "0.6"# Native crash capture (src/native_crash_macos.rs): the signal handler, the faulting modulediff --git a/apps/solidcraft/src/desktop_transparency.rs b/apps/solidcraft/src/desktop_transparency.rsnew file mode 100644index 0000000000..cb0a125ccf--- /dev/null+++ b/apps/solidcraft/src/desktop_transparency.rs@@ -0,0 +1,63 @@+//! Cached accessibility signal, observed only while a theme offers blur. No UI-thread IO.+use std::sync::{+ Arc,+ atomic::{AtomicBool, AtomicU8, Ordering},+};++#[derive(Default)]+struct Reading {+ needed: AtomicBool,+ started: AtomicBool,+ value: AtomicU8,+}++pub fn cached(ctx: &egui::Context) -> Box<dyn Fn(bool) -> Option<bool>> {+ let state = Arc::new(Reading::default());+ let ctx = ctx.clone();+ Box::new(move |needed| {+ state.needed.store(needed, Ordering::Relaxed);+ if needed && !state.started.swap(true, Ordering::Relaxed) {+ let weak = Arc::downgrade(&state);+ let ctx = ctx.clone();+ if let Err(error) = std::thread::Builder::new().name("desktop-transparency".into()).spawn(move || {+ while let Some(state) = weak.upgrade() {+ if state.needed.load(Ordering::Relaxed) {+ let code = match read() {+ Some(true) => 1,+ Some(false) => 2,+ None => 0,+ };+ if state.value.swap(code, Ordering::Relaxed) != code {+ ctx.request_repaint();+ }+ }+ drop(state);+ std::thread::sleep(std::time::Duration::from_secs(5));+ }+ }) {+ log::warn!("desktop transparency: could not observe accessibility setting: {error}");+ }+ }+ match state.value.load(Ordering::Relaxed) {+ 1 => Some(true),+ 2 => Some(false),+ _ => None,+ }+ })+}++#[cfg(target_os = "windows")]+fn read() -> Option<bool> {+ let key =+ winreg::RegKey::predef(winreg::enums::HKEY_CURRENT_USER).open_subkey(r"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize").ok()?;+ match key.get_value::<u32, _>("EnableTransparency").ok()? {+ 0 => Some(true),+ 1 => Some(false),+ _ => None,+ }+}++#[cfg(target_os = "macos")]+fn read() -> Option<bool> {+ objc2::rc::autoreleasepool(|_| Some(objc2_app_kit::NSWorkspace::sharedWorkspace().accessibilityDisplayShouldReduceTransparency()))+}diff --git a/apps/solidcraft/src/main.rs b/apps/solidcraft/src/main.rsindex b5bf7e7ab5..cbead5a1dd 100644--- a/apps/solidcraft/src/main.rs+++ b/apps/solidcraft/src/main.rs@@ -24,6 +24,8 @@ mod come_forward;mod control_server;#[cfg(target_os = "linux")]mod desktop_theme;+#[cfg(any(target_os = "windows", target_os = "macos"))]+mod desktop_transparency;mod device_lost;#[cfg(target_os = "windows")]mod native_crash;@@ -539,6 +541,10 @@ fn services(cc: &eframe::CreationContext<'_>, folder: &DialogFolder) -> Servicesdesktop_dark: Some(desktop_theme::start(&cc.egui_ctx)),#[cfg(not(target_os = "linux"))]desktop_dark: None,+ #[cfg(any(target_os = "windows", target_os = "macos"))]+ reduce_transparency: Some(desktop_transparency::cached(&cc.egui_ctx)),+ #[cfg(not(any(target_os = "windows", target_os = "macos")))]+ reduce_transparency: None,http_get: Some(std::sync::Arc::new(http_get)),http_download: Some(std::sync::Arc::new(http_download)),// Already an installed app: only the browser build offers to install.diff --git a/assets/locales/pending/theme-blur-ui.json b/assets/locales/pending/theme-blur-ui.jsonnew file mode 100644index 0000000000..2a6e50ff40--- /dev/null+++ b/assets/locales/pending/theme-blur-ui.json@@ -0,0 +1,122 @@+{+ "en": {+ "prefs.blur_cost": "Relative rendering cost. More bars usually mean more work.",+ "prefs.blur_device": "Unavailable on this graphics device or rendering path",+ "prefs.blur_guard": "Blur quality was reduced to keep frames responsive. The radius is unchanged.",+ "prefs.blur_off": "Off",+ "prefs.blur_reduce_transparency": "Disabled by the system's Reduce transparency setting",+ "prefs.blur_software": "Unavailable with software graphics (gpu-software)",+ "prefs.blur_source": "Unavailable in this workspace view",+ "prefs.blur_web": "Unavailable on this web rendering path",+ "prefs.theme_notice_dismiss": "Dismiss",+ "prefs.theme_option_blur": "Blur behind panels",+ "prefs.theme_option_blur_help": "Blur behind translucent panels, in physical pixels. Zero is off.",+ "prefs.theme_option_invalid": "Saved value for {option} is invalid; using the theme default. The saved value is kept.",+ "prefs.theme_options_newer": "This theme requires a newer SolidCraft. Upgrade, then reimport the original theme to recover its option definitions."+ },+ "de": {+ "prefs.blur_cost": "Relativer Renderaufwand. Mehr Balken bedeuten meist mehr Arbeit.",+ "prefs.blur_device": "Auf diesem Grafikgerät oder Renderpfad nicht verfügbar",+ "prefs.blur_guard": "Die Unschärfequalität wurde für flüssigere Bilder verringert. Der Radius bleibt unverändert.",+ "prefs.blur_off": "Aus",+ "prefs.blur_reduce_transparency": "Durch die Systemeinstellung zur Transparenzreduzierung deaktiviert",+ "prefs.blur_software": "Mit Softwaregrafik nicht verfügbar (gpu-software)",+ "prefs.blur_source": "In dieser Arbeitsbereichsansicht nicht verfügbar",+ "prefs.blur_web": "Auf diesem Web-Renderpfad nicht verfügbar",+ "prefs.theme_notice_dismiss": "Ausblenden",+ "prefs.theme_option_blur": "Unschärfe hinter Panels",+ "prefs.theme_option_blur_help": "Unschärfe hinter durchscheinenden Panels in physischen Pixeln. Null bedeutet aus.",+ "prefs.theme_option_invalid": "Der gespeicherte Wert für {option} ist ungültig; der Designstandard wird verwendet. Der gespeicherte Wert bleibt erhalten.",+ "prefs.theme_options_newer": "Dieses Design benötigt eine neuere Version von SolidCraft. Nach dem Upgrade das Originaldesign erneut importieren, um seine Optionsdefinitionen wiederherzustellen."+ },+ "ko": {+ "prefs.blur_cost": "상대적인 렌더링 비용입니다. 막대가 많을수록 일반적으로 더 많은 작업이 필요합니다.",+ "prefs.blur_device": "이 그래픽 장치 또는 렌더링 경로에서는 사용할 수 없습니다",+ "prefs.blur_guard": "화면의 원활한 응답을 위해 흐림 품질을 낮췄습니다. 반경은 변경되지 않습니다.",+ "prefs.blur_off": "끄기",+ "prefs.blur_reduce_transparency": "시스템의 투명도 줄이기 설정에 의해 비활성화됨",+ "prefs.blur_software": "소프트웨어 그래픽에서는 사용할 수 없습니다 (gpu-software)",+ "prefs.blur_source": "이 작업 공간 보기에서는 사용할 수 없습니다",+ "prefs.blur_web": "이 웹 렌더링 경로에서는 사용할 수 없습니다",+ "prefs.theme_notice_dismiss": "닫기",+ "prefs.theme_option_blur": "패널 뒤 흐림",+ "prefs.theme_option_blur_help": "반투명 패널 뒤의 흐림을 물리적 픽셀 단위로 설정합니다. 0이면 꺼집니다.",+ "prefs.theme_option_invalid": "{option}의 저장된 값이 유효하지 않아 테마 기본값을 사용합니다. 저장된 값은 유지됩니다.",+ "prefs.theme_options_newer": "이 테마에는 더 최신 버전의 SolidCraft가 필요합니다. 업그레이드 후 원본 테마를 다시 가져와 옵션 정의를 복구하세요."+ },+ "ar": {+ "prefs.blur_cost": "تكلفة العرض النسبية. زيادة الأشرطة تعني عادةً مزيدًا من العمل.",+ "prefs.blur_device": "غير متاح على جهاز الرسومات أو مسار العرض هذا",+ "prefs.blur_guard": "خُفّضت جودة التمويه للحفاظ على استجابة الإطارات. لم يتغير نصف القطر.",+ "prefs.blur_off": "إيقاف",+ "prefs.blur_reduce_transparency": "معطّل بسبب إعداد تقليل الشفافية في النظام",+ "prefs.blur_software": "غير متاح مع الرسومات البرمجية (gpu-software)",+ "prefs.blur_source": "غير متاح في عرض مساحة العمل هذا",+ "prefs.blur_web": "غير متاح في مسار عرض الويب هذا",+ "prefs.theme_notice_dismiss": "إخفاء",+ "prefs.theme_option_blur": "تمويه خلف اللوحات",+ "prefs.theme_option_blur_help": "تمويه خلف اللوحات شبه الشفافة، بالبكسل الفعلي. الصفر يوقف التمويه.",+ "prefs.theme_option_invalid": "القيمة المحفوظة للخيار {option} غير صالحة؛ تُستخدم القيمة الافتراضية للسمة. تبقى القيمة المحفوظة كما هي.",+ "prefs.theme_options_newer": "تتطلب هذه السمة إصدارًا أحدث من SolidCraft. بعد الترقية، أعد استيراد السمة الأصلية لاستعادة تعريفات خياراتها."+ },+ "he": {+ "prefs.blur_cost": "עלות עיבוד יחסית. יותר פסים מציינים בדרך כלל יותר עבודה.",+ "prefs.blur_device": "לא זמין בהתקן הגרפי או בנתיב העיבוד הזה",+ "prefs.blur_guard": "איכות הטשטוש הופחתה כדי לשמור על תגובתיות הפריימים. הרדיוס לא השתנה.",+ "prefs.blur_off": "כבוי",+ "prefs.blur_reduce_transparency": "מושבת עקב הגדרת הפחתת השקיפות של המערכת",+ "prefs.blur_software": "לא זמין עם עיבוד גרפי בתוכנה (gpu-software)",+ "prefs.blur_source": "לא זמין בתצוגת סביבת העבודה הזו",+ "prefs.blur_web": "לא זמין בנתיב העיבוד הזה בדפדפן",+ "prefs.theme_notice_dismiss": "הסתרה",+ "prefs.theme_option_blur": "טשטוש מאחורי לוחות",+ "prefs.theme_option_blur_help": "טשטוש מאחורי לוחות שקופים למחצה, בפיקסלים פיזיים. אפס מכבה את הטשטוש.",+ "prefs.theme_option_invalid": "הערך השמור עבור {option} אינו תקין; נעשה שימוש בברירת המחדל של ערכת הנושא. הערך השמור נשמר ללא שינוי.",+ "prefs.theme_options_newer": "ערכת נושא זו דורשת גרסה חדשה יותר של SolidCraft. לאחר השדרוג יש לייבא שוב את ערכת הנושא המקורית כדי לשחזר את הגדרות האפשרויות שלה."+ },+ "ja": {+ "prefs.blur_cost": "相対的な描画負荷です。バーが多いほど、通常は処理量が増えます。",+ "prefs.blur_device": "このグラフィックスデバイスまたは描画経路では利用できません",+ "prefs.blur_guard": "画面の応答性を保つため、ぼかしの品質を下げました。半径は変更されていません。",+ "prefs.blur_off": "オフ",+ "prefs.blur_reduce_transparency": "システムの透明度を下げる設定により無効です",+ "prefs.blur_software": "ソフトウェア描画では利用できません (gpu-software)",+ "prefs.blur_source": "このワークスペース表示では利用できません",+ "prefs.blur_web": "このウェブ描画経路では利用できません",+ "prefs.theme_notice_dismiss": "非表示",+ "prefs.theme_option_blur": "パネル背面のぼかし",+ "prefs.theme_option_blur_help": "半透明パネルの背面のぼかしを物理ピクセル単位で指定します。0でオフになります。",+ "prefs.theme_option_invalid": "{option} の保存値が無効なため、テーマの既定値を使用します。保存値は保持されます。",+ "prefs.theme_options_newer": "このテーマには新しいバージョンの SolidCraft が必要です。更新後、元のテーマを再インポートしてオプション定義を復元してください。"+ },+ "vi": {+ "prefs.blur_cost": "Chi phí kết xuất tương đối. Nhiều thanh hơn thường có nghĩa là cần xử lý nhiều hơn.",+ "prefs.blur_device": "Không khả dụng trên thiết bị đồ họa hoặc đường kết xuất này",+ "prefs.blur_guard": "Chất lượng làm mờ đã giảm để duy trì độ phản hồi của khung hình. Bán kính không thay đổi.",+ "prefs.blur_off": "Tắt",+ "prefs.blur_reduce_transparency": "Bị tắt bởi cài đặt Giảm độ trong suốt của hệ thống",+ "prefs.blur_software": "Không khả dụng với đồ họa phần mềm (gpu-software)",+ "prefs.blur_source": "Không khả dụng trong chế độ xem không gian làm việc này",+ "prefs.blur_web": "Không khả dụng trên đường kết xuất web này",+ "prefs.theme_notice_dismiss": "Ẩn",+ "prefs.theme_option_blur": "Làm mờ phía sau bảng",+ "prefs.theme_option_blur_help": "Làm mờ phía sau các bảng bán trong suốt, tính bằng pixel vật lý. Giá trị 0 là tắt.",+ "prefs.theme_option_invalid": "Giá trị đã lưu cho {option} không hợp lệ; đang dùng giá trị mặc định của giao diện. Giá trị đã lưu vẫn được giữ lại.",+ "prefs.theme_options_newer": "Giao diện này yêu cầu phiên bản SolidCraft mới hơn. Sau khi nâng cấp, hãy nhập lại giao diện gốc để khôi phục các định nghĩa tùy chọn."+ },+ "zh": {+ "prefs.blur_cost": "相对渲染开销。条形越多,通常意味着处理工作越多。",+ "prefs.blur_device": "此图形设备或渲染路径不支持此功能",+ "prefs.blur_guard": "已降低模糊质量,以保持画面响应。模糊半径未改变。",+ "prefs.blur_off": "关闭",+ "prefs.blur_reduce_transparency": "已被系统的降低透明度设置禁用",+ "prefs.blur_software": "软件图形渲染不支持此功能 (gpu-software)",+ "prefs.blur_source": "此工作区视图不支持此功能",+ "prefs.blur_web": "此网页渲染路径不支持此功能",+ "prefs.theme_notice_dismiss": "忽略",+ "prefs.theme_option_blur": "面板背后模糊",+ "prefs.theme_option_blur_help": "半透明面板背后的模糊程度,以物理像素为单位。0 表示关闭。",+ "prefs.theme_option_invalid": "{option} 的已保存值无效;正在使用主题默认值。已保存值将予以保留。",+ "prefs.theme_options_newer": "此主题需要更新版本的 SolidCraft。升级后,请重新导入原始主题以恢复其选项定义。"+ }+}diff --git a/attribution/pending/theme-blur-ui.md b/attribution/pending/theme-blur-ui.mdnew file mode 100644index 0000000000..85cfad9f33--- /dev/null+++ b/attribution/pending/theme-blur-ui.md@@ -0,0 +1,2 @@+| assets/locales/pending/theme-blur-ui.json | SolidCraft contributors | Original blur controls, notices and translations | MIT OR Apache-2.0 |+| crates/ui-egui/tests/fixtures/theme-blur.json | SolidCraft contributors | Original theme for blur option scenarios and manager review | MIT OR Apache-2.0 |diff --git a/crates/ui-egui/src/agent_chat/markdown_view.rs b/crates/ui-egui/src/agent_chat/markdown_view.rsindex 4b8dfed147..c9f8473426 100644--- a/crates/ui-egui/src/agent_chat/markdown_view.rs+++ b/crates/ui-egui/src/agent_chat/markdown_view.rs@@ -6,6 +6,7 @@//! changes.use crate::fonts::RichTextExt as _;+use crate::ui_kit::BackingTooltipExt as _;use std::hash::{Hash, Hasher};use std::sync::Arc;@@ -70,7 +71,7 @@ fn spans(ui: &mut egui::Ui, spans: &[Span], size: f32, color: Color32) {for (label, url) in links {// The text above already shows the label; the button says where it goes.let to = format!("↗ {}", host(url));- ui.hyperlink_to(RichText::new(to).size(size - (t.font_button - t.font_body)), url).on_hover_text(format!("{label}: {url}"));+ ui.hyperlink_to(RichText::new(to).size(size - (t.font_button - t.font_body)), url).backing_on_hover_text(format!("{label}: {url}"));}});}@@ -94,17 +95,21 @@ pub fn show(ui: &mut egui::Ui, slot: usize, src: &str) {ui.add(egui::Label::new(RichText::new(markdown::plain(s)).size(size).semibold().color(t.text)).selectable(true).wrap());}Block::Code { text, .. } => {- egui::Frame::NONE.fill(t.field).corner_radius(t.radius_sm).inner_margin(Margin::same(6)).show(ui, |ui| {- ui.set_width(ui.available_width());- ui.add(- egui::Label::new(RichText::new(text).monospace().size(size - (t.font_button - t.font_body)).color(t.text))- .selectable(true)- .wrap(),- );- if crate::ui_kit::button(ui, tr("ui.agent_chat_copy"), crate::ui_kit::Button::Small).clicked() {- ui.ctx().copy_text(text.clone());- }- });+ crate::ui_kit::Container::show_backing(+ ui,+ egui::Frame::NONE.fill(t.field).corner_radius(t.radius_sm).inner_margin(Margin::same(6)),+ |ui| {+ ui.set_width(ui.available_width());+ ui.add(+ egui::Label::new(RichText::new(text).monospace().size(size - (t.font_button - t.font_body)).color(t.text))+ .selectable(true)+ .wrap(),+ );+ if crate::ui_kit::button(ui, tr("ui.agent_chat_copy"), crate::ui_kit::Button::Small).clicked() {+ ui.ctx().copy_text(text.clone());+ }+ },+ );}Block::List { ordered, start, items } => {for (i, item) in items.iter().enumerate() {diff --git a/crates/ui-egui/src/agent_chat/panel.rs b/crates/ui-egui/src/agent_chat/panel.rsindex b7388ca0cf..6276755f81 100644--- a/crates/ui-egui/src/agent_chat/panel.rs+++ b/crates/ui-egui/src/agent_chat/panel.rs@@ -3,6 +3,7 @@//! width and fold are preferences, so they come back next time.use crate::fonts::RichTextExt as _;+use crate::ui_kit::BackingTooltipExt as _;use crate::ui_kit::{Container, Edge, Surface};use egui::{Align, Align2, Color32, Id, Layout, Rect, RichText, Sense, Stroke, pos2, vec2};@@ -379,7 +380,7 @@ fn context_chips(ui: &mut egui::Ui, context: &Context, removable: bool) -> Optio}).response;if !item.detail.is_empty() {- chip.on_hover_text(&item.detail);+ chip.backing_on_hover_text(&item.detail);}}}@@ -425,7 +426,7 @@ fn picture_strip(ui: &mut egui::Ui, n: usize, pictures: &[Picture]) -> Option<uslet thumb = ui.add(egui::Image::new((texture.id(), size)).corner_radius(t.radius_sm).sense(Sense::click()));crate::scenario::publish_handle(&format!("agent_chat:picture:{n}:{i}"), thumb.rect.center());let hover_max = (ui.ctx().content_rect().size() * 0.5).min(vec2(PREVIEW_MAX.0, PREVIEW_MAX.1));- let thumb = thumb.on_hover_cursor(egui::CursorIcon::PointingHand).on_hover_ui(|ui| {+ let thumb = thumb.on_hover_cursor(egui::CursorIcon::PointingHand).backing_on_hover_ui(|ui| {ui.add(egui::Image::new((texture.id(), fit(texture.size_vec2(), hover_max))).corner_radius(t.radius_sm));if !picture.note.is_empty() {ui.label(&picture.note);@@ -583,7 +584,8 @@ fn window(app: &mut SolveApp, ctx: &egui::Context) {}let t = Tokens::get();let frame = Container::new(ui.ctx(), Surface::Panel).edge_frame(t.dialog_body);- let r = Container::new(ui.ctx(), Surface::Viewport).central().frame(frame).show(ui, |ui| ui_kit::scope(ui, |ui| body(app, ui, false)));+ let panel = Container::new(ui.ctx(), Surface::Viewport).central();+ let r = Container::show_central(ui, panel, frame, |ui| ui_kit::scope(ui, |ui| body(app, ui, false)));// The picture viewer opens over this window, where the click was, not over the main one.gallery_window(app, ui.ctx());if class == egui::ViewportClass::EmbeddedWindow {@@ -672,7 +674,7 @@ fn glyph_button(ui: &mut egui::Ui, kind: &str, tip: &str) -> egui::Response {}crate::scenario::publish_rect(&format!("agent_chat:{kind}"), r);crate::scenario::publish_handle(&format!("agent_chat:{kind}"), r.center());- resp.on_hover_text(tip)+ resp.backing_on_hover_text(tip)}fn state_color(state: State) -> Color32 {@@ -715,7 +717,7 @@ fn strip(app: &mut SolveApp, ui: &mut egui::Ui) {t.primary_border(t.border),);let tip = format!("{} · {}", tip(app), state.label());- if resp.on_hover_text(tip).clicked() {+ if resp.backing_on_hover_text(tip).clicked() {app.preferences.agent_chat_minimized = false;}}@@ -967,7 +969,7 @@ fn desktop_body(app: &mut SolveApp, ui: &mut egui::Ui) {)}).inner;- let permissions = permissions.on_hover_text(mode.label());+ let permissions = permissions.backing_on_hover_text(mode.label());crate::scenario::publish_rect("agent_chat:permissions", permissions.rect);crate::scenario::publish_handle("agent_chat:permissions", permissions.rect.center());// A message waits for files still being read.@@ -1004,8 +1006,8 @@ fn desktop_body(app: &mut SolveApp, ui: &mut egui::Ui) {let attach = ui.add_enabled_ui(images, |ui| ui_kit::checkbox(ui, tr("ui.agent_chat_attach_view"), &mut app.agent_chat.attach_view)).inner- .on_hover_text(tr("ui.agent_chat_attach_view_tip"))- .on_disabled_hover_text(tr("ui.agent_chat_no_images"));+ .backing_on_hover_text(tr("ui.agent_chat_attach_view_tip"))+ .backing_on_disabled_hover_text(tr("ui.agent_chat_no_images"));crate::scenario::publish_handle("agent_chat:attach", attach.rect.center());// What is selected in the model goes with the message: text for the agent,// chips in the conversation.@@ -1016,11 +1018,11 @@ fn desktop_body(app: &mut SolveApp, ui: &mut egui::Ui) {tr("ui.agent_chat_attach_selection").to_string()};let pick = ui_kit::checkbox(ui, &label, &mut app.agent_chat.attach_selection)- .on_hover_text(tr("ui.agent_chat_attach_selection_tip"));+ .backing_on_hover_text(tr("ui.agent_chat_attach_selection_tip"));crate::scenario::publish_handle("agent_chat:attach_selection", pick.rect.center());// Choose faces, edges, features and bodies on purpose, then OK.let picker = ui_kit::button(ui, tr("ui.agent_chat_pick_context"), ui_kit::Button::Enabled(app.dialog.is_none()))- .on_hover_text(tr("ui.agent_chat_pick_context_tip"));+ .backing_on_hover_text(tr("ui.agent_chat_pick_context_tip"));crate::scenario::publish_handle("agent_chat:pick_context", picker.rect.center());pick_clicked = picker.clicked();if let Some(turn) = &app.agent_chat.turn {@@ -1101,7 +1103,7 @@ fn switcher(app: &mut SolveApp, ui: &mut egui::Ui) {ui_kit::dropdown_menu(ui, "sc_agent_switch", &label, |ui| {for e in &all {let sel = current.as_ref().is_some_and(|c| c.id == e.id);- let r = ui_kit::list_picker(ui, &e.id, &e.name, sel).on_hover_text(format!("{} {}", e.detail(), e.login));+ let r = ui_kit::list_picker(ui, &e.id, &e.name, sel).backing_on_hover_text(format!("{} {}", e.detail(), e.login));crate::scenario::publish_handle(&format!("agent_chat:agent:{}", e.id), r.rect.center());if r.clicked() {picked = Some(e.id.clone());@@ -1119,7 +1121,7 @@ fn switcher(app: &mut SolveApp, ui: &mut egui::Ui) {.inner;crate::scenario::publish_rect("agent_chat:switcher", combo.rect);crate::scenario::publish_handle("agent_chat:switcher", combo.rect.center());- combo.on_hover_text(tr("ui.ai_switch_tip"));+ combo.backing_on_hover_text(tr("ui.ai_switch_tip"));if add {super::settings::open_add(app);}@@ -1148,7 +1150,7 @@ fn switcher(app: &mut SolveApp, ui: &mut egui::Ui) {.inner;crate::scenario::publish_rect("agent_chat:mode", r.rect);crate::scenario::publish_handle("agent_chat:mode", r.rect.center());- r.on_hover_text(tr("ui.ai_agent_mode_tip"));+ r.backing_on_hover_text(tr("ui.ai_agent_mode_tip"));if let Some(m) = pick {set_mode(app, &m);}@@ -1187,7 +1189,7 @@ fn switcher(app: &mut SolveApp, ui: &mut egui::Ui) {)}).inner;- picker.response.on_hover_text(tr("ui.agent_chat_model_tip"));+ picker.response.backing_on_hover_text(tr("ui.agent_chat_model_tip"));match picker.inner {Some(ui_kit::Picked::Listed(m)) => set_model(app, &m),Some(ui_kit::Picked::Custom(m)) => {@@ -1205,7 +1207,7 @@ fn switcher(app: &mut SolveApp, ui: &mut egui::Ui) {}ui.horizontal(|ui| {let b = if app.agent_chat.state().running() {- ui_kit::button(ui, tr("ui.agent_chat_stop"), ui_kit::Button::Normal).on_hover_text(tr("ui.agent_chat_stop_tip"))+ ui_kit::button(ui, tr("ui.agent_chat_stop"), ui_kit::Button::Normal).backing_on_hover_text(tr("ui.agent_chat_stop_tip"))} else {let label = if app.agent_chat.state() == State::Failed { "ui.agent_chat_retry" } else { "ui.agent_chat_connect" };ui_kit::button(ui, tr(label), ui_kit::Button::Normal)@@ -1372,11 +1374,11 @@ fn config_select(app: &mut SolveApp, ui: &mut egui::Ui, option: &acp::ConfigOptiif let Some(group) = group&& previous_group != Some(group){- ui.label(RichText::new(compact_text(group, 32)).color(t.text_dim).size(t.font_small)).on_hover_text(group);+ ui.label(RichText::new(compact_text(group, 32)).color(t.text_dim).size(t.font_small)).backing_on_hover_text(group);}previous_group = group;let row = ui_kit::list_picker(ui, &choice.value, &compact_text(&choice.name, 32), choice.value == option.current_value);- let row = row.on_hover_text(+ let row = row.backing_on_hover_text([choice.name.as_str(), choice.description.as_str()].into_iter().filter(|part| !part.is_empty())@@ -1400,7 +1402,7 @@ fn config_select(app: &mut SolveApp, ui: &mut egui::Ui, option: &acp::ConfigOptiresponse};response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::ComboBox, enabled, format!("{name}: {selected}")));- response.on_hover_text(tip);+ response.backing_on_hover_text(tip);match picked {Some(ui_kit::Picked::Listed(value)) => super::set_config_option(app, &option.id, &value),Some(ui_kit::Picked::Custom(value)) => {@@ -1556,7 +1558,7 @@ fn agent_list(app: &mut SolveApp, ui: &mut egui::Ui) {}for e in &all {let selected = current.as_ref().is_some_and(|c| c.id == e.id);- let resp = ui_kit::list_picker(ui, &e.id, &e.name, selected).on_hover_text(format!("{} {}", e.detail(), e.login));+ let resp = ui_kit::list_picker(ui, &e.id, &e.name, selected).backing_on_hover_text(format!("{} {}", e.detail(), e.login));crate::scenario::publish_handle(&format!("agent_chat:pick:{}", e.id), resp.rect.center());if resp.clicked() {app.agent_chat.agent_id = Some(e.id.clone());@@ -1575,7 +1577,7 @@ fn agent_list(app: &mut SolveApp, ui: &mut egui::Ui) {for m in missing {ui.horizontal(|ui| {ui_kit::text(ui, m.name, ui_kit::Text::Inline);- if ui_kit::button(ui, tr("ui.agent_chat_copy"), ui_kit::Button::Small).on_hover_text(m.install).clicked() {+ if ui_kit::button(ui, tr("ui.agent_chat_copy"), ui_kit::Button::Small).backing_on_hover_text(m.install).clicked() {ui.ctx().copy_text(m.install.to_string());}});@@ -1812,7 +1814,7 @@ fn conversation(app: &mut SolveApp, ui: &mut egui::Ui) {ui_kit::assistant_actions(ui, |ui| {let allow = ui_kit::primary_button(ui, tr("ui.agent_chat_allow_once"));let always = ui_kit::button(ui, tr("ui.ai_always_allow"), ui_kit::Button::Normal)- .on_hover_text(trf("ui.ai_always_allow_tip", &[("tool", tool)]));+ .backing_on_hover_text(trf("ui.ai_always_allow_tip", &[("tool", tool)]));let deny = ui.with_layout(Layout::left_to_right(Align::Center), |ui| {ui_kit::button(ui, tr("ui.agent_chat_deny"), ui_kit::Button::Normal)@@ -1842,7 +1844,8 @@ fn conversation(app: &mut SolveApp, ui: &mut egui::Ui) {if *undone {ui.label(RichText::new(tr("ui.agent_chat_undone")).color(t.text_dim).size(crate::theme::Tokens::get().font_caption));} else if Arc::ptr_eq(doc, ¤t_doc) {- let b = ui_kit::button(ui, tr("ui.agent_chat_undo_changes"), ui_kit::Button::Normal).on_hover_text(tr("ui.ai_undo_tip"));+ let b =+ ui_kit::button(ui, tr("ui.agent_chat_undo_changes"), ui_kit::Button::Normal).backing_on_hover_text(tr("ui.ai_undo_tip"));crate::scenario::publish_handle("agent_chat:undo", b.rect.center());if b.clicked() {undo = Some(n);@@ -1867,61 +1870,62 @@ fn conversation(app: &mut SolveApp, ui: &mut egui::Ui) {let mut edit_buf = editing.as_ref().map(|(_, b)| b.clone());for (n, p) in app.agent_chat.pending.iter().enumerate() {ui.add_space(6.0);- Container::new(ui.ctx(), Surface::Panel)+ let frame = Container::new(ui.ctx(), Surface::Panel).edge_frame(t.panel).stroke(Stroke::new(1.0, t.accent)).corner_radius(t.control_radius)- .inner_margin(egui::Margin::same(6))- .show(ui, |ui| {- ui.set_width(ui.available_width());- ui.horizontal(|ui| {- let tag = if stopped && !busy { "ui.agent_chat_queued_stopped" } else { "ui.agent_chat_queued" };- ui.label(RichText::new(tr(tag)).color(t.accent).semibold().size(crate::theme::Tokens::get().font_small));- ui.with_layout(Layout::right_to_left(Align::Center), |ui| {- let x = ui_kit::button(ui, "×", ui_kit::Button::Small).on_hover_text(tr("ui.agent_chat_remove"));- crate::scenario::publish_handle(&format!("agent_chat:pending_remove:{n}"), x.rect.center());- if x.clicked() {- remove = Some(n);- }- if editing.as_ref().is_none_or(|(i, _)| *i != n) {- let e = ui_kit::button(ui, tr("ui.agent_chat_edit"), ui_kit::Button::Small);- crate::scenario::publish_handle(&format!("agent_chat:pending_edit:{n}"), e.rect.center());- if e.clicked() {- start_edit = Some((n, p.text.clone()));- }+ .inner_margin(egui::Margin::same(6));+ Container::show_backing(ui, frame, |ui| {+ ui.set_width(ui.available_width());+ ui.horizontal(|ui| {+ let tag = if stopped && !busy { "ui.agent_chat_queued_stopped" } else { "ui.agent_chat_queued" };+ ui.label(RichText::new(tr(tag)).color(t.accent).semibold().size(crate::theme::Tokens::get().font_small));+ ui.with_layout(Layout::right_to_left(Align::Center), |ui| {+ let x = ui_kit::button(ui, "×", ui_kit::Button::Small).backing_on_hover_text(tr("ui.agent_chat_remove"));+ crate::scenario::publish_handle(&format!("agent_chat:pending_remove:{n}"), x.rect.center());+ if x.clicked() {+ remove = Some(n);+ }+ if editing.as_ref().is_none_or(|(i, _)| *i != n) {+ let e = ui_kit::button(ui, tr("ui.agent_chat_edit"), ui_kit::Button::Small);+ crate::scenario::publish_handle(&format!("agent_chat:pending_edit:{n}"), e.rect.center());+ if e.clicked() {+ start_edit = Some((n, p.text.clone()));}- });- });- match (&editing, edit_buf.as_mut()) {- (Some((i, _)), Some(buf)) if *i == n => {- let te = ui_kit::message_field(ui, Id::new(("sc_agent_pending_input", n)), buf, "");- crate::scenario::publish_rect("agent_chat:pending_input", te.rect);- ui.horizontal(|ui| {- if ui_kit::button(ui, tr("ui.agent_chat_save"), ui_kit::Button::Normal).clicked() {- edit_done = Some((n, Some(buf.clone())));- }- if ui_kit::button(ui, tr("ui.agent_chat_cancel"), ui_kit::Button::Normal).clicked() {- edit_done = Some((n, None));- }- });}- _ => {- if !p.text.is_empty() {- ui.add(egui::Label::new(RichText::new(&p.text).color(t.text)).selectable(true).wrap());+ });+ });+ match (&editing, edit_buf.as_mut()) {+ (Some((i, _)), Some(buf)) if *i == n => {+ let te = ui_kit::message_field(ui, Id::new(("sc_agent_pending_input", n)), buf, "");+ crate::scenario::publish_rect("agent_chat:pending_input", te.rect);+ ui.horizontal(|ui| {+ if ui_kit::button(ui, tr("ui.agent_chat_save"), ui_kit::Button::Normal).clicked() {+ edit_done = Some((n, Some(buf.clone())));}- if p.image {- ui.label(RichText::new(tr("ui.agent_chat_view_attached")).color(t.text_dim).size(crate::theme::Tokens::get().font_small));+ if ui_kit::button(ui, tr("ui.agent_chat_cancel"), ui_kit::Button::Normal).clicked() {+ edit_done = Some((n, None));}- context_chips(ui, &p.context, false);- files_line(ui, p.files.iter().map(|f| f.name.as_str()));+ });+ }+ _ => {+ if !p.text.is_empty() {+ ui.add(egui::Label::new(RichText::new(&p.text).color(t.text)).selectable(true).wrap());+ }+ if p.image {+ ui.label(RichText::new(tr("ui.agent_chat_view_attached")).color(t.text_dim).size(crate::theme::Tokens::get().font_small));}+ context_chips(ui, &p.context, false);+ files_line(ui, p.files.iter().map(|f| f.name.as_str()));}- });+ }+ });}if !app.agent_chat.pending.is_empty() && editing.is_none() {ui.horizontal(|ui| {if busy {- let b = ui_kit::button(ui, tr("ui.agent_chat_send_now"), ui_kit::Button::Normal).on_hover_text(tr("ui.agent_chat_send_now_tip"));+ let b =+ ui_kit::button(ui, tr("ui.agent_chat_send_now"), ui_kit::Button::Normal).backing_on_hover_text(tr("ui.agent_chat_send_now_tip"));crate::scenario::publish_handle("agent_chat:send_now", b.rect.center());send_now_clicked = b.clicked();} else {@@ -2054,34 +2058,38 @@ pub(super) fn remove_tip(f: &attach::Attachment) -> &'static str {fn loading_chip(ui: &mut egui::Ui, name: &str, importing: bool, i: usize, w: f32) -> bool {let t = Tokens::get();let mut clicked = false;- let r = egui::Frame::NONE- .fill(t.toolbar)- .stroke(t.control_border_stroke(t.border))- .corner_radius(t.control_radius)- .inner_margin(egui::Margin::symmetric(4, 3))- .show(ui, |ui| {+ let r = crate::ui_kit::Container::show_backing(+ ui,+ egui::Frame::NONE+ .fill(t.toolbar)+ .stroke(t.control_border_stroke(t.border))+ .corner_radius(t.control_radius)+ .inner_margin(egui::Margin::symmetric(4, 3)),+ |ui| {let inner = (w - 10.0).max(40.0);ui.set_width(inner);ui.horizontal(|ui| {ui.spacing_mut().item_spacing.x = 4.0;let doing = tr(if importing { "ui.agent_chat_file_importing" } else { "ui.agent_chat_file_loading" });- let mark = ui.add(egui::Spinner::new().size(t.form_icon_size)).on_hover_text(doing).rect.width();+ let mark = ui.add(egui::Spinner::new().size(t.form_icon_size)).backing_on_hover_text(doing).rect.width();let name_w = (inner - mark - 18.0 - 8.0).max(8.0);ui.allocate_ui(vec2(name_w, 20.0), |ui| {ui.set_width(name_w);ui.add(egui::Label::new(RichText::new(name).size(t.font_small).color(t.text_dim)).truncate())}).inner- .on_hover_text(name);+ .backing_on_hover_text(name);let (r, x) = ui.allocate_exact_size(vec2(18.0, 18.0), Sense::click());let c = r.center();let s = Stroke::new(1.3, if x.hovered() { t.text } else { t.text_dim });ui.painter().line_segment([c + vec2(-3.5, -3.5), c + vec2(3.5, 3.5)], s);ui.painter().line_segment([c + vec2(-3.5, 3.5), c + vec2(3.5, -3.5)], s);crate::scenario::publish_handle(&format!("agent_chat:file_loading_remove:{i}"), c);- clicked = x.on_hover_text(tr(if importing { "ui.agent_chat_remove_imported" } else { "ui.agent_chat_remove_file" })).clicked();+ clicked =+ x.backing_on_hover_text(tr(if importing { "ui.agent_chat_remove_imported" } else { "ui.agent_chat_remove_file" })).clicked();});- });+ },+ );crate::scenario::publish_handle(&format!("agent_chat:file_loading:{i}"), r.response.rect.center());clicked}@@ -2091,12 +2099,14 @@ fn loading_chip(ui: &mut egui::Ui, name: &str, importing: bool, i: usize, w: f32fn chip(ui: &mut egui::Ui, thumbs: &mut std::collections::HashMap<u64, egui::TextureHandle>, f: &attach::Attachment, i: usize, w: f32) -> bool {let t = Tokens::get();let mut clicked = false;- let r = egui::Frame::NONE- .fill(t.toolbar)- .stroke(t.control_border_stroke(t.border))- .corner_radius(t.control_radius)- .inner_margin(egui::Margin::symmetric(4, 3))- .show(ui, |ui| {+ let r = crate::ui_kit::Container::show_backing(+ ui,+ egui::Frame::NONE+ .fill(t.toolbar)+ .stroke(t.control_border_stroke(t.border))+ .corner_radius(t.control_radius)+ .inner_margin(egui::Margin::symmetric(4, 3)),+ |ui| {let inner = (w - 10.0).max(40.0);ui.set_width(inner);ui.horizontal(|ui| {@@ -2130,16 +2140,17 @@ fn chip(ui: &mut egui::Ui, thumbs: &mut std::collections::HashMap<u64, egui::Texui.add(egui::Label::new(RichText::new(&f.name).size(t.font_small)).truncate())}).inner- .on_hover_text(&f.name);+ .backing_on_hover_text(&f.name);let (r, x) = ui.allocate_exact_size(vec2(18.0, 18.0), Sense::click());let c = r.center();let s = Stroke::new(1.3, if x.hovered() { t.text } else { t.text_dim });ui.painter().line_segment([c + vec2(-3.5, -3.5), c + vec2(3.5, 3.5)], s);ui.painter().line_segment([c + vec2(-3.5, 3.5), c + vec2(3.5, -3.5)], s);crate::scenario::publish_handle(&format!("agent_chat:file_remove:{i}"), c);- clicked = x.on_hover_text(remove_tip(f)).clicked();+ clicked = x.backing_on_hover_text(remove_tip(f)).clicked();});- });+ },+ );crate::scenario::publish_target(&format!("agent_chat:file:{i}"), r.response.rect);clicked}@@ -2164,7 +2175,7 @@ fn add_menu(app: &mut SolveApp, ui: &mut egui::Ui) {}});crate::scenario::publish_handle("agent_chat:add", r.response.rect.center());- r.response.on_hover_text(tr("ui.agent_chat_add"));+ r.response.backing_on_hover_text(tr("ui.agent_chat_add"));if choose {app.pick_file(tr("ui.agent_chat_attachable"), &attach::extensions(), |app, path| {if let Some(path) = path@@ -2232,7 +2243,7 @@ fn tool_card(ui: &mut egui::Ui, n: usize, call: &ToolCall) {Some(words) => RichText::new(words).size(t.font_caption).color(t.text),None => RichText::new(summary::plain_title(call.title)).monospace().size(t.font_caption).color(t.text),};- ui.add(egui::Label::new(text).truncate().selectable(false)).on_hover_text(call.title);+ ui.add(egui::Label::new(text).truncate().selectable(false)).backing_on_hover_text(call.title);});});});@@ -2242,7 +2253,7 @@ fn tool_card(ui: &mut egui::Ui, n: usize, call: &ToolCall) {state_.toggle(ui);}if details {- click.on_hover_text(tr("ui.ai_tool_unfold"));+ click.backing_on_hover_text(tr("ui.ai_tool_unfold"));}state_.show_body_unindented(ui, |ui| {ui.indent(id.with("detail"), |ui| {diff --git a/crates/ui-egui/src/agent_chat/settings.rs b/crates/ui-egui/src/agent_chat/settings.rsindex 26da3b9387..0ddbdda922 100644--- a/crates/ui-egui/src/agent_chat/settings.rs+++ b/crates/ui-egui/src/agent_chat/settings.rs@@ -7,6 +7,7 @@ use super::agents::{self, AgentConfig, Kind, Mode, Protocol};use super::backend::TestError;use super::*;use crate::ui_kit;+use crate::ui_kit::BackingTooltipExt as _;#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]pub enum AddKind {@@ -405,7 +406,7 @@ fn start_test(app: &SolveApp, e: &agents::Entry, key: Option<String>) -> Test {/// An endpoint's request timeout field: seconds, 30 s to an hour.fn timeout_field(ui: &mut egui::Ui, secs: &mut u64, handle: &str) -> bool {let r = ui_kit::number_field(ui, secs, agents::MIN_REQUEST_TIMEOUT_S..=agents::MAX_REQUEST_TIMEOUT_S, 5.0, "")- .on_hover_text(tr("ui.ai_request_timeout_hint"));+ .backing_on_hover_text(tr("ui.ai_request_timeout_hint"));r.widget_info(|| {let mut info = egui::WidgetInfo::drag_value(ui.is_enabled(), *secs as f64);info.label = Some(tr("prefs.assistant_seconds_aria").to_owned());@@ -419,7 +420,7 @@ fn timeout_field(ui: &mut egui::Ui, secs: &mut u64, handle: &str) -> bool {/// The free-text reasoning effort field with its hover hint; true when the text changed.fn effort_field(ui: &mut egui::Ui, effort: &mut String, handle: &str) -> bool {let response = ui_kit::cell_editor(ui, ui.id().with("ai_reasoning_effort"), effort, tr("ui.ai_reasoning_effort_field_hint"), false)- .on_hover_text(tr("ui.ai_reasoning_effort_hint"));+ .backing_on_hover_text(tr("ui.ai_reasoning_effort_hint"));crate::scenario::publish_target(handle, response.rect);response.changed()}@@ -446,14 +447,14 @@ pub fn page(app: &mut SolveApp, ui: &mut egui::Ui) {ui_kit::settings_heading(ui, tr("prefs.assistant"), tr("ai.prefs.intro"));ui_kit::settings_section(ui, "assistant_availability", tr("ai.prefs.availability"), |ui| {ui.horizontal(|ui| {- let response =- ui_kit::checkbox(ui, tr("ui.ai_show_features"), &mut app.preferences.ai_features).on_hover_text(tr("ui.ai_show_features_note"));+ let response = ui_kit::checkbox(ui, tr("ui.ai_show_features"), &mut app.preferences.ai_features)+ .backing_on_hover_text(tr("ui.ai_show_features_note"));crate::scenario::publish_handle("prefs:ai_features", response.rect.center());ui_kit::help_icon(ui, tr("ui.ai_show_features_note"));});ui.add_enabled_ui(app.preferences.ai_features && !cfg!(target_arch = "wasm32"), |ui| {let response = ui_kit::checkbox(ui, tr("ui.ai_toolbar_button"), &mut app.preferences.ai_toolbar_button)- .on_hover_text(tr("ui.ai_toolbar_button_note"));+ .backing_on_hover_text(tr("ui.ai_toolbar_button_note"));crate::scenario::publish_handle("prefs:ai_toolbar_button", response.rect.center());});if cfg!(target_arch = "wasm32") {@@ -487,7 +488,7 @@ fn connecting_section(app: &mut SolveApp, ui: &mut egui::Ui) {("ai.prefs.open_at_start", "ai.prefs.open_at_start_note", "agent_chat_open_at_start", &mut app.preferences.agent_chat_open_at_start),] {ui.horizontal(|ui| {- let response = ui_kit::checkbox(ui, tr(label), value).on_hover_text(tr(help));+ let response = ui_kit::checkbox(ui, tr(label), value).backing_on_hover_text(tr(help));crate::scenario::publish_handle(&format!("prefs:{handle}"), response.rect.center());ui_kit::help_icon(ui, tr(help));});@@ -540,7 +541,8 @@ fn permissions_section(app: &mut SolveApp, ui: &mut egui::Ui) {.collect();ui_kit::section_count(ui, "always_allowed", tr("ui.ai_always_allowed"), false, Some(remembered.len()), |ui| {if remembered.is_empty() {- ui_kit::text(ui, tr("ai.prefs.no_saved_approvals"), ui_kit::Text::Hint("none")).on_hover_text(tr("ui.ai_always_allowed_none"));+ ui_kit::text(ui, tr("ai.prefs.no_saved_approvals"), ui_kit::Text::Hint("none"))+ .backing_on_hover_text(tr("ui.ai_always_allowed_none"));}let names: std::collections::HashMap<_, _> = agents::entries(app).into_iter().map(|entry| (entry.id, entry.name)).collect();for (agent, tools) in remembered {@@ -605,7 +607,7 @@ fn panel_section(app: &mut SolveApp, ui: &mut egui::Ui) {}if limit != 0 {let response =- ui_kit::settings_number(ui, &mut p.agent_chat_turn_limit, 1..=200, 1.0).on_hover_text(tr("ai.prefs.turn_limit_hint"));+ ui_kit::settings_number(ui, &mut p.agent_chat_turn_limit, 1..=200, 1.0).backing_on_hover_text(tr("ai.prefs.turn_limit_hint"));response.widget_info(|| {let mut info = egui::WidgetInfo::drag_value(ui.is_enabled(), f64::from(p.agent_chat_turn_limit));info.label = Some(tr("prefs.assistant_limit").to_owned());@@ -625,7 +627,7 @@ fn pointer_section(app: &mut SolveApp, ui: &mut egui::Ui) {ui,|ui| {let response = ui_kit::checkbox(ui, tr("ai.prefs.show_pointer"), &mut app.ui.agent_cursor.show)- .on_hover_text(crate::i18n::tr_label("Show the pointer an AI agent moves (#35)"));+ .backing_on_hover_text(crate::i18n::tr_label("Show the pointer an AI agent moves (#35)"));crate::scenario::publish_target("prefs:agent_pointer_show", response.rect);ui.add_enabled_ui(app.ui.agent_cursor.show, |ui| {let speed_label_width = ui_kit::ContentWidth::label(ui, tr("ai.prefs.pointer_speed")) + crate::theme::Tokens::get().space_4;@@ -653,7 +655,7 @@ fn pointer_section(app: &mut SolveApp, ui: &mut egui::Ui) {});ui.horizontal(|ui| {let response = ui_kit::checkbox(ui, tr("ai.prefs.follow_camera"), &mut app.ui.agent_cursor.follow_camera)- .on_hover_text(tr("prefs.assistant_follow_help"));+ .backing_on_hover_text(tr("prefs.assistant_follow_help"));crate::scenario::publish_target("prefs:agent_pointer_follow", response.rect);ui_kit::help_icon(ui, tr("prefs.assistant_follow_help"));});@@ -719,13 +721,13 @@ fn agents_section(app: &mut SolveApp, ui: &mut egui::Ui) {Kind::Api => "ui.ai_test_api_tip",Kind::Anthropic => "ui.ai_test_anthropic_tip",};- if test_button.on_hover_text(tr(tip)).clicked() {+ if test_button.backing_on_hover_text(tr(tip)).clicked() {test = Some(entry.clone());}if !entry.found {let edit_button = ui_kit::button(ui, tr("ui.ai_edit"), ui_kit::Button::Small);crate::scenario::publish_handle(&format!("prefs:ai_edit:{}", entry.id), edit_button.rect.center());- if edit_button.on_hover_text(tr("ui.ai_edit_tip")).clicked() {+ if edit_button.backing_on_hover_text(tr("ui.ai_edit_tip")).clicked() {edit = Some(entry.id.clone());}}@@ -748,7 +750,7 @@ fn agents_section(app: &mut SolveApp, ui: &mut egui::Ui) {}},);- ui_kit::settings_short_note(ui, &detail).on_hover_text(&entry.id);+ ui_kit::settings_short_note(ui, &detail).backing_on_hover_text(&entry.id);// Wide enough for an endpoint's "Request timeout" or "Reasoning effort" too,// so all rows line up.let label_w = [tr("ui.ai_permissions"), tr("ui.ai_request_timeout"), tr("ui.ai_reasoning_effort")]@@ -819,7 +821,7 @@ fn agents_section(app: &mut SolveApp, ui: &mut egui::Ui) {}if app.preferences.agent_permissions.get(&entry.id) == Some(&Mode::All) {ui_kit::text(ui, tr("ai.prefs.override_all_warning"), ui_kit::Text::Report("agent_permissions_warning", true))- .on_hover_text(tr("ui.ai_mode_all_warning"));+ .backing_on_hover_text(tr("ui.ai_mode_all_warning"));}test_line(ui, &app.agent_chat.settings.tests.get(&entry.id));});diff --git a/crates/ui-egui/src/agent_cursor.rs b/crates/ui-egui/src/agent_cursor.rsindex 44f700b03d..f26fc67a76 100644--- a/crates/ui-egui/src/agent_cursor.rs+++ b/crates/ui-egui/src/agent_cursor.rs@@ -502,7 +502,8 @@ pub fn paint(app: &SolveApp, ctx: &egui::Context) {.interactable(false).fade_in(false).show(ctx, |ui| {- Container::popup_frame(ui.style()).fill(t.overlay).show(ui, |ui| {+ let frame = Container::popup_frame(ui.style()).fill(t.overlay);+ Container::show_backing(ui, frame, |ui| {ui.label(egui::RichText::new(crate::i18n::tr_label(label)).size(t.font_label).color(t.text));});});diff --git a/crates/ui-egui/src/blur.rs b/crates/ui-egui/src/blur.rsindex e2b68c0e78..d310c733ef 100644--- a/crates/ui-egui/src/blur.rs+++ b/crates/ui-egui/src/blur.rs@@ -40,19 +40,24 @@ impl Counters {}pub fn validate_radius(radius: f32) -> Result<f32, &'static str> {- if radius.is_finite() && (0.0..=40.0).contains(&radius) {+ if radius.is_finite() && (0.0..=60.0).contains(&radius) {Ok(radius)} else {- Err("blur radius must be finite and between 0 and 40 physical pixels")+ Err("blur radius must be finite and between 0 and 60 physical pixels")}}/// Original Kawase schedule. Offsets are in input texels; the first level is half sized.pub fn schedule(radius: f32) -> Option<(usize, f32)> {+ schedule_capped(radius, 5)+}++/// A transient quality cap changes pass count, retaining the requested physical radius.+pub fn schedule_capped(radius: f32, cap: usize) -> Option<(usize, f32)> {if validate_radius(radius).ok()? == 0.0 {return None;}- let steps = if radius <= 8.0 {+ let steps = (if radius <= 8.0 {2} else if radius <= 18.0 {3@@ -60,13 +65,120 @@ pub fn schedule(radius: f32) -> Option<(usize, f32)> {4} else {5- };+ })+ .min(cap.clamp(2, 5));// Per-axis tap variance: down 1/2, up 4/3, scaled by input texel size.// Target tap sigma = radius / 2. Resampling adds its own measurable footprint.let variance = (35.0 / 18.0) * (4.0_f32.powi(steps as i32) - 1.0);Some((steps, radius / (2.0 * variance.sqrt())))}+/// Evidence from the native pass owner's actual submission, never UI construction time.+#[derive(Clone, Copy, Debug)]+pub struct PaintedFrame {+ pub frame: u64,+ pub interval_ms: Option<f64>,+ pub continuous: bool,+}++#[derive(Debug)]+pub(crate) struct Guard {+ pub cap: usize,+ pub streak: u8,+ pub notice: bool,+ pub opted_out: bool,+ original: Option<usize>,+ announced: bool,+}++impl Default for Guard {+ fn default() -> Self {+ Self { cap: 5, streak: 0, notice: false, opted_out: false, original: None, announced: false }+ }+}++impl Guard {+ pub fn reset(&mut self) {+ self.streak = 0;+ }++ pub fn observe(&mut self, radius: f32, interval_ms: f64, eligible: bool) {+ let steps = schedule_capped(radius, self.cap).map_or(0, |s| s.0);+ if self.opted_out || !eligible || !interval_ms.is_finite() || interval_ms <= 22.0 || steps <= 2 {+ self.reset();+ return;+ }+ self.streak = self.streak.saturating_add(1);+ if self.streak == 60 {+ self.original.get_or_insert(self.cap);+ self.cap = steps - 1;+ self.reset();+ if !self.announced {+ self.notice = true;+ self.announced = true;+ }+ }+ }++ pub fn undo(&mut self) {+ if let Some(original) = self.original.take() {+ self.cap = original;+ }+ self.opted_out = true;+ self.notice = false;+ self.reset();+ }+}++/// Session-only state. Harness inputs never replace a real GPU capability with success.+#[derive(Default)]+pub(crate) struct Session {+ pub guard: Guard,+ pub harness_radius: Option<f32>,+ pub harness_unavailable: Option<&'static str>,+ pub evidence_fixture: Option<&'static str>,+ identity: Option<(u64, u32)>,+ frame: Option<u64>,+ painted: Option<u64>,+ dismissed: std::collections::VecDeque<u64>,+}++impl Session {+ pub fn sample(&mut self, ctx: &egui::Context, revision: u64, radius: f32, available: bool, paint: Option<PaintedFrame>) {+ let frame = ctx.cumulative_frame_nr();+ if self.frame == Some(frame) {+ return;+ } // egui layout re-passes do not count twice.+ self.frame = Some(frame);+ let identity = (revision, radius.to_bits());+ if self.identity.as_ref() != Some(&identity) {+ self.identity = Some(identity);+ self.painted = paint.map(|p| p.frame);+ self.guard.reset();+ return;+ }+ let eligible = available+ && radius > 0.0+ && ctx.requested_repaint_last_pass()+ && ctx.input(|i| i.viewport().visible() != Some(false))+ && paint.is_some_and(|p| p.frame.checked_add(1) == Some(frame) && self.painted != Some(p.frame) && p.continuous);+ self.painted = paint.map(|p| p.frame);+ self.guard.observe(radius, paint.and_then(|p| p.interval_ms).unwrap_or(0.0), eligible);+ }++ pub fn dismissed(&self, key: u64) -> bool {+ self.dismissed.contains(&key)+ }+ pub fn dismiss(&mut self, key: u64) {+ if !self.dismissed(key) {+ if self.dismissed.len() == 64 {+ self.dismissed.pop_front();+ }+ self.dismissed.push_back(key);+ }+ }+}+#[cfg(not(target_arch = "wasm32"))]#[path = "blur_native.rs"]mod implementation;@@ -100,6 +212,14 @@ mod implementation {}pub fn begin(&mut self, _: &egui::Context, _: bool) {}pub fn set_surface_alpha(&mut self, _: Option<u8>) {}+ pub fn set_available(&mut self, _: bool) {}+ pub fn set_tier_cap(&mut self, _: usize) {}+ pub fn software_adapter(&self) -> bool {+ false+ }+ pub fn painted_frame(&self) -> Option<PaintedFrame> {+ None+ }}pub fn enabled() -> bool {falsediff --git a/crates/ui-egui/src/blur.wgsl b/crates/ui-egui/src/blur.wgslindex 033f4ffd6f..e947215ee3 100644--- a/crates/ui-egui/src/blur.wgsl+++ b/crates/ui-egui/src/blur.wgsl@@ -1,4 +1,4 @@-// Original SolidCraft viewport-only dual-Kawase and rounded panel composition.+// Original SolidCraft backdrop dual-Kawase and rounded surface composition.struct Params { a: vec4<f32>, rect: vec4<f32>, corners: vec4<f32>, top: vec4<f32>, bottom: vec4<f32>, outside: vec4<f32> }@group(0) @binding(0) var image: texture_2d<f32>;@group(0) @binding(1) var filtering: sampler;@@ -16,7 +16,7 @@ fn gamma(c: vec3<f32>) -> vec3<f32> {}fn load_linear(at: vec2<i32>) -> vec4<f32> {let c = textureLoad(image, clamp(at, vec2<i32>(0), vec2<i32>(textureDimensions(image)) - vec2<i32>(1)), 0);- // Only the source is gamma encoded on unorm targets. It is opaque, so decoding+ // Only the scene/composition input is gamma encoded on unorm targets. Decoding// each texel BEFORE bilinear interpolation avoids filtering encoded colors.return vec4<f32>(linear(c.rgb), c.a);}@@ -60,7 +60,7 @@ fn sample_at(uv: vec2<f32>) -> vec4<f32> {let alpha = clamp(0.5 - distance, 0.0, 1.0) * p.a.w;let c = textureSample(image, filtering, v.position.xy / vec2<f32>(textureDimensions(image)));// Match egui: coverage/opacity multiply gamma-premultiplied RGB BEFORE the- // framebuffer conversion. B itself remains linear, opaque viewport color.+ // framebuffer conversion. The sampled backdrop remains linear color.let premultiplied_gamma = gamma(c.rgb) * alpha;let rgb = select(premultiplied_gamma, linear(premultiplied_gamma), p.a.z > 0.5);return vec4<f32>(rgb, alpha);diff --git a/crates/ui-egui/src/blur_native.rs b/crates/ui-egui/src/blur_native.rsindex 84169d0575..6443785e85 100644--- a/crates/ui-egui/src/blur_native.rs+++ b/crates/ui-egui/src/blur_native.rs@@ -11,8 +11,8 @@ const BUDGET: u64 = 256 * 1024 * 1024;const MAX_MARKERS: usize = 256;type Params = [f32; 24];-fn capability(adapter: &wgpu::Adapter, format: wgpu::TextureFormat, split: bool, msaa: u32) -> Capability {- if solidcraft_gpu::select::tier_of(adapter.get_info().device_type) == solidcraft_gpu::select::Tier::Software {+fn capability(adapter: &wgpu::Adapter, device_type: wgpu::DeviceType, format: wgpu::TextureFormat, split: bool, msaa: u32) -> Capability {+ if device_type == wgpu::DeviceType::Cpu {return Capability::Unavailable("software adapter (gpu-software)");}rendering_capability(adapter, format, split, msaa)@@ -38,6 +38,7 @@ fn rendering_capability(adapter: &wgpu::Adapter, format: wgpu::TextureFormat, sp#[derive(Clone)]struct Host {adapter: wgpu::Adapter,+ device_type: wgpu::DeviceType,device: wgpu::Device,queue: wgpu::Queue,renderer: std::sync::Weak<egui::epaint::mutex::RwLock<egui_wgpu::Renderer>>,@@ -49,12 +50,14 @@ struct Host {}impl Host {fn capability(&self) -> Capability {- *self.capability.get_or_init(|| capability(&self.adapter, self.format, self.split, self.msaa))+ *self.capability.get_or_init(|| capability(&self.adapter, self.device_type, self.format, self.split, self.msaa))}}pub struct State {radius: f32,+ available: bool,+ tier_cap: usize,host: Option<Host>,active: Option<Arc<Shared>>,retired: Counters,@@ -69,6 +72,8 @@ impl Default for State {fn default() -> Self {Self {radius: 0.0,+ available: true,+ tier_cap: 5,host: None,active: None,retired: Counters::default(),@@ -87,6 +92,7 @@ impl State {self.failure = None;self.host = Some(Host {adapter: rs.adapter.clone(),+ device_type: rs.adapter.get_info().device_type,device: rs.device.clone(),queue: rs.queue.clone(),renderer: Arc::downgrade(&rs.renderer),@@ -124,6 +130,25 @@ impl State {pub fn radius(&self) -> f32 {self.radius}+ pub fn software_adapter(&self) -> bool {+ self.host.as_ref().is_some_and(|h| h.device_type == wgpu::DeviceType::Cpu)+ }+ pub fn set_available(&mut self, available: bool) {+ self.available = available;+ if !available {+ self.retire();+ }+ }+ pub fn set_tier_cap(&mut self, cap: usize) {+ let cap = cap.clamp(2, 5);+ if self.tier_cap != cap {+ self.retire();+ self.tier_cap = cap;+ }+ }+ pub fn painted_frame(&self) -> Option<PaintedFrame> {+ self.active.as_ref()?.inner.lock().ok()?.painted+ }pub fn capability(&self) -> Capability {let base = self.base_capability();if base == Capability::Available && self.active.as_ref().is_some_and(|s| s.inner.lock().is_ok_and(|i| i.missing_source)) {@@ -207,7 +232,7 @@ impl State {self.last_size = Some(size_key);}}- if self.base_capability() != Capability::Available || !size.is_finite() || size.x <= 0.0 || size.y <= 0.0 {+ if !self.available || self.base_capability() != Capability::Available || !size.is_finite() || size.x <= 0.0 || size.y <= 0.0 {self.retire();return Scope { previous, alpha };}@@ -216,6 +241,7 @@ impl State {Arc::new(Shared {host: host.clone(),radius: self.radius,+ tier_cap: self.tier_cap,painting_owner: std::sync::atomic::AtomicBool::new(true),inner: Mutex::new(Inner { counts: self.retired, ..Inner::default() }),})@@ -225,6 +251,12 @@ impl State {inner.serial = inner.serial.wrapping_add(1);inner.source_seen = false;inner.source_count = 0;+ if inner.frame != ctx.cumulative_frame_nr() {+ inner.frame = ctx.cumulative_frame_nr();+ inner.continuous = ctx.requested_repaint_last_pass();+ }+ inner.rendered = false;+ inner.drawn_before = inner.counts.markers_drawn;}if let Some(renderer) = host.renderer.upgrade() {renderer.write().frame_compositor = Some(shared.clone());@@ -253,8 +285,11 @@ pub(crate) fn fixture_state() -> State {State {radius: 0.0,+ available: true,+ tier_cap: 5,host: Some(Host {adapter: adapter.clone(),+ device_type: adapter.get_info().device_type,device: device.clone(),queue: queue.clone(),renderer: Arc::downgrade(renderer),@@ -317,11 +352,18 @@ pub fn panel_fill(fill: Color32) -> Color32 {struct Shared {host: Host,radius: f32,+ tier_cap: usize,inner: Mutex<Inner>,painting_owner: std::sync::atomic::AtomicBool,}#[derive(Default)]struct Inner {+ frame: u64,+ continuous: bool,+ rendered: bool,+ drawn_before: u64,+ painted: Option<PaintedFrame>,+ submitted_at: Option<std::time::Instant>,gpu: Option<Gpu>,markers: Vec<Marker>,counts: Counters,@@ -340,10 +382,14 @@ struct Marker {corners: egui::CornerRadius,opacity: f32,snap: bool,+ // Identity only: the paint job owns this callback for the entire frame. Keeping+ // its Arc here would create a Shared -> callback -> Shared ownership cycle.+ callback_id: usize,}pub fn decorate(painter: &Painter, frame: Frame, content: Rect, ordinary: Shape) -> Shape {- if frame.fill.a() == 255 || frame.fill.a() == 0 || !painter.is_visible() {+ let opacity = painter.opacity();+ if frame.fill.a() == 0 || (frame.fill.a() == 255 && opacity >= 1.0) || !opacity.is_finite() || opacity <= 0.0 || !painter.is_visible() {return ordinary;}CURRENT.with(|c| {@@ -356,7 +402,7 @@ pub fn decorate(painter: &Painter, frame: Frame, content: Rect, ordinary: Shape)if !rect.is_finite() || !rect.is_positive() {return ordinary;}- let index = if let Ok(mut inner) = shared.inner.lock() {+ let callback = if let Ok(mut inner) = shared.inner.lock() {if inner.markers.len() >= MAX_MARKERS {inner.failure = Some("blur panel limit exceeded");inner.gpu = None;@@ -364,18 +410,19 @@ pub fn decorate(painter: &Painter, frame: Frame, content: Rect, ordinary: Shape)return ordinary;}let index = inner.markers.len();+ let callback = egui_wgpu::Callback::new_paint_callback(rect, PanelMarker { shared: shared.clone(), index });inner.markers.push(Marker {rect,corners: frame.corner_radius,- opacity: painter.opacity(),+ opacity,snap: painter.ctx().tessellation_options(|o| o.round_rects_to_pixels),+ callback_id: Arc::as_ptr(&callback.callback) as *const () as usize,});inner.counts.markers_emitted += 1;- index+ callback} else {return ordinary;};- let callback = egui_wgpu::Callback::new_paint_callback(rect, PanelMarker { shared: shared.clone(), index });Shape::Vec(vec![Shape::Callback(callback), ordinary])})}@@ -477,7 +524,7 @@ impl CallbackTrait for Source {return Vec::new();}inner.source_seen = true;- let Some((steps, offset)) = schedule(self.shared.radius) else { return Vec::new() };+ let Some((steps, offset)) = schedule_capped(self.shared.radius, self.shared.tier_cap) else { return Vec::new() };let Some(bytes) = target_bytes(screen.size_in_pixels, steps, self.shared.host.device.limits().max_texture_dimension_2d) else {inner.failure = Some("blur target is empty, exceeds device limits or memory budget");inner.gpu = None;@@ -539,13 +586,9 @@ impl CallbackTrait for Source {}}counts.source_passes += 1;- for step in &gpu.chain {- let mut pass = pass(encoder, "blur_kawase", &step.target.view, wgpu::Color::TRANSPARENT);- pass.set_pipeline(if step.down { &gpu.down } else { &gpu.up });- pass.set_bind_group(0, &step.binding.group, &[]);- pass.draw(0..3, 0..1);- counts.blur_passes += 1;- }+ // The backdrop pyramid is built at paint-order boundaries in render(),+ // after the underlying UI has actually been drawn, rather than from this+ // scene-only texture during preparation.gpu.pending = Some(key);Vec::new()}@@ -575,6 +618,7 @@ impl Source {screen.size_in_pixels.hash(&mut h);screen.pixels_per_point.to_bits().hash(&mut h);self.shared.radius.to_bits().hash(&mut h);+ self.shared.tier_cap.hash(&mut h);self.shared.host.format.hash(&mut h);h.finish()}@@ -672,7 +716,7 @@ impl FrameCompositor for Shared {if !self.painting_owner.load(std::sync::atomic::Ordering::Relaxed) {return false;}- let (composition, pipeline, binding) = {+ let (composition, pipeline, binding, marker_ids) = {let Ok(mut inner) = self.inner.lock() else { return false };if !inner.source_seen {inner.missing_source = true;@@ -688,14 +732,51 @@ impl FrameCompositor for Shared {if gpu.ready_serial != inner.serial || gpu.size != screen.size_in_pixels {return false;}- let data = (gpu.composition.view.clone(), gpu.present.clone(), gpu.presentation.group.clone());+ let mut marker_ids: Vec<_> = inner.markers.iter().map(|marker| marker.callback_id).collect();+ marker_ids.sort_unstable();+ let data = (gpu.composition.view.clone(), gpu.present.clone(), gpu.presentation.group.clone(), marker_ids);inner.counts.composition_passes += 1;data};{let color = wgpu::Color { r: clear[0] as f64, g: clear[1] as f64, b: clear[2] as f64, a: clear[3] as f64 };- let mut ui = pass(encoder, "blur_ui_composition", &composition, color);- renderer.render(&mut ui, jobs, screen);+ let _clear = pass(encoder, "blur_ui_composition", &composition, color);+ }+ let mut start = 0;+ let mut mesh_offset = 0;+ let mut segment_passes = 0;+ for end in 0..=jobs.len() {+ let callback_id = jobs.get(end).and_then(|job| {+ let egui::epaint::Primitive::Callback(callback) = &job.primitive else { return None };+ Some(Arc::as_ptr(&callback.callback) as *const () as usize)+ });+ let marker = callback_id.is_some_and(|identity| marker_ids.binary_search(&identity).is_ok());+ if !marker && end != jobs.len() {+ continue;+ }+ if start < end {+ let mut ui = load_pass(encoder, "blur_ui_segment", &composition);+ renderer.render_with_mesh_offset(&mut ui, &jobs[start..end], screen, mesh_offset);+ mesh_offset += jobs[start..end].iter().filter(|job| matches!(&job.primitive, egui::epaint::Primitive::Mesh(_))).count();+ segment_passes += 1;+ }+ if marker {+ // The preceding segment is complete before sampling its color target.+ // Reuse the pyramid, but include previously painted UI in the backdrop.+ if let Ok(mut inner) = self.inner.lock() {+ let Inner { gpu, counts, .. } = &mut *inner;+ if let Some(gpu) = gpu {+ for step in &gpu.chain {+ let mut blur = pass(encoder, "blur_backdrop", &step.target.view, wgpu::Color::TRANSPARENT);+ blur.set_pipeline(if step.down { &gpu.down } else { &gpu.up });+ blur.set_bind_group(0, &step.binding.group, &[]);+ blur.draw(0..3, 0..1);+ counts.blur_passes += 1;+ }+ }+ }+ }+ start = end;}{let mut present = pass(encoder, "blur_present", target, wgpu::Color::TRANSPARENT);@@ -704,7 +785,9 @@ impl FrameCompositor for Shared {present.draw(0..3, 0..1);}if let Ok(mut inner) = self.inner.lock() {+ inner.counts.composition_passes += segment_passes;inner.counts.present_passes += 1;+ inner.rendered = true;}true}@@ -713,6 +796,19 @@ impl FrameCompositor for Shared {return;}if let Ok(mut inner) = self.inner.lock() {+ if inner.rendered && inner.counts.markers_drawn > inner.drawn_before && !self.host.lost.is_lost() {+ let now = std::time::Instant::now();+ inner.painted = Some(PaintedFrame {+ frame: inner.frame,+ interval_ms: inner.submitted_at.map(|at| now.duration_since(at).as_secs_f64() * 1000.0),+ continuous: inner.continuous,+ });+ inner.submitted_at = Some(now);+ inner.rendered = false;+ } else {+ inner.painted = None;+ inner.submitted_at = None;+ }if self.host.lost.is_lost() {inner.gpu = None;inner.counts.clear_live();@@ -811,6 +907,19 @@ fn background_params(rect: Rect, clip: Rect, colors: [Color32; 2], outside: Colo}fn pass(encoder: &mut wgpu::CommandEncoder, label: &'static str, view: &wgpu::TextureView, clear: wgpu::Color) -> wgpu::RenderPass<'static> {+ attachment_pass(encoder, label, view, wgpu::LoadOp::Clear(clear))+}++fn load_pass(encoder: &mut wgpu::CommandEncoder, label: &'static str, view: &wgpu::TextureView) -> wgpu::RenderPass<'static> {+ attachment_pass(encoder, label, view, wgpu::LoadOp::Load)+}++fn attachment_pass(+ encoder: &mut wgpu::CommandEncoder,+ label: &'static str,+ view: &wgpu::TextureView,+ load: wgpu::LoadOp<wgpu::Color>,+) -> wgpu::RenderPass<'static> {encoder.begin_render_pass(&wgpu::RenderPassDescriptor {label: Some(label),@@ -818,7 +927,7 @@ fn pass(encoder: &mut wgpu::CommandEncoder, label: &'static str, view: &wgpu::Teview,resolve_target: None,depth_slice: None,- ops: wgpu::Operations { load: wgpu::LoadOp::Clear(clear), store: wgpu::StoreOp::Store },+ ops: wgpu::Operations { load, store: wgpu::StoreOp::Store },})],depth_stencil_attachment: None,timestamp_writes: None,@@ -931,7 +1040,7 @@ impl Gpu {dimensions.push(last.map(|d| d.div_ceil(2)));}for (index, dims) in dimensions.iter().skip(1).enumerate() {- let input = chain.last().map_or(&source.view, |s| &s.target.view);+ let input = chain.last().map_or(&composition.view, |s| &s.target.view);let mut p = [0.0; 24];p[0] = offset;p[1] = u8::from(index == 0 && !format.is_srgb()) as f32;@@ -940,7 +1049,7 @@ impl Gpu {chain.push(Step { target, binding, down: true });}for dims in dimensions.iter().take(steps).rev() {- let input = chain.last().map_or(&source.view, |s| &s.target.view);+ let input = chain.last().map_or(&composition.view, |s| &s.target.view);let mut p = [0.0; 24];p[0] = offset;let binding = Binding::new(device, &layout, &sampler, input, p, counts);diff --git a/crates/ui-egui/src/browser.rs b/crates/ui-egui/src/browser.rsindex 3aa8ff79e7..d446427caa 100644--- a/crates/ui-egui/src/browser.rs+++ b/crates/ui-egui/src/browser.rs@@ -6,6 +6,7 @@//! viewport, a double-click on a sketch edits it, and a right-click opens the item's menu//! ([`crate::context_menu`]).+use crate::ui_kit::BackingTooltipExt as _;use crate::ui_kit::{Container, Surface};use solidcraft_engine::geom::prelude::*;@@ -1201,7 +1202,7 @@ fn browser_collapsed_rail(app: &mut SolveApp, ui: &mut egui::Ui) {crate::scenario::publish_handle("left-browser-toggle", disclosure.center());crate::scenario::publish_target("browser:header", disclosure);response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Button, ui.is_enabled(), crate::i18n::tr("ui.browser_title")));- if response.on_hover_text(crate::i18n::tr("ui.browser_expand")).clicked() {+ if response.backing_on_hover_text(crate::i18n::tr("ui.browser_expand")).clicked() {app.preferences.timeline_left_browser_collapsed = false;}let galley = ui.painter().layout_no_wrap(crate::i18n::tr("ui.browser_title").to_owned(), crate::fonts::semibold(t.font_body), t.text);@@ -1289,7 +1290,7 @@ fn browser_header(app: &mut SolveApp, ui: &mut egui::Ui, collapsible: bool) {ui.painter().galley(pos2(right - galley.size().x, rect.center().y - galley.size().y / 2.0), galley, t.text_dim);if collapsible {let tip = crate::i18n::tr(if collapsed { "ui.browser_expand" } else { "ui.browser_collapse" });- if response.on_hover_cursor(egui::CursorIcon::PointingHand).on_hover_text(tip).clicked() {+ if response.on_hover_cursor(egui::CursorIcon::PointingHand).backing_on_hover_text(tip).clicked() {if stacked {app.preferences.timeline_left_browser_collapsed = !app.preferences.timeline_left_browser_collapsed;} else if vertical {@@ -1716,7 +1717,7 @@ fn occurrence_rows_inner(}if let Some(resp) = &r.resp {let inherited = if own_visible && !visible { "\nHidden by a parent placement. Show the parent to reveal this instance." } else { "" };- resp.clone().on_hover_ui(|ui| {+ resp.clone().backing_on_hover_ui(|ui| {ui.label(&placement.tooltip);if !inherited.is_empty() {ui.label(inherited.trim_start());diff --git a/crates/ui-egui/src/browser/features.rs b/crates/ui-egui/src/browser/features.rsindex 6e4d88064f..75322ffd5e 100644--- a/crates/ui-egui/src/browser/features.rs+++ b/crates/ui-egui/src/browser/features.rs@@ -351,7 +351,7 @@ fn marker_row(app: &SolveApp, ui: &mut egui::Ui, depth: usize) -> egui::Responseif response.hovered() || response.dragged() {ui.ctx().set_cursor_icon(egui::CursorIcon::Grab);}- response.on_hover_text(crate::i18n::tr("ui.history_marker_tip"))+ response.backing_on_hover_text(crate::i18n::tr("ui.history_marker_tip"))}/// Dragging the marker shows where it lands; letting go rolls the history there, through thediff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rsindex 3b2897ded0..92e80623d7 100644--- a/crates/ui-egui/src/canvas.rs+++ b/crates/ui-egui/src/canvas.rs@@ -5,6 +5,7 @@//! command has its geometry, so typing a number sets the value at once; Enter applies, Tab//! moves on, Esc cancels.+use crate::ui_kit::BackingTooltipExt as _;use crate::ui_kit::{Container, Surface};use egui::{Color32, Pos2, Stroke, vec2};use solidcore_record::{Vec2, Vec3};@@ -927,7 +928,8 @@ fn value_box_full(// Background: under Preferences, Report a bug and other system windows (#9016). The box is// already kept clear of the command window (#6608), which floats at Middle with Features.Container::new(ui.ctx(), Surface::Canvas).area(area).fixed_pos(at).pivot(pivot).order(egui::Order::Background).show(ui.ctx(), |ui| {- Container::popup_frame(ui.style()).inner_margin(egui::Margin::symmetric(6, 3)).show(ui, |ui| {+ let frame = Container::popup_frame(ui.style()).inner_margin(egui::Margin::symmetric(6, 3));+ Container::show_backing(ui, frame, |ui| {ui.horizontal(|ui| {ui.label(egui::RichText::new(crate::i18n::tr_label(label)).color(t.text_dim).size(crate::theme::Tokens::get().font_caption));let r = crate::ui_kit::canvas_value_field(ui, id, value, keep_tab);@@ -1801,7 +1803,8 @@ fn draw_revolve(.order(egui::Order::Background).interactable(false);area.show(ui.ctx(), |ui| {- Container::popup_frame(ui.style()).inner_margin(egui::Margin::symmetric(6, 3)).show(ui, |ui| {+ let frame = Container::popup_frame(ui.style()).inner_margin(egui::Margin::symmetric(6, 3));+ Container::show_backing(ui, frame, |ui| {let text = if extent.curved_to {"To surface".into()} else if extent.sweep.is_finite() {@@ -1809,7 +1812,7 @@ fn draw_revolve(} else {"Choose target".into()};- ui.label(text).on_hover_text(crate::i18n::tr_label("Determined by To Object. Choose Angle to edit the angular extent."));+ ui.label(text).backing_on_hover_text(crate::i18n::tr_label("Determined by To Object. Choose Angle to edit the angular extent."));});});} else if let Kind::Revolve { angle, .. } = &mut d.kind {diff --git a/crates/ui-egui/src/command_help.rs b/crates/ui-egui/src/command_help.rsindex f3b7c67e4e..0901b8c25b 100644--- a/crates/ui-egui/src/command_help.rs+++ b/crates/ui-egui/src/command_help.rs@@ -5,6 +5,7 @@//! ships with its help: `every_toolbar_command_has_help` fails otherwise.use crate::i18n;+use crate::ui_kit::BackingTooltipExt as _;/// The commands that have help text. Each one needs a `help.<id>` message in the catalogs.pub const DOCUMENTED: &[&str] = &[@@ -335,7 +336,7 @@ pub fn help(command: &str) -> Option<String> {/// with the help of `command` below it when there is one.pub fn tooltip(response: egui::Response, command: &str, tip: String) -> egui::Response {let help = help(command);- response.on_hover_ui(move |ui| {+ response.backing_on_hover_ui(move |ui| {ui.set_max_width(300.0);ui.label(tip);if let Some(help) = help {diff --git a/crates/ui-egui/src/configuration_rules_ui.rs b/crates/ui-egui/src/configuration_rules_ui.rsindex 627fa4de88..958760abcf 100644--- a/crates/ui-egui/src/configuration_rules_ui.rs+++ b/crates/ui-egui/src/configuration_rules_ui.rs@@ -1,6 +1,7 @@//! Structured configuration rule editing and non-mutating row preview.use crate::SolveApp;use crate::ui_kit;+use crate::ui_kit::BackingTooltipExt as _;use egui::Ui;use serde_json::{Value, json};use solidcraft_engine::doc::config::{Column, ConfigRule, RuleCondition, RuleEffect, RuleOperator};@@ -116,13 +117,13 @@ pub(super) fn show(ui: &mut Ui, app: &mut SolveApp, error: &mut Option<String>,if ui_kit::button(ui, crate::i18n::tr_label("Edit"), ui_kit::Button::Normal).clicked() {editor.rule = rule.clone();}- let up = ui_kit::button(ui, "↑", ui_kit::Button::Enabled(index > 0)).on_hover_text(crate::i18n::tr_label("Move earlier"));+ let up = ui_kit::button(ui, "↑", ui_kit::Button::Enabled(index > 0)).backing_on_hover_text(crate::i18n::tr_label("Move earlier"));crate::scenario::publish_handle(&format!("config:rule:{}:up", rule.id), up.rect.center());if up.clicked() {*error = app.run("config.rule", json!({"id":rule.id,"index":index-1})).err();}if ui_kit::button(ui, "↓", ui_kit::Button::Enabled(index + 1 < rules.len()))- .on_hover_text(crate::i18n::tr_label("Move later"))+ .backing_on_hover_text(crate::i18n::tr_label("Move later")).clicked(){*error = app.run("config.rule", json!({"id":rule.id,"index":index+1})).err();diff --git a/crates/ui-egui/src/control.rs b/crates/ui-egui/src/control.rsindex 45edee7e8d..97ce6175ec 100644--- a/crates/ui-egui/src/control.rs+++ b/crates/ui-egui/src/control.rs@@ -653,8 +653,8 @@ fn dispatch(app: &mut SolveApp, ctx: &egui::Context, method: &str, p: &Value) ->"ui.blur" => {// Internal rendering harness; deliberately no saved preference or product UI.let radius = if let Some(radius) = p.get("radius_px") {- let Some(radius) = radius.as_f64().filter(|v| v.is_finite() && (0.0..=40.0).contains(v)) else {- return err("radius_px must be finite and between 0 and 40");+ let Some(radius) = radius.as_f64().filter(|v| v.is_finite() && (0.0..=60.0).contains(v)) else {+ return err("radius_px must be finite and between 0 and 60");};Some(radius as f32)} else {@@ -673,18 +673,70 @@ fn dispatch(app: &mut SolveApp, ctx: &egui::Context, method: &str, p: &Value) ->} else {None};+ // Explicit, labelled evidence fixtures only. They can force a failure, never fake+ // real renderer support. All validation precedes mutation, including old fields.+ let fixture = if let Some(fixture) = p.get("fixture") {+ let Some(fixture) =+ fixture.as_str().filter(|s| matches!(*s, "clear" | "gpu-software" | "reduce-transparency" | "web-unsupported" | "guard-60"))+ else {+ return err("unknown blur evidence fixture");+ };+ Some(fixture)+ } else {+ None+ };if let Some(radius) = radius {if let Err(error) = app.blur.set_radius(radius) {return err(error);}+ app.blur_session.harness_radius = Some(radius);ctx.request_repaint();}if let Some(alpha) = alpha {app.blur.set_surface_alpha(alpha);ctx.request_repaint();}+ if let Some(fixture) = fixture {+ match fixture {+ "clear" => {+ app.blur_session.harness_unavailable = None;+ app.blur_session.harness_radius = None;+ app.blur_session.evidence_fixture = None;+ }+ "gpu-software" => {+ app.blur_session.harness_unavailable = Some("prefs.blur_software");+ app.blur_session.evidence_fixture = Some("gpu-software");+ }+ "reduce-transparency" => {+ app.blur_session.harness_unavailable = Some("prefs.blur_reduce_transparency");+ app.blur_session.evidence_fixture = Some("reduce-transparency");+ }+ "web-unsupported" => {+ app.blur_session.harness_unavailable = Some("prefs.blur_web");+ app.blur_session.evidence_fixture = Some("web-unsupported");+ }+ "guard-60" => {+ let radius = app.blur.radius();+ for _ in 0..60 {+ app.blur_session.guard.observe(radius, 23.0, true);+ }+ app.blur_session.evidence_fixture = Some("guard-60");+ }+ _ => {}+ }+ ctx.request_repaint();+ }+ let availability = crate::prefs::blur_availability(app);+ let reason = match availability {+ crate::theme_options::Availability::Unavailable(reason) => Some(app.tr(reason)),+ crate::theme_options::Availability::Available => None,+ };ok(- json!({"radius_px":app.blur.radius(), "max_radius_px":40, "capability":app.blur.capability_for(ctx.viewport_id()), "counters":app.blur.counters()}),+ json!({"radius_px":app.blur.radius(), "max_radius_px":60, "capability":app.blur.capability_for(ctx.viewport_id()), "counters":app.blur.counters(),+ "available": availability == crate::theme_options::Availability::Available, "reason": reason,+ "evidence_fixture": app.blur_session.evidence_fixture,+ "guard": {"tier_cap": app.blur_session.guard.cap, "streak": app.blur_session.guard.streak,+ "notice": app.blur_session.guard.notice, "opted_out": app.blur_session.guard.opted_out}}),)}"ui.status_fixture" => wrap(crate::viewport_status_fixture::control(app, p)),@@ -1694,7 +1746,7 @@ mod tests {#[test]fn blur_control_validates_before_mutation_and_reports_no_gpu() {let mut h = crate::scenario::Harness::new();- for invalid in [json!(-1), json!(41), json!("18"), json!(null)] {+ for invalid in [json!(-1), json!(61), json!("18"), json!(null)] {let reply = h.call("ui.blur", json!({"radius_px":invalid}));assert_eq!(reply["ok"], false, "{reply}");assert_eq!(h.app.blur.radius(), 0.0);@@ -1712,6 +1764,43 @@ mod tests {assert_eq!(h.app.blur.radius(), 0.0);}+ #[test]+ fn blur_evidence_fixtures_are_atomic_transient_and_never_fake_support() {+ let mut h = crate::scenario::Harness::new();+ let source: Value = serde_json::from_str(include_str!("../tests/fixtures/theme-blur.json")).unwrap();+ assert_eq!(h.call("ui.prefs", json!({"theme_import":source,"theme_options":{"blur-review":{"blur":40}}}))["ok"], true);+ h.frames(2);+ let saved = h.app.preferences.theme_options.clone();+ let revision = h.app.session.revision;+ for invalid in [json!(null), json!([]), json!("available"), json!("unknown")] {+ assert_eq!(h.call("ui.blur", json!({"fixture":invalid,"radius_px":8}))["ok"], false);+ assert_eq!(h.app.blur.radius(), 40.0);+ assert_eq!(h.app.blur_session.harness_radius, None);+ }+ for fixture in ["gpu-software", "reduce-transparency", "web-unsupported"] {+ let reply = h.call("ui.blur", json!({"fixture":fixture}));+ assert_eq!(reply["result"]["evidence_fixture"], fixture);+ assert_eq!(reply["result"]["available"], false);+ h.frames(2);+ assert_eq!(h.app.blur.counters().textures_created, 0);+ assert_eq!(h.app.blur.counters().markers_emitted, 0);+ assert_eq!(h.app.preferences.theme_options, saved);+ }+ h.call("ui.blur", json!({"fixture":"clear"}));+ h.call("ui.blur", json!({"fixture":"guard-60"}));+ assert_eq!((h.app.blur_session.guard.cap, h.app.blur_session.guard.notice), (4, true));+ assert_eq!(h.app.blur_session.evidence_fixture, Some("guard-60"));+ h.app.blur_session.guard.undo();+ assert_eq!((h.app.blur_session.guard.cap, h.app.blur_session.guard.opted_out), (5, true));+ h.call("ui.blur", json!({"fixture":"guard-60"}));+ assert_eq!(h.app.blur_session.guard.cap, 5);+ assert_eq!(h.app.session.revision, revision, "quality actions never enter document undo");+ assert_eq!(h.app.preferences.theme_options, saved);+ h.call("ui.blur", json!({"fixture":"clear"}));+ assert!(h.app.blur_session.evidence_fixture.is_none());+ assert!(matches!(h.app.blur.capability(), crate::blur::Capability::Unavailable(_)), "clearing a fixture cannot manufacture a GPU");+ }+use serde_json::json;use solidcraft_engine::{Sel, Session};diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rsindex 48aea54881..0b71595e91 100644--- a/crates/ui-egui/src/dialogs.rs+++ b/crates/ui-egui/src/dialogs.rs@@ -2,6 +2,7 @@//! inputs (geometry picked in the viewport, never typed), then runs its command; it never//! changes the design itself. Things selected before the command starts become its input.+use crate::ui_kit::BackingTooltipExt as _;use crate::ui_kit::choice_row;use solidcraft_engine::geom::prelude::*;use std::hash::{Hash, Hasher};@@ -2674,7 +2675,7 @@ fn object_type_row(d: &mut Dialog, ui: &mut egui::Ui) {let cur = usize::from(inp.accept == selection::FEATURES);let mut ty = cur;// What the two kinds are, and that a sketch is neither (#10057).- choice_row(ui, "Object Type", "pat_obj", &mut ty, &["Bodies", "Features"]).on_hover_text(crate::i18n::tr("ui.pattern_object_type_tip"));+ choice_row(ui, "Object Type", "pat_obj", &mut ty, &["Bodies", "Features"]).backing_on_hover_text(crate::i18n::tr("ui.pattern_object_type_tip"));if ty != cur {inp.accept = if ty == 1 { selection::FEATURES } else { BODIES };inp.label = objects_label(inp.accept);@@ -2987,7 +2988,7 @@ pub(crate) fn input_rows_range(d: &mut Dialog, ui: &mut egui::Ui, s: &Session, n} else {format!("{} (click to pick into this input)", hint(inp))};- if chip.on_hover_text(tooltip).clicked() {+ if chip.backing_on_hover_text(tooltip).clicked() {activate = Some(i);surrender_keyboard_focus(ui);}@@ -3187,7 +3188,7 @@ fn error_rows(app: &mut SolveApp, ctx: &egui::Context, d: &mut Dialog, ui: &mutui.vertical(|ui| {match &plain {Some(FilletRefusal::Plain(plain)) => {- crate::ui_kit::text(ui, plain, crate::ui_kit::Text::Report("error", true)).on_hover_text(shown_error(&error));+ crate::ui_kit::text(ui, plain, crate::ui_kit::Text::Report("error", true)).backing_on_hover_text(shown_error(&error));}Some(FilletRefusal::InField) => {}None => {@@ -3198,7 +3199,7 @@ fn error_rows(app: &mut SolveApp, ctx: &egui::Context, d: &mut Dialog, ui: &mutif plain.is_some() {let copy = crate::ui_kit::button(ui, tr("ui.copy_details"), crate::ui_kit::Button::Normal);crate::scenario::publish_handle("dialog:copy_details", copy.rect.center());- if copy.on_hover_text(tr("ui.copy_details_tip")).clicked() {+ if copy.backing_on_hover_text(tr("ui.copy_details_tip")).clicked() {ui.ctx().copy_text(error.clone());}}diff --git a/crates/ui-egui/src/dialogs_appearance.rs b/crates/ui-egui/src/dialogs_appearance.rsindex 74aff4159d..1acf870a1a 100644--- a/crates/ui-egui/src/dialogs_appearance.rs+++ b/crates/ui-egui/src/dialogs_appearance.rs@@ -3,6 +3,7 @@//! body or face in the viewport, or onto a body's row in the Browser, applies at once; Apply//! (and OK) gives the picked objects the current look.+use crate::ui_kit::BackingTooltipExt as _;use egui::Color32;use serde_json::{Value, json};use solidcraft_engine::Sel;@@ -415,7 +416,7 @@ pub fn rows(app: &mut SolveApp, ui: &mut egui::Ui, k: &mut Ap, inputs: &mut [Sel});let mut enabled = k.pbr.is_some();let toggle = ui_kit::row(ui, app.tr("appearance.surface_response"), |ui| ui_kit::checkbox(ui, app.tr("appearance.pbr_opaque"), &mut enabled))- .on_hover_text(app.tr("appearance.pbr_help"));+ .backing_on_hover_text(app.tr("appearance.pbr_help"));crate::scenario::publish_handle("appearance:pbr", toggle.rect.center());if toggle.changed() {detach_preset(k);@@ -461,7 +462,7 @@ pub fn rows(app: &mut SolveApp, ui: &mut egui::Ui, k: &mut Ap, inputs: &mut [Sel});}if ui_kit::button(ui, "Remove override", ui_kit::Button::Enabled(has_target))- .on_hover_text(crate::i18n::tr_label("Restore the inherited component or physical material appearance"))+ .backing_on_hover_text(crate::i18n::tr_label("Restore the inherited component or physical material appearance")).clicked()&& let Some(p) = clear_params(k, &picked){@@ -543,7 +544,7 @@ pub fn rows(app: &mut SolveApp, ui: &mut egui::Ui, k: &mut Ap, inputs: &mut [Sel}}).response- .on_hover_text(tip);+ .backing_on_hover_text(tip);});// A swatch dropped on the model or the Browser.let released = ui.input(|i| i.pointer.any_released());diff --git a/crates/ui-egui/src/dialogs_assembly.rs b/crates/ui-egui/src/dialogs_assembly.rsindex 0afd602df3..77d99e32ef 100644--- a/crates/ui-egui/src/dialogs_assembly.rs+++ b/crates/ui-egui/src/dialogs_assembly.rs@@ -6,6 +6,7 @@//! component shows where it goes, and with Animate the joint plays its motion.use crate::fonts::RichTextExt as _;+use crate::ui_kit::BackingTooltipExt as _;use crate::ui_kit::{choice_row, expr_row, text_row};use egui::{Color32, Pos2, RichText, Stroke, vec2};use serde_json::{Value, json};@@ -737,7 +738,7 @@ pub fn rows(app: &mut SolveApp, ui: &mut egui::Ui, k: &mut Asm, inputs: &mut [Secrate::ui_kit::status_line(ui, &why, crate::ui_kit::StatusTone::Warning);if !bodies.is_empty()&& crate::ui_kit::button(ui, crate::i18n::tr("cmd.component_from_bodies"), crate::ui_kit::Button::Normal)- .on_hover_text(crate::i18n::tr("joint.from_bodies_hint"))+ .backing_on_hover_text(crate::i18n::tr("joint.from_bodies_hint")).clicked(){// A refusal shows on the status line; the picks stay either way.@@ -773,7 +774,7 @@ pub fn rows(app: &mut SolveApp, ui: &mut egui::Ui, k: &mut Asm, inputs: &mut [Seform_row(ui, "Animate", |ui| {let label = crate::i18n::tr(if f.animate { "ui.joint_stop" } else { "ui.joint_play" });if crate::ui_kit::button(ui, label, crate::ui_kit::Button::Normal)- .on_hover_text(crate::i18n::tr_label("Play the joint's motion in the view"))+ .backing_on_hover_text(crate::i18n::tr_label("Play the joint's motion in the view")).clicked(){f.animate = !f.animate;@@ -1034,7 +1035,7 @@ fn find_limits_row(app: &mut SolveApp, ui: &mut egui::Ui, f: &mut JointForm, id:}});} else if crate::ui_kit::button(ui, crate::i18n::tr("joint.find_limits"), crate::ui_kit::Button::Normal)- .on_hover_text(crate::i18n::tr("joint.find_limits_hint"))+ .backing_on_hover_text(crate::i18n::tr("joint.find_limits_hint")).clicked(){find_limits(app, f, id, inputs);@@ -1261,7 +1262,7 @@ fn interference_rows(app: &SolveApp, ui: &mut egui::Ui, r: &Value) {for u in unchecked {form_row(ui, &format!("{} · {}", u["a"].as_str().unwrap_or(""), u["b"].as_str().unwrap_or("")), |ui| {ui.label(RichText::new(crate::i18n::tr("dialog.could_not_be_checked")).color(t.warning))- .on_hover_text(u["reason"].as_str().unwrap_or(""));+ .backing_on_hover_text(u["reason"].as_str().unwrap_or(""));});}}@@ -1727,7 +1728,7 @@ pub(crate) fn timeline_joint_tiles(app: &mut SolveApp, ui: &mut egui::Ui, p: &egif suppressed {p.line_segment([br.left_bottom() + vec2(4.0, -4.0), br.right_top() + vec2(-4.0, 4.0)], Stroke::new(1.5, t.text_dim));}- let resp = resp.on_hover_text(format!("{name} ({kind:?} joint)\nDouble-click to edit · right-click for more"));+ let resp = resp.backing_on_hover_text(format!("{name} ({kind:?} joint)\nDouble-click to edit · right-click for more"));if resp.double_clicked() {open = edit_joint(app, id);} else if resp.clicked() {@@ -1790,7 +1791,7 @@ pub(crate) fn timeline_joint_rows(app: &mut SolveApp, ui: &mut egui::Ui, ids: Opegui::FontId::proportional(crate::theme::Tokens::get().font_body),if suppressed { t.text_dim } else { t.text },);- let response = response.on_hover_text(format!("{name} ({kind:?} joint)\nDouble-click to edit · right-click for more"));+ let response = response.backing_on_hover_text(format!("{name} ({kind:?} joint)\nDouble-click to edit · right-click for more"));if response.double_clicked() {open = edit_joint(app, id);} else if response.clicked() {@@ -1862,7 +1863,7 @@ pub fn browser_joints(app: &mut SolveApp, ui: &mut egui::Ui, depth: usize) {},);if let Some(resp) = &r.resp {- resp.clone().on_hover_text(format!("{kind:?} joint"));+ resp.clone().backing_on_hover_text(format!("{kind:?} joint"));}if r.eye {let _ = app.run("browser.visibility", json!({ "joints": [id], "visible": !visible }));@@ -1951,7 +1952,7 @@ pub fn component_joints(app: &mut SolveApp, ui: &mut egui::Ui, path: &[u64], key},);if let Some(resp) = &r.resp {- resp.clone().on_hover_text(format!("{:?} joint", j.kind));+ resp.clone().backing_on_hover_text(format!("{:?} joint", j.kind));}if r.eye {let _ = app.run("browser.visibility", json!({ "joints": [id], "visible": !visible }));diff --git a/crates/ui-egui/src/dialogs_cam.rs b/crates/ui-egui/src/dialogs_cam.rsindex 64751dbde1..137f1a706b 100644--- a/crates/ui-egui/src/dialogs_cam.rs+++ b/crates/ui-egui/src/dialogs_cam.rs@@ -4,6 +4,7 @@//! where it touches) or a flat face. Picking the profile on a part chooses the joint that part//! turns on. Play turns the cam a full turn so the follower shows its motion before OK.+use crate::ui_kit::BackingTooltipExt as _;use egui::RichText;use serde_json::{Value, json};use solidcraft_engine::Sel;@@ -133,7 +134,7 @@ pub fn rows(app: &mut SolveApp, ui: &mut egui::Ui, f: &mut CamForm, inputs: &[Seform_row(ui, "Animate", |ui| {let label = crate::i18n::tr(if f.animate { "ui.joint_stop" } else { "ui.joint_play" });let r = crate::ui_kit::button(ui, label, crate::ui_kit::Button::Normal)- .on_hover_text(crate::i18n::tr_label("Play the joint's motion in the view"));+ .backing_on_hover_text(crate::i18n::tr_label("Play the joint's motion in the view"));crate::scenario::publish_handle("dialog:Animate", r.rect.center());if r.clicked() {f.animate = !f.animate;diff --git a/crates/ui-egui/src/dialogs_coupling.rs b/crates/ui-egui/src/dialogs_coupling.rsindex b222babbcf..fac6aec242 100644--- a/crates/ui-egui/src/dialogs_coupling.rs+++ b/crates/ui-egui/src/dialogs_coupling.rs@@ -4,6 +4,7 @@//! face also picks the joint it turns on. Play turns the driving joint so the coupling shows its//! motion before OK.+use crate::ui_kit::BackingTooltipExt as _;use crate::ui_kit::{StatusTone, choice_row, expr_row, status_line};use egui::RichText;use serde_json::{Value, json};@@ -206,7 +207,7 @@ pub fn rows(app: &mut SolveApp, ui: &mut egui::Ui, f: &mut CouplingForm, inputs:form_row(ui, "Animate", |ui| {let label = crate::i18n::tr(if f.animate { "ui.joint_stop" } else { "ui.joint_play" });let r = crate::ui_kit::button(ui, label, crate::ui_kit::Button::Normal)- .on_hover_text(crate::i18n::tr_label("Play the joint's motion in the view"));+ .backing_on_hover_text(crate::i18n::tr_label("Play the joint's motion in the view"));crate::scenario::publish_handle("dialog:Animate", r.rect.center());if r.clicked() {f.animate = !f.animate;diff --git a/crates/ui-egui/src/dialogs_dense.rs b/crates/ui-egui/src/dialogs_dense.rsindex 640e978150..2cb85551cd 100644--- a/crates/ui-egui/src/dialogs_dense.rs+++ b/crates/ui-egui/src/dialogs_dense.rs@@ -218,7 +218,7 @@ fn fillet_corner_rows(let hint = crate::i18n::format("ui.fillet_setback_hint", &[("factor", &factor)]);ui_kit::checked_row(ui, "ui.fillet_setback", &mut text, &hint, warning.as_deref())});- row.response.on_hover_text(crate::i18n::format("ui.fillet_setback_tip", &[("factor", &factor)]));+ row.response.backing_on_hover_text(crate::i18n::format("ui.fillet_setback_tip", &[("factor", &factor)]));let (accepted, field) = row.inner;enter |= accepted;if text != shown {@@ -237,7 +237,7 @@ fn fillet_fit_rows(app: &SolveApp, ui: &mut egui::Ui, extra: &mut serde_json::Malet t = Tokens::get();let before = extra.get("fit").cloned();let row = ui.scope(|ui| form_row(ui, "ui.fillet_fit", |ui| extra_choice(ui, extra, "fi_fit", "fit", &FILLET_FITS)));- row.response.on_hover_text(tr("ui.fillet_fit_tip"));+ row.response.backing_on_hover_text(tr("ui.fillet_fit_tip"));let fit = row.inner;if extra.get("fit") != before.as_ref() {settle_fillet_options(extra, "fit", setback);@@ -322,14 +322,14 @@ pub(super) fn rows(app: &mut SolveApp, ctx: &egui::Context, d: &mut Dialog, ui:};tr(key).to_owned()};- ui_kit::text(ui, &prompt, ui_kit::Text::Hint("tool")).on_hover_text(&prompt);+ ui_kit::text(ui, &prompt, ui_kit::Text::Hint("tool")).backing_on_hover_text(&prompt);if matches!(&d.kind, Kind::SketchModify(k) if k.previews()) {let label = d.active_input().map(|input| tr(input.label)).unwrap_or_else(|| tr("Objects"));let step = crate::i18n::format("dialog.selection_step",&[("step", &(d.active + 1).to_string()), ("total", &d.inputs.len().to_string()), ("input", label)],);- ui_kit::text(ui, &step, ui_kit::Text::Hint("step")).on_hover_text(tr("dialog.selection_guidance"));+ ui_kit::text(ui, &step, ui_kit::Text::Hint("step")).backing_on_hover_text(tr("dialog.selection_guidance"));}}let manage_hint = match &d.kind {@@ -540,7 +540,7 @@ pub(super) fn rows(app: &mut SolveApp, ctx: &egui::Context, d: &mut Dialog, ui:}response})- .on_hover_text(tr("ui.fillet_type_choices_tip"));+ .backing_on_hover_text(tr("ui.fillet_type_choices_tip"));if rtype == 0 {enter |= fillet_corner_rows(ui, &app.session, &mut d.extra, &d.inputs, radius, setback);fillet_fit_rows(app, ui, &mut d.extra, setback);@@ -558,7 +558,7 @@ pub(super) fn rows(app: &mut SolveApp, ctx: &egui::Context, d: &mut Dialog, ui:ui_kit::section(ui, "fillet_options", "Options", true, |ui| {ui.scope(|ui| ui_kit::checkbox_grid(ui, &mut [("Tangent Chain", chain), ("Preview", &mut d.preview_enabled)], 2)).response- .on_hover_text(tr("ui.fillet_options_tip"));+ .backing_on_hover_text(tr("ui.fillet_options_tip"));});// The radii along the edge, for the two types that take them.if !*chamfer && matches!(rtype, 2 | 4) {@@ -579,12 +579,12 @@ pub(super) fn rows(app: &mut SolveApp, ctx: &egui::Context, d: &mut Dialog, ui:form_row(ui, "Mid Radius", |ui| {ui.horizontal(|ui| {ui_kit::fraction_field(ui, position)- .on_hover_text(tr("Position along the edge, 0 at the start end, 1 at the other"));+ .backing_on_hover_text(tr("Position along the edge, 0 at the start end, 1 at the other"));let width = (ui.available_width() - t.space_24 - t.space_4).max(0.0);ui.allocate_ui_with_layout(vec2(width, t.space_24), egui::Layout::left_to_right(egui::Align::Center), |ui| {enter |= field(ui, r);});- if ui_kit::button(ui, "×", ui_kit::Button::Small).on_hover_text(tr("Remove this point")).clicked() {+ if ui_kit::button(ui, "×", ui_kit::Button::Small).backing_on_hover_text(tr("Remove this point")).clicked() {remove = Some(k);}});@@ -1006,7 +1006,7 @@ fn additional_rows(app: &mut SolveApp, d: &mut Dialog, ui: &mut egui::Ui) -> booui.label(format!("{:.2}, {:.2}, {:.2}", p.x, p.y, p.z));// A cylinder's place is its Face pick, cleared there.if *cmd != "solid.cylinder"- && ui_kit::button(ui, "×", ui_kit::Button::Small).on_hover_text(tr("Place at the origin instead")).clicked()+ && ui_kit::button(ui, "×", ui_kit::Button::Small).backing_on_hover_text(tr("Place at the origin instead")).clicked(){*at = None;}diff --git a/crates/ui-egui/src/dialogs_insert_drawing.rs b/crates/ui-egui/src/dialogs_insert_drawing.rsindex d9ce723da4..00b1e50b5c 100644--- a/crates/ui-egui/src/dialogs_insert_drawing.rs+++ b/crates/ui-egui/src/dialogs_insert_drawing.rs@@ -2,6 +2,7 @@//! its middle goes, its size in millimetres or as a factor, and an angle) with a live preview,//! and OK adds it (#2605, #3443).+use crate::ui_kit::BackingTooltipExt as _;use serde_json::{Value, json};use crate::SolveApp;@@ -46,7 +47,7 @@ pub fn title(p: &Place) -> &'static str {pub fn rows(ui: &mut egui::Ui, p: &mut Place) {let name = std::path::Path::new(&p.path).file_name().map(|n| n.to_string_lossy().to_string()).unwrap_or_else(|| p.path.clone());form_row(ui, "File", |ui| {- ui.label(name).on_hover_text(&p.path);+ ui.label(name).backing_on_hover_text(&p.path);});for (label, v, handle) in [("X", &mut p.x, "dialog:insert:x"), ("Y", &mut p.y, "dialog:insert:y")] {form_row(ui, label, |ui| {diff --git a/crates/ui-egui/src/dialogs_library.rs b/crates/ui-egui/src/dialogs_library.rsindex 71fcccedfa..4d990e3ce6 100644--- a/crates/ui-egui/src/dialogs_library.rs+++ b/crates/ui-egui/src/dialogs_library.rs@@ -1,6 +1,7 @@//! The first local appearance-library consumer, inside the existing Appearance panel.-#[cfg(not(target_arch = "wasm32"))]use crate::dialogs_appearance::selected_params;+#[cfg(not(target_arch = "wasm32"))]+use crate::ui_kit::BackingTooltipExt as _;use crate::{SolveApp, dialogs_appearance::Ap, selection::SelInput, ui_kit};use serde_json::json;use solidcraft_engine::io::catalog::Catalog;@@ -221,7 +222,7 @@ fn import_rows(app: &mut SolveApp, ui: &mut egui::Ui, k: &mut Ap, inputs: &[SelI}let button =ui_kit::list_picker(ui, &entry.id, entry.definition.name(), k.local.selected.as_deref() == Some(entry.id.as_str()))- .on_hover_text(format!(+ .backing_on_hover_text(format!("{} · {} · {}",entry.id,entry.provenance.license,diff --git a/crates/ui-egui/src/dialogs_motion.rs b/crates/ui-egui/src/dialogs_motion.rsindex 055ff6106c..fe970e83f9 100644--- a/crates/ui-egui/src/dialogs_motion.rs+++ b/crates/ui-egui/src/dialogs_motion.rs@@ -3,6 +3,7 @@//! show while open (a study's pose, an explosion) is display only: pending occurrence moves,//! computed on a scratch copy of the design and put back when the dialog closes.+use crate::ui_kit::BackingTooltipExt as _;use crate::ui_kit::{choice_row, expr_row, text_row};use std::collections::BTreeMap;@@ -205,7 +206,7 @@ fn transport(ui: &mut egui::Ui, what: Transport, tip: &str) -> egui::Response {p.add(bar(c.x + 6.0));}}- resp.on_hover_text(crate::i18n::tr_label(tip))+ resp.backing_on_hover_text(crate::i18n::tr_label(tip))}/// Study `key` as the Motion Study dialog edits it: (id, name, steps, keys as tracks with values@@ -473,7 +474,7 @@ pub fn rows(app: &mut SolveApp, ui: &mut egui::Ui, k: &mut Mo, inputs: &mut [Sellet _ = app.run("contact.edit", json!({"set": n, "suppressed": !off}));}if crate::ui_kit::button(ui, crate::i18n::tr_label("×"), crate::ui_kit::Button::Small)- .on_hover_text(crate::i18n::tr_label("Delete the set"))+ .backing_on_hover_text(crate::i18n::tr_label("Delete the set")).clicked(){let _ = app.run("contact.edit", json!({"set": n, "delete": true}));@@ -641,7 +642,7 @@ fn motion_study_rows(app: &mut SolveApp, ui: &mut egui::Ui, k: &mut Mo, inputs:let width = (ui.available_width() - t.control_height - t.space_8).max(0.0);ui.allocate_ui(vec2(width, t.control_height), |ui| combo(ui, &format!("ms_joint{ti}"), &refs, &mut pos));if crate::ui_kit::button(ui, crate::i18n::tr_label("×"), crate::ui_kit::Button::Small)- .on_hover_text(crate::i18n::tr_label("Remove the track"))+ .backing_on_hover_text(crate::i18n::tr_label("Remove the track")).clicked(){remove = Some(ti);@@ -671,7 +672,7 @@ fn motion_study_rows(app: &mut SolveApp, ui: &mut egui::Ui, k: &mut Mo, inputs:ui.vertical(|ui| {ui.horizontal(|ui| {if crate::ui_kit::button(ui, crate::i18n::tr_label("Key here"), crate::ui_kit::Button::Small)- .on_hover_text(crate::i18n::tr_label("Add a key at this step with the joint's value now"))+ .backing_on_hover_text(crate::i18n::tr_label("Add a key at this step with the joint's value now")).clicked()&& !tr.points.iter().any(|(s, _)| *s == now){@@ -699,7 +700,7 @@ fn motion_study_rows(app: &mut SolveApp, ui: &mut egui::Ui, k: &mut Mo, inputs:ui.vertical(|ui| {ui.horizontal(|ui| {if crate::ui_kit::button(ui, crate::i18n::tr_label("Add Key"), crate::ui_kit::Button::Normal)- .on_hover_text(crate::i18n::tr_label("Key a joint's value at this step"))+ .backing_on_hover_text(crate::i18n::tr_label("Key a joint's value at this step")).clicked()&& let Some((ji, _, kind)) = moving.first(){@@ -707,7 +708,7 @@ fn motion_study_rows(app: &mut SolveApp, ui: &mut egui::Ui, k: &mut Mo, inputs:tracks.push(Track { joint: *ji, index: 0, points: vec![(now, format!("0 {unit}"))] });}export = crate::ui_kit::button(ui, crate::i18n::tr_label("Export Animation…"), crate::ui_kit::Button::Normal)- .on_hover_text(crate::i18n::tr_label("Save the study as an animated GIF, seen as the viewport shows it"))+ .backing_on_hover_text(crate::i18n::tr_label("Save the study as an animated GIF, seen as the viewport shows it")).clicked();});});diff --git a/crates/ui-egui/src/dialogs_save_mesh.rs b/crates/ui-egui/src/dialogs_save_mesh.rsindex 7304127c98..61a9431a5e 100644--- a/crates/ui-egui/src/dialogs_save_mesh.rs+++ b/crates/ui-egui/src/dialogs_save_mesh.rs@@ -15,6 +15,7 @@//! over a program the user added removes it.use crate::selection::SelectionExt as _;+use crate::ui_kit::BackingTooltipExt as _;use crate::ui_kit::choice_row;use std::collections::HashMap;@@ -450,12 +451,12 @@ fn slicer_combo(app: &mut SolveApp, ui: &mut egui::Ui, k: &mut SaveMesh) {crate::scenario::publish_handle(&format!("dialog:Slicer:{}", e.slicer.name), rect.center());if e.user {let hint = crate::i18n::format("ui.slicer_delete_tip", &[("program", e.slicer.command.first().map_or("", String::as_str))]);- resp.clone().on_hover_text(if elided { format!("{}\n{hint}", e.slicer.name) } else { hint });+ resp.clone().backing_on_hover_text(if elided { format!("{}\n{hint}", e.slicer.name) } else { hint });if resp.hovered() && ui.input_mut(|i| i.consume_key(egui::Modifiers::NONE, egui::Key::Delete)) {delete = Some(e.key.clone());}} else if elided {- resp.clone().on_hover_text(&e.slicer.name);+ resp.clone().backing_on_hover_text(&e.slicer.name);}if resp.clicked() {chosen = Some(e.key.clone());@@ -495,14 +496,14 @@ fn slicer_combo(app: &mut SolveApp, ui: &mut egui::Ui, k: &mut SaveMesh) {Tokens::get().text,);crate::scenario::publish_handle("dialog:Slicer:Custom", rect.center());- if resp.on_hover_text(crate::i18n::tr("ui.custom_program_tip")).clicked() {+ if resp.backing_on_hover_text(crate::i18n::tr("ui.custom_program_tip")).clicked() {pick_custom = true;ui.close();}});ui.style_mut().wrap_mode = wrap;if let Some(name) = name {- r.clone().on_hover_text(name);+ r.clone().backing_on_hover_text(name);}if let Some(e) = current {let tex = icon(&mut app.slicer_menu, &ctx, e);diff --git a/crates/ui-egui/src/dialogs_sheet.rs b/crates/ui-egui/src/dialogs_sheet.rsindex d6cac06bb6..c65ea801f7 100644--- a/crates/ui-egui/src/dialogs_sheet.rs+++ b/crates/ui-egui/src/dialogs_sheet.rs@@ -4,6 +4,7 @@//! its bend lines, the bend table and DXF export).use crate::dialogs::put;+use crate::ui_kit::BackingTooltipExt as _;use crate::ui_kit::{choice_row, expr_row, hint_row};use egui::{Align2, Color32, FontId, Pos2, Rect, RichText, Stroke, pos2, vec2};use serde_json::{Map, Value, json};@@ -261,7 +262,7 @@ pub fn rows(app: &mut SolveApp, ui: &mut egui::Ui, k: &mut Sm, inputs: &mut [Sel// Further bends: each a flange on the far edge of the one before it.form_row(ui, "Further Bends", |ui| {let add = crate::ui_kit::button(ui, "Add bend", crate::ui_kit::Button::Normal)- .on_hover_text(crate::i18n::tr_label("Another bend on the far edge of the last flange"));+ .backing_on_hover_text(crate::i18n::tr_label("Another bend on the far edge of the last flange"));if add.clicked() && then.len() < 16 {then.push(("45 deg".into(), "20 mm".into(), false));}@@ -296,7 +297,7 @@ pub fn rows(app: &mut SolveApp, ui: &mut egui::Ui, k: &mut Sm, inputs: &mut [Selif points.len() > 1 || own.iter().any(|o| !(o.1.trim().is_empty() && o.2.trim().is_empty())) {form_row(ui, "Per Edge", |ui| {ui.label(RichText::new(crate::i18n::tr_label("angle, height")).weak())- .on_hover_text("An edge's own angle and height. Empty: the values above.");+ .backing_on_hover_text("An edge's own angle and height. Empty: the values above.");});for (n, p) in points.iter().enumerate() {let slot = own_slot(own, *p);diff --git a/crates/ui-egui/src/dim_view.rs b/crates/ui-egui/src/dim_view.rsindex 8125509934..381145289a 100644--- a/crates/ui-egui/src/dim_view.rs+++ b/crates/ui-egui/src/dim_view.rs@@ -13,6 +13,7 @@//! Everything acts through commands: `sketch.dimension_text`, `sketch.delete`,//! `sketch.toggle_driven`, `parameters.change`.+use crate::ui_kit::BackingTooltipExt as _;use crate::ui_kit::{Container, Surface};use solidcraft_engine::geom::prelude::*;use std::cell::RefCell;@@ -1014,11 +1015,12 @@ fn edit_box(app: &mut SolveApp, ctx: &egui::Context) {let anchor = edit_anchor(at, e.live.is_some(), drawable, popup_width);// Background: under Preferences and Report a bug (#9016), like canvas value boxes.Container::new(ctx, Surface::Canvas).area(egui::Id::new("sc_dim_edit_area")).fixed_pos(anchor).order(egui::Order::Background).show(ctx, |ui| {- Container::popup_frame(ui.style()).fill(Tokens::get().dialog_body).inner_margin(Tokens::get().space_4).show(ui, |ui| {+ let frame = Container::popup_frame(ui.style()).fill(Tokens::get().dialog_body).inner_margin(Tokens::get().space_4);+ Container::show_backing(ui, frame, |ui| {crate::ui_kit::scope(ui, |ui| {ui.set_max_width(popup_width);crate::ui_kit::text(ui, &crate::i18n::format("dialog.dimension_name", &[("name", &e.param)]), crate::ui_kit::Text::Inline)- .on_hover_text(crate::i18n::tr("dialog.dimension_insert_hint"));+ .backing_on_hover_text(crate::i18n::tr("dialog.dimension_insert_hint"));if !e.owned {// The whole value is selected before the field reads its state, every frame// until the person takes it over, so typing replaces it (#11204). Only on thediff --git a/crates/ui-egui/src/documents.rs b/crates/ui-egui/src/documents.rsindex 12210406ed..692dd45078 100644--- a/crates/ui-egui/src/documents.rs+++ b/crates/ui-egui/src/documents.rs@@ -5,6 +5,7 @@//! Closing a design with unsaved changes asks first, and so does quitting: one "save changes?"//! per design with unsaved changes ([`request_quit`]).+use crate::ui_kit::BackingTooltipExt as _;use crate::ui_kit::{Container, Surface};use egui::{FontId, Rect, Sense, pos2, vec2};use serde_json::{Value, json};@@ -947,9 +948,9 @@ pub fn tabs(app: &mut SolveApp, ui: &mut egui::Ui, r: Rect, x0: f32, x1: f32) {if resp.secondary_clicked() {menu = Some((i, ui.ctx().pointer_interact_pos().unwrap_or(tr.left_bottom())));}- if xresp.on_hover_text("Close").clicked() {+ if xresp.backing_on_hover_text("Close").clicked() {shut = Some(i);- } else if (if held.is_some() { resp } else { resp.on_hover_text(tip) }).clicked() {+ } else if (if held.is_some() { resp } else { resp.backing_on_hover_text(tip) }).clicked() {pick = Some(i);}}@@ -976,7 +977,7 @@ pub fn tabs(app: &mut SolveApp, ui: &mut egui::Ui, r: Rect, x0: f32, x1: f32) {t.app_bar_text,);let id = egui::Id::new("sc_doc_more");- if mresp.clone().on_hover_text(crate::i18n::tr_label("All open designs")).clicked() {+ if mresp.clone().backing_on_hover_text(crate::i18n::tr_label("All open designs")).clicked() {ui.ctx().data_mut(|d| d.insert_temp(id, !d.get_temp::<bool>(id).unwrap_or(false)));}if ui.ctx().data(|d| d.get_temp::<bool>(id).unwrap_or(false)) {@@ -1058,7 +1059,7 @@ pub fn tabs(app: &mut SolveApp, ui: &mut egui::Ui, r: Rect, x0: f32, x1: f32) {// A file loading into the window keeps the tabs as they are (dragging still moves it).let idle = !app.file_load.busy();crate::scenario::publish_handle("tab:new", pr.center());- if presp.on_hover_text(app.tr("ui.start_page")).clicked() && idle {+ if presp.backing_on_hover_text(app.tr("ui.start_page")).clicked() && idle {app.home.show(app.session.revision);}match (shut, pick) {diff --git a/crates/ui-egui/src/file_load.rs b/crates/ui-egui/src/file_load.rsindex 98f5889a69..a99359878e 100644--- a/crates/ui-egui/src/file_load.rs+++ b/crates/ui-egui/src/file_load.rs@@ -1227,7 +1227,8 @@ pub fn show(app: &mut SolveApp, ctx: &egui::Context) {Container::new(ctx, Surface::InputShield).area(id).order(egui::Order::Middle).fixed_pos(cover.min).interactable(true).show(ctx, |ui| {ui.set_min_size(cover.size());ui.interact(cover, egui::Id::new("file_loading_block"), egui::Sense::click_and_drag());- ui.painter().rect_filled(cover, 0.0, egui::Color32::from_black_alpha(70));+ let shield = Container::new(ctx, Surface::InputShield);+ shield.paint_background(ui.painter(), shield.frame(ctx, egui::Color32::from_black_alpha(70), crate::frame::Side::Left), cover);});// Anchored at its top: the card grows downwards (the saved preview) and Cancel stays put.let top = egui::pos2(centre.x, (centre.y - 120.0).max(cover.top() + 8.0));diff --git a/crates/ui-egui/src/frame_rate.rs b/crates/ui-egui/src/frame_rate.rsindex 7d59e257b6..0321697481 100644--- a/crates/ui-egui/src/frame_rate.rs+++ b/crates/ui-egui/src/frame_rate.rs@@ -2,6 +2,7 @@//! (#2548): a graph of the last frames' times with the triangles drawn over it, a histogram of//! frame times, and what the GPU drew. Click the readout to show or hide the details.+use crate::ui_kit::BackingTooltipExt as _;use std::collections::VecDeque;use egui::{Align2, Color32, FontId, Rect, Sense, Stroke, pos2, vec2};@@ -192,7 +193,7 @@ pub(crate) fn paint(app: &mut SolveApp, ui: &egui::Ui, painter: &egui::Painter,r = r.translate(vec2(0.0, nav.top() - 6.0 - r.bottom()));}let id = egui::Id::new("sc_frame_rate");- let clicked = ui.interact(r, id, Sense::click()).on_hover_text(tr("perf.click_for_details")).clicked();+ let clicked = ui.interact(r, id, Sense::click()).backing_on_hover_text(tr("perf.click_for_details")).clicked();if clicked {app.preferences.frame_rate_details = !app.preferences.frame_rate_details;}diff --git a/crates/ui-egui/src/gpu.rs b/crates/ui-egui/src/gpu.rsindex 4b8f4ab2e3..31a05cecb6 100644--- a/crates/ui-egui/src/gpu.rs+++ b/crates/ui-egui/src/gpu.rs@@ -662,18 +662,122 @@ mod tests {#[test]fn blur_radius_schedule_and_hostile_values() {use crate::blur::{schedule, validate_radius};- for radius in [f32::NAN, f32::INFINITY, -1.0, 40.01] {+ for radius in [f32::NAN, f32::INFINITY, -1.0, 60.01] {assert!(validate_radius(radius).is_err());assert!(schedule(radius).is_none());}assert!(schedule(0.0).is_none());- for (radius, steps) in [(1.0, 2), (8.0, 2), (9.0, 3), (18.0, 3), (19.0, 4), (30.0, 4), (31.0, 5), (40.0, 5)] {+ for (radius, steps) in [(1.0, 2), (8.0, 2), (9.0, 3), (18.0, 3), (19.0, 4), (30.0, 4), (31.0, 5), (40.0, 5), (60.0, 5)] {let (actual, offset) = schedule(radius).unwrap();assert_eq!(actual, steps);assert!(offset.is_finite() && offset > 0.0);let variance = (35.0 / 18.0) * (4.0_f32.powi(steps as i32) - 1.0);assert!((offset * variance.sqrt() - radius / 2.0).abs() < 0.0001);}+ for cap in 2..=5 {+ let (steps, offset) = crate::blur::schedule_capped(40.0, cap).unwrap();+ assert_eq!(steps, cap);+ let variance = (35.0 / 18.0) * (4.0_f32.powi(steps as i32) - 1.0);+ assert!((offset * variance.sqrt() - 20.0).abs() < 0.0001, "tier cap must preserve target radius");+ }+ }++ #[test]+ fn blur_guard_threshold_idle_minimum_and_session_undo() {+ let mut guard = crate::blur::Guard::default();+ let radius = 40.0;+ for _ in 0..59 {+ guard.observe(radius, 23.0, true);+ }+ assert_eq!((guard.cap, guard.streak, guard.notice), (5, 59, false));+ guard.observe(radius, 23.0, false); // idle, unavailable, hidden or no actual paint+ assert_eq!((guard.cap, guard.streak), (5, 0));+ for _ in 0..59 {+ guard.observe(radius, 23.0, true);+ }+ guard.observe(radius, 22.0, true); // strictly over budget+ assert_eq!((guard.cap, guard.streak), (5, 0));+ for _ in 0..59 {+ guard.observe(radius, 23.0, true);+ }+ assert_eq!(guard.cap, 5);+ guard.observe(radius, 23.0, true);+ assert_eq!((guard.cap, guard.notice), (4, true));+ guard.notice = false; // Dismiss does not stop later reductions or reannounce.+ for _ in 0..180 {+ guard.observe(radius, 23.0, true);+ }+ assert_eq!((guard.cap, guard.streak, guard.notice), (2, 0, false));+ assert_eq!(crate::blur::schedule_capped(radius, guard.cap).unwrap().0, 2);+ assert_eq!(radius, 40.0, "quality guard never turns radius down or off");+ guard.undo();+ assert_eq!((guard.cap, guard.notice, guard.opted_out), (5, false, true));+ guard.reset(); // theme/radius changes do not revoke the session opt-out+ for _ in 0..120 {+ guard.observe(18.0, 23.0, true);+ }+ assert_eq!(guard.cap, 5);+ for radius in [0.0, 1.0, 8.0] {+ let mut guard = crate::blur::Guard::default();+ for _ in 0..120 {+ guard.observe(radius, 23.0, true);+ }+ assert_eq!((guard.cap, guard.notice), (5, false));+ }+ }++ #[cfg(not(target_arch = "wasm32"))]+ #[test]+ fn blur_guard_requires_consecutive_visible_actual_paints() {+ let ctx = egui::Context::default();+ let mut session = crate::blur::Session::default();+ let mut time = 0.0;+ let mut feed =+ |session: &mut crate::blur::Session, rendered: bool, continuous: bool, visible: bool, available: bool, revision: u64, radius: f32| {+ time += 0.023;+ let mut raw = egui::RawInput { time: Some(time), ..Default::default() };+ raw.viewports.entry(egui::ViewportId::ROOT).or_default().occluded = Some(!visible);+ let _ = ctx.run_ui(raw, |ui| {+ ui.ctx().request_repaint(); // Deterministic harness only; product never does this for sampling.+ let paint = rendered.then(|| crate::blur::PaintedFrame {+ frame: ui.ctx().cumulative_frame_nr().saturating_sub(1),+ interval_ms: Some(23.0),+ continuous,+ });+ session.sample(ui.ctx(), revision, radius, available, paint);+ session.sample(ui.ctx(), revision, radius, available, paint); // egui re-pass duplicate+ });+ };+ feed(&mut session, false, true, true, true, 1, 40.0);+ feed(&mut session, false, true, true, true, 1, 40.0);+ for _ in 0..59 {+ feed(&mut session, true, true, true, true, 1, 40.0);+ }+ assert_eq!((session.guard.cap, session.guard.streak), (5, 59));+ for (rendered, continuous, visible, available) in+ [(false, true, true, true), (true, false, true, true), (true, true, false, true), (true, true, true, false)]+ {+ feed(&mut session, rendered, continuous, visible, available, 1, 40.0);+ assert_eq!((session.guard.cap, session.guard.streak), (5, 0));+ feed(&mut session, true, true, true, true, 1, 40.0);+ assert_eq!(session.guard.streak, 1);+ }+ feed(&mut session, true, true, true, true, 2, 40.0); // theme contents changed+ assert_eq!(session.guard.streak, 0);+ feed(&mut session, true, true, true, true, 2, 18.0); // radius changed+ assert_eq!(session.guard.streak, 0);+ for _ in 0..59 {+ feed(&mut session, true, true, true, true, 2, 18.0);+ }+ assert_eq!((session.guard.cap, session.guard.streak), (5, 59));+ feed(&mut session, true, true, true, true, 2, 18.0);+ assert_eq!((session.guard.cap, session.guard.notice), (2, true));+ session.guard.undo();+ feed(&mut session, true, true, true, true, 3, 40.0);+ for _ in 0..100 {+ feed(&mut session, true, true, true, true, 3, 40.0);+ }+ assert_eq!((session.guard.cap, session.guard.opted_out), (5, true));}#[cfg(not(target_arch = "wasm32"))]@@ -707,6 +811,11 @@ mod tests {#[cfg(not(target_arch = "wasm32"))]impl BlurFixture {+ fn radius(&mut self, radius: f32) {+ // Explicit PR5 rendering harness activation, independent of theme declarations.+ self.app.blur_session.harness_radius = Some(radius);+ self.app.blur.set_radius(radius).unwrap();+ }fn new(srgb: bool, policy: crate::blur::FixturePolicy) -> Option<Self> {use super::*;let Some((adapter, device, queue)) = offscreen_device() else {@@ -731,6 +840,11 @@ mod tests {app.viewport.draw_stats = Some(view.stats());renderer.write().callback_resources.insert(view);app.blur = crate::blur::fixture_state(&adapter, &device, &queue, &renderer, format, policy);+ assert_eq!(+ app.blur.software_adapter(),+ adapter.get_info().device_type == wgpu::DeviceType::Cpu,+ "fixture must retain real adapter identity"+ );if policy == crate::blur::FixturePolicy::Rendering {assert_eq!(app.blur.capability(), crate::blur::Capability::Available, "blur fixture requires real rendering capabilities");}@@ -892,11 +1006,15 @@ mod tests {}let unavailable = Capability::Unavailable("software adapter (gpu-software)");assert_eq!(f.app.blur.capability(), unavailable);- f.app.blur.set_radius(18.0).unwrap();+ f.radius(18.0);for _ in 0..6 {f.frame();+ assert_eq!(f.app.blur.radius(), 18.0, "each prepared fallback frame retains the requested radius");}assert_eq!(f.app.blur.capability(), unavailable);+ assert_eq!(f.app.blur.radius(), 18.0, "production fallback preserves the actual requested radius through prepare_blur");+ assert_eq!(f.app.blur_session.harness_radius, Some(18.0));+ assert_eq!(crate::prefs::blur_availability(&f.app), crate::theme_options::Availability::Unavailable("prefs.blur_software"));let counts = f.app.blur.counters();assert_eq!((counts.textures_created, counts.buffers_created, counts.bind_groups_created, counts.pipelines_created), (0, 0, 0, 0));assert_eq!((counts.markers_emitted, counts.markers_drawn), (0, 0));@@ -905,6 +1023,152 @@ mod tests {assert!(f.renderer.read().frame_compositor.is_none());}+ #[cfg(not(target_arch = "wasm32"))]+ #[test]+ fn blur_offered_zero_has_no_effect_work() {+ let Some(mut f) = BlurFixture::new(false, crate::blur::FixturePolicy::Production) else { return };+ assert!(f.app.blur_session.harness_radius.is_none(), "zero must come from the declared theme option");+ crate::prefs::control(+ &mut f.app,+ &serde_json::json!({"theme_import":{+ "format":"solidcraft-theme/1", "name":"Zero blur", "base":"dark",+ "options":[{"id":"blur","type":"range","default":0}]+ }}),+ )+ .unwrap();+ for _ in 0..6 {+ f.frame();+ }+ assert!(crate::theme::blur_intent(&f.ctx).offered);+ assert_eq!(crate::theme::blur_intent(&f.ctx).radius, 0.0);+ assert_eq!(f.app.blur.radius(), 0.0);+ assert!(f.app.blur_session.harness_radius.is_none());+ let counters = serde_json::to_value(f.app.blur.counters()).unwrap();+ for (name, count) in counters.as_object().unwrap() {+ assert_eq!(count, 0, "{name}");+ }+ assert!(f.renderer.read().frame_compositor.is_none());+ assert!(f.app.blur.painted_frame().is_none());+ }++ #[cfg(not(target_arch = "wasm32"))]+ #[test]+ fn blur_search_picker_popup_and_tooltips_keep_native_backing() {+ use crate::ui_kit::{SearchChoice, SearchPicker};+ let Some(mut f) = BlurFixture::new(false, crate::blur::FixturePolicy::Rendering) else { return };+ f.radius(18.0);+ let heading = "Long provider heading ".repeat(4);+ let note = "Long discovery note ".repeat(20);+ for target in ["choice", "group", "heading", "note"] {+ let ctx = crate::fonts::test_context();+ ctx.global_style_mut(|s| {+ s.visuals.window_fill = egui::Color32::from_rgba_unmultiplied(40, 60, 80, 180);+ s.interaction.tooltip_delay = 0.0;+ s.interaction.show_tooltips_only_when_still = false;+ s.animation_time = 0.0;+ });+ let choices = [+ SearchChoice { value: "one", label: "One", tip: "First choice detail", group: Some(&heading) },+ SearchChoice { value: "two", label: "Two", tip: "Second choice detail", group: (target != "heading").then_some("Other") },+ ];+ let mut widget = egui::Id::NULL;+ let mut time = 0.0;+ let mut frame = |events| {+ // Native tooltips suppress movement just after a click for 100 ms.+ // Advance deterministic input time beyond that grace period; never+ // depend on the machine's speed to make a hover eligible.+ time += 0.25;+ crate::scenario::clear_handles();+ crate::test_support::frame(+ &ctx,+ egui::RawInput {+ screen_rect: Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(800.0, 600.0))),+ events,+ time: Some(time),+ focused: true,+ ..Default::default()+ },+ |ui| {+ let _blur = f.app.blur.begin(ui.ctx(), true);+ ui.set_width(300.0);+ crate::ui_kit::scope(ui, |ui| {+ let result = crate::ui_kit::search_picker(+ ui,+ SearchPicker {+ id: "blur_picker",+ handles: "blur:picker",+ current: "One",+ current_value: "one",+ hint: "Search",+ choices: &choices,+ custom: false,+ note: Some(¬e),+ open_group: None,+ enabled: true,+ },+ );+ widget = result.response.id;+ assert!(result.inner.is_none(), "hovering must not pick a value");+ });+ },+ )+ };+ frame(vec![]);+ let at = crate::scenario::handle_at("blur:picker").unwrap();+ frame(crate::test_support::pointer(at, true));+ frame(crate::test_support::pointer(at, false));+ let mut output = frame(vec![]);+ let at = match target {+ "choice" => crate::scenario::handle_at("blur:picker:one").unwrap(),+ "group" => crate::scenario::handle_at(&format!("blur:picker:group:{heading}")).unwrap(),+ _ => output+ .shapes+ .iter()+ .find_map(|s| match &s.shape {+ egui::Shape::Text(t) if t.galley.job.text.starts_with(if target == "note" { "Long discovery" } else { "Long provider" }) => {+ Some(t.pos + t.galley.rect.center().to_vec2())+ }+ _ => None,+ })+ .expect("picker heading or note has visible text"),+ };+ for _ in 0..4 {+ output = frame(vec![egui::Event::PointerMoved(at)]);+ }+ let mut leaves = Vec::new();+ for clipped in &output.shapes {+ crate::test_support::each_shape(&clipped.shape, &mut |shape| leaves.push(shape.clone()));+ }+ let markers: Vec<_> = leaves+ .iter()+ .enumerate()+ .filter_map(|(i, shape)| match shape {+ egui::Shape::Callback(cb) => Some((i, cb.rect)),+ _ => None,+ })+ .collect();+ assert_eq!(markers.len(), 2, "{target}: popup and tooltip both have backing markers");+ let popup = ctx.read_response(widget.with("popup")).unwrap().rect;+ assert_eq!(markers[0].1, popup, "the marker covers popup padding and scrollbars");+ assert!(+ leaves+ .iter()+ .skip(markers[0].0 + 1)+ .find(|shape| !matches!(shape, egui::Shape::Noop))+ .is_some_and(|shape| matches!(shape, egui::Shape::Rect(_))),+ "backing precedes native popup chrome"+ );+ assert!(ctx.memory(|m| m.has_focus(egui::Id::new("blur_picker").with("search"))), "native search focus survives hover");+ }+ }++ #[cfg(not(target_arch = "wasm32"))]+ fn assert_backdrop_passes(before: crate::blur::Counters, after: crate::blur::Counters, steps: usize) {+ let markers = after.markers_drawn - before.markers_drawn;+ assert!(markers > 0, "the fixture must paint a visible backing boundary");+ assert_eq!(after.blur_passes - before.blur_passes, 2 * steps as u64 * markers, "each backing boundary filters the preceding UI");+ }+#[cfg(not(target_arch = "wasm32"))]#[test]fn blur_full_egui_composition() {@@ -927,7 +1191,7 @@ mod tests {f.app.blur.set_surface_alpha(Some(180));f.app.cam = original_camera;f.app.preferences.viewport_background = original_background;- f.app.blur.set_radius(0.0).unwrap();+ f.radius(0.0);for _ in 0..3 {f.frame();}@@ -939,19 +1203,27 @@ mod tests {for radius in [8.0, 18.0, 40.0] {f.app.cam = original_camera;f.app.preferences.viewport_background = original_background;- f.app.blur.set_radius(radius).unwrap();+ f.radius(radius);for _ in 0..3 {f.frame();}let before = f.app.blur.counters();+ assert_eq!(+ crate::prefs::blur_availability(&f.app),+ crate::theme_options::Availability::Available,+ "positive rendering fixtures must pass the shared app-aware capability policy"+ );+ assert_eq!(f.app.blur.radius(), radius);+ assert!(f.app.blur.painted_frame().is_some(), "guard evidence comes from actual submitted visible marker work");let source = f.pixels(true);+ let resting = f.pixels(false);f.frame();let after = f.app.blur.counters();assert_eq!(before.source_passes, after.source_passes, "resting source");- assert_eq!(before.blur_passes, after.blur_passes, "resting chain");+ assert_backdrop_passes(before, after, crate::blur::schedule(radius).unwrap().0);assert!(after.cache_hits > before.cache_hits);- assert!(after.markers_drawn > before.markers_drawn);assert_eq!(f.pixels(true), source);+ assert_eq!(f.pixels(false), resting, "resting ordered composition is stable");// Change panels only: the immutable source must be byte-identical.f.app.blur.set_surface_alpha(Some(120));f.frame();@@ -975,7 +1247,7 @@ mod tests {f.frame();let after = f.app.blur.counters();assert_eq!(after.source_passes, before.source_passes + 1);- assert_eq!(after.blur_passes - before.blur_passes, 2 * crate::blur::schedule(radius).unwrap().0 as u64);+ assert_backdrop_passes(before, after, crate::blur::schedule(radius).unwrap().0);f.app.cam = original_camera;f.frame();f.app.preferences.viewport_background = Some([3, 37, 93]);@@ -987,7 +1259,21 @@ mod tests {f.app.preferences.viewport_background = original_background;f.frame();}- f.app.blur.set_radius(0.0).unwrap();+ let before = f.app.blur.counters();+ f.app.blur_session.guard.cap = 3; // Explicit deterministic quality input in this GPU fixture.+ f.frame();+ let reduced = f.app.blur.counters();+ assert_eq!(f.app.blur.radius(), 40.0);+ assert_eq!(reduced.source_passes, before.source_passes + 1, "tier change invalidates the source cache");+ assert_backdrop_passes(before, reduced, 3);+ f.frame();+ let cached = f.app.blur.counters();+ assert_eq!(cached.source_passes, reduced.source_passes, "reduced tier has its own stable source cache");+ assert_backdrop_passes(reduced, cached, 3);+ f.app.blur_session.guard.cap = 5;+ f.frame();+ assert_backdrop_passes(cached, f.app.blur.counters(), 5);+ f.radius(0.0);for _ in 0..2 {f.frame();}@@ -1026,7 +1312,7 @@ mod tests {f.app.blur.set_surface_alpha(Some(180));let mut rows = Vec::new();for radius in [0.0, 18.0, 0.0] {- f.app.blur.set_radius(radius).unwrap();+ f.radius(radius);for _ in 0..6 {f.frame();}@@ -1035,7 +1321,17 @@ mod tests {times.sort_by(f64::total_cmp);let after = f.app.blur.counters();assert_eq!(after.source_passes, before.source_passes);- assert_eq!(after.blur_passes, before.blur_passes);+ if radius == 0.0 {+ assert_eq!(after.blur_passes, before.blur_passes);+ assert_eq!(after.markers_drawn, before.markers_drawn);+ } else {+ assert_backdrop_passes(before, after, crate::blur::schedule(radius).unwrap().0);+ assert_eq!(after.cache_hits - before.cache_hits, 30, "all resting sources are cached");+ }+ assert_eq!(after.textures_created, before.textures_created);+ assert_eq!(after.buffers_created, before.buffers_created);+ assert_eq!(after.bind_groups_created, before.bind_groups_created);+ assert_eq!(after.pipelines_created, before.pipelines_created);rows.push(serde_json::json!({"radius_px":radius, "samples":times.len(), "min_ms":times[0],"median_ms":(times[14] + times[15]) / 2.0, "max_ms":times[29], "before":before, "after":after}));}@@ -1051,7 +1347,7 @@ mod tests {fn blur_suspend_releases_targets() {let Some(mut f) = BlurFixture::new(false, crate::blur::FixturePolicy::Rendering) else { return };f.app.blur.set_surface_alpha(Some(180));- f.app.blur.set_radius(18.0).unwrap();+ f.radius(18.0);for _ in 0..3 {f.frame();}@@ -1060,7 +1356,7 @@ mod tests {assert_eq!(f.app.blur.counters().live_bytes, 0);f.frame();assert!(f.app.blur.counters().live_textures > 0);- f.app.blur.set_radius(0.0).unwrap();+ f.radius(0.0);assert_eq!(f.app.blur.counters().live_textures, 0);assert_eq!(f.app.blur.counters().live_bind_groups, 0);assert_eq!(f.app.blur.counters().live_pipelines, 0);@@ -1071,7 +1367,7 @@ mod tests {#[test]fn blur_late_layer_transform_moves_source_and_invalidates_cache() {let Some(mut f) = BlurFixture::new(false, crate::blur::FixturePolicy::Rendering) else { return };- f.app.blur.set_radius(18.0).unwrap();+ f.radius(18.0);f.app.blur.set_surface_alpha(Some(180));for _ in 0..6 {f.frame();@@ -1091,12 +1387,12 @@ mod tests {assert_eq!(f.app.blur.source_geometry().unwrap(), local.map(|r| transform.mul_rect(r)), "viewport, clip and background all transform once");let after = f.app.blur.counters();assert_eq!(after.source_passes, before.source_passes + 1);- assert_eq!(after.blur_passes, before.blur_passes + 6);+ assert_backdrop_passes(before, after, 3);assert_eq!(after.textures_created, before.textures_created, "placement changes reuse storage");assert_eq!(&f.pixels(true)[offset..offset + 4], &outside, "old location is outside the transformed clip");f.frame();assert_eq!(f.app.blur.counters().source_passes, after.source_passes, "unchanged transformed placement is cached");- assert_eq!(f.app.blur.counters().blur_passes, after.blur_passes);+ assert_backdrop_passes(after, f.app.blur.counters(), 3);// A forced miss must still paint at the transformed location, not merely hash it.f.app.cam.yaw += 0.1;f.frame();diff --git a/crates/ui-egui/src/hole_place.rs b/crates/ui-egui/src/hole_place.rsindex 3fbb829638..ecdeae02b0 100644--- a/crates/ui-egui/src/hole_place.rs+++ b/crates/ui-egui/src/hole_place.rs@@ -12,6 +12,7 @@//! centre that drags it across the model (snapping as a pick would) and takes it out when//! clicked, and a pick elsewhere on a face that already has a hole moves the hole there.+use crate::ui_kit::BackingTooltipExt as _;use solidcraft_engine::geom::prelude::*;use std::cell::RefCell;use std::sync::Arc;@@ -305,7 +306,7 @@ pub(crate) fn show(app: &mut SolveApp, ui: &mut egui::Ui, painter: &egui::Paintecrate::icons::markers::hole_handle(painter, c, if hot { t.accent } else { t.manipulator }, hot);crate::scenario::publish_handle(&format!("hole:{n}"), c);if !r.dragged() {- r.on_hover_text(crate::i18n::tr_label("Drag to move the hole; click to remove it"));+ r.backing_on_hover_text(crate::i18n::tr_label("Drag to move the hole; click to remove it"));}}if let Some((i, to)) = moveddiff --git a/crates/ui-egui/src/joint_handles.rs b/crates/ui-egui/src/joint_handles.rsindex d7aa242b4a..64a2eb8835 100644--- a/crates/ui-egui/src/joint_handles.rs+++ b/crates/ui-egui/src/joint_handles.rs@@ -645,7 +645,8 @@ pub(crate) fn show(app: &mut SolveApp, ui: &mut egui::Ui, painter: &egui::Paintelet at = (p + vec2(20.0, 22.0)).clamp(proj.rect.min, proj.rect.max - vec2(260.0, 82.0).min(proj.rect.size()));let host = Container::new(ui.ctx(), Surface::Canvas);host.area(egui::Id::new("joint_move_readout")).interactable(false).fixed_pos(at).order(egui::Order::Foreground).show(ui.ctx(), |ui| {- host.frame(ui.ctx(), tk.overlay, crate::frame::Side::Right).inner_margin(tk.space_8).show(ui, |ui| {+ let frame = host.frame(ui.ctx(), tk.overlay, crate::frame::Side::Right).inner_margin(tk.space_8);+ Container::show_backing(ui, frame, |ui| {let value = if d.axis.angular {format!("{}{:.precision$}°",@@ -678,7 +679,8 @@ pub(crate) fn show(app: &mut SolveApp, ui: &mut egui::Ui, painter: &egui::Paintelet host = Container::new(ui.ctx(), Surface::Canvas);let mut done = false;host.area(egui::Id::new("joint_move_help")).fixed_pos(proj.rect.left_bottom() + vec2(16.0, -148.0)).show(ui.ctx(), |ui| {- host.frame(ui.ctx(), tk.overlay, crate::frame::Side::Right).inner_margin(tk.space_8).show(ui, |ui| {+ let frame = host.frame(ui.ctx(), tk.overlay, crate::frame::Side::Right).inner_margin(tk.space_8);+ Container::show_backing(ui, frame, |ui| {ui.label(app.tr("joint_move.help"));if mode.axes.iter().any(|a| a.angular) {ui.label(app.tr("joint_move.precision"));diff --git a/crates/ui-egui/src/keymap.rs b/crates/ui-egui/src/keymap.rsindex 82ecc6be71..6698e6783f 100644--- a/crates/ui-egui/src/keymap.rs+++ b/crates/ui-egui/src/keymap.rs@@ -3,6 +3,7 @@//! already uses is reported and only taken over on request; keys the app itself handles (Esc, S,//! V, Delete, Ctrl+Z…) can't be bound. Changes are kept between runs.+use crate::ui_kit::BackingTooltipExt as _;use std::collections::BTreeMap;use serde_json::{Value, json};@@ -655,7 +656,7 @@ pub fn page(app: &mut SolveApp, ui: &mut egui::Ui) {}}let export = ui_kit::icon_label_button(ui, app.tr("prefs.profile_export"), "export_tray", true, false)- .on_hover_text(app.tr_label("Keys, S box favorites and the toolbar, as a file"));+ .backing_on_hover_text(app.tr_label("Keys, S box favorites and the toolbar, as a file"));crate::scenario::publish_target("keymap:export", export.rect);if export.clicked() {action = Some((String::new(), "export"));@@ -672,7 +673,7 @@ pub fn page(app: &mut SolveApp, ui: &mut egui::Ui) {ui_kit::text(ui, app.tr_label("Read-only list: shortcuts can't be changed here."), ui_kit::Text::Note("shortcut_read_only"));}ui_kit::checkbox(ui, app.tr("ui.sketch_keys_only"), &mut app.preferences.sketch_keys_only)- .on_hover_text(app.tr("ui.sketch_keys_only_tip"));+ .backing_on_hover_text(app.tr("ui.sketch_keys_only_tip"));if let Some(chosen) = outcome(app, ui) {action = Some((String::new(), chosen));}@@ -910,7 +911,7 @@ fn shortcut_row(let name =egui::Rect::from_min_size(rect.min + egui::vec2(0.0, t.space_4), egui::vec2(if beside { name_width } else { width }, label_height));ui.painter().galley(egui::pos2(name.left(), name.center().y - label_galley.size().y / 2.0), label_galley, t.form_ink);- let response = ui.interact(name, ui.id().with("command"), egui::Sense::hover()).on_hover_text(command.id);+ let response = ui.interact(name, ui.id().with("command"), egui::Sense::hover()).backing_on_hover_text(command.id);response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Label, ui.is_enabled(), format!("{label} ({})", command.id)));let top = if beside { name.top() } else { name.bottom() + t.space_4 };let total = widths.iter().sum::<f32>() + widths.len().saturating_sub(1) as f32 * t.space_8;@@ -937,7 +938,7 @@ fn shortcut_row(ui_kit::quiet_icon_button_at(ui, r, "plus", app.tr_label("Click, then press the new key"))};if editing {- let capture = capture.on_hover_text(app.tr_label("Click, then press the new key"));+ let capture = capture.backing_on_hover_text(app.tr_label("Click, then press the new key"));let name = if *slot == 0 { command.id.to_owned() } else { format!("{}:{slot}", command.id) };crate::scenario::publish_target(&format!("keymap:capture:{name}"), capture.rect);if ui.is_rect_visible(capture.rect) {diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rsindex 206a39d78e..1b8df2ad74 100644--- a/crates/ui-egui/src/lib.rs+++ b/crates/ui-egui/src/lib.rs@@ -455,6 +455,8 @@ pub struct Services {/// frame, so it only reads a value kept up to date elsewhere. None, or `None` from it: the/// window toolkit's theme.pub desktop_dark: Option<Box<dyn Fn() -> Option<bool>>>,+ /// Lazy background observation; `needed` arms polling, the return is cached only.+ pub reduce_transparency: Option<Box<dyn Fn(bool) -> Option<bool>>>,/// Adapter names and descriptive labels from the desktop renderer's chosen backends.pub graphics_adapters: Vec<(String, String)>,/// HTTPS GET for the update check (`update`); None: never check (browser, tests).@@ -513,6 +515,7 @@ pub struct SolveApp {/// Common panel foundation, internal opt-in; stays on the app across document tabs.pub(crate) panel_runtime: Option<panel_runtime::AppPanelRuntime>,pub blur: blur::State,+ pub(crate) blur_session: blur::Session,pub(crate) viewport_status: ui_kit::StatusPresentation,pub(crate) viewport_status_fixture: viewport_status_fixture::Fixture,/// Compact browser embed: retain model panels and joint controls without application chrome.@@ -790,6 +793,7 @@ impl SolveApp {panel_runtime: None,viewport_status: Default::default(),blur: Default::default(),+ blur_session: Default::default(),viewport_status_fixture: Default::default(),session,ui: UiState::default(),@@ -2960,6 +2964,7 @@ impl SolveApp {/// Lay out the whole window.pub fn ui(&mut self, ui: &mut egui::Ui) {+ prefs::prepare_blur(self, ui.ctx());let blur_source = !self.home.open && !render_workspace::result_active(self);let _blur_scope = self.blur.begin(ui.ctx(), blur_source);value_step::set_enabled(ui.ctx(), self.preferences.step_values);diff --git a/crates/ui-egui/src/navigation_bar_view.rs b/crates/ui-egui/src/navigation_bar_view.rsindex 2d7ba3d97c..8b44a180bc 100644--- a/crates/ui-egui/src/navigation_bar_view.rs+++ b/crates/ui-egui/src/navigation_bar_view.rs@@ -2,6 +2,7 @@use crate::navigation::NavCaps;use crate::navigation_bar::{self, Edge, Idle, Kind, Labels, MenuDisplay, NavigationBar, Position, Slot};use crate::theme::Tokens;+use crate::ui_kit::BackingTooltipExt as _;use crate::ui_kit::{self, Container, Surface};use crate::{SolveApp, viewport::NavMode};use egui::{Align2, Rect, pos2, vec2};@@ -531,7 +532,7 @@ fn display_menu(app: &mut SolveApp, ui: &mut egui::Ui) {item.selected = app.ui.perspective == perspective;item.enabled = !projection_locked(app);let response = item.show(ui);- let response = if projection_locked(app) { response.on_hover_text(app.tr("nav.perspective.sketch")) } else { response };+ let response = if projection_locked(app) { response.backing_on_hover_text(app.tr("nav.perspective.sketch")) } else { response };crate::scenario::publish_target(if perspective { "view:projection" } else { "view:orthographic" }, response.rect);if response.clicked() && app.ui.perspective != perspective {toggle_projection(app);@@ -556,7 +557,7 @@ fn display_menu(app: &mut SolveApp, ui: &mut egui::Ui) {// The View angles readout under the orientation gizmo (#6032).let mut angles = NavigationMenuRow::new("view_angles", app.tr("ui.view_angles"), "select");angles.selected = app.preferences.show_view_angles;- let response = angles.show(ui).on_hover_text(app.tr("ui.view_angles_help"));+ let response = angles.show(ui).backing_on_hover_text(app.tr("ui.view_angles_help"));crate::scenario::publish_target("view:view_angles", response.rect);if response.clicked() {let _ = app.run("view.angle_readout", json!({"enabled": !app.preferences.show_view_angles}));diff --git a/crates/ui-egui/src/navigation_cube.rs b/crates/ui-egui/src/navigation_cube.rsindex f43c8ce22f..e449a6eaee 100644--- a/crates/ui-egui/src/navigation_cube.rs+++ b/crates/ui-egui/src/navigation_cube.rs@@ -173,7 +173,7 @@ fn navigate(app: &mut SolveApp, action: Option<&str>, dir: Option<Vec3>) {fn control(app: &mut SolveApp, ui: &mut egui::Ui, bounds: Rect, action: &str, tooltip: &str) -> bool {crate::scenario::publish_handle(&format!("navigation_cube:control:{action}"), bounds.center());- let response = ui.interact(bounds, ui.id().with(("navigation_cube", action)), Sense::click()).on_hover_text(tooltip);+ let response = ui.interact(bounds, ui.id().with(("navigation_cube", action)), Sense::click()).backing_on_hover_text(tooltip);let hover = response.hovered();if response.clicked() {navigate(app, Some(action), None);@@ -253,7 +253,11 @@ pub(super) fn show(app: &mut SolveApp, ui: &mut egui::Ui, rect: Rect) {if let Some(face) = hovered.and_then(|i| faces.get(i)) {ui.ctx().set_cursor_icon(egui::CursorIcon::PointingHand);ui.interact(Rect::from_center_size(hover.unwrap_or(face.centre), vec2(2.0, 2.0)), ui.id().with("navigation_cube_tip"), Sense::hover())- .on_hover_text(format!("{} view. Drag to orbit{}.", face.label, if app.preferences.free_orbit { "" } else { "; hold Shift to snap" }));+ .backing_on_hover_text(format!(+ "{} view. Drag to orbit{}.",+ face.label,+ if app.preferences.free_orbit { "" } else { "; hold Shift to snap" }+ ));if ui.input(|i| i.pointer.primary_clicked()) {navigate(app, None, Some(face.direction));}diff --git a/crates/ui-egui/src/open_meshing.rs b/crates/ui-egui/src/open_meshing.rsindex d7dbf0da6a..4dad02ba4a 100644--- a/crates/ui-egui/src/open_meshing.rs+++ b/crates/ui-egui/src/open_meshing.rs@@ -171,7 +171,8 @@ pub(crate) fn show(app: &SolveApp, ctx: &egui::Context) {.fixed_pos(at).interactable(false).show(ctx, |ui| {- Container::popup_frame(ui.style()).fill(t.panel).show(ui, |ui| {+ let frame = Container::popup_frame(ui.style()).fill(t.panel);+ Container::show_backing(ui, frame, |ui| {ui.horizontal(|ui| {ui.spinner();ui.label(egui::RichText::new(format!("Loading parts {done}/{total}")).color(t.text));diff --git a/crates/ui-egui/src/panel_runtime/host.rs b/crates/ui-egui/src/panel_runtime/host.rsindex 928321cffa..d4c8917cf4 100644--- a/crates/ui-egui/src/panel_runtime/host.rs+++ b/crates/ui-egui/src/panel_runtime/host.rs@@ -1,3 +1,4 @@+use crate::ui_kit::BackingTooltipExt as _;use solidcraft_engine::panels::*;/// Content receives this value separately from state/model/command services. All@@ -267,7 +268,7 @@ impl PanelHost for EguiPanelHost<'_> {let ink = if presentation.attention { tokens.form_primary } else { tokens.form_ink };let mut response = ui.label(egui::RichText::new(&presentation.title).color(ink));if let Some(status) = &presentation.status {- response = response.on_hover_text(status);+ response = response.backing_on_hover_text(status);}response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Label, true, &presentation.title));}@@ -285,7 +286,7 @@ impl PanelHost for EguiPanelHost<'_> {.inner;let clicked = response.clicked();if let Some(reason) = &action.disabled_reason {- response.on_disabled_hover_text(reason);+ response.backing_on_disabled_hover_text(reason);}if clicked&& failure.is_none()diff --git a/crates/ui-egui/src/params_dialog.rs b/crates/ui-egui/src/params_dialog.rsindex 1b2439e61a..bfe4bc43fa 100644--- a/crates/ui-egui/src/params_dialog.rs+++ b/crates/ui-egui/src/params_dialog.rs@@ -13,6 +13,7 @@//! [`complete`] adds suggestions (parameters, functions, units) under any expression box: the//! names come from `parameters.complete`, cached per document revision by [`publish`].+use crate::ui_kit::BackingTooltipExt as _;use std::sync::Arc;use serde_json::{Value, json};@@ -273,7 +274,7 @@ pub fn show(app: &mut SolveApp, ctx: &egui::Context) {});ui.horizontal_wrapped(|ui| {if ui_kit::icon_label_button(ui, "Import…", "import_tray", true, false)- .on_hover_text(crate::i18n::tr_label("CSV or JSON: updates existing parameters, adds new ones"))+ .backing_on_hover_text(crate::i18n::tr_label("CSV or JSON: updates existing parameters, adds new ones")).clicked(){app.pick_open_command("parameters.import", json!({}), IMPORT_TYPES);@@ -601,7 +602,7 @@ fn table(app: &mut SolveApp, ui: &mut egui::Ui, d: &mut ParamsDialog, rows: &[&R}});row.cell(|ui| {- ui_kit::text(ui, &shown, ui_kit::Text::Value(&format!("value:{}", r.name), error)).on_hover_text(&shown);+ ui_kit::text(ui, &shown, ui_kit::Text::Value(&format!("value:{}", r.name), error)).backing_on_hover_text(&shown);});row.cell(|ui| {let mut comment = d.comments.get(&r.name).cloned().unwrap_or_else(|| r.comment.clone());@@ -700,7 +701,7 @@ fn apply_held(app: &mut SolveApp, d: &mut ParamsDialog, rows: &[Row]) -> bool {/// back on applies what was waiting.fn apply_live_checkbox(app: &mut SolveApp, ui: &mut egui::Ui, d: &mut ParamsDialog, rows: &[Row]) {let response = ui_kit::checkbox(ui, crate::i18n::tr("parameters.apply_live"), &mut app.preferences.parameters_apply_live)- .on_hover_text(crate::i18n::tr("parameters.apply_live_tip"));+ .backing_on_hover_text(crate::i18n::tr("parameters.apply_live_tip"));crate::scenario::publish_handle("params:apply_live", response.rect.center());if response.changed() && app.preferences.parameters_apply_live {apply_held(app, d, rows);@@ -754,7 +755,7 @@ fn add_row(app: &mut SolveApp, ui: &mut egui::Ui, table: &mut ui_kit::Table<'_>,left |= !completed && response.lost_focus();});row.cell(|ui| {- ui_kit::text(ui, &value, ui_kit::Text::Value("new_value", invalid)).on_hover_text(&value);+ ui_kit::text(ui, &value, ui_kit::Text::Value("new_value", invalid)).backing_on_hover_text(&value);});row.cell(|ui| {let response = ui_kit::cell_editor(ui, comment_id, &mut d.new_comment, "Comment", false);diff --git a/crates/ui-egui/src/place_gizmo.rs b/crates/ui-egui/src/place_gizmo.rsindex 61a71d99bd..e4535c9c1f 100644--- a/crates/ui-egui/src/place_gizmo.rs+++ b/crates/ui-egui/src/place_gizmo.rs@@ -24,6 +24,7 @@ mod look;mod rest;mod snap_fit;+use crate::ui_kit::BackingTooltipExt as _;use egui::{Pos2, vec2};use look::{CrossStyle, DIM, DIM_S, MARKER_ACTIVE, MARKER_HOT, RING_ACTIVE, RING_OPEN, RING_PX, RingStyle, angle_label, compass, crosshair, footprint, ring,@@ -250,7 +251,7 @@ pub(crate) fn show(app: &mut SolveApp, ui: &mut egui::Ui, painter: &egui::Paintelet (hovered, dragging) = (r.hovered(), r.dragged());// The tip while pointing, not while dragging: the hand is busy and the footprint says it all.if hovered && !dragging {- r.clone().on_hover_text(crate::i18n::tr_label(sp.move_tip));+ r.clone().backing_on_hover_text(crate::i18n::tr_label(sp.move_tip));}// The handle not in use steps back while the other one works (the ring's drag is last frame's).let turning = ui.data(|m| m.get_temp::<bool>(id("turning"))).unwrap_or(false);@@ -340,7 +341,7 @@ pub(crate) fn show(app: &mut SolveApp, ui: &mut egui::Ui, painter: &egui::Paintecompass(painter, &on, &dirs, style.active);}if hovered && !dragging {- r.clone().on_hover_text(crate::i18n::tr_label(turn.tip));+ r.clone().backing_on_hover_text(crate::i18n::tr_label(turn.tip));}if hovered || dragging {ui.ctx().set_cursor_icon(if dragging { egui::CursorIcon::Grabbing } else { egui::CursorIcon::Grab });diff --git a/crates/ui-egui/src/plugins.rs b/crates/ui-egui/src/plugins.rsindex 66e239ce08..6915a8ab9b 100644--- a/crates/ui-egui/src/plugins.rs+++ b/crates/ui-egui/src/plugins.rs@@ -11,6 +11,7 @@ use egui::RichText;use serde::Deserialize;use crate::SolveApp;+use crate::ui_kit::BackingTooltipExt as _;/// How many turned-off ids a preferences file may name.pub const MAX_DISABLED: usize = 256;@@ -212,7 +213,7 @@ fn page_in_dir(app: &mut SolveApp, ui: &mut egui::Ui, dir: Option<&Path>) {if !searching {ui.horizontal(|ui| {let button = crate::ui_kit::icon_label_button(ui, crate::i18n::tr("prefs.plugins_show_folder"), "folder", true, false)- .on_hover_text(crate::i18n::format("ui.plugins_note", &[("path", &path)]));+ .backing_on_hover_text(crate::i18n::format("ui.plugins_note", &[("path", &path)]));crate::scenario::publish_target("prefs:plugins:folder", button.rect);if button.clicked() {if let Err(e) = std::fs::create_dir_all(dir) {diff --git a/crates/ui-egui/src/prefs.rs b/crates/ui-egui/src/prefs.rsindex 2c97ff1d1e..f81cc07553 100644--- a/crates/ui-egui/src/prefs.rs+++ b/crates/ui-egui/src/prefs.rs@@ -1,6 +1,7 @@//! Grouped preferences composed with the shared UI kit. Changes apply immediately; Cancel//! restores the opening snapshot, Apply keeps editing, and Defaults affects the current page.+use crate::ui_kit::BackingTooltipExt as _;use solidcraft_engine::geom::prelude::*;use std::collections::BTreeMap;@@ -985,7 +986,7 @@ macro_rules! preference_settings {(@page $page:expr) => { Some($page) };(@control $app:ident, $ui:ident, $field:ident, check($label:literal $(, $help:literal)?)) => {ui_kit::checkbox($ui, crate::i18n::tr_label($label), &mut $app.preferences.$field)- $(.on_hover_text(crate::i18n::tr_label($help)))?+ $(.backing_on_hover_text(crate::i18n::tr_label($help)))?};(@control $app:ident, $ui:ident, $field:ident, check_tr($label:literal)) => {ui_kit::checkbox($ui, crate::i18n::tr($label), &mut $app.preferences.$field)@@ -2019,8 +2020,8 @@ fn theme_row(app: &mut SolveApp, ui: &mut egui::Ui) {});});} else {- let tile =- ui_kit::theme_import_tile(ui, app.tr_label("Import…"), app.tr("prefs.theme_file")).on_hover_text(app.tr("prefs.theme_import_hint"));+ let tile = ui_kit::theme_import_tile(ui, app.tr_label("Import…"), app.tr("prefs.theme_file"))+ .backing_on_hover_text(app.tr("prefs.theme_import_hint"));import_tile = Some(tile.rect);if tile.clicked() {action = Some("import");@@ -2049,7 +2050,7 @@ fn theme_row(app: &mut SolveApp, ui: &mut egui::Ui) {] {if let Some(rect) = crate::scenario::rect_of(&format!("prefs:carousel:{}", crate::i18n::tr(label))) {crate::scenario::publish_target(handle, rect);- ui.interact(rect, ui.make_persistent_id((handle, "help")), egui::Sense::hover()).on_hover_text(app.tr(help));+ ui.interact(rect, ui.make_persistent_id((handle, "help")), egui::Sense::hover()).backing_on_hover_text(app.tr(help));}}}@@ -2132,7 +2133,7 @@ fn follow_row(app: &mut SolveApp, ui: &mut egui::Ui) {if !path.is_empty() {let name = std::path::Path::new(&path).file_name().map(|n| n.to_string_lossy().to_string()).unwrap_or_default();ui_kit::settings_inline_note(ui, &name);- ui_kit::help_icon(ui, app.tr(if launch { "prefs.theme_follow_launch" } else { "prefs.theme_follow_note" })).on_hover_text(&path);+ ui_kit::help_icon(ui, app.tr(if launch { "prefs.theme_follow_launch" } else { "prefs.theme_follow_note" })).backing_on_hover_text(&path);}});if let Some(error) = error.filter(|_| !path.is_empty()) {@@ -2715,7 +2716,7 @@ pub fn show(app: &mut SolveApp, ctx: &egui::Context) {Some((Tokens::get().space_24 * 2.0, crate::settings_profiles::sidebar)),|ui| {let defaults = ui_kit::button(ui, crate::i18n::tr("prefs.restore_page_defaults"), ui_kit::Button::Ghost)- .on_hover_text(crate::i18n::tr("ui.reset_the_settings_on_this_page"));+ .backing_on_hover_text(crate::i18n::tr("ui.reset_the_settings_on_this_page"));crate::scenario::publish_target("prefs:defaults", defaults.rect);if defaults.clicked() {button = Some("defaults");@@ -2892,7 +2893,7 @@ fn nav_bridge(app: &mut SolveApp, ui: &mut egui::Ui) {(None, true) => Some((app.tr("ui.nav_bridge_waiting").to_owned(), true)),};ui.with_layout(egui::Layout::left_to_right(egui::Align::Min).with_main_wrap(true), |ui| {- ui_kit::checkbox(ui, &label, &mut app.preferences.nav_bridge_enabled).on_hover_text(&tip);+ ui_kit::checkbox(ui, &label, &mut app.preferences.nav_bridge_enabled).backing_on_hover_text(&tip);if let Some((status, waiting)) = &status {ui_kit::settings_state_badge(ui, status, if *waiting { ui_kit::SettingsBadgeTone::Warning } else { ui_kit::SettingsBadgeTone::Success });}@@ -3462,6 +3463,69 @@ fn active_theme_file(app: &SolveApp) -> Option<&crate::theme_files::ThemeFile> {.or_else(|| crate::theme_files::find(&app.preferences.theme, &app.preferences.custom_themes))}+/// The single runtime decision used by controls, ui.prefs and renderer activation. It never+/// changes saved intent or caches accessibility/hardware state in palette tokens.+pub(crate) fn blur_availability(app: &SolveApp) -> crate::theme_options::Availability {+ blur_availability_for(app, active_theme_file(app).is_some_and(crate::theme_options::declares_blur))+}++fn blur_availability_for(app: &SolveApp, offered: bool) -> crate::theme_options::Availability {+ use crate::theme_options::Availability::{Available, Unavailable};+ let reduced = app.services.reduce_transparency.as_ref().and_then(|read| read(offered));+ if !offered && app.blur_session.harness_radius.is_none() {+ return Available;+ }+ if let Some(reason) = app.blur_session.harness_unavailable {+ return Unavailable(reason);+ }+ // State owns CPU policy, including the explicit cfg(test) rendering fixture. The+ // adapter identity stays real; production CPU capability can never be Available.+ let capability = app.blur.capability();+ if app.blur.software_adapter() && capability != crate::blur::Capability::Available {+ return Unavailable("prefs.blur_software");+ }+ if cfg!(target_arch = "wasm32") {+ return Unavailable("prefs.blur_web");+ }+ if reduced == Some(true) {+ return Unavailable("prefs.blur_reduce_transparency");+ }+ if app.home.open || crate::render_workspace::result_active(app) {+ return Unavailable("prefs.blur_source");+ }+ match capability {+ crate::blur::Capability::Available => Available,+ crate::blur::Capability::Unavailable(_) => Unavailable("prefs.blur_device"),+ }+}++pub(crate) fn prepare_blur(app: &mut SolveApp, ctx: &egui::Context) {+ if ctx.viewport_id() != egui::ViewportId::ROOT {+ return;+ }+ let intent = crate::theme::blur_intent(ctx);+ let radius = app.blur_session.harness_radius.unwrap_or(intent.radius);+ // Disabled frames need only cached intent and atomic OS observation. Explicit UI/API+ // queries still report capabilities at radius zero; painting need not probe the GPU.+ let availability = if radius > 0.0 {+ blur_availability_for(app, intent.offered)+ } else {+ if let Some(read) = &app.services.reduce_transparency {+ read(intent.offered);+ }+ crate::theme_options::Availability::Available+ };+ // Resolve raw/default intent separately so temporary unavailability never drives the+ // renderer through radius=0 and clears a latched device/allocation failure.+ let available = availability == crate::theme_options::Availability::Available;+ app.blur_session.sample(ctx, intent.revision, radius, available, app.blur.painted_frame());+ app.blur.set_available(available);+ app.blur.set_tier_cap(app.blur_session.guard.cap);+ if let Err(error) = app.blur.set_radius(radius) {+ log::warn!("theme blur: {error}");+ }+}+fn followed_theme<'a>(prefs: &Prefs, follow: &'a crate::theme_files::Follow) -> Option<&'a crate::theme_files::ThemeFile> {(!follow.path(&prefs.theme_follow).is_empty()).then(|| follow.theme()).flatten()}@@ -3529,6 +3593,7 @@ fn theme_option_rows<'a>(file: &'a crate::theme_files::ThemeFile,language: &str,providers: &[crate::theme_options::Provider],+ blur: crate::theme_options::Availability,) -> Vec<ui_kit::ThemeOptionRow<'a>> {use crate::theme_options::{Availability, offered, provider};let locale = crate::i18n::Locale::for_language(language);@@ -3538,6 +3603,7 @@ fn theme_option_rows<'a>(let provider = provider(&definition.id, providers);ui_kit::ThemeOptionRow {definition,+ blur: definition.id == "blur",label: provider.map(|p| locale.text(p.label).to_owned()).unwrap_or_else(|| theme_option_text(&definition.label, language, &definition.id)),@@ -3548,22 +3614,50 @@ fn theme_option_rows<'a>(}_ => Vec::new(),},- reason: provider.and_then(|p| match (p.availability)() {+ reason: match crate::theme_options::availability(file, &definition.id, providers, blur) {Availability::Available => None,Availability::Unavailable(reason) => Some(locale.text(reason).to_owned()),- }),+ },}}).collect()}fn theme_options_row(app: &mut SolveApp, ui: &mut egui::Ui) {- let Some(file) = active_theme_file(app) else { return };- let rows = theme_option_rows(file, crate::i18n::effective_language(&app.preferences.language), crate::theme_options::PROVIDERS);+ let availability = blur_availability(app);+ let Some(file) = active_theme_file(app).cloned() else { return };+ let (mut values, notices) = effective_theme_options(&app.preferences, &file);+ // Notices precede the empty-control return: newer requirements intentionally have no rows.+ let mut problems: Vec<_> = notices+ .iter()+ .map(|notice| {+ let raw = app.preferences.theme_options.get(&file.id).and_then(|v| v.get(¬ice.id));+ (notice.id.clone(), format!("{:?}:{raw:?}", notice.kind), crate::i18n::format("prefs.theme_option_invalid", &[("option", ¬ice.id)]))+ })+ .collect();+ if file.needs_newer() {+ problems.push(("newer".into(), file.requires.to_string(), app.tr("prefs.theme_options_newer").to_owned()));+ }+ for (id, identity, text) in problems {+ let key = theme_notice_key(&file.id, &id, &identity);+ if !app.blur_session.dismissed(key) && ui_kit::theme_option_notice(ui, &id, &text, false).1 {+ app.blur_session.dismiss(key);+ }+ }+ if app.blur_session.guard.notice {+ let (undo, dismiss) = ui_kit::theme_option_notice(ui, "guard", app.tr("prefs.blur_guard"), true);+ if undo {+ app.blur_session.guard.undo();+ ui.ctx().request_repaint();+ }+ if dismiss {+ app.blur_session.guard.notice = false;+ }+ }+ let rows = theme_option_rows(&file, crate::i18n::effective_language(&app.preferences.language), crate::theme_options::PROVIDERS, availability);if rows.is_empty() {return;}- let (mut values, _) = effective_theme_options(&app.preferences, file);let before = values.clone();let reset = ui_kit::settings_card(ui, |ui| ui_kit::theme_options_list(ui, &file.id, &file.name, &rows, &mut values)).inner;let changes: BTreeMap<_, _> = values.into_iter().filter(|(id, value)| before.get(id) != Some(value)).collect();@@ -3578,6 +3672,13 @@ fn theme_options_row(app: &mut SolveApp, ui: &mut egui::Ui) {}}+fn theme_notice_key(theme: &str, problem: &str, raw: &str) -> u64 {+ use std::hash::{Hash, Hasher};+ let mut hash = std::collections::hash_map::DefaultHasher::new();+ (theme, problem, raw).hash(&mut hash);+ hash.finish()+}+/// Only explicitly supplied entries are checked. Stale saved entries survive unrelated changes.fn merge_theme_options(prefs: &mut Prefs, followed: Option<&crate::theme_files::ThemeFile>, update: &serde_json::Value) -> Result<(), String> {use crate::theme_files::{OptionKind, OptionValue};@@ -3644,13 +3745,14 @@ fn theme_options_reply(app: &SolveApp) -> solidcraft_engine::schema::ui_prefs::T.to_string()};let (values, notices) = effective_theme_options(&app.preferences, file);+ let blur = blur_availability(app);ThemeOptionsReply {theme_option_defs: crate::theme_files::ordered_options(file).into_iter().map(|o| {let standard = crate::theme_options::standard(&o.id);let provider = crate::theme_options::provider(&o.id, crate::theme_options::PROVIDERS);- let availability = provider.map(|p| (p.availability)());+ let availability = crate::theme_options::availability(file, &o.id, crate::theme_options::PROVIDERS, blur);ThemeOptionDef {id: o.id.clone(),kind: match &o.kind {@@ -3669,11 +3771,10 @@ fn theme_options_reply(app: &SolveApp) -> solidcraft_engine::schema::ui_prefs::Tadvanced: o.advanced,section: o.section.clone(),standard,- available: !standard || availability == Some(crate::theme_options::Availability::Available),+ available: availability == crate::theme_options::Availability::Available,reason: match availability {- Some(crate::theme_options::Availability::Unavailable(reason)) => Some(app.tr(reason).to_owned()),- None if standard => Some("not implemented".into()),- _ => None,+ crate::theme_options::Availability::Unavailable(reason) => Some(app.tr(reason).to_owned()),+ crate::theme_options::Availability::Available => None,},}})@@ -6829,12 +6930,12 @@ mod tests {if count == 0 {let viewport = crate::scenario::rect_of("prefs:section:viewport_logo").unwrap();let mut unknown = theme_options_fixture(base, count);- unknown["options"] = json!([{"id":"blur","type":"range","default":0}]);+ unknown["options"] = json!([]);h.call("ui.prefs", json!({"theme_import":unknown}));h.frames(2);assert!(crate::scenario::rect_of("prefs:theme_options_header").is_none());assert!(crate::scenario::rect_of(&format!("prefs:theme_options_badge:{id}")).is_none());- assert_eq!(crate::scenario::rect_of("prefs:section:viewport_logo").unwrap(), viewport, "unknown providers add no gap or notice");+ assert_eq!(crate::scenario::rect_of("prefs:section:viewport_logo").unwrap(), viewport, "empty declarations add no gap or notice");}if count == 12 {assert!(crate::scenario::rect_of("prefs:theme_option:outline").is_none());@@ -7043,11 +7144,11 @@ mod tests {{"id":"opacity","type":"range","default":100}]})).unwrap();- let rows = theme_option_rows(&file, "de", crate::theme_options::PROVIDERS);- assert_eq!(rows.iter().map(|r| r.definition.id.as_str()).collect::<Vec<_>>(), ["opacity", "tab_colours", "tab_fade_ms", "custom"]);+ let rows = theme_option_rows(&file, "de", crate::theme_options::PROVIDERS, Availability::Available);+ assert_eq!(rows.iter().map(|r| r.definition.id.as_str()).collect::<Vec<_>>(), ["opacity", "blur", "tab_colours", "tab_fade_ms", "custom"]);assert_eq!(rows[0].label, "Deckkraft");- assert_eq!(rows[3].label, "Eigene");- assert_eq!(theme_option_rows(&file, "ja", crate::theme_options::PROVIDERS)[3].label, "Custom", "English fallback");+ assert_eq!(rows[4].label, "Eigene");+ assert_eq!(theme_option_rows(&file, "ja", crate::theme_options::PROVIDERS, Availability::Available)[4].label, "Custom", "English fallback");let providers = [Provider {id: "blur",label: "prefs.theme_option_opacity",@@ -7055,7 +7156,7 @@ mod tests {availability: || Availability::Unavailable("prefs.theme_options_unavailable"),apply: |_, _| {},}];- let rows = theme_option_rows(&file, "en", &providers);+ let rows = theme_option_rows(&file, "en", &providers, Availability::Available);assert_eq!(rows.iter().map(|r| r.definition.id.as_str()).collect::<Vec<_>>(), ["blur", "custom"]);assert_eq!(rows[0].reason.as_deref(), Some("Unavailable on this device"));// The internal fixture goes through the real kit. No fake provider is shipped.@@ -7091,6 +7192,179 @@ mod tests {}}+ #[test]+ fn blur_slider_reserves_readout_meter_and_disabled_reason() {+ use crate::theme_files::OptionValue;+ use crate::theme_options::Availability;+ let source: serde_json::Value = serde_json::from_str(include_str!("../tests/fixtures/theme-blur.json")).unwrap();+ let file = crate::theme_files::from_value(&source).unwrap();+ for dark in [false, true] {+ crate::theme::set_custom(None);+ crate::theme::set_dark(dark);+ for available in [Availability::Available, Availability::Unavailable("prefs.theme_options_unavailable")] {+ let rows = theme_option_rows(&file, "en", crate::theme_options::PROVIDERS, available);+ for radius in [0.0, 1.0, 8.0, 9.0, 18.0, 33.0, 40.0, 18.25] {+ let ctx = crate::fonts::test_context();+ let mut values = crate::theme_files::effective_values(&file, &BTreeMap::new()).0;+ values.insert("blur".into(), OptionValue::Num(radius));+ let before = values.clone();+ let mut output = egui::FullOutput::default();+ for _ in 0..2 {+ crate::scenario::clear_handles();+ output = crate::test_support::frame(+ &ctx,+ egui::RawInput {+ screen_rect: Some(egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1200.0, 800.0))),+ ..Default::default()+ },+ |ui| {+ ui_kit::scope(ui, |ui| {+ ui_kit::theme_options_list(ui, &file.id, &file.name, &rows, &mut values);+ })+ },+ );+ }+ assert_eq!(values, before, "drawing must preserve fractional intent");+ let meter = crate::scenario::rect_of("prefs:blur_cost").unwrap();+ let readout = crate::scenario::rect_of("prefs:theme_option_readout:blur").unwrap();+ let slider = crate::scenario::rect_of("dialog:slider_track:Blur behind panels").unwrap();+ assert!(slider.width() > 300.0, "standalone blur fills remaining row width");+ assert!(slider.right() <= readout.left() && readout.right() <= meter.left());+ assert_eq!(crate::scenario::rect_of("prefs:theme_option_reason:blur").is_some(), available != Availability::Available);+ let mut heights = Vec::new();+ for clipped in &output.shapes {+ crate::test_support::each_shape(&clipped.shape, &mut |shape| {+ if let egui::Shape::Rect(rect) = shape+ && meter.contains_rect(rect.rect)+ {+ heights.push(rect.rect.height());+ }+ });+ }+ assert_eq!(heights, if radius == 0.0 { vec![2.0] } else { vec![4.0, 6.0, 8.0, 11.0, 14.0] });+ }+ }+ }+ }++ #[test]+ fn blur_availability_preserves_saved_intent_and_parent_state() {+ use crate::theme_options::{Availability, Provider};+ let mut h = crate::scenario::Harness::new();+ h.app.home.open = false;+ let source = json!({"format":"solidcraft-theme/1","name":"Blur parent","base":"dark","options":[+ {"id":"enabled","type":"bool","default":true}, {"id":"blur","type":"range","default":0,"parent":"enabled"},+ {"id":"amount","type":"range","default":5,"min":0,"max":10,"step":1,"parent":"enabled"}+ ]});+ control(&mut h.app, &json!({"theme_import":source,"theme_options":{"blur-parent":{"blur":18.25,"amount":7.5}}})).unwrap();+ let file = active_theme_file(&h.app).unwrap().clone();+ assert_eq!(file.options.iter().find(|o| o.id == "blur").unwrap().parent, None, "reserved blur ignores authored parenting");+ assert_eq!(file.options.iter().find(|o| o.id == "amount").unwrap().parent.as_deref(), Some("enabled"));+ let saved = h.app.preferences.theme_options.clone();+ let values = effective_theme_options(&h.app.preferences, &file).0;+ for reason in ["prefs.blur_software", "prefs.blur_web", "prefs.blur_reduce_transparency"] {+ assert_eq!(crate::theme_options::blur_radius(&file, &values, Availability::Unavailable(reason)), 0.0);+ assert_eq!(crate::theme_options::blur_radius(&file, &values, Availability::Available), 18.25);+ }+ assert_eq!(h.app.preferences.theme_options, saved);+ let providers = [+ Provider { id: "enabled", label: "", help: "", availability: || Availability::Unavailable("prefs.blur_software"), apply: |_, _| {} },+ Provider {+ id: "blur",+ label: "prefs.theme_option_blur",+ help: "prefs.theme_option_blur_help",+ availability: || Availability::Available,+ apply: |_, _| {},+ },+ ];+ assert_eq!(+ crate::theme_options::availability(&file, "amount", &providers, Availability::Available),+ Availability::Unavailable("prefs.blur_software")+ );+ assert_eq!(+ crate::theme_options::availability(&file, "blur", &providers, Availability::Available),+ Availability::Available,+ "standard blur remains independent of the unavailable custom parent"+ );+ let rows = theme_option_rows(&file, "en", &providers, Availability::Available);+ let parent = rows.iter().find(|r| r.definition.id == "enabled").unwrap();+ let child = rows.iter().find(|r| r.definition.id == "amount").unwrap();+ let blur = rows.iter().find(|r| r.definition.id == "blur").unwrap();+ assert!(parent.reason.is_some());+ assert_eq!(child.reason, parent.reason, "the genuine custom child inherits its parent's unavailable reason");+ assert!(blur.reason.is_none(), "the reserved blur control is unaffected by custom-parent availability");+ let reduced = std::rc::Rc::new(std::cell::Cell::new(true));+ let reading = reduced.clone();+ h.app.services.reduce_transparency = Some(Box::new(move |_| Some(reading.get())));+ assert_eq!(blur_availability(&h.app), Availability::Unavailable("prefs.blur_reduce_transparency"));+ let reply = control(&mut h.app, &json!({})).unwrap();+ assert_eq!(reply["theme_option_values"]["blur"], 18.25);+ h.frames(2);+ assert_eq!(h.app.blur.radius(), 18.25, "OS unavailability preserves requested intent");+ assert_eq!(h.app.preferences.theme_options, saved);+ assert_eq!(h.app.blur.counters().textures_created, 0);+ assert_eq!(h.app.blur.counters().markers_emitted, 0);+ reduced.set(false);+ assert_ne!(blur_availability(&h.app), Availability::Unavailable("prefs.blur_reduce_transparency"));+ h.frames(2);+ assert_eq!(h.app.blur.radius(), 18.25, "renderer retains raw intent even without a GPU");+ assert_eq!(h.app.blur.counters().textures_created, 0);+ control(&mut h.app, &json!({"theme_options":{"blur-parent":{"enabled":false}}})).unwrap();+ h.frames(2);+ assert_eq!(h.app.blur.radius(), 18.25, "an inactive custom parent cannot turn independent standard blur off");+ assert_eq!(crate::theme::blur_intent(&h.ctx).radius, 18.25);+ let reply = control(&mut h.app, &json!({})).unwrap();+ assert_eq!(reply["theme_option_values"]["enabled"], false);+ assert_eq!(reply["theme_option_values"]["amount"], 7.5, "an inactive custom child retains its saved value");+ assert_eq!(h.app.preferences.theme_options["blur-parent"]["blur"], 18.25);+ control(&mut h.app, &json!({"theme_options":{"blur-parent":{"enabled":true}}})).unwrap();+ h.frames(2);+ assert_eq!(h.app.blur.radius(), 18.25);+ assert_eq!(h.app.preferences.theme_options["blur-parent"]["amount"], 7.5);+ let counts = h.app.blur.counters();+ assert_eq!((counts.textures_created, counts.markers_emitted, counts.markers_drawn, counts.live_bytes), (0, 0, 0, 0));+ }++ #[test]+ fn blur_notices_dismiss_by_problem_identity_and_preserve_raw_json() {+ let mut h = crate::scenario::Harness::new();+ h.app.home.open = false;+ h.call("ui.resize", json!({"width":1600,"height":1100}));+ h.call("ui.prefs", json!({"theme_import":option_theme_file("Notice blur"),"open":"Interface"}));+ h.app.preferences.theme_options.insert("notice-blur".into(), BTreeMap::from([("blur".into(), json!({"future":18}))]));+ h.frames(3);+ assert!(crate::scenario::rect_of("prefs:theme_notice:blur").is_some());+ h.step(&json!({"click":{"handle":"prefs:theme_notice_dismiss:blur"}})).unwrap();+ h.frames(2);+ assert!(crate::scenario::rect_of("prefs:theme_notice:blur").is_none());+ assert_eq!(h.app.preferences.theme_options["notice-blur"]["blur"], json!({"future":18}));+ let reply = control(&mut h.app, &json!({})).unwrap();+ assert_eq!(reply["theme_option_notices"], json!([{"id":"blur","kind":"wrong_type"}]));+ h.app.preferences.theme_options.get_mut("notice-blur").unwrap().insert("blur".into(), json!({"future":19}));+ h.frames(2);+ assert!(crate::scenario::rect_of("prefs:theme_notice:blur").is_some(), "changed raw value must reappear");+ h.call(+ "ui.prefs",+ json!({"theme_import":{"format":"solidcraft-theme/1","name":"Future blur","base":"dark","requires":2,+ "options":[{"id":"blur","type":"range","default":18}]}}),+ );+ h.frames(2);+ assert!(crate::scenario::rect_of("prefs:theme_notice:newer").is_some());+ assert!(crate::scenario::rect_of("prefs:theme_options_header").is_none());+ h.step(&json!({"click":{"handle":"prefs:theme_notice_dismiss:newer"}})).unwrap();+ h.frames(2);+ assert!(crate::scenario::rect_of("prefs:theme_notice:newer").is_none());+ assert!(active_theme_file(&h.app).unwrap().options.is_empty(), "unsupported tables were discarded, never auto-restored");+ h.app.preferences.custom_themes.iter_mut().find(|f| f.id == "future-blur").unwrap().requires = 3;+ h.frames(2);+ assert!(crate::scenario::rect_of("prefs:theme_notice:newer").is_some());+ for identity in 0..80 {+ h.app.blur_session.dismiss(identity);+ }+ assert!(!h.app.blur_session.dismissed(0), "dismissal storage is bounded");+ assert!(h.app.blur_session.dismissed(79));+ }+fn option_theme_file(name: &str) -> serde_json::Value {json!({"format": "solidcraft-theme/1", "name": name, "base": "dark", "colors": {"panel": "#112233"},@@ -7572,7 +7846,8 @@ mod tests {assert_eq!(reply.options.theme_option_defs.iter().map(|o| o.id.as_str()).collect::<Vec<_>>(), ["blur", "enabled", "amount", "style"]);let defs = &reply.options.theme_option_defs;assert!(defs[0].standard && !defs[0].available);- assert_eq!(defs[0].reason.as_deref(), Some("not implemented"));+ let crate::theme_options::Availability::Unavailable(reason) = blur_availability(&h.app) else { panic!("headless fixture has no GPU") };+ assert_eq!(defs[0].reason.as_deref(), Some(crate::i18n::Locale::for_language("de").text(reason)));assert_eq!((&defs[1].label, &defs[1].help), (&"Aktiv".to_string(), &"Farben verwenden".to_string()));assert!(defs[1].available && defs[1].reason.is_none());assert!(defs[2].advanced && defs[2].section.as_deref() == Some("Details"));diff --git a/crates/ui-egui/src/prefs/design.rs b/crates/ui-egui/src/prefs/design.rsindex d71d2b01df..336adb7e14 100644--- a/crates/ui-egui/src/prefs/design.rs+++ b/crates/ui-egui/src/prefs/design.rs@@ -91,7 +91,7 @@ pub(super) fn show(app: &mut SolveApp, ui: &mut egui::Ui) {),] {ui.horizontal_wrapped(|ui| {- let response = setting(app, ui).on_hover_text(app.tr(help));+ let response = setting(app, ui).backing_on_hover_text(app.tr(help));crate::scenario::publish_target(&format!("prefs:{target}"), response.rect);crate::scenario::publish_target(&format!("dialog:{legacy}"), response.rect);if !crate::prefs_search::suppress_chrome(ui) {@@ -139,7 +139,7 @@ pub(super) fn show(app: &mut SolveApp, ui: &mut egui::Ui) {}});ui.horizontal_wrapped(|ui| {- let response = setting::offer_stand_up(app, ui).on_hover_text(app.tr("prefs.stand_up_note"));+ let response = setting::offer_stand_up(app, ui).backing_on_hover_text(app.tr("prefs.stand_up_note"));crate::scenario::publish_target("prefs:offer_stand_up", response.rect);if !crate::prefs_search::suppress_chrome(ui) {ui_kit::help_icon(ui, app.tr("prefs.stand_up_note"));@@ -176,7 +176,7 @@ pub(super) fn show(app: &mut SolveApp, ui: &mut egui::Ui) {crate::scenario::publish_target("prefs:update_changed_links", response.rect);crate::scenario::publish_target("dialog:Update changed linked designs when a tab comes back", response.rect);ui.horizontal_wrapped(|ui| {- let response = setting::double_click_components(app, ui).on_hover_text(app.tr("prefs.design_tools.double_click_help"));+ let response = setting::double_click_components(app, ui).backing_on_hover_text(app.tr("prefs.design_tools.double_click_help"));crate::scenario::publish_target("prefs:double_click_components", response.rect);crate::scenario::publish_target("dialog:Double-click a component to activate it, or to edit a linked one in place", response.rect);if !crate::prefs_search::suppress_chrome(ui) {diff --git a/crates/ui-egui/src/prefs/general.rs b/crates/ui-egui/src/prefs/general.rsindex 89eda1fb1c..4e115f8c2c 100644--- a/crates/ui-egui/src/prefs/general.rs+++ b/crates/ui-egui/src/prefs/general.rs@@ -104,7 +104,7 @@ pub(super) fn show(app: &mut SolveApp, ui: &mut egui::Ui) {let (single, tip) = (app.tr("ui.slicer_single_instance").to_string(), app.tr("ui.slicer_single_instance_tip").to_string());let width = (ui.available_width() - t.space_16 - ui.spacing().item_spacing.x).max(0.0);ui.allocate_ui_with_layout(egui::vec2(width, t.control_height), egui::Layout::left_to_right(egui::Align::Center), |ui| {- ui_kit::checkbox(ui, &single, &mut app.preferences.slicer_single_instance).on_hover_text(&tip);+ ui_kit::checkbox(ui, &single, &mut app.preferences.slicer_single_instance).backing_on_hover_text(&tip);});ui_kit::help_icon(ui, &tip);});@@ -135,7 +135,7 @@ pub(super) fn show(app: &mut SolveApp, ui: &mut egui::Ui) {let badge = ui_kit::settings_state_badge(ui, &label, tone);crate::scenario::publish_rect("prefs:crash_count", badge.rect);if ui_kit::button(ui, app.tr("prefs.crash_reports"), ui_kit::Button::Normal)- .on_hover_text(app.tr("prefs.crash_reports_note"))+ .backing_on_hover_text(app.tr("prefs.crash_reports_note")).clicked(){crate::crash_ui::open(app);@@ -192,7 +192,7 @@ fn file_size_rows(app: &mut SolveApp, ui: &mut egui::Ui, labels: f32) {ui_kit::number_field(ui, value, default..=top, 1.0, "")}).inner- .on_hover_text(&help);+ .backing_on_hover_text(&help);crate::scenario::publish_rect(handle, field.rect);let size = limits::describe(value.saturating_mul(limits::MB));let note = if *value >= 1024 { format!("{unit} ({size})") } else { unit.to_owned() };diff --git a/crates/ui-egui/src/prefs/graphics.rs b/crates/ui-egui/src/prefs/graphics.rsindex 67f63a4f12..e1adf7e3c3 100644--- a/crates/ui-egui/src/prefs/graphics.rs+++ b/crates/ui-egui/src/prefs/graphics.rs@@ -30,7 +30,7 @@ pub(super) fn show(app: &mut SolveApp, ui: &mut egui::Ui) {&|p, rect, ink| paint_preset_glyph(p, rect, id, ink),width,)- .on_hover_text(app.tr("ui.graphics_preset_help"));+ .backing_on_hover_text(app.tr("ui.graphics_preset_help"));crate::scenario::publish_target(&format!("view:graphics_preset:{id}"), response.rect);if id == "performance" {crate::scenario::publish_target("view:graphics_preset", response.rect);@@ -71,7 +71,7 @@ pub(super) fn show(app: &mut SolveApp, ui: &mut egui::Ui) {},width,)- .on_hover_text(app.tr("settings.display_quality_note"));+ .backing_on_hover_text(app.tr("settings.display_quality_note"));crate::scenario::publish_target(&format!("prefs:display_quality:{}", q.id()), response.rect);crate::scenario::publish_target(&format!("prefs:option:{label}"), response.rect);if response.clicked() {@@ -111,8 +111,8 @@ pub(super) fn show(app: &mut SolveApp, ui: &mut egui::Ui) {},(t.space_24 * 5.0 + t.space_10).min(ui.max_rect().width()),)- .on_hover_text(app.tr("settings.msaa_applies_on_restart"))- .on_disabled_hover_text(app.tr("settings.msaa_applies_on_restart"));+ .backing_on_hover_text(app.tr("settings.msaa_applies_on_restart"))+ .backing_on_disabled_hover_text(app.tr("settings.msaa_applies_on_restart"));crate::scenario::publish_target(&format!("prefs:msaa:{m}"), response.rect);crate::scenario::publish_target(&format!("prefs:option:{label}"), response.rect);if enabled && response.clicked() {@@ -154,7 +154,7 @@ pub(super) fn show(app: &mut SolveApp, ui: &mut egui::Ui) {crate::scenario::publish_target("prefs:supersampling_adaptive", response.rect);crate::scenario::publish_target("dialog:Only when the view is still", response.rect);});- let response = setting::dark_parts_shading(app, ui).on_hover_text(app.tr("prefs.dark_parts_shading_help"));+ let response = setting::dark_parts_shading(app, ui).backing_on_hover_text(app.tr("prefs.dark_parts_shading_help"));crate::scenario::publish_target("prefs:dark_parts_shading", response.rect);});ui_kit::settings_section(ui, "current_view", app.tr("prefs.graphics_page.current_view"), |ui| {@@ -262,7 +262,7 @@ pub(super) fn show(app: &mut SolveApp, ui: &mut egui::Ui) {},width,)- .on_hover_text(help);+ .backing_on_hover_text(help);crate::scenario::publish_target(&format!("prefs:{id}"), response.rect);crate::scenario::publish_target(&format!("dialog:{label}"), response.rect);if id == "quick_measure" {@@ -285,10 +285,10 @@ pub(super) fn show(app: &mut SolveApp, ui: &mut egui::Ui) {});ui.add_enabled_ui(app.preferences.show_frame_rate, |ui| {let response = ui_kit::checkbox(ui, app.tr("ui.frame_rate_details"), &mut app.preferences.frame_rate_details)- .on_hover_text(app.tr("settings.frame_rate_details_note"));+ .backing_on_hover_text(app.tr("settings.frame_rate_details_note"));crate::scenario::publish_target("prefs:frame_rate_details", response.rect);});- let profile = setting::profile_operations(app, ui).on_hover_text(app.tr("prefs.profile_operations_note"));+ let profile = setting::profile_operations(app, ui).backing_on_hover_text(app.tr("prefs.profile_operations_note"));crate::scenario::publish_target("prefs:profile_operations", profile.rect);ui.horizontal_wrapped(|ui| {ui_kit::settings_inline_note(ui, app.tr("prefs.graphics_page.status_chips"));@@ -310,7 +310,7 @@ pub(super) fn show(app: &mut SolveApp, ui: &mut egui::Ui) {if id == "viewport_section_status" { crate::i18n::tr_label(label) } else { crate::i18n::tr(label) },*value,)- .on_hover_text(crate::i18n::tr(help));+ .backing_on_hover_text(crate::i18n::tr(help));crate::scenario::publish_target(&format!("prefs:{id}"), response.rect);if response.clicked() {*value = !*value;@@ -320,7 +320,7 @@ pub(super) fn show(app: &mut SolveApp, ui: &mut egui::Ui) {});ui_kit::settings_section(ui, "surfaces_edges", app.tr("prefs.graphics_page.surfaces_edges"), |ui| {let response = ui_kit::checkbox(ui, app.tr("ui.cosmetic_thread_markings"), &mut app.preferences.cosmetic_threads)- .on_hover_text(app.tr("ui.cosmetic_thread_markings_help"));+ .backing_on_hover_text(app.tr("ui.cosmetic_thread_markings_help"));crate::scenario::publish_target("prefs:cosmetic_threads", response.rect);setting::sketch_halo(app, ui);ui_kit::row(ui, app.tr("prefs.section_hatch"), |ui| {@@ -336,17 +336,17 @@ pub(super) fn show(app: &mut SolveApp, ui: &mut egui::Ui) {app.preferences.section_hatch = *style;}});- let tint_new = setting::preview_tint_new_faces(app, ui).on_hover_text(app.tr("prefs.preview_tint_new_faces_help"));+ let tint_new = setting::preview_tint_new_faces(app, ui).backing_on_hover_text(app.tr("prefs.preview_tint_new_faces_help"));crate::scenario::publish_target("prefs:preview_tint_new_faces", tint_new.rect);- let cut_tint = setting::cut_preview_tint(app, ui).on_hover_text(app.tr("prefs.cut_preview_tint_help"));+ let cut_tint = setting::cut_preview_tint(app, ui).backing_on_hover_text(app.tr("prefs.cut_preview_tint_help"));crate::scenario::publish_target("prefs:cut_preview_tint", cut_tint.rect);let reference =- setting::reference_geometry_through_bodies(app, ui).on_hover_text(app.tr("settings.reference_geometry_through_bodies_help"));+ setting::reference_geometry_through_bodies(app, ui).backing_on_hover_text(app.tr("settings.reference_geometry_through_bodies_help"));crate::scenario::publish_target("dialog:Show reference geometry through bodies", reference.rect);ui.add_enabled_ui(app.ui.show_grid, |ui| {- setting::grid_follows_view(app, ui).on_hover_text(app.tr("ui.grid_follows_view_hint"));+ setting::grid_follows_view(app, ui).backing_on_hover_text(app.tr("ui.grid_follows_view_hint"));});- let response = setting::single_surface_analysis(app, ui).on_hover_text(app.tr("prefs.single_surface_analysis_help"));+ let response = setting::single_surface_analysis(app, ui).backing_on_hover_text(app.tr("prefs.single_surface_analysis_help"));crate::scenario::publish_target("prefs:single_surface_analysis", response.rect);crate::scenario::publish_target("dialog:Use a single surface analysis", response.rect);if response.changed() {@@ -364,7 +364,7 @@ pub(super) fn show(app: &mut SolveApp, ui: &mut egui::Ui) {}#[cfg(target_os = "linux")]window_system_row(app, ui, help_label_width);- setting::render_previous_geometry_budget(app, ui).on_hover_text(app.tr("prefs.render_previous_geometry_budget_help"));+ setting::render_previous_geometry_budget(app, ui).backing_on_hover_text(app.tr("prefs.render_previous_geometry_budget_help"));});});});@@ -433,16 +433,19 @@ fn computer_card(ui: &mut egui::Ui, add: impl FnOnce(&mut egui::Ui)) {add(ui);return;}- egui::Frame::NONE- .fill(t.pref_well)- .stroke(egui::Stroke::new(1.0, t.dialog_border))- .corner_radius(f32::from(t.radius_lg) + t.space_2)- .inner_margin(egui::Margin::same(t.space_14 as i8))- .show(ui, |ui| {+ ui_kit::Container::show_backing(+ ui,+ egui::Frame::NONE+ .fill(t.pref_well)+ .stroke(egui::Stroke::new(1.0, t.dialog_border))+ .corner_radius(f32::from(t.radius_lg) + t.space_2)+ .inner_margin(egui::Margin::same(t.space_14 as i8)),+ |ui| {ui.set_width(ui.available_width());ui.spacing_mut().item_spacing.y = t.space_12;add(ui);- });+ },+ );}/// The device line: a tile with a monitor, the adapter's name, its backend and renderer, and a badge.@@ -474,8 +477,8 @@ fn computer_header(app: &SolveApp, ui: &mut egui::Ui) {paint_monitor(ui.painter(), egui::Rect::from_center_size(rect.center(), rect.size() * 0.56), t.form_primary);ui.vertical(|ui| {ui.spacing_mut().item_spacing.y = 1.0;- ui_kit::text(ui, name, ui_kit::Text::NameCell(true)).on_hover_text(adapter);- ui.label(egui::RichText::new(line).monospace().size(t.font_small).color(t.form_dim)).on_hover_text(renderer_details);+ ui_kit::text(ui, name, ui_kit::Text::NameCell(true)).backing_on_hover_text(adapter);+ ui.label(egui::RichText::new(line).monospace().size(t.font_small).color(t.form_dim)).backing_on_hover_text(renderer_details);});});});diff --git a/crates/ui-egui/src/prefs/interface.rs b/crates/ui-egui/src/prefs/interface.rsindex ada39cd801..45313f046e 100644--- a/crates/ui-egui/src/prefs/interface.rs+++ b/crates/ui-egui/src/prefs/interface.rs@@ -115,7 +115,7 @@ pub(super) fn appearance(app: &mut SolveApp, ui: &mut egui::Ui, t: &Tokens) {ui_kit::Slider { step: Some(0.05), format: |v| format!("{:.0} %", v * 100.0), ..Default::default() },)})- .on_hover_text(app.tr("prefs.scale_note"));+ .backing_on_hover_text(app.tr("prefs.scale_note"));crate::scenario::publish_target("prefs:scale", response.rect);});});@@ -160,7 +160,7 @@ pub(super) fn appearance(app: &mut SolveApp, ui: &mut egui::Ui, t: &Tokens) {app.preferences.ui_font.clear();}});- ui.scope(|ui| ui_kit::font_specimen(ui, app.tr("prefs.font_sample"))).response.on_hover_text(app.tr("prefs.font_fallback"));+ ui.scope(|ui| ui_kit::font_specimen(ui, app.tr("prefs.font_sample"))).response.backing_on_hover_text(app.tr("prefs.font_fallback"));}});ui_kit::settings_section(ui, "colour_vision", app.tr("ui.colour_vision"), |ui| {@@ -422,7 +422,7 @@ pub(super) fn layout(app: &mut SolveApp, ui: &mut egui::Ui) {let options = [app.tr("prefs.dialogs_edge"), app.tr("prefs.dialogs_left_column")];let segments =ui.scope(|ui| ui_kit::segmented(ui, &mut selected, &options, ui_kit::Segments { intrinsic: true, ..Default::default() }));- segments.response.on_hover_text(app.tr("prefs.dialogs_note"));+ segments.response.backing_on_hover_text(app.tr("prefs.dialogs_note"));if segments.inner {app.preferences.dialog_place = if selected == 1 { DialogPlace::LeftColumn } else { DialogPlace::Edge };}@@ -560,7 +560,7 @@ fn layout_check(ui: &mut egui::Ui, label: &str, help: &str, value: &mut bool, keui.spacing_mut().item_spacing.x = t.space_6;let check_width = (ui.available_width() - t.space_16 - t.space_6).max(0.0);let response = ui_kit::settings_control_width(ui, check_width, |ui| {- ui_kit::checkbox(ui, label, value).on_hover_text(help).on_disabled_hover_text(help)+ ui_kit::checkbox(ui, label, value).backing_on_hover_text(help).backing_on_disabled_hover_text(help)});crate::scenario::publish_target(&format!("prefs:{key}"), response.rect);ui_kit::help_icon(ui, help);diff --git a/crates/ui-egui/src/prefs/mouse3d.rs b/crates/ui-egui/src/prefs/mouse3d.rsindex 6455e0d0fe..300ed5c3ff 100644--- a/crates/ui-egui/src/prefs/mouse3d.rs+++ b/crates/ui-egui/src/prefs/mouse3d.rs@@ -17,104 +17,103 @@ fn device(app: &mut SolveApp, ui: &mut egui::Ui) {let t = Tokens::get();ui_kit::settings_section(ui, "space_mouse_device", app.tr("prefs.navigation.device"), |ui| {// A confirmed input record identifies the device; an open reader alone does not.- let card =- ui_kit::settings_card(ui, |ui| {- let device = app.space_mouse.device.clone();- let saved = device.as_ref().is_some_and(|device| app.preferences.space_mouse_calibrations.contains_key(device));- let denied = found_but_not_allowed(app.space_mouse.drivers);- // Native wrapping labels use the initial row height as their first-line minimum.- ui.allocate_ui_with_layout(- egui::vec2(ui.available_width(), t.control_height),- egui::Layout::left_to_right(egui::Align::Min).with_main_wrap(true),- |ui| {- if let Some(device) = &device {- ui_kit::text(ui, device, ui_kit::Text::Inline);- ui_kit::settings_state_badge(ui, app.tr("ui.nav_bridge_connected"), ui_kit::SettingsBadgeTone::Success);- ui_kit::settings_state_badge(- ui,- app.tr(if saved { "ui.3d_mouse_calibrated" } else { "ui.3d_mouse_not_calibrated" }),- if saved { ui_kit::SettingsBadgeTone::Success } else { ui_kit::SettingsBadgeTone::Warning },- );+ let card = ui_kit::settings_card(ui, |ui| {+ let device = app.space_mouse.device.clone();+ let saved = device.as_ref().is_some_and(|device| app.preferences.space_mouse_calibrations.contains_key(device));+ let denied = found_but_not_allowed(app.space_mouse.drivers);+ // Native wrapping labels use the initial row height as their first-line minimum.+ ui.allocate_ui_with_layout(+ egui::vec2(ui.available_width(), t.control_height),+ egui::Layout::left_to_right(egui::Align::Min).with_main_wrap(true),+ |ui| {+ if let Some(device) = &device {+ ui_kit::text(ui, device, ui_kit::Text::Inline);+ ui_kit::settings_state_badge(ui, app.tr("ui.nav_bridge_connected"), ui_kit::SettingsBadgeTone::Success);+ ui_kit::settings_state_badge(+ ui,+ app.tr(if saved { "ui.3d_mouse_calibrated" } else { "ui.3d_mouse_not_calibrated" }),+ if saved { ui_kit::SettingsBadgeTone::Success } else { ui_kit::SettingsBadgeTone::Warning },+ );+ } else {+ let status = app.tr(if denied {+ "ui.3d_mouse_denied_short"+ } else if waiting_for_a_record(app.space_mouse.drivers) {+ "ui.3d_mouse_calibrate_wait"} else {- let status = app.tr(if denied {- "ui.3d_mouse_denied_short"- } else if waiting_for_a_record(app.space_mouse.drivers) {- "ui.3d_mouse_calibrate_wait"- } else {- "ui.3d_mouse_none"+ "ui.3d_mouse_none"+ });+ let response = ui_kit::text(ui, status, ui_kit::Text::Report("calibration_status", false))+ .backing_on_hover_text(app.tr(if denied { "ui.3d_mouse_denied" } else { "ui.3d_mouse_wiggle" }));+ crate::scenario::publish_target("prefs:space_mouse_status", response.rect);+ }+ },+ );+ let calibrate_width = ui_kit::ContentWidth::button(ui, app.tr("ui.3d_mouse_calibrate"));+ let forget_width = ui_kit::ContentWidth::button(ui, app.tr("ui.3d_mouse_forget"));+ let available = ui.available_width();+ ui.allocate_ui_with_layout(+ egui::vec2(available, t.control_height),+ egui::Layout::left_to_right(egui::Align::Min).with_main_wrap(true),+ |ui| {+ ui.spacing_mut().item_spacing.x = t.space_8;+ ui.allocate_ui_with_layout(+ egui::vec2(calibrate_width.min(available), t.control_height),+ egui::Layout::top_down(egui::Align::Min),+ |ui| {+ ui_kit::settings_form(ui, 0.0, |ui| {+ ui_kit::row(ui, app.tr("ui.3d_mouse_calibrate"), |ui| {+ ui.add_enabled_ui(app.preferences.space_mouse_enabled && device.is_some(), |ui| {+ let response = ui_kit::button(ui, app.tr("ui.3d_mouse_calibrate"), ui_kit::Button::Normal)+ .backing_on_hover_text(app.tr("ui.3d_mouse_calibrate_tip"))+ .backing_on_disabled_hover_text(app.tr(if device.is_none() {+ "ui.3d_mouse_calibrate_wait"+ } else {+ "ui.3d_mouse_calibrate_tip"+ }));+ crate::scenario::publish_target("prefs:space_mouse_calibrate", response.rect);+ crate::scenario::publish_target(+ &format!("dialog:button:Calibration:{}", app.tr("ui.3d_mouse_calibrate")),+ response.rect,+ );+ if response.clicked() {+ crate::space_mouse_calibration::start(app);+ }+ });+ });});- let response = ui_kit::text(ui, status, ui_kit::Text::Report("calibration_status", false))- .on_hover_text(app.tr(if denied { "ui.3d_mouse_denied" } else { "ui.3d_mouse_wiggle" }));- crate::scenario::publish_target("prefs:space_mouse_status", response.rect);- }- },- );- let calibrate_width = ui_kit::ContentWidth::button(ui, app.tr("ui.3d_mouse_calibrate"));- let forget_width = ui_kit::ContentWidth::button(ui, app.tr("ui.3d_mouse_forget"));- let available = ui.available_width();- ui.allocate_ui_with_layout(- egui::vec2(available, t.control_height),- egui::Layout::left_to_right(egui::Align::Min).with_main_wrap(true),- |ui| {- ui.spacing_mut().item_spacing.x = t.space_8;+ },+ );+ if saved {ui.allocate_ui_with_layout(- egui::vec2(calibrate_width.min(available), t.control_height),+ egui::vec2(forget_width.min(available), t.control_height),egui::Layout::top_down(egui::Align::Min),|ui| {ui_kit::settings_form(ui, 0.0, |ui| {- ui_kit::row(ui, app.tr("ui.3d_mouse_calibrate"), |ui| {- ui.add_enabled_ui(app.preferences.space_mouse_enabled && device.is_some(), |ui| {- let response = ui_kit::button(ui, app.tr("ui.3d_mouse_calibrate"), ui_kit::Button::Normal)- .on_hover_text(app.tr("ui.3d_mouse_calibrate_tip"))- .on_disabled_hover_text(app.tr(if device.is_none() {- "ui.3d_mouse_calibrate_wait"- } else {- "ui.3d_mouse_calibrate_tip"- }));- crate::scenario::publish_target("prefs:space_mouse_calibrate", response.rect);+ ui_kit::row(ui, app.tr("ui.3d_mouse_forget"), |ui| {+ ui.add_enabled_ui(app.preferences.space_mouse_enabled, |ui| {+ let response = ui_kit::button(ui, app.tr("ui.3d_mouse_forget"), ui_kit::Button::Normal);+ crate::scenario::publish_target("prefs:space_mouse_forget", response.rect);crate::scenario::publish_target(- &format!("dialog:button:Calibration:{}", app.tr("ui.3d_mouse_calibrate")),+ &format!("dialog:button:Calibration:{}", app.tr("ui.3d_mouse_forget")),response.rect,);- if response.clicked() {- crate::space_mouse_calibration::start(app);+ if response.clicked()+ && let Some(device) = &device+ {+ app.preferences.space_mouse_calibrations.remove(device);}});});});},);- if saved {- ui.allocate_ui_with_layout(- egui::vec2(forget_width.min(available), t.control_height),- egui::Layout::top_down(egui::Align::Min),- |ui| {- ui_kit::settings_form(ui, 0.0, |ui| {- ui_kit::row(ui, app.tr("ui.3d_mouse_forget"), |ui| {- ui.add_enabled_ui(app.preferences.space_mouse_enabled, |ui| {- let response = ui_kit::button(ui, app.tr("ui.3d_mouse_forget"), ui_kit::Button::Normal);- crate::scenario::publish_target("prefs:space_mouse_forget", response.rect);- crate::scenario::publish_target(- &format!("dialog:button:Calibration:{}", app.tr("ui.3d_mouse_forget")),- response.rect,- );- if response.clicked()- && let Some(device) = &device- {- app.preferences.space_mouse_calibrations.remove(device);- }- });- });- });- },- );- }- },- );- });+ }+ },+ );+ });crate::scenario::publish_rect("prefs:space_mouse_device_card", card.response.rect);- setting::space_mouse_enabled(app, ui).on_hover_text(crate::i18n::tr("ui.3d_mouse_hint"));- setting::space_mouse_in_view(app, ui).on_hover_text(crate::i18n::tr("ui.3d_mouse_show_in_view_tip"));+ setting::space_mouse_enabled(app, ui).backing_on_hover_text(crate::i18n::tr("ui.3d_mouse_hint"));+ setting::space_mouse_in_view(app, ui).backing_on_hover_text(crate::i18n::tr("ui.3d_mouse_show_in_view_tip"));let names = [(SpaceMouseGhost::LeftViewport, app.tr("ui.3d_mouse_ghost_left_viewport").to_owned()),(SpaceMouseGhost::RightViewport, app.tr("ui.3d_mouse_ghost_right_viewport").to_owned()),@@ -192,7 +191,7 @@ fn orbit(app: &mut SolveApp, ui: &mut egui::Ui) {});});ui.add_enabled_ui(app.preferences.space_mouse_enabled, |ui| {- setting::space_mouse_sketch_orbit(app, ui).on_hover_text(crate::i18n::tr("ui.3d_mouse_sketch_orbit_tip"));+ setting::space_mouse_sketch_orbit(app, ui).backing_on_hover_text(crate::i18n::tr("ui.3d_mouse_sketch_orbit_tip"));});});}@@ -264,7 +263,7 @@ fn axes(app: &mut SolveApp, ui: &mut egui::Ui) {}}})- .on_hover_text(if *off { &off_tip } else { &driven_by });+ .backing_on_hover_text(if *off { &off_tip } else { &driven_by });if chosen != current {crate::space_mouse::reassign(source, axis, chosen);}@@ -342,7 +341,7 @@ fn advanced(app: &mut SolveApp, ui: &mut egui::Ui) {0.0..=solidcraft_space_mouse::MAX_DEAD_ZONE_SHARE,ui_kit::Slider { step: Some(0.01), format: |v| format!("{:.0} %", v * 100.0), ..Default::default() },)- .on_hover_text(tip);+ .backing_on_hover_text(tip);});});}diff --git a/crates/ui-egui/src/prefs/navbar.rs b/crates/ui-egui/src/prefs/navbar.rsindex da4e3c05fd..80d0d46bd2 100644--- a/crates/ui-egui/src/prefs/navbar.rs+++ b/crates/ui-egui/src/prefs/navbar.rs@@ -2,6 +2,7 @@use crate::navigation::NavCaps;use crate::navigation_bar::{self, Edge, Idle, Kind, Labels, MenuDisplay, NavigationBar, Position, Size, SlotOptions};use crate::navigation_bar_view;+use crate::ui_kit::BackingTooltipExt as _;use crate::{SolveApp, scenario, theme::Tokens, ui_kit};use egui::{Rect, Sense, vec2};use serde_json::json;@@ -363,7 +364,7 @@ fn inspector_header(app: &mut SolveApp, ui: &mut egui::Ui, state: &mut State, in}ui_kit::text(ui, app.tr(slot.label), ui_kit::Text::NameCell(true));});- ui.interact(name, ui.make_persistent_id("slot_help"), Sense::hover()).on_hover_text(app.tr(slot.description));+ ui.interact(name, ui.make_persistent_id("slot_help"), Sense::hover()).backing_on_hover_text(app.tr(slot.description));scenario::publish_rect("prefs:navbar:inspector:name", name);scenario::publish_rect("prefs:navbar:inspector:header", bounds);let mut actions_ui = ui.new_child(egui::UiBuilder::new().id_salt("slot_actions").max_rect(bounds));@@ -391,7 +392,7 @@ fn inspector_header(app: &mut SolveApp, ui: &mut egui::Ui, state: &mut State, in.inner}).inner- .on_hover_text(label);+ .backing_on_hover_text(label);response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Button, enabled && ui.is_enabled(), label));scenario::publish_target(&format!("prefs:navbar:{key}"), response.rect);if response.clicked() {@@ -414,7 +415,7 @@ fn available(app: &mut SolveApp, ui: &mut egui::Ui, state: &mut State) {let dragging =egui::DragAndDrop::payload::<Drag>(ui.ctx()).is_some_and(|payload| payload.from_menu && payload.id.slot == slot.id);let (tile, add) = ui_kit::navigation_separator_source(ui, slot.id, app.tr(slot.label), dragging);- let tile = tile.on_hover_text(hint);+ let tile = tile.backing_on_hover_text(hint);scenario::publish_target(&format!("prefs:navbar:tile:{}", slot.id), tile.rect);scenario::publish_target(&format!("prefs:navbar:add:{}", slot.id), add.rect);if tile.drag_started() {@@ -441,7 +442,7 @@ fn available(app: &mut SolveApp, ui: &mut egui::Ui, state: &mut State) {}let dragging = egui::DragAndDrop::payload::<Drag>(ui.ctx()).is_some_and(|payload| payload.from_menu && payload.id.slot == slot.id);let (tile, add) = ui_kit::navigation_tile(ui, slot.id, app.tr(slot.label), slot.current_icon(app.ui.visual_style), dragging);- let tile = tile.on_hover_text(&caption);+ let tile = tile.backing_on_hover_text(&caption);scenario::publish_target(&format!("prefs:navbar:tile:{}", slot.id), tile.rect);scenario::publish_target(&format!("prefs:navbar:add:{}", slot.id), add.rect);if tile.drag_started() {diff --git a/crates/ui-egui/src/prefs/navigation.rs b/crates/ui-egui/src/prefs/navigation.rsindex 5af506a9ad..7be5fa75da 100644--- a/crates/ui-egui/src/prefs/navigation.rs+++ b/crates/ui-egui/src/prefs/navigation.rs@@ -92,7 +92,7 @@ fn mouse(app: &mut SolveApp, ui: &mut egui::Ui, t: &Tokens) {let response = ui_kit::dropdown_menu(ui, "pref_nav", nav_preset(&app.preferences.nav).translated_label(), |ui| {for preset in NAV_PRESETS {if ui_kit::list_picker(ui, preset.id, preset.translated_label(), app.preferences.nav == preset.id)- .on_hover_text(preset.translated_help())+ .backing_on_hover_text(preset.translated_help()).clicked(){choose_nav_preset(&mut app.preferences, preset);@@ -101,16 +101,16 @@ fn mouse(app: &mut SolveApp, ui: &mut egui::Ui, t: &Tokens) {});crate::scenario::publish_target("dialog:Pan, zoom, orbit", response.rect);crate::scenario::publish_target("prefs:nav", response.rect);- response.on_hover_text(nav_preset(&app.preferences.nav).translated_help());+ response.backing_on_hover_text(nav_preset(&app.preferences.nav).translated_help());});});});});if nav_preset(&app.preferences.nav).bindings.iter().any(|b| b.button == NavButton::Right && b.mode == NavMode::Orbit) {- let response = setting::right_drag_orbits(app, ui).on_hover_text(crate::i18n::tr("nav.right_drag_orbits.help"));+ let response = setting::right_drag_orbits(app, ui).backing_on_hover_text(crate::i18n::tr("nav.right_drag_orbits.help"));crate::scenario::publish_target("prefs:right_drag_orbits", response.rect);}- setting::radial_context_menu(app, ui).on_hover_text(crate::i18n::tr("prefs.navigation.radial_help"));+ setting::radial_context_menu(app, ui).backing_on_hover_text(crate::i18n::tr("prefs.navigation.radial_help"));let label = app.tr("Middle double-click");let width = ui_kit::ContentWidth::label(ui, label);ui_kit::settings_form(ui, width, |ui| {@@ -125,7 +125,7 @@ fn mouse(app: &mut SolveApp, ui: &mut egui::Ui, t: &Tokens) {}});crate::scenario::publish_target("prefs:middle_double_click", response.rect);- response.on_hover_text(crate::i18n::tr_label("Double-clicking the middle button in the view: Home (the home view, framing what is shown), Fit (frame what is shown, keeping the orientation) or nothing"));+ response.backing_on_hover_text(crate::i18n::tr_label("Double-clicking the middle button in the view: Home (the home view, framing what is shown), Fit (frame what is shown, keeping the orientation) or nothing"));});});});@@ -197,7 +197,7 @@ fn orbit(app: &mut SolveApp, ui: &mut egui::Ui, t: &Tokens) {});});ui.add_enabled_ui(app.preferences.free_orbit, |ui| {- let response = setting::free_orbit_upright(app, ui).on_hover_text(crate::i18n::tr("nav.free_orbit_upright.help"));+ let response = setting::free_orbit_upright(app, ui).backing_on_hover_text(crate::i18n::tr("nav.free_orbit_upright.help"));crate::scenario::publish_target("prefs:free_orbit_upright", response.rect);});});@@ -227,12 +227,14 @@ fn wheel(app: &mut SolveApp, ui: &mut egui::Ui, t: &Tokens) {setting::smooth_wheel_zoom(app, ui);let touchpad = app.preferences.nav == TOUCHPAD_NAV;ui.add_enabled_ui(!touchpad, |ui| {- let response = ui_kit::checkbox(ui, crate::i18n::tr("ui.two_finger_scroll_pans"), &mut app.preferences.trackpad_pan)- .on_hover_text(if touchpad { crate::i18n::tr("nav.touchpad.scroll") } else { crate::i18n::tr("ui.trackpad_pan_tip") });+ let response =+ ui_kit::checkbox(ui, crate::i18n::tr("ui.two_finger_scroll_pans"), &mut app.preferences.trackpad_pan).backing_on_hover_text(+ if touchpad { crate::i18n::tr("nav.touchpad.scroll") } else { crate::i18n::tr("ui.trackpad_pan_tip") },+ );crate::scenario::publish_target("prefs:trackpad_pan", response.rect);});setting::orbit_reverse(app, ui);- let response = setting::zoom_stop_at_model(app, ui).on_hover_text(crate::i18n::tr("prefs.zoom_stop_at_model_tip"));+ let response = setting::zoom_stop_at_model(app, ui).backing_on_hover_text(crate::i18n::tr("prefs.zoom_stop_at_model_tip"));crate::scenario::publish_target("prefs:zoom_stop_at_model", response.rect);});});@@ -260,7 +262,7 @@ fn wheel(app: &mut SolveApp, ui: &mut egui::Ui, t: &Tokens) {}}})- .on_hover_text(crate::i18n::tr("prefs.trackpad_zoom_modifier.help"));+ .backing_on_hover_text(crate::i18n::tr("prefs.trackpad_zoom_modifier.help"));crate::scenario::publish_target("prefs:trackpad_zoom_modifier", response.rect);});});@@ -302,17 +304,17 @@ fn view(app: &mut SolveApp, ui: &mut egui::Ui, t: &Tokens) {ui_kit::Slider { step: Some(0.05), format: |v| format!("{:.0} %", v * 100.0), ..Default::default() },);crate::scenario::publish_rect("prefs:home_fit_size", response.rect);- response.on_hover_text(note);+ response.backing_on_hover_text(note);});});let (label, note) = (app.tr("prefs.navigator_fit").to_owned(), app.tr("prefs.navigator_fit_note").to_owned());- let response = ui_kit::checkbox(ui, &label, &mut app.preferences.navigator_fit).on_hover_text(note);+ let response = ui_kit::checkbox(ui, &label, &mut app.preferences.navigator_fit).backing_on_hover_text(note);crate::scenario::publish_target("prefs:navigator_fit", response.rect);let (label, note) = (app.tr("prefs.invert_navigator_arrows").to_owned(), app.tr("prefs.invert_navigator_arrows_note").to_owned());- let response = ui_kit::checkbox(ui, &label, &mut app.preferences.invert_navigator_arrows).on_hover_text(note);+ let response = ui_kit::checkbox(ui, &label, &mut app.preferences.invert_navigator_arrows).backing_on_hover_text(note);crate::scenario::publish_target("prefs:invert_navigator_arrows", response.rect);let (label, note) = (app.tr("prefs.invert_curved_roll_arrows").to_owned(), app.tr("prefs.invert_curved_roll_arrows_note").to_owned());- let response = ui_kit::checkbox(ui, &label, &mut app.preferences.invert_curved_roll_arrows).on_hover_text(note);+ let response = ui_kit::checkbox(ui, &label, &mut app.preferences.invert_curved_roll_arrows).backing_on_hover_text(note);crate::scenario::publish_target("prefs:invert_curved_roll_arrows", response.rect);});}diff --git a/crates/ui-egui/src/prefs/sketch.rs b/crates/ui-egui/src/prefs/sketch.rsindex 13a802d2f2..ede212693c 100644--- a/crates/ui-egui/src/prefs/sketch.rs+++ b/crates/ui-egui/src/prefs/sketch.rs@@ -74,7 +74,7 @@ fn snapping(app: &mut SolveApp, ui: &mut egui::Ui) {}}})- .on_hover_text(crate::i18n::tr("prefs.snap_drawing_note"));+ .backing_on_hover_text(crate::i18n::tr("prefs.snap_drawing_note"));crate::scenario::publish_target("prefs:suppress_sketch_snap", response.rect);});});@@ -232,7 +232,7 @@ fn opening(app: &mut SolveApp, ui: &mut egui::Ui) {},width,)- .on_hover_text(app.tr("prefs.sketch_exit_view_note"));+ .backing_on_hover_text(app.tr("prefs.sketch_exit_view_note"));crate::scenario::publish_target(&format!("prefs:sketch_exit_view:{key}"), response.rect);crate::scenario::publish_target(&format!("dialog:list:{}", choice.label_id()), response.rect);if app.preferences.sketch_exit_view == choice {@@ -307,7 +307,7 @@ fn marks(app: &mut SolveApp, ui: &mut egui::Ui) {},width,)- .on_hover_text(crate::i18n::tr(help));+ .backing_on_hover_text(crate::i18n::tr(help));targets(key, &response);if response.clicked() {*value = !*value;@@ -451,7 +451,7 @@ fn check(ui: &mut egui::Ui, key: &str, label: &str, help: Option<&str>, value: &if show_help && response.rect.is_positive() {ui_kit::help_icon(ui, help);}- response.on_hover_text(help)+ response.backing_on_hover_text(help)} else {response}diff --git a/crates/ui-egui/src/prefs/tools.rs b/crates/ui-egui/src/prefs/tools.rsindex 90fa51c48b..75269a1e7c 100644--- a/crates/ui-egui/src/prefs/tools.rs+++ b/crates/ui-egui/src/prefs/tools.rs@@ -18,7 +18,7 @@ pub(super) fn show(app: &mut SolveApp, ui: &mut egui::Ui) {(setting::hole_moves, "prefs.design_tools.hole_moves_help", "hole_moves", "Move holes by clicking or dragging"),] {ui.horizontal_wrapped(|ui| {- let response = setting(app, ui).on_hover_text(app.tr(help));+ let response = setting(app, ui).backing_on_hover_text(app.tr(help));crate::scenario::publish_target(&format!("prefs:{key}"), response.rect);crate::scenario::publish_target(&format!("dialog:{legacy}"), response.rect);if !crate::prefs_search::suppress_chrome(ui) {@@ -37,7 +37,7 @@ pub(super) fn show(app: &mut SolveApp, ui: &mut egui::Ui) {(setting::auto_operation, "prefs.auto_operation_note", "auto_operation"),] {ui.horizontal_wrapped(|ui| {- let response = setting(app, ui).on_hover_text(app.tr(help));+ let response = setting(app, ui).backing_on_hover_text(app.tr(help));crate::scenario::publish_target(&format!("prefs:{key}"), response.rect);if !crate::prefs_search::suppress_chrome(ui) {ui_kit::help_icon(ui, app.tr(help));@@ -55,7 +55,7 @@ pub(super) fn show(app: &mut SolveApp, ui: &mut egui::Ui) {});create_row(ui, app.tr("prefs.design_tools.placement_group"), &["rest", "boss", "snap_fit"], false, |ui| {ui.horizontal_wrapped(|ui| {- let response = setting::placement_handles(app, ui).on_hover_text(app.tr("ui.placement_handles_tip"));+ let response = setting::placement_handles(app, ui).backing_on_hover_text(app.tr("ui.placement_handles_tip"));crate::scenario::publish_target("prefs:placement_handles", response.rect);if !crate::prefs_search::suppress_chrome(ui) {ui_kit::help_icon(ui, app.tr("ui.placement_handles_tip"));@@ -67,7 +67,7 @@ pub(super) fn show(app: &mut SolveApp, ui: &mut egui::Ui) {ui_kit::settings_section(ui, "joint_move", app.tr("joint_move.settings"), |ui| {tool_group(ui, "", ui_kit::paint_assembly_move, |ui| {ui.horizontal_wrapped(|ui| {- let response = setting::assembly_move_handles(app, ui).on_hover_text(app.tr("joint_move.legacy_hint"));+ let response = setting::assembly_move_handles(app, ui).backing_on_hover_text(app.tr("joint_move.legacy_hint"));crate::scenario::publish_target("prefs:assembly_move_handles", response.rect);crate::scenario::publish_target("dialog:Use joint motion handles for assembly Move", response.rect);if !crate::prefs_search::suppress_chrome(ui) {@@ -137,7 +137,7 @@ pub(super) fn show(app: &mut SolveApp, ui: &mut egui::Ui) {}}if key == "direct_interaction" {- response.on_hover_text(app.tr_label("Work on the model directly in the viewport. Press a flat face or a profile and pull: up extrudes, down into a body cuts, and sideways movement sets the step size"));+ response.backing_on_hover_text(app.tr_label("Work on the model directly in the viewport. Press a flat face or a profile and pull: up extrudes, down into a body cuts, and sideways movement sets the step size"));}}});@@ -187,8 +187,9 @@ fn create_card(ui: &mut egui::Ui, rows: impl FnOnce(&mut egui::Ui)) {rows(ui);return;}- egui::Frame::NONE.fill(t.control_fill).stroke(egui::Stroke::new(1.0, t.dialog_border)).corner_radius(f32::from(t.radius_lg) + t.space_2).show(+ ui_kit::Container::show_backing(ui,+ egui::Frame::NONE.fill(t.control_fill).stroke(egui::Stroke::new(1.0, t.dialog_border)).corner_radius(f32::from(t.radius_lg) + t.space_2),|ui| {ui.spacing_mut().item_spacing.y = 0.0;ui.set_width(ui.available_width());diff --git a/crates/ui-egui/src/quick_measure.rs b/crates/ui-egui/src/quick_measure.rsindex 0a439085a4..a212c0030b 100644--- a/crates/ui-egui/src/quick_measure.rs+++ b/crates/ui-egui/src/quick_measure.rs@@ -6,6 +6,7 @@//! the selection or the design changes; nothing shows while it computes, or for a selection with//! nothing to measure. A click copies the readout.+use crate::ui_kit::BackingTooltipExt as _;use serde_json::{Value, json};use solidcraft_engine::Sel;@@ -239,7 +240,8 @@ pub(crate) fn show(app: &mut SolveApp, ui: &egui::Ui, view: egui::Rect, taken: &if !view.contains_rect(r) {return None;}- let response = ui.interact(r, egui::Id::new("sc_quick_measure"), egui::Sense::click()).on_hover_text(crate::i18n::tr("measure.quick_copy"));+ let response =+ ui.interact(r, egui::Id::new("sc_quick_measure"), egui::Sense::click()).backing_on_hover_text(crate::i18n::tr("measure.quick_copy"));crate::scenario::publish_rect("measure:quick", r);painter.rect_filled(r, t.radius_sm, if response.hovered() { t.hover } else { t.overlay });painter.rect_stroke(r, t.radius_sm, egui::Stroke::new(1.0, t.border), egui::StrokeKind::Inside);diff --git a/crates/ui-egui/src/render_ui/appearance.rs b/crates/ui-egui/src/render_ui/appearance.rsindex c004069f3e..a199c51017 100644--- a/crates/ui-egui/src/render_ui/appearance.rs+++ b/crates/ui-egui/src/render_ui/appearance.rs@@ -1,4 +1,5 @@//! Selection-following appearance editor. All mutations use the appearance registry.+use crate::ui_kit::BackingTooltipExt as _;use crate::{SolveApp, dialogs_appearance, ui_kit};use serde_json::{Value, json};use solidcraft_engine::{@@ -269,7 +270,7 @@ pub(in crate::render_workspace) fn footer(app: &mut SolveApp, ui: &mut egui::Ui)ui.horizontal(|ui| {let enabled = !app.session.selection.is_empty();if ui_kit::icon_label_action(ui, app.tr("render.inspector_save_library"), Some("plus"), enabled, false)- .on_hover_text(app.tr_label("Export design library..."))+ .backing_on_hover_text(app.tr_label("Export design library...")).clicked(){app.start("library.export");diff --git a/crates/ui-egui/src/render_ui/inspector.rs b/crates/ui-egui/src/render_ui/inspector.rsindex 52e1932703..e4f3f95482 100644--- a/crates/ui-egui/src/render_ui/inspector.rs+++ b/crates/ui-egui/src/render_ui/inspector.rs@@ -1,5 +1,6 @@//! One floating editor for the selected Render item.use super::{RenderSelection, environment, inspector, library, light, setups, shot, wear};+use crate::ui_kit::BackingTooltipExt as _;use crate::{SolveApp, ui_kit};use inspector::selection_appearance;use serde_json::json;@@ -130,7 +131,7 @@ pub(super) fn output_actions(app: &mut SolveApp, ui: &mut egui::Ui) {] {let ready = super::ribbon::action_ready(app, id);let response = ui_kit::icon_label_action(ui, &label, Some("play"), ready.is_ok(), id == "render.start");- let response = if let Err(reason) = ready { response.on_disabled_hover_text(reason) } else { response };+ let response = if let Err(reason) = ready { response.backing_on_disabled_hover_text(reason) } else { response };crate::scenario::publish_target(target, response.rect);if response.clicked() {app.start(id);diff --git a/crates/ui-egui/src/render_ui/mod.rs b/crates/ui-egui/src/render_ui/mod.rsindex b3c2dd007d..c9ffadd321 100644--- a/crates/ui-egui/src/render_ui/mod.rs+++ b/crates/ui-egui/src/render_ui/mod.rs@@ -1,4 +1,5 @@//! Render shell composition; all hosting and chrome belong to the shared kit.+use crate::ui_kit::BackingTooltipExt as _;use crate::{SolveApp,theme::Tokens,@@ -105,7 +106,7 @@ fn stage_tools(app: &mut SolveApp, ui: &mut egui::Ui) {}});crate::scenario::publish_target("render:pick", pick.response.rect);- pick.response.on_hover_text(app.tr("render.pick_help"));+ pick.response.backing_on_hover_text(app.tr("render.pick_help"));ui_kit::StageBar::tool_gap(ui);for (id, label, icon) in[("appearance.paint", "render.paint_label", "appearance"), ("appearance.pick_up", "render.pick_up_label", "select")]@@ -116,18 +117,18 @@ fn stage_tools(app: &mut SolveApp, ui: &mut egui::Ui) {crate::scenario::publish_target(&format!("render:stage:{id}"), response.rect);let hint = crate::keymap::display_for(app, id).map_or_else(|| app.tr_label(command.label).to_string(), |key| format!("{} ({key})", app.tr_label(command.label)));- let response = response.on_hover_text(hint);+ let response = response.backing_on_hover_text(hint);if response.clicked() {app.start(id);}if let Some(reason) = info.disabled_reason {- response.on_disabled_hover_text(reason);+ response.backing_on_disabled_hover_text(reason);}}}crate::render_workspace::assign::banner(app, ui);ui_kit::StageBar::separator(ui);- let note = ui_kit::StageBar::note(ui, app.tr("render.stage_preview_note")).on_hover_text(app.tr("render.preview_lighting_help"));+ let note = ui_kit::StageBar::note(ui, app.tr("render.stage_preview_note")).backing_on_hover_text(app.tr("render.preview_lighting_help"));crate::scenario::publish_rect("render:preview_note", note.rect);if ui_kit::StageBar::icon_action(ui, "settings", app.tr("render.preview_image_settings_help")).clicked() {app.start("render.settings.get");@@ -145,7 +146,7 @@ fn stage_tools(app: &mut SolveApp, ui: &mut egui::Ui) {);}).response- .on_disabled_hover_text(app.tr("render.light_anchor_pending"));+ .backing_on_disabled_hover_text(app.tr("render.light_anchor_pending"));ui_kit::text(ui, app.tr("render.light_anchor_pending"), ui_kit::Text::Inline);}Stage::Frame => {@@ -167,7 +168,7 @@ fn stage_tools(app: &mut SolveApp, ui: &mut egui::Ui) {app.start(command.id);}if let Some(reason) = info.disabled_reason {- response.on_disabled_hover_text(reason);+ response.backing_on_disabled_hover_text(reason);}}}@@ -246,7 +247,8 @@ fn shots_pill(app: &mut SolveApp, ui: &mut egui::Ui, free: Rect) {free.left_bottom() + vec2(Tokens::get().space_8, -Tokens::get().space_8),egui::Align2::LEFT_BOTTOM,|ui| {- let response = ui_kit::strip_toggle(ui, false, crate::i18n::tr_label("Shots")).on_hover_text(crate::i18n::tr_label("Show Shots strip"));+ let response =+ ui_kit::strip_toggle(ui, false, crate::i18n::tr_label("Shots")).backing_on_hover_text(crate::i18n::tr_label("Show Shots strip"));crate::scenario::publish_target("render:shots:show", response.rect);if response.clicked() {let _ = app.run("view.shots_strip", serde_json::json!({"visible":true}));diff --git a/crates/ui-egui/src/render_workspace.rs b/crates/ui-egui/src/render_workspace.rsindex f040f30aa7..fe123f38c9 100644--- a/crates/ui-egui/src/render_workspace.rs+++ b/crates/ui-egui/src/render_workspace.rs@@ -1,5 +1,6 @@//! Integrated product preview. Shares the installed device/pipelines, not Design's scene policy.+use crate::ui_kit::BackingTooltipExt as _;use solidcraft_engine::geom::prelude::*;use std::hash::{Hash, Hasher};use std::sync::{Arc, Mutex};@@ -963,7 +964,7 @@ fn method_dropdown(app: &mut SolveApp, ui: &mut egui::Ui) -> egui::Response {ui.close();}if let Err(reason) = capability {- response.on_hover_text(reason);+ response.backing_on_hover_text(reason);}}});@@ -1034,7 +1035,7 @@ fn image_method_controls(app: &mut SolveApp, ui: &mut egui::Ui) {cpu_lighting_controls(app, ui);ui.label(app.tr("render.image_exposure"));let exposure_help = app.tr("render.cpu_exposure_help").to_string();- crate::ui_kit::number_field(ui, &mut app.render_workspace.view.draft.exposure_ev, -32.0..=32.0, 0.1, " EV").on_hover_text(exposure_help);+ crate::ui_kit::number_field(ui, &mut app.render_workspace.view.draft.exposure_ev, -32.0..=32.0, 0.1, " EV").backing_on_hover_text(exposure_help);cpu::controls(app, ui);}@@ -1053,7 +1054,7 @@ fn image_edit_controls(app: &mut SolveApp, ui: &mut egui::Ui) {let _ = app.run("render.result.view", json!({"view":"fit"}));}if crate::ui_kit::button(ui, crate::i18n::tr("render.result_actual_size"), crate::ui_kit::Button::Enabled(!reduced_display(app)))- .on_hover_text(app.tr("render.result_actual_help"))+ .backing_on_hover_text(app.tr("render.result_actual_help")).clicked(){let _ = app.run("render.result.view", json!({"view":"actual"}));@@ -1213,7 +1214,7 @@ fn job_controls(app: &mut SolveApp, ui: &mut egui::Ui, compact: bool) {let response = ui.add_sized([ui.available_width(), ui.text_style_height(&egui::TextStyle::Body)], egui::Label::new(message).truncate());crate::scenario::publish_target("render:job-summary", response.rect);if let Err(error) = ¶ms {- response.on_hover_text(error);+ response.backing_on_hover_text(error);}if let Some(status) = &state {if !compact {@@ -1272,7 +1273,7 @@ fn completed_image(app: &mut SolveApp, ui: &mut egui::Ui) {Ok(texture) => {if ui.add(egui::Image::new(texture).max_size(egui::vec2(ui.available_width(), 240.0)).shrink_to_fit().sense(Sense::click()))- .on_hover_text(app.tr("render.result_open"))+ .backing_on_hover_text(app.tr("render.result_open")).clicked(){let _ = app.run("render.result.view", json!({"view":"image"}));diff --git a/crates/ui-egui/src/render_workspace_environment.rs b/crates/ui-egui/src/render_workspace_environment.rsindex 141ae7a976..b1cbc28045 100644--- a/crates/ui-egui/src/render_workspace_environment.rs+++ b/crates/ui-egui/src/render_workspace_environment.rs@@ -1,5 +1,6 @@//! Standalone Environment inspector body. Drawing and source browsing never save a setup.use super::{ImageMethod, Stage, cpu, hdr, setups, studio};+use crate::ui_kit::BackingTooltipExt as _;use crate::{SolveApp, theme::Tokens, ui_kit};use serde_json::{Value, json};use solidcraft_engine::doc::render_settings::{RenderJob, RenderSetup};@@ -206,7 +207,7 @@ pub(super) fn ring_overlay(app: &mut SolveApp, ui: &mut egui::Ui, viewport: eguiegui::Id::new("render_environment_rotation"),ring.center + egui::vec2(0.0, ring.radius - t.control_height - t.space_8),egui::Align2::CENTER_BOTTOM,- |ui| ui_kit::text(ui, &format!("{angle:.0}°"), ui_kit::Text::Inline).on_hover_text(app.tr("render.env_ring_help")),+ |ui| ui_kit::text(ui, &format!("{angle:.0}°"), ui_kit::Text::Inline).backing_on_hover_text(app.tr("render.env_ring_help")),);crate::scenario::publish_target("render:environment:ring-degrees", chip.response.rect);}diff --git a/crates/ui-egui/src/render_workspace_library.rs b/crates/ui-egui/src/render_workspace_library.rsindex 6d6bf08a8f..16c158df66 100644--- a/crates/ui-egui/src/render_workspace_library.rs+++ b/crates/ui-egui/src/render_workspace_library.rs@@ -4,6 +4,7 @@pub(super) mod review;use super::{ImageMethod, materials, setups};+use crate::ui_kit::BackingTooltipExt as _;use crate::{SolveApp, theme::Tokens, ui_kit};use serde_json::{Value, json};use solidcore_record::Vec3;@@ -1147,7 +1148,7 @@ fn browse_contents(app: &mut SolveApp, ui: &mut egui::Ui, stage_card: bool) {None,);crate::scenario::publish_target(identities.get(index).map(String::as_str).unwrap_or("render:library:item"), r.rect);- if r.on_hover_text(tip).clicked() {+ if r.backing_on_hover_text(tip).clicked() {selected = Some(index);}}diff --git a/crates/ui-egui/src/render_workspace_light.rs b/crates/ui-egui/src/render_workspace_light.rsindex 1d73c79730..1c8ef8eaeb 100644--- a/crates/ui-egui/src/render_workspace_light.rs+++ b/crates/ui-egui/src/render_workspace_light.rs@@ -1,5 +1,6 @@//! Selected-light editor and transient visibility. Saved settings are edited only by commands.use super::{ImageMethod, RenderSelection, cpu, setups, studio};+use crate::ui_kit::BackingTooltipExt as _;use crate::{SolveApp, ui_kit};use serde_json::{Value, json};use solidcraft_engine::doc::render_settings::{CpuJob, GpuJob, RenderJob, RenderSetup, SkyEnvironment};@@ -521,7 +522,7 @@ pub(super) fn add_menu(app: &mut SolveApp, ui: &mut egui::Ui) {let enabled = count < cap && !(gpu && kind == "point");let response = ui.add_enabled_ui(enabled, |ui| ui_kit::list_picker(ui, kind, app.tr(key), false)).inner;if response- .on_hover_text(app.tr(if gpu && kind == "point" { "render.light_gpu_punctual" } else { "render.lighting_budget_help" }))+ .backing_on_hover_text(app.tr(if gpu && kind == "point" { "render.light_gpu_punctual" } else { "render.lighting_budget_help" })).clicked(){dispatch(app, "render.lights.add", None, Some(json!({"kind":kind})));@@ -798,7 +799,7 @@ pub(super) fn editor(app: &mut SolveApp, ui: &mut egui::Ui, id: &str) {});let response = ui_kit::button(ui, app.tr("render.light_place_highlight"), ui_kit::Button::Enabled(false));crate::scenario::publish_target("render:light:place-highlight", response.rect);- response.on_hover_text(app.tr("render.light_place_pending"));+ response.backing_on_hover_text(app.tr("render.light_place_pending"));note(app, ui, "render.light_place_pending");if sun {note(app, ui, "render.lighting_direction_help");@@ -905,7 +906,7 @@ pub(super) fn editor(app: &mut SolveApp, ui: &mut egui::Ui, id: &str) {).count();if ui_kit::button(ui, app.tr("render.light_duplicate"), ui_kit::Button::Enabled(!blocked && count < cap))- .on_hover_text(app.tr("render.lighting_budget_help"))+ .backing_on_hover_text(app.tr("render.lighting_budget_help")).clicked(){dispatch(app, "render.lights.duplicate", Some(id), None);diff --git a/crates/ui-egui/src/render_workspace_output.rs b/crates/ui-egui/src/render_workspace_output.rsindex cc68203275..8c8c834330 100644--- a/crates/ui-egui/src/render_workspace_output.rs+++ b/crates/ui-egui/src/render_workspace_output.rs@@ -1,6 +1,7 @@//! Output, sampling, checks and shared Render editor adapters.//! Unsupported backend capabilities remain visible with a reason.use super::{ImageMethod, cpu, library, materials, setups, studio};+use crate::ui_kit::BackingTooltipExt as _;use crate::{SolveApp, ui_kit};use serde_json::{Value, json};use solidcraft_engine::doc::Document;@@ -285,7 +286,7 @@ pub(super) fn scene_controls(app: &mut SolveApp, ui: &mut egui::Ui) {let response = ui_kit::icon_label_action(ui, app.tr(label), None, ready.is_ok(), primary);crate::scenario::publish_target(&format!("render:scene:{id}"), response.rect);if let Err(reason) = ready {- response.clone().on_disabled_hover_text(reason);+ response.clone().backing_on_disabled_hover_text(reason);}if response.clicked()&& let Err(error) = super::ribbon::perform_job(app, command)@@ -494,7 +495,7 @@ fn output_controls(app: &mut SolveApp, ui: &mut egui::Ui) {(true, Some((w, h))) => size_limit_reason(app, u32::try_from(w).unwrap_or(u32::MAX), u32::try_from(h).unwrap_or(u32::MAX)),_ => app.tr("render.output_over_budget").to_string(),};- if response.on_disabled_hover_text(reason).clicked()+ if response.backing_on_disabled_hover_text(reason).clicked()&& let Some((w, h)) = allowed&& let (Ok(w), Ok(h)) = (u32::try_from(w), u32::try_from(h))&& let Err(error) = apply_size(app, w, h, false)@@ -560,7 +561,7 @@ fn destination_controls(app: &mut SolveApp, ui: &mut egui::Ui) {app.start(id);}if let Err(reason) = ready {- button.on_disabled_hover_text(reason);+ button.backing_on_disabled_hover_text(reason);}}});@@ -593,10 +594,10 @@ fn render_controls(app: &mut SolveApp, ui: &mut egui::Ui) {app.start("render.start");}if let Err(reason) = ready {- button.on_disabled_hover_text(reason);+ button.backing_on_disabled_hover_text(reason);}ui_kit::button(ui, app.tr("render.children.all_shots"), ui_kit::Button::Enabled(false))- .on_disabled_hover_text(app.tr("render.queue_pending"));+ .backing_on_disabled_hover_text(app.tr("render.queue_pending"));});ui_kit::text(ui, app.tr("render.queue_pending"), ui_kit::Text::Note("render.queue_pending"));if ui_kit::button(ui, app.tr("render.output_view_image"), ui_kit::Button::Enabled(app.render_workspace.view.completed.is_some())).clicked() {@@ -679,7 +680,7 @@ fn check_controls(app: &mut SolveApp, ui: &mut egui::Ui) {app.start("render.preflight");}if let Err(reason) = ready {- check.on_disabled_hover_text(reason);+ check.backing_on_disabled_hover_text(reason);}output_check(app, ui);let report = check_report(app);@@ -941,7 +942,7 @@ pub(super) fn size_presets(app: &mut SolveApp, ui: &mut egui::Ui) {}).inner;let reason = size.map_or_else(String::new, |(w, h)| size_limit_reason(app, w, h));- if response.on_disabled_hover_text(reason).clicked() {+ if response.backing_on_disabled_hover_text(reason).clicked() {choose_size(app, size);}}@@ -958,7 +959,7 @@ pub(super) fn stage_tools(app: &mut SolveApp, ui: &mut egui::Ui) {let response = ui.add_enabled_ui(enabled, |ui| ui_kit::list_picker(ui, key, mark.as_deref().unwrap_or(app.tr(label)), false)).inner;crate::scenario::publish_target(&format!("render:stage:size:{key}"), response.rect);let reason = size.map_or_else(String::new, |(w, h)| size_limit_reason(app, w, h));- if response.on_disabled_hover_text(reason).clicked() {+ if response.backing_on_disabled_hover_text(reason).clicked() {choose_size(app, size);ui.close();}@@ -968,7 +969,7 @@ pub(super) fn stage_tools(app: &mut SolveApp, ui: &mut egui::Ui) {studio::format_choices(app, ui);quality_choices(app, ui);let summary = check_summary(app);- let response = ui_kit::button(ui, &summary, ui_kit::Button::Normal).on_hover_text(app.tr("render.output_check_help"));+ let response = ui_kit::button(ui, &summary, ui_kit::Button::Normal).backing_on_hover_text(app.tr("render.output_check_help"));crate::scenario::publish_target("render:stage:check", response.rect);if response.clicked() {let _ = app.run("view.render_select", json!({"kind":"check"}));diff --git a/crates/ui-egui/src/render_workspace_shots.rs b/crates/ui-egui/src/render_workspace_shots.rsindex e42de977ba..b115b3c86a 100644--- a/crates/ui-egui/src/render_workspace_shots.rs+++ b/crates/ui-egui/src/render_workspace_shots.rs@@ -1,4 +1,5 @@//! Shot strip adapters. Commands own saved intent; the kit owns every control and layout.+use crate::ui_kit::BackingTooltipExt as _;use crate::{SolveApp, ui_kit};use serde_json::json;use solidcraft_engine::{doc::render_settings::RenderSettings, render::job::Phase};@@ -51,7 +52,7 @@ pub(crate) fn contents(app: &mut SolveApp, ui: &mut egui::Ui) {let response = ui_kit::completion_text(ui, &queue_label, false);crate::scenario::publish_rect("render:shots:queue", response.rect);let response = ui_kit::icon_label_action(ui, app.tr("cmd.render_start"), Some("play"), ready.is_ok(), true);- let response = if let Err(reason) = &ready { response.on_disabled_hover_text(reason) } else { response };+ let response = if let Err(reason) = &ready { response.backing_on_disabled_hover_text(reason) } else { response };crate::scenario::publish_target("render:shots:render", response.rect);start = response.clicked();let response = ui_kit::compact_dropdown_menu(ui, "render_shots_size", &size_label, |ui| {@@ -61,7 +62,7 @@ pub(crate) fn contents(app: &mut SolveApp, ui: &mut egui::Ui) {let mut response =ui_kit::list_picker(ui, label, mark.as_deref().unwrap_or(&text), draft.width == width && draft.height == height);if mark.is_some() {- response = response.on_hover_text(super::inspector::size_limit_reason(app, width, height));+ response = response.backing_on_hover_text(super::inspector::size_limit_reason(app, width, height));}if response.clicked() {size = Some((width, height));diff --git a/crates/ui-egui/src/select_other.rs b/crates/ui-egui/src/select_other.rsindex 9a972bc384..4909aaf778 100644--- a/crates/ui-egui/src/select_other.rs+++ b/crates/ui-egui/src/select_other.rs@@ -21,6 +21,7 @@//!//! The control channel's `ui.selectOther` opens, describes and picks from the list.+use crate::ui_kit::BackingTooltipExt as _;use crate::ui_kit::{Container, Surface};use egui::{Align2, FontId, Pos2, Rect, Sense, pos2, vec2};use serde_json::{Value, json};@@ -684,7 +685,7 @@ pub fn show(app: &mut SolveApp, ctx: &egui::Context) {let elided = galley.elided;let at = pos2(text_rect.left(), r.center().y - galley.size().y / 2.0);ui.painter().with_clip_rect(ui.clip_rect().intersect(text_rect)).galley(at, galley, t.text);- let resp = if elided { resp.on_hover_text(&row.label) } else { resp };+ let resp = if elided { resp.backing_on_hover_text(&row.label) } else { resp };if resp.clicked() {picked = Some(i);}diff --git a/crates/ui-egui/src/settings_profiles.rs b/crates/ui-egui/src/settings_profiles.rsindex 14a31aa0c1..368c80f48d 100644--- a/crates/ui-egui/src/settings_profiles.rs+++ b/crates/ui-egui/src/settings_profiles.rs@@ -17,6 +17,7 @@use serde_json::{Map, Value, json};use solidcraft_engine::{MAX_PROFILE_NAME, profile_name};+use crate::ui_kit::BackingTooltipExt as _;use crate::{SolveApp, prefs, theme_files, ui_kit};/// The format tag of a profile document.@@ -616,8 +617,8 @@ pub(crate) fn section(app: &mut SolveApp, ui: &mut egui::Ui) {app.settings_profiles.draft = draft;let name = app.settings_profiles.draft.trim().to_string();let valid = profile_name(&name).is_some();- let save =- ui_kit::icon_label_action(ui, app.tr("prefs.general.save_new"), None, valid, true).on_hover_text(app.tr("prefs.profiles_note"));+ let save = ui_kit::icon_label_action(ui, app.tr("prefs.general.save_new"), None, valid, true)+ .backing_on_hover_text(app.tr("prefs.profiles_note"));crate::scenario::publish_target("prefs:profile:save", save.rect);if valid && (enter || save.clicked()) {act(app, "settings.profile.save", json!({ "name": name }), "prefs.profile_saved");@@ -787,6 +788,6 @@ pub(crate) fn tag(ui: &mut egui::Ui) {crate::i18n::tr("prefs.structure.in_profile"),ui_kit::SettingsChip { icon: Some("settings_profile"), compact: true, ..Default::default() },)- .on_hover_text(crate::i18n::tr("prefs.structure.profile_hover"));+ .backing_on_hover_text(crate::i18n::tr("prefs.structure.profile_hover"));crate::scenario::publish_target("prefs:in_profile", response.rect);}diff --git a/crates/ui-egui/src/sketch_attachment_ui.rs b/crates/ui-egui/src/sketch_attachment_ui.rsindex 316f70e33a..714e37066c 100644--- a/crates/ui-egui/src/sketch_attachment_ui.rs+++ b/crates/ui-egui/src/sketch_attachment_ui.rs@@ -1,5 +1,6 @@//! Reviewable sketch-plane rebinding. Saved lost planes are repair guides, never model geometry.+use crate::ui_kit::BackingTooltipExt as _;use egui::RichText;use serde_json::{Value, json};use solidcore_record::{Plane, Vec3};@@ -259,7 +260,7 @@ pub fn panel(app: &mut SolveApp, ctx: &egui::Context) {let text = if draft.candidate.is_some() { draft.label.as_str() } else { crate::i18n::tr("dialog.select") };let response = ui_kit::selection_field(ui, text, ui_kit::Selection { active: true, filled: draft.candidate.is_some() });if response- .on_hover_text(crate::i18n::tr_label(+ .backing_on_hover_text(crate::i18n::tr_label("Choose a new plane. Sketch geometry and dimensions stay unchanged in its two-dimensional coordinates.",)).clicked()diff --git a/crates/ui-egui/src/sketch_construction.rs b/crates/ui-egui/src/sketch_construction.rsindex d9715bab7e..7eccebb199 100644--- a/crates/ui-egui/src/sketch_construction.rs+++ b/crates/ui-egui/src/sketch_construction.rs@@ -74,7 +74,7 @@ pub fn line_type_switch(ui: &mut egui::Ui, t: &mut Tool) {.fixed_pos(length_box.left_bottom() + egui::vec2(0.0, tokens.space_2)).order(egui::Order::Background).show(ui.ctx(), |ui| {- frame.show(ui, |ui| {+ crate::ui_kit::Container::show_backing(ui, frame, |ui| {let segments = crate::ui_kit::Segments {disabled_reasons: if has_length { &[] } else { &refused },targets: &["construction_switch:construction", "construction_switch:normal"],diff --git a/crates/ui-egui/src/sketch_corner_ui_tests.rs b/crates/ui-egui/src/sketch_corner_ui_tests.rsindex bb80a21f76..4e30d253ed 100644--- a/crates/ui-egui/src/sketch_corner_ui_tests.rs+++ b/crates/ui-egui/src/sketch_corner_ui_tests.rs@@ -304,12 +304,11 @@ fn preview_in(h: &mut crate::scenario::Harness) {}fn apply(h: &mut crate::scenario::Harness) {- // Lay the window out once before reading its OK handle. An error line that wraps onto a- // second row moves the button, and a click on the handle from the frame before then- // lands above it and commits nothing.+ // Preview refusals can reflow the window during hover. The widget path resolves the+ // button again after hovering, so the click follows its current position.h.frames(2);preview_in(h);- h.step(&json!({"click":{"handle":"dialog:OK"}})).unwrap();+ h.step(&json!({"widget":"OK"})).unwrap();h.frames(2);}diff --git a/crates/ui-egui/src/sketch_dims.rs b/crates/ui-egui/src/sketch_dims.rsindex 21e507131d..c601321f37 100644--- a/crates/ui-egui/src/sketch_dims.rs+++ b/crates/ui-egui/src/sketch_dims.rs@@ -649,7 +649,7 @@ fn boxes(app: &SolveApp, ui: &mut egui::Ui, proj: &Proj, t: &mut Tool) -> Optionui.ctx(),|ui| {let fill = if b.locked { tk.accent_soft } else { tk.panel };- field_frame.fill(fill).show(ui, |ui| {+ Container::show_backing(ui, field_frame.fill(fill), |ui| {let r = crate::ui_kit::placement_field(ui, id, &mut b.value, b.label);// A completion gets first use of forward Tab. Shift+Tab always moves back;// the box reached by egui's generic traversal must not complete its text.diff --git a/crates/ui-egui/src/sketch_palette.rs b/crates/ui-egui/src/sketch_palette.rsindex 67f750615f..ce960b8381 100644--- a/crates/ui-egui/src/sketch_palette.rs+++ b/crates/ui-egui/src/sketch_palette.rs@@ -9,6 +9,7 @@//! The line type is also a drawing mode: with nothing selected, Construction (or X) makes what//! is drawn next construction geometry until it is switched back.+use crate::ui_kit::BackingTooltipExt as _;use std::cell::Cell;use serde_json::{Value, json};@@ -407,14 +408,14 @@ pub fn show(app: &mut SolveApp, ctx: &egui::Context) {let t = crate::theme::Tokens::get();if open_ends > 0 {let text = crate::i18n::format("sketch.open_ends", &[("count", &open_ends.to_string())]);- ui.label(egui::RichText::new(text).size(t.font_small).color(t.warning)).on_hover_text(app.tr("ui.open_ends_tip"));+ ui.label(egui::RichText::new(text).size(t.font_small).color(t.warning)).backing_on_hover_text(app.tr("ui.open_ends_tip"));}if untied_ends > 0 {ui.horizontal(|ui| {let text = crate::i18n::format("sketch.untied_ends", &[("count", &untied_ends.to_string())]);- ui.label(egui::RichText::new(text).size(t.font_small).color(t.warning)).on_hover_text(app.tr("ui.untied_ends_tip"));- let button =- crate::ui_kit::button(ui, app.tr("ui.tie_ends"), crate::ui_kit::Button::Normal).on_hover_text(app.tr("ui.tie_ends_tip"));+ ui.label(egui::RichText::new(text).size(t.font_small).color(t.warning)).backing_on_hover_text(app.tr("ui.untied_ends_tip"));+ let button = crate::ui_kit::button(ui, app.tr("ui.tie_ends"), crate::ui_kit::Button::Normal)+ .backing_on_hover_text(app.tr("ui.tie_ends_tip"));crate::scenario::publish_handle("sketch_palette:tie_ends", button.rect.center());tie = button.clicked();});diff --git a/crates/ui-egui/src/sketch_text.rs b/crates/ui-egui/src/sketch_text.rsindex 54cfd8daab..2da4ca6e9c 100644--- a/crates/ui-egui/src/sketch_text.rs+++ b/crates/ui-egui/src/sketch_text.rs@@ -2,6 +2,7 @@//! sketch text's outlines; OK runs `sketch.edit_text`. The canvas follows the fields as they//! change (live `sketch.edit_text`); the whole edit is one undo step and Cancel puts the text//! back. The Text tool places a text and opens this dialog on it, so a new text is typed here too.+use crate::ui_kit::BackingTooltipExt as _;use solidcraft_engine::geom::prelude::*;use std::sync::{Arc, OnceLock};@@ -509,7 +510,7 @@ pub(crate) fn rows(ui: &mut egui::Ui, k: &mut Tx, inputs: &mut [SelInput], activif ui.memory(|m| m.has_focus(id)) {enter |= ui.input_mut(|i| !i.modifiers.shift && i.consume_key(egui::Modifiers::NONE, egui::Key::Enter));}- let response = ui_kit::multiline_text_field(ui, "Text", id, &mut k.text).on_hover_text(crate::i18n::tr("sketch_text.formula"));+ let response = ui_kit::multiline_text_field(ui, "Text", id, &mut k.text).backing_on_hover_text(crate::i18n::tr("sketch_text.formula"));crate::scenario::publish_handle("dialog:Text", response.rect.center());if k.focus {response.request_focus();@@ -551,7 +552,7 @@ pub(crate) fn rows(ui: &mut egui::Ui, k: &mut Tx, inputs: &mut [SelInput], activlet response = ui.add_enabled_ui(!on_path, |ui| ui_kit::value_pair(ui, "Position", [x, y], ["X", "Y"], None));enter |= response.inner;if on_path {- response.response.on_disabled_hover_text(crate::i18n::tr("sketch_text.on_path"));+ response.response.backing_on_disabled_hover_text(crate::i18n::tr("sketch_text.on_path"));}}for (i, (label, value)) in LABELS.iter().skip(2).zip(rest).enumerate() {@@ -559,7 +560,7 @@ pub(crate) fn rows(ui: &mut egui::Ui, k: &mut Tx, inputs: &mut [SelInput], activlet response = ui.add_enabled_ui(!(on_path && index == ANGLE), |ui| ui_kit::row(ui, label, |ui| ui_kit::field(ui, value)));enter |= response.inner;if on_path && index == ANGLE {- response.response.on_disabled_hover_text(crate::i18n::tr("sketch_text.on_path"));+ response.response.backing_on_disabled_hover_text(crate::i18n::tr("sketch_text.on_path"));}}path_row(ui, k, inputs, active);@@ -573,7 +574,7 @@ fn path_row(ui: &mut egui::Ui, k: &mut Tx, inputs: &mut [SelInput], active: &mutlet on = k.style.path.is_some();let text = if on { crate::i18n::format("dialog.selected_count", &[("count", "1")]) } else { crate::i18n::tr("dialog.select").into() };let chip = ui_kit::selection_field(ui, &text, ui_kit::Selection { active: k.picking, filled: on })- .on_hover_text(crate::i18n::tr("sketch_text.path_hint"));+ .backing_on_hover_text(crate::i18n::tr("sketch_text.path_hint"));let chip_rect = chip.rect;crate::scenario::publish_handle("dialog:Path", chip.rect.center());if chip.clicked() {diff --git a/crates/ui-egui/src/sketch_tools.rs b/crates/ui-egui/src/sketch_tools.rsindex 937334a0c5..f6d888073c 100644--- a/crates/ui-egui/src/sketch_tools.rs+++ b/crates/ui-egui/src/sketch_tools.rs@@ -5,6 +5,7 @@use crate::icons::markers::glyph_icon;use crate::icons::markers::glyph_letter;+use crate::ui_kit::BackingTooltipExt as _;use solidcraft_engine::geom::prelude::*;use std::cell::{Cell, RefCell};@@ -464,7 +465,7 @@ fn comb_options_card(app: &mut SolveApp, ctx: &egui::Context, proj: &Proj) {crate::ui_kit::Slider { step: Some(0.25), format, ..Default::default() },)});- length.on_hover_text(&length_tip);+ length.backing_on_hover_text(&length_tip);let teeth = crate::ui_kit::row(ui, "ui.comb_teeth", |ui| {crate::ui_kit::slider(ui,@@ -473,7 +474,7 @@ fn comb_options_card(app: &mut SolveApp, ctx: &egui::Context, proj: &Proj) {crate::ui_kit::Slider { integer: true, format: |v| format!("{v:.0}"), ..Default::default() },)});- teeth.on_hover_text(&teeth_tip);+ teeth.backing_on_hover_text(&teeth_tip);});});});diff --git a/crates/ui-egui/src/space_mouse_calibration.rs b/crates/ui-egui/src/space_mouse_calibration.rsindex 536c031161..7378d39eb8 100644--- a/crates/ui-egui/src/space_mouse_calibration.rs+++ b/crates/ui-egui/src/space_mouse_calibration.rs@@ -4,6 +4,7 @@//! (`solidcraft_space_mouse::Wizard`), and saves what it found for the device it started with.//! The window closes with Preferences, and when another device (or none) is read instead.+use crate::ui_kit::BackingTooltipExt as _;use solidcraft_space_mouse::{Calibration, Kind, Problem, Stage, Wizard};use crate::SolveApp;@@ -112,7 +113,7 @@ pub(crate) fn dead_zone_pads(ui: &mut egui::Ui, calibration: &Calibration, raw:let dot = if dot.length() > 1.0 { dot.normalized() } else { dot };let live = moving[h] != 0 || moving[v] != 0;painter.circle_filled(centre + dot * radius, 3.5, if live { visuals.selection.stroke.color } else { faint });- response.on_hover_text(pad_tooltip(&shares, (h, v), stories));+ response.backing_on_hover_text(pad_tooltip(&shares, (h, v), stories));// As wide as the circle, so the labels don't push the circles apart.ui.allocate_ui(egui::vec2(SIZE, 0.0), |ui| {crate::ui_kit::text(ui, &format!("{} · {}", NAMES[h], NAMES[v]), crate::ui_kit::Text::Note("space_mouse_pad"));@@ -245,7 +246,7 @@ pub fn show(app: &mut SolveApp, ctx: &egui::Context) {crate::ui_kit::text(ui, app.tr("ui.3d_mouse_axes_reassigned"), crate::ui_kit::Text::Note("space_mouse_axes_reassigned"));}crate::ui_kit::row(ui, app.tr("ui.3d_mouse_dead_zone"), |ui| {- dead_zone_slider(ui, &mut dead_zone).on_hover_text(app.tr("ui.3d_mouse_dead_zone_tip"));+ dead_zone_slider(ui, &mut dead_zone).backing_on_hover_text(app.tr("ui.3d_mouse_dead_zone_tip"));});},|ui| {@@ -256,7 +257,7 @@ pub fn show(app: &mut SolveApp, ctx: &egui::Context) {.clicked();skip = can_skip&& crate::ui_kit::button(ui, app.tr("ui.3d_mouse_skip"), crate::ui_kit::Button::Normal)- .on_hover_text(app.tr("ui.3d_mouse_skip_tip"))+ .backing_on_hover_text(app.tr("ui.3d_mouse_skip_tip")).clicked();over =matches!(result, Some(Err(_))) && crate::ui_kit::button(ui, app.tr("ui.start_over"), crate::ui_kit::Button::Normal).clicked();diff --git a/crates/ui-egui/src/status_bar.rs b/crates/ui-egui/src/status_bar.rsindex cd8d7b9992..82f32d7f97 100644--- a/crates/ui-egui/src/status_bar.rs+++ b/crates/ui-egui/src/status_bar.rs@@ -11,6 +11,7 @@//! bottom (History, the navigation bar, toasts) sit above it, and it is one of the shell's//! covered rects.+use crate::ui_kit::BackingTooltipExt as _;use egui::{Color32, FontId, Rect, Sense, pos2, vec2};use crate::SolveApp;@@ -119,13 +120,8 @@ pub(crate) fn show(app: &mut SolveApp, ui: &mut egui::Ui) {let t = Tokens::get();let contents = contents(app);let host = Container::new(ui.ctx(), Surface::ApplicationBar);- let response = host- .edge("sc_status_bar", Edge::Bottom)- .exact_size(HEIGHT)- .show_separator_line(false)- .frame(host.edge_frame(t.toolbar))- .show(ui, |ui| paint(app, ui, &contents))- .response;+ let panel = host.edge("sc_status_bar", Edge::Bottom).exact_size(HEIGHT).show_separator_line(false);+ let response = host.show_edge(ui, panel, host.edge_frame(t.toolbar), |ui| paint(app, ui, &contents)).response;app.shell.status_bar = Some(response.rect);crate::scenario::publish_target("status:bar", response.rect);}@@ -203,7 +199,7 @@ fn menu_button(app: &mut SolveApp, ui: &mut egui::Ui, right: f32, target: Targetcrate::ui_kit::dropdown_indicator(&painter, chevron_rect, t.text_dim);response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Button, true, label));crate::scenario::publish_target(handle, button);- if response.on_hover_text(tip).clicked() {+ if response.backing_on_hover_text(tip).clicked() {crate::context_menu::toggle_for(app, button, button.right_top(), target);}buttondiff --git a/crates/ui-egui/src/theme.rs b/crates/ui-egui/src/theme.rsindex 4933d4b91c..54114aa4d7 100644--- a/crates/ui-egui/src/theme.rs+++ b/crates/ui-egui/src/theme.rs@@ -199,6 +199,7 @@ impl Fade {#[derive(Clone, Default)]struct TabThemeState {+ blur: BlurIntent,prepared: Option<PreparedTheme>,environment: Option<Environment>,targets: BTreeMap<String, TabTarget>,@@ -220,6 +221,19 @@ struct TabTarget {const TAB_STATE: &str = "sc_tab_theme_state";+/// Only authored/effective intent is cached. Runtime OS/device availability is never stored+/// here. Reuse prepare_tabs' borrowed full-content/raw comparison, including followed reloads.+#[derive(Clone, Copy, Default)]+pub(crate) struct BlurIntent {+ pub offered: bool,+ pub radius: f32,+ pub revision: u64,+}++pub(crate) fn blur_intent(ctx: &egui::Context) -> BlurIntent {+ ctx.data_mut(|data| data.get_temp_mut_or_default::<TabThemeState>(egui::Id::new(TAB_STATE)).blur)+}+/// Cache the authored theme and raw saved values before any effective-value normalization./// Followed-file reloads use full content equality, including edits that keep the same id/base./// The caller supplies its existing normalization contract only on a cache miss.@@ -237,8 +251,13 @@ pub(crate) fn prepare_tabs(_ => false,};if !same {+ state.blur = BlurIntent { revision: state.blur.revision.wrapping_add(1), ..Default::default() };state.prepared = file.map(|file| {let values = values();+ state.blur.offered = crate::theme_options::declares_blur(file);+ if state.blur.offered {+ state.blur.radius = crate::theme_options::blur_radius(file, &values, crate::theme_options::Availability::Available);+ }let (enabled, fade_ms) = crate::theme_options::tab_settings(file, &values);let base = Custom { dark: file.base.is_dark(), tokens: crate::theme_files::resolve_with(file, &values) };PreparedTheme { file: file.clone(), raw: raw.cloned(), values, base, enabled, fade_ms }@@ -1659,6 +1678,51 @@ mod tests {}}+ #[test]+ fn blur_intent_cache_resolves_only_when_theme_or_raw_values_change() {+ let ctx = egui::Context::default();+ let source: serde_json::Value = serde_json::from_str(include_str!("../tests/fixtures/theme-blur.json")).unwrap();+ let mut file = crate::theme_files::from_value(&source).unwrap();+ let resolutions = Cell::new(0);+ let prepare = |file: Option<&crate::theme_files::ThemeFile>, raw: Option<&BTreeMap<String, serde_json::Value>>| {+ prepare_tabs(&ctx, file, raw, || {+ resolutions.set(resolutions.get() + 1);+ let saved = raw.into_iter().flatten().map(|(k, v)| (k.clone(), serde_json::from_value(v.clone()).unwrap())).collect();+ file.map_or_else(BTreeMap::new, |file| crate::theme_files::effective_values(file, &saved).0)+ });+ };+ for _ in 0..100 {+ prepare(None, None);+ }+ assert_eq!(resolutions.get(), 0, "builtins do not normalize option tables");+ prepare(Some(&file), None);+ let zero = blur_intent(&ctx);+ assert!(zero.offered);+ assert_eq!(zero.radius, 0.0);+ for _ in 0..100 {+ prepare(Some(&file), None);+ }+ assert_eq!(resolutions.get(), 1, "offered zero is a borrowed cache hit");+ assert_eq!(blur_intent(&ctx).revision, zero.revision);+ let raw = BTreeMap::from([("blur".into(), serde_json::json!(18.25))]);+ prepare(Some(&file), Some(&raw));+ assert_eq!(blur_intent(&ctx).radius, 18.25);+ assert_ne!(blur_intent(&ctx).revision, zero.revision);+ for _ in 0..100 {+ prepare(Some(&file), Some(&raw));+ }+ assert_eq!(resolutions.get(), 2);+ // Followed reload keeps id/base, but content changes: it must invalidate.+ file.options.retain(|o| o.id != "blur");+ prepare(Some(&file), Some(&raw));+ assert!(!blur_intent(&ctx).offered);+ assert_eq!(blur_intent(&ctx).radius, 0.0);+ for _ in 0..100 {+ prepare(Some(&file), Some(&raw));+ }+ assert_eq!(resolutions.get(), 3, "undeclared themes also reuse the borrowed identity");+ }+#[test]fn tabs_cache_invalidates_for_theme_values_vision_and_viewport_overrides() {let ctx = egui::Context::default();diff --git a/crates/ui-egui/src/theme_files.rs b/crates/ui-egui/src/theme_files.rsindex 5bfd14f372..ed452db33c 100644--- a/crates/ui-egui/src/theme_files.rs+++ b/crates/ui-egui/src/theme_files.rs@@ -739,7 +739,7 @@ fn parse_option(v: &Value) -> Result<OptionDef, String> {}let (floor, ceiling, standard_unit) = match id {"opacity" => (40.0, 100.0, Some("%")),- "blur" => (0.0, 40.0, Some("px")),+ "blur" => (0.0, 60.0, Some("px")),"tab_fade_ms" => (0.0, 600.0, Some("ms")),_ => (0.0, 0.0, None),};@@ -1601,7 +1601,7 @@ mod tests {(json!([{"id":"a","type":"bool","default":true,"parent":"missing"}]), "parent"),(json!([{"id":"a","type":"bool","default":true,"advanced":"yes"}]), "advanced"),(json!([{"id":"opacity","type":"range","default":80,"min":39}]), "min"),- (json!([{"id":"blur","type":"range","default":10,"max":41}]), "max"),+ (json!([{"id":"blur","type":"range","default":10,"max":61}]), "max"),];let mut too_many = Vec::new();for i in 0..17 {diff --git a/crates/ui-egui/src/theme_options.rs b/crates/ui-egui/src/theme_options.rsindex 3081b73516..03bf4919f8 100644--- a/crates/ui-egui/src/theme_options.rs+++ b/crates/ui-egui/src/theme_options.rs@@ -9,7 +9,6 @@ use std::collections::BTreeMap;pub(crate) enum Availability {Available,/// Message-catalog id, translated at the presentation boundary.- #[allow(dead_code)] // Hardware-dependent registrations arrive with blur and tab providers.Unavailable(&'static str),}@@ -22,6 +21,13 @@ pub(crate) struct Provider {}pub(crate) const PROVIDERS: &[Provider] = &[+ Provider {+ id: "blur",+ label: "prefs.theme_option_blur",+ help: "prefs.theme_option_blur_help",+ availability: || Availability::Available,+ apply: apply_runtime_setting,+ },Provider {id: "opacity",label: "prefs.theme_option_opacity",@@ -34,17 +40,62 @@ pub(crate) const PROVIDERS: &[Provider] = &[label: "prefs.theme_option_tab_colours",help: "prefs.theme_option_tab_colours_help",availability: || Availability::Available,- apply: apply_tab_setting,+ apply: apply_runtime_setting,},Provider {id: "tab_fade_ms",label: "prefs.theme_option_tab_fade_ms",help: "prefs.theme_option_tab_fade_ms_help",availability: || Availability::Available,- apply: apply_tab_setting,+ apply: apply_runtime_setting,},];+/// Hardware/OS state is resolved per app, outside the theme token cache. An unavailable+/// ancestor disables its descendants in both the API and the UI.+pub(crate) fn availability(file: &ThemeFile, id: &str, providers: &[Provider], blur: Availability) -> Availability {+ let mut current = Some(id);+ for _ in 0..=crate::theme_files::MAX_OPTIONS {+ let Some(id) = current else { return Availability::Available };+ if let Some(p) = provider(id, providers) {+ let state = if id == "blur" && (p.availability)() == Availability::Available { blur } else { (p.availability)() };+ if state != Availability::Available {+ return state;+ }+ } else if standard(id) {+ return Availability::Unavailable("prefs.theme_options_unavailable");+ }+ current = file.options.iter().find(|o| o.id == id).and_then(|o| o.parent.as_deref());+ }+ Availability::Unavailable("prefs.theme_options_unavailable")+}++pub(crate) fn blur_radius(file: &ThemeFile, values: &BTreeMap<String, OptionValue>, blur: Availability) -> f32 {+ let definitions = offered(file, PROVIDERS);+ let Some(def) = definitions.iter().find(|o| o.id == "blur") else { return 0.0 };+ if availability(file, "blur", PROVIDERS, blur) != Availability::Available {+ return 0.0;+ }+ let mut parent = def.parent.as_deref();+ for _ in 0..crate::theme_files::MAX_OPTIONS {+ let Some(id) = parent else { break };+ if values.get(id) != Some(&OptionValue::Bool(true)) {+ return 0.0;+ }+ parent = definitions.iter().find(|o| o.id == id).and_then(|o| o.parent.as_deref());+ }+ match values.get("blur") {+ Some(OptionValue::Num(n)) if n.is_finite() && (0.0..=60.0).contains(n) => *n,+ _ => 0.0,+ }+}++/// All standard providers are registered; normalized declarations have validated ancestry.+/// This query is also used by cold UI/API compositions and does not order/allocate a table.+pub(crate) fn declares_blur(file: &ThemeFile) -> bool {+ !file.needs_newer() && file.options.iter().any(|o| o.id == "blur")+}+/// Tab providers affect resolution/animation rather than the base palette. Undeclared values/// and inactive parents cannot enable them, even for a directly supplied theme.pub(crate) fn tab_settings(file: &ThemeFile, values: &BTreeMap<String, OptionValue>) -> (bool, f32) {@@ -61,8 +112,8 @@ pub(crate) fn tab_settings(file: &ThemeFile, values: &BTreeMap<String, OptionVal(enabled, duration)}-// Consumed by tab_settings at the per-tab resolution boundary; never mutate base tokens.-fn apply_tab_setting(_: &mut Tokens, _: &OptionValue) {}+// Consumed by tab_settings or the blur-intent boundary; never store runtime state in tokens.+fn apply_runtime_setting(_: &mut Tokens, _: &OptionValue) {}pub(crate) fn standard(id: &str) -> bool {matches!(id, "opacity" | "blur" | "tab_colours" | "tab_fade_ms")diff --git a/crates/ui-egui/src/timeline.rs b/crates/ui-egui/src/timeline.rsindex 5b5b6d9dec..673c25d478 100644--- a/crates/ui-egui/src/timeline.rs+++ b/crates/ui-egui/src/timeline.rs@@ -1,5 +1,6 @@//! The timeline (bottom): features in order, the rollback marker, errors and warnings.+use crate::ui_kit::BackingTooltipExt as _;use crate::ui_kit::{Container, Edge, Status, Surface};use egui::{Rect, Sense, UiBuilder, pos2, vec2};use serde_json::{Value, json};@@ -906,7 +907,7 @@ fn folder_tile(app: &mut SolveApp, ui: &mut egui::Ui, p: &egui::Painter, x: f32,app.tree.collapsed.remove(&key);}}- resp.on_hover_text(format!("{} ({count})", group.name));+ resp.backing_on_hover_text(format!("{} ({count})", group.name));x + 32.0}@@ -976,7 +977,7 @@ fn timeline_contents(app: &mut SolveApp, ui: &mut egui::Ui, floating: bool) {} else {"Activate or pick a component in the browser to show only its features"};- if resp.on_hover_text(tip).clicked() && (only.is_some() || show_all) {+ if resp.backing_on_hover_text(tip).clicked() && (only.is_some() || show_all) {ui.data_mut(|d| d.insert_temp(show_all_id, !show_all));}x = br.right() + 8.0;@@ -1112,7 +1113,7 @@ fn timeline_contents(app: &mut SolveApp, ui: &mut egui::Ui, floating: bool) {drag = Some(Drag::Feature(*id));}// The tip is written only while it shows (as `on_hover_text` would lay it out).- let resp = resp.on_hover_ui(|ui| {+ let resp = resp.backing_on_hover_ui(|ui| {let mut tip = feature_status_text(name, ty, res);// Greyed out says only "not shown": say why (#8100).if rolled {@@ -1207,7 +1208,7 @@ fn timeline_contents(app: &mut SolveApp, ui: &mut egui::Ui, floating: bool) {ui.ctx().set_cursor_icon(egui::CursorIcon::Grab);}crate::ui_kit::history_marker(&p, mr, false, accent);- resp.on_hover_text(crate::i18n::tr("ui.history_marker_tip"));+ resp.backing_on_hover_text(crate::i18n::tr("ui.history_marker_tip"));}let content_end = crate::dialogs_assembly::timeline_joints(app, ui, &p, end + 10.0, r);// The scroll range follows the drawn content (the buttons don't take layout space themselves).diff --git a/crates/ui-egui/src/timeline_left.rs b/crates/ui-egui/src/timeline_left.rsindex 1c5cb2af91..503b08a69f 100644--- a/crates/ui-egui/src/timeline_left.rs+++ b/crates/ui-egui/src/timeline_left.rs@@ -1,5 +1,6 @@//! The left feature-history panel: named rows, folders, rollback and drag-and-drop.+use crate::ui_kit::BackingTooltipExt as _;use crate::ui_kit::{Container, Edge, Surface};use egui::{Rect, Sense, Stroke, pos2, vec2};use serde_json::json;@@ -569,7 +570,7 @@ fn vertical_marker(app: &mut SolveApp, ui: &mut egui::Ui, drag: &mut Option<Dragif response.hovered() {ui.ctx().set_cursor_icon(egui::CursorIcon::Grab);}- response.on_hover_text(crate::i18n::tr("ui.history_marker_tip"));+ response.backing_on_hover_text(crate::i18n::tr("ui.history_marker_tip"));rect.center().y}@@ -747,7 +748,7 @@ fn selection_actions(app: &mut SolveApp, ui: &mut egui::Ui, groups: &[solidcraftui.separator();}if crate::context_menu::button(ui, "Delete Selected Folders", "delete")- .on_hover_text(crate::i18n::tr("timeline.delete_folders_tip"))+ .backing_on_hover_text(crate::i18n::tr("timeline.delete_folders_tip")).clicked(){let ids = app.tree.picked_timeline_groups.clone();@@ -765,14 +766,14 @@ fn selection_actions(app: &mut SolveApp, ui: &mut egui::Ui, groups: &[solidcraft&& joints.iter().all(|id| app.session.doc.assembly.joints.iter().any(|joint| joint.id == *id && joint.suppressed));let label = if all_suppressed { "Unsuppress Selected Folders" } else { "Suppress Selected Folders" };if crate::context_menu::button_enabled(ui, label, "suppress", has_contents)- .on_hover_text(crate::i18n::tr("timeline.suppress_folders_tip"))+ .backing_on_hover_text(crate::i18n::tr("timeline.suppress_folders_tip")).clicked(){let _ = app.run_heavy("timeline.suppress", json!({"groups": selected_groups, "suppressed": !all_suppressed}));ui.close();}if crate::context_menu::button(ui, "Delete Folders and Features…", "delete")- .on_hover_text(crate::i18n::tr("timeline.delete_folders_with_features_tip"))+ .backing_on_hover_text(crate::i18n::tr("timeline.delete_folders_with_features_tip")).clicked(){crate::timeline::delete_folders(app, selected_groups.clone(), contents);@@ -1139,7 +1140,7 @@ fn vertical_group_row(crate::scenario::publish_handle(&format!("timeline-folder-status:{}:{}", status.icon(), group.name), mark.center());}let response = match tip {- Some(tip) => response.on_hover_text(tip),+ Some(tip) => response.backing_on_hover_text(tip),None => response,};let renaming = timeline_group_name(app, ui, group, rect, offset, names, suppressed, &t);@@ -1619,7 +1620,7 @@ fn feature_row_body(let listed_under = plan.host(id).and_then(|host| table.name(host));let mut tooltip = egui::Tooltip::for_enabled(&response);tooltip.popup = tooltip.popup.align(egui::RectAlign::RIGHT_START);- tooltip.show(|ui| {+ crate::ui_kit::Container::show_tooltip(response.id, tooltip, |ui| {let summary = app.session.docdiff --git a/crates/ui-egui/src/titlebar.rs b/crates/ui-egui/src/titlebar.rsindex cdbf11214f..f777a3f7a0 100644--- a/crates/ui-egui/src/titlebar.rs+++ b/crates/ui-egui/src/titlebar.rs@@ -15,6 +15,7 @@//! Adapted from VectorCraft's `crates/ui-egui/src/titlebar.rs` (MIT OR Apache-2.0).use crate::icons::glyphs::paint_glyph;+use crate::ui_kit::BackingTooltipExt as _;use egui::{Color32, CursorIcon, Id, LayerId, Order, PointerButton, Pos2, Rect, ResizeDirection, Sense, Stroke, Ui, ViewportCommand, pos2, vec2};use crate::SolveApp;@@ -116,7 +117,7 @@ pub fn caption_buttons(app: &mut SolveApp, ui: &mut Ui, bar: Rect) {Caption::Maximize => "Maximize",Caption::Close => "Close",};- if resp.on_hover_text(tip).clicked() {+ if resp.backing_on_hover_text(tip).clicked() {clicked = Some(c);}}diff --git a/crates/ui-egui/src/toolbar.rs b/crates/ui-egui/src/toolbar.rsindex 0ac655f5d8..f5fffa2ee6 100644--- a/crates/ui-egui/src/toolbar.rs+++ b/crates/ui-egui/src/toolbar.rs@@ -2,6 +2,7 @@use crate::fonts::RichTextExt as _;use crate::icons::glyphs::pin_icon;+use crate::ui_kit::BackingTooltipExt as _;use crate::ui_kit::{self, Container, Edge, Surface};use egui::{Align2, Color32, FontId, Rect, Sense, Stroke, pos2, vec2};use serde_json::json;@@ -402,7 +403,7 @@ pub fn app_bar(app: &mut SolveApp, ui: &mut egui::Ui) {let t = Tokens::get();let app_bar = Container::new(ui.ctx(), Surface::ApplicationBar).edge("sc_appbar", Edge::Top);let frame = Container::new(ui.ctx(), Surface::ApplicationBar).edge_frame(t.app_bar);- app_bar.exact_size(APP_BAR_HEIGHT).show_separator_line(false).frame(frame).show(ui, |ui| {+ Container::new(ui.ctx(), Surface::ApplicationBar).show_edge(ui, app_bar.exact_size(APP_BAR_HEIGHT).show_separator_line(false), frame, |ui| {let r = ui.max_rect();// The bar is the window's title bar: its empty space moves the window.if app.custom_titlebar || app.integrated_titlebar {@@ -441,7 +442,7 @@ pub fn app_bar(app: &mut SolveApp, ui: &mut egui::Ui) {ui.painter().rect_filled(home.shrink(3.0), t.radius_sm, t.app_bar_hover_button);}icons::paint_app_bar(ui.painter(), home.shrink(7.0), "home", if idle { 1.0 } else { 0.35 });- if home_response.on_hover_text(home_tip).clicked() && idle {+ if home_response.backing_on_hover_text(home_tip).clicked() && idle {app.home.show(app.session.revision);}x = home.right() + 8.0;@@ -480,7 +481,7 @@ pub fn app_bar(app: &mut SolveApp, ui: &mut egui::Ui) {ui.painter().rect_filled(br.shrink(3.0), t.radius_sm, t.app_bar_hover_button);}icons::paint_app_bar(ui.painter(), Rect::from_center_size(br.center(), vec2(18.0, 18.0)), icon, if enabled { 1.0 } else { 0.35 });- let clicked = resp.on_hover_text(tip).clicked();+ let clicked = resp.backing_on_hover_text(tip).clicked();enabled && clicked};let step = if compact_actions { 22.0 } else { 34.0 };@@ -591,7 +592,7 @@ pub fn app_bar(app: &mut SolveApp, ui: &mut egui::Ui) {}crate::i18n::tr_label("Report a bug — review a screenshot and open a GitHub draft")};- if response.on_hover_text(tip).clicked() {+ if response.backing_on_hover_text(tip).clicked() {crate::help::run(app, &ui.ctx().clone(), "report");}// Settings sits immediately left of Help (also Ctrl+,).@@ -611,7 +612,7 @@ pub fn app_bar(app: &mut SolveApp, ui: &mut egui::Ui) {} else {format!("{} (Ctrl+,)", app.tr("ui.preferences"))};- if gresp.on_hover_text(prefs_tip).clicked() {+ if gresp.backing_on_hover_text(prefs_tip).clicked() {crate::prefs::open_at(app, 0);}if app.header.version == VersionPlace::Header && version_room(r, captions, tabs_start, version.size().x).is_some() {@@ -623,7 +624,7 @@ pub fn app_bar(app: &mut SolveApp, ui: &mut egui::Ui) {Sense::click(),);let url = crate::update::release_notes_url(crate::update::current_version(), crate::update::release_build());- let vresp = vresp.on_hover_cursor(egui::CursorIcon::PointingHand).on_hover_text(&url);+ let vresp = vresp.on_hover_cursor(egui::CursorIcon::PointingHand).backing_on_hover_text(&url);if vresp.hovered() || vresp.has_focus() {ui.painter().hline(vrect.x_range(), vrect.bottom(), Stroke::new(1.0, t.app_bar_text));}@@ -874,7 +875,7 @@ fn file_menu(app: &mut SolveApp, ctx: &egui::Context) {// The browser can install SolidCraft as an app (`install`): only while it offers to.if let Some(offer) = crate::install::offered(app)&& crate::context_menu::button(ui, crate::i18n::tr("install.menu"), "new")- .on_hover_text(crate::i18n::tr("install.button_tip"))+ .backing_on_hover_text(crate::i18n::tr("install.button_tip")).clicked(){crate::install::start(app, offer);@@ -1384,7 +1385,7 @@ fn ribbon_tabs(app: &mut SolveApp, ui: &mut egui::Ui, row: Rect) {app.start(id);}if let Err(reason) = ready {- response.on_disabled_hover_text(reason);+ response.backing_on_disabled_hover_text(reason);}x += width + t.space_2;}@@ -1600,7 +1601,7 @@ pub fn toolbar(app: &mut SolveApp, ui: &mut egui::Ui) {ribbon_galley(ui, pos2(ws.center().x - 6.0, ws.top() + if labels { 89.0 } else { 70.0 }), galley, t.text_dim);dropdown_arrow(&painter, pos2(ws.center().x - 6.0 + label_width / 2.0 + 7.0, ws.top() + if labels { 89.5 } else { 70.5 }), t.text_dim);}- if wresp.on_hover_text(app.tr("ui.change_workspace")).clicked() {+ if wresp.backing_on_hover_text(app.tr("ui.change_workspace")).clicked() {crate::context_menu::toggle_for(app, ws, ws.left_bottom(), crate::context_menu::Target::Workspace);}crate::scenario::publish_rect("toolbar", r);@@ -1771,7 +1772,7 @@ pub fn toolbar(app: &mut SolveApp, ui: &mut egui::Ui) {}dropdown_arrow(&painter, pos2(br.center().x, br.bottom() - 3.0), t.text_dim);let tip = format!("{} ({})", app.tr_label(panel), shown.len().max(cmds.len()));- if fresp.on_hover_text(tip).clicked() && enabled_panel {+ if fresp.backing_on_hover_text(tip).clicked() && enabled_panel {ui.ctx().data_mut(|d| d.insert_temp(egui::Id::new("sc_panel_open"), popup_id));opened = true;}@@ -2202,8 +2203,11 @@ pub fn toolbar(app: &mut SolveApp, ui: &mut egui::Ui) {} else {ui_kit::command_menu_button(ui, c.id, info.label, info.icon, &shortcut, info.enabled)};- let response =- if let Some(hint) = persistent_hint(app, c, info.enabled) { response.on_hover_text(hint) } else { response };+ let response = if let Some(hint) = persistent_hint(app, c, info.enabled) {+ response.backing_on_hover_text(hint)+ } else {+ response+ };crate::scenario::publish_handle(&format!("toolbar:{}", c.id), response.rect.center());if response.clicked() {app.start_at(c.id, Some(response.rect));@@ -2214,7 +2218,7 @@ pub fn toolbar(app: &mut SolveApp, ui: &mut egui::Ui) {}});crate::scenario::publish_target("toolbar:overflow", response.response.rect);- response.response.on_hover_text(crate::i18n::tr_label("More toolbar panels"));+ response.response.backing_on_hover_text(crate::i18n::tr_label("More toolbar panels"));});}@@ -2285,7 +2289,7 @@ fn assistant_button(app: &mut SolveApp, ui: &mut egui::Ui, at: Rect) {AssistantMark::Waiting(count) => crate::ui_kit::AssistantEntryState::Waiting(count),};crate::ui_kit::assistant_entry(ui, &resp, state, app.agent_chat.open, ui.ctx().global_style().animation_time > 0.0);- if resp.on_hover_text(tip).clicked() {+ if resp.backing_on_hover_text(tip).clicked() {crate::agent_chat::toggle(app);}}@@ -2306,9 +2310,9 @@ const CONSTRAINT_GRID_WIDTH: f32 = 82.0;/// where present; other commands intentionally show only their name and registered shortcut.fn ribbon_tooltip(app: &SolveApp, response: egui::Response, command: &solidcraft_engine::CommandSpec, disabled: Option<&str>) -> egui::Response {if let Some(hint) = persistent_hint(app, command, disabled.is_none() && response.enabled() && command.info(&app.session).enabled) {- return response.on_hover_text(hint);+ return response.backing_on_hover_text(hint);}- response.on_hover_ui(|ui| {+ response.backing_on_hover_ui(|ui| {let t = Tokens::get();let name = app.tr_label(crate::render_workspace::interactive_command_info(app, command).label);let name_width =@@ -2324,14 +2328,17 @@ fn ribbon_tooltip(app: &SolveApp, response: egui::Response, command: &solidcraftribbon_text(ui, rect.center(), name, t.font_heading, t.text, true);if let Some(key) = crate::keymap::display_for(app, command.id) {ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {- egui::Frame::NONE- .fill(t.panel_header)- .stroke(t.tertiary_border(t.border))- .corner_radius(t.radius_sm.saturating_sub(1))- .inner_margin(egui::Margin::symmetric(5, 1))- .show(ui, |ui| {+ crate::ui_kit::Container::show_backing(+ ui,+ egui::Frame::NONE+ .fill(t.panel_header)+ .stroke(t.tertiary_border(t.border))+ .corner_radius(t.radius_sm.saturating_sub(1))+ .inner_margin(egui::Margin::symmetric(5, 1)),+ |ui| {ui.label(egui::RichText::new(key).monospace().color(t.text_dim));- });+ },+ );});}});@@ -2387,7 +2394,7 @@ fn reveal_tooltip(app: &SolveApp, ui: &egui::Ui, rect: Rect, command: &solidcraflet label = app.tr_label(info.label);let shortcut = crate::keymap::display_for(app, command.id).map(|k| format!(" ({k})")).unwrap_or_default();let help = crate::command_help::help(command.id);- if let Some(shown) = tip.show(|ui| {+ if let Some(shown) = crate::ui_kit::Container::show_tooltip(egui::Id::new(("ribbon_reveal", command.id)), tip, |ui| {ui.set_max_width(300.0);ui.label(egui::RichText::new(format!("{label}{shortcut}")).strong());if let Some(help) = help {@@ -3041,7 +3048,7 @@ fn dropdown_cell(if let Some(pin) = pin {crate::scenario::publish_handle(&format!("dropdown_pin:{}", c.id), pr.center());let tip = if pinned { "Remove from Toolbar" } else { "Pin to Toolbar" };- if pin.on_hover_text(crate::i18n::tr_label(tip)).clicked() {+ if pin.backing_on_hover_text(crate::i18n::tr_label(tip)).clicked() {return RowAction::TogglePin;}}diff --git a/crates/ui-egui/src/ui_kit/actions.rs b/crates/ui-egui/src/ui_kit/actions.rsindex 30a646ff62..3c178ea8d0 100644--- a/crates/ui-egui/src/ui_kit/actions.rs+++ b/crates/ui-egui/src/ui_kit/actions.rs@@ -1,5 +1,6 @@//! Actions elements for dense cards; see `docs/ui-kit.md` for tokens and usage.use super::metrics::*;+use crate::ui_kit::BackingTooltipExt as _;use crate::{fonts::RichTextExt as _, scenario, theme::Tokens};use egui::{Response, RichText, Ui, vec2};@@ -167,7 +168,7 @@ fn icon_button_presentation();response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Button, ui.is_enabled(), crate::i18n::tr_label(label)));pointer_on_hover(ui, &response);- response.on_hover_text(crate::i18n::tr_label(label))+ response.backing_on_hover_text(crate::i18n::tr_label(label))}/// Plain secondary text action, sharing the kit's normal hit height and typography.@@ -497,7 +498,7 @@ pub(crate) fn button_pair(ui: &mut egui::Ui, key: &str, states: [bool; 2], buttopointer_on_hover(ui, &response);crate::scenario::publish_target(&format!("{key}:{}", button.key), rect);if let Some(value) = clicked.get_mut(index) {- *value = response.on_hover_text(label).clicked();+ *value = response.backing_on_hover_text(label).clicked();}}});@@ -686,7 +687,7 @@ pub(crate) fn compact_button(ui: &mut Ui, glyph: &str, tooltip: &str, enabled: b.inner;publish_button(ui, &response, glyph);pointer_on_hover(ui, &response);- response.on_hover_text(crate::i18n::tr_label(tooltip))+ response.backing_on_hover_text(crate::i18n::tr_label(tooltip))}/// Secondary action with an existing icon, optionally using the danger ink. Keeps button handles.@@ -697,7 +698,7 @@ pub(crate) fn icon_label_button(ui: &mut Ui, label: &str, icon: &str, enabled: b/// Icon-only action with an accessible name and tooltip, using the shared action/// geometry, enabled state and optional danger ink. Tokens: icon-label action tokens.pub(crate) fn icon_action(ui: &mut Ui, label: &str, icon: &str, enabled: bool, danger: bool) -> Response {- let response = icon_label_button(ui, "", icon, enabled, danger).on_hover_text(label);+ let response = icon_label_button(ui, "", icon, enabled, danger).backing_on_hover_text(label);response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Button, enabled && ui.is_enabled(), label));response}@@ -752,7 +753,7 @@ pub(crate) fn selection_actions(ui: &mut Ui, name: &str, actions: &[super::Stageclicked = Some(index);}if let Some(reason) = action.reason {- response.on_disabled_hover_text(reason);+ response.backing_on_disabled_hover_text(reason);}}clickeddiff --git a/crates/ui-egui/src/ui_kit/assistant.rs b/crates/ui-egui/src/ui_kit/assistant.rsindex 8a9f28d89d..4aee088c6b 100644--- a/crates/ui-egui/src/ui_kit/assistant.rs+++ b/crates/ui-egui/src/ui_kit/assistant.rs@@ -1,5 +1,7 @@//! Assistant presentation primitives; protocol state and action dispatch stay with callers.use crate::theme::Tokens;+#[cfg(not(target_arch = "wasm32"))]+use crate::ui_kit::BackingTooltipExt as _;use egui::{InnerResponse, Response, Ui, vec2};#[derive(Clone, Copy)]@@ -85,11 +87,13 @@ pub(crate) fn assistant_bubble<R>(ui: &mut Ui, add: impl FnOnce(&mut Ui) -> R) -ui.horizontal_top(|ui| {ui.spacing_mut().item_spacing.x = 0.0;ui.add_space(width - bubble_width);- egui::Frame::NONE- .fill(t.accent_soft)- .corner_radius(egui::CornerRadius { nw: t.radius_xl, ne: t.radius_xl, sw: t.radius_xl, se: t.radius_sm.saturating_sub(1) })- .inner_margin(egui::Margin::symmetric((t.space_8 + t.space_3) as i8, t.space_8 as i8))- .show(ui, |ui| {+ crate::ui_kit::Container::show_backing(+ ui,+ egui::Frame::NONE+ .fill(t.accent_soft)+ .corner_radius(egui::CornerRadius { nw: t.radius_xl, ne: t.radius_xl, sw: t.radius_xl, se: t.radius_sm.saturating_sub(1) })+ .inner_margin(egui::Margin::symmetric((t.space_8 + t.space_3) as i8, t.space_8 as i8)),+ |ui| {let content_width = (bubble_width - (t.space_8 + t.space_3) * 2.0).max(0.0);ui.set_width(content_width);ui.with_layout(egui::Layout::top_down(egui::Align::Min), |ui| {@@ -100,7 +104,8 @@ pub(crate) fn assistant_bubble<R>(ui: &mut Ui, add: impl FnOnce(&mut Ui) -> R) -add(ui)}).inner- })+ },+ )}).inner}@@ -165,64 +170,81 @@ pub(crate) fn assistant_tool_status(ui: &mut Ui, state: AssistantToolState) -> R#[cfg(any(not(target_arch = "wasm32"), test))]pub(crate) fn assistant_tool_frame<R>(ui: &mut Ui, failed: bool, add: impl FnOnce(&mut Ui) -> R) -> InnerResponse<R> {let t = Tokens::get();- egui::Frame::NONE- .fill(if failed { t.form_error_fill } else { t.dialog_body })- .stroke(t.container_border(t.dialog_rule))- .corner_radius(t.radius_lg)- .inner_margin(t.space_3)- .show(ui, |ui| {+ crate::ui_kit::Container::show_backing(+ ui,+ egui::Frame::NONE+ .fill(if failed { t.form_error_fill } else { t.dialog_body })+ .stroke(t.container_border(t.dialog_rule))+ .corner_radius(t.radius_lg)+ .inner_margin(t.space_3),+ |ui| {ui.set_min_width(ui.available_width().max(0.0));add(ui)- })+ },+ )}/// Individual tool-row surface, retaining a failed row's tint inside a shared group.#[cfg(any(not(target_arch = "wasm32"), test))]pub(crate) fn assistant_tool_row<R>(ui: &mut Ui, failed: bool, add: impl FnOnce(&mut Ui) -> R) -> InnerResponse<R> {let t = Tokens::get();- egui::Frame::NONE.fill(if failed { t.form_error_fill } else { t.dialog_body }).corner_radius(t.control_radius).show(ui, add)+ crate::ui_kit::Container::show_backing(+ ui,+ egui::Frame::NONE.fill(if failed { t.form_error_fill } else { t.dialog_body }).corner_radius(t.control_radius),+ add,+ )}/// Indented detail box using the same field surface as inline command parameters.#[cfg(any(not(target_arch = "wasm32"), test))]pub(crate) fn assistant_tool_detail<R>(ui: &mut Ui, add: impl FnOnce(&mut Ui) -> R) -> InnerResponse<R> {let t = Tokens::get();- egui::Frame::NONE- .fill(t.control_fill)- .stroke(t.container_border(t.dialog_rule))- .corner_radius(t.control_radius)- .inner_margin(egui::Margin::symmetric((t.space_6 + t.space_3) as i8, t.space_6 as i8))- .show(ui, add)+ crate::ui_kit::Container::show_backing(+ ui,+ egui::Frame::NONE+ .fill(t.control_fill)+ .stroke(t.container_border(t.dialog_rule))+ .corner_radius(t.control_radius)+ .inner_margin(egui::Margin::symmetric((t.space_6 + t.space_3) as i8, t.space_6 as i8)),+ add,+ )}/// Approval frame with a tinted heading. Permission choices remain entirely caller-owned.#[cfg(any(not(target_arch = "wasm32"), test))]pub(crate) fn assistant_approval<R>(ui: &mut Ui, title: &str, body: impl FnOnce(&mut Ui) -> R) -> InnerResponse<R> {let t = Tokens::get();- let output = egui::Frame::NONE.fill(t.dialog_body).stroke(egui::Stroke::new(1.0, t.form_primary)).corner_radius(t.radius_xl).show(ui, |ui| {- ui.set_min_width(ui.available_width().max(0.0));- ui.spacing_mut().item_spacing.y = 0.0;- egui::Frame::NONE- .fill(t.accent_soft)- .corner_radius(egui::CornerRadius { nw: t.radius_xl.saturating_sub(1), ne: t.radius_xl.saturating_sub(1), sw: 0, se: 0 })- .inner_margin(egui::Margin::symmetric(t.space_10 as i8, t.space_8 as i8))- .show(ui, |ui| {- ui.set_min_width(ui.available_width().max(0.0));- ui.horizontal_top(|ui| {- ui.spacing_mut().item_spacing.x = t.space_6;- let (icon, _) = ui.allocate_exact_size(vec2(t.space_16, t.space_16), egui::Sense::hover());- crate::icons::paint_ink(ui.painter(), icon, "shield", t.selected_ink);- ui.add(egui::Label::new(egui::RichText::new(title).font(crate::fonts::semibold(t.font_label)).color(t.form_ink)).wrap());- });- });- egui::Frame::NONE- .inner_margin(t.space_10)- .show(ui, |ui| {- ui.spacing_mut().item_spacing.y = t.space_8;- body(ui)- })- .inner- });+ let output = crate::ui_kit::Container::show_backing(+ ui,+ egui::Frame::NONE.fill(t.dialog_body).stroke(egui::Stroke::new(1.0, t.form_primary)).corner_radius(t.radius_xl),+ |ui| {+ ui.set_min_width(ui.available_width().max(0.0));+ ui.spacing_mut().item_spacing.y = 0.0;+ crate::ui_kit::Container::show_backing(+ ui,+ egui::Frame::NONE+ .fill(t.accent_soft)+ .corner_radius(egui::CornerRadius { nw: t.radius_xl.saturating_sub(1), ne: t.radius_xl.saturating_sub(1), sw: 0, se: 0 })+ .inner_margin(egui::Margin::symmetric(t.space_10 as i8, t.space_8 as i8)),+ |ui| {+ ui.set_min_width(ui.available_width().max(0.0));+ ui.horizontal_top(|ui| {+ ui.spacing_mut().item_spacing.x = t.space_6;+ let (icon, _) = ui.allocate_exact_size(vec2(t.space_16, t.space_16), egui::Sense::hover());+ crate::icons::paint_ink(ui.painter(), icon, "shield", t.selected_ink);+ ui.add(egui::Label::new(egui::RichText::new(title).font(crate::fonts::semibold(t.font_label)).color(t.form_ink)).wrap());+ });+ },+ );+ egui::Frame::NONE+ .inner_margin(t.space_10)+ .show(ui, |ui| {+ ui.spacing_mut().item_spacing.y = t.space_8;+ body(ui)+ })+ .inner+ },+ );crate::scenario::publish_rect("assistant:approval", output.response.rect);output}@@ -285,16 +307,19 @@ fn composer_corners(t: &Tokens) -> egui::CornerRadius {#[cfg(any(not(target_arch = "wasm32"), test))]pub(crate) fn assistant_composer<R>(ui: &mut Ui, focused: bool, add: impl FnOnce(&mut Ui) -> R) -> InnerResponse<R> {let t = Tokens::get();- egui::Frame::NONE- .fill(t.control_fill)- .stroke(if focused { egui::Stroke::new(1.0, t.form_primary) } else { t.control_border_stroke(t.control_border) })- .corner_radius(composer_corners(&t))- .inner_margin(egui::Margin::symmetric(t.space_10 as i8, t.space_8 as i8))- .show(ui, |ui| {+ crate::ui_kit::Container::show_backing(+ ui,+ egui::Frame::NONE+ .fill(t.control_fill)+ .stroke(if focused { egui::Stroke::new(1.0, t.form_primary) } else { t.control_border_stroke(t.control_border) })+ .corner_radius(composer_corners(&t))+ .inner_margin(egui::Margin::symmetric(t.space_10 as i8, t.space_8 as i8)),+ |ui| {ui.set_min_width(ui.available_width().max(0.0));ui.spacing_mut().item_spacing.y = t.space_6;add(ui)- })+ },+ )}/// Circular primary send or stop action. The caller retains queue and cancellation dispatch.@@ -315,7 +340,7 @@ pub(crate) fn assistant_send(ui: &mut Ui, enabled: bool, busy: bool, label: &strui.ctx().set_cursor_icon(egui::CursorIcon::PointingHand);}response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Button, ui.is_enabled(), label));- response.on_hover_text(label)+ response.backing_on_hover_text(label)}).inner}@@ -324,13 +349,16 @@ pub(crate) fn assistant_send(ui: &mut Ui, enabled: bool, busy: bool, label: &str#[cfg(any(not(target_arch = "wasm32"), test))]pub(crate) fn assistant_composer_footer<R>(ui: &mut Ui, add: impl FnOnce(&mut Ui) -> R) -> InnerResponse<R> {let t = Tokens::get();- let output = egui::Frame::NONE- .fill(t.dialog_footer)- .corner_radius(composer_corners(&t))- // No margin: the composer box inside fills this footer edge to edge. The text padding- // lives on the box itself, so there is one inset, not two.- .inner_margin(0)- .show(ui, add);+ let output = crate::ui_kit::Container::show_backing(+ ui,+ egui::Frame::NONE+ .fill(t.dialog_footer)+ .corner_radius(composer_corners(&t))+ // No margin: the composer box inside fills this footer edge to edge. The text padding+ // lives on the box itself, so there is one inset, not two.+ .inner_margin(0),+ add,+ );t.secondary_hline(ui.painter(), output.response.rect.x_range(), output.response.rect.top(), t.dialog_rule);output}@@ -364,11 +392,15 @@ pub(crate) fn assistant_banner<R>(ui: &mut Ui, tone: AssistantTone, add: impl Fnpub(crate) fn banner<R>(ui: &mut Ui, tone: AssistantTone, add: impl FnOnce(&mut Ui) -> R) -> InnerResponse<R> {let t = Tokens::get();let (_, fill) = tone.colors(&t);- egui::Frame::NONE.fill(fill).stroke(t.container_border(t.dialog_rule)).corner_radius(t.radius_lg).inner_margin(t.space_10).show(ui, |ui| {- ui.set_min_width(ui.available_width().max(0.0));- ui.spacing_mut().item_spacing.y = t.space_8;- add(ui)- })+ crate::ui_kit::Container::show_backing(+ ui,+ egui::Frame::NONE.fill(fill).stroke(t.container_border(t.dialog_rule)).corner_radius(t.radius_lg).inner_margin(t.space_10),+ |ui| {+ ui.set_min_width(ui.available_width().max(0.0));+ ui.spacing_mut().item_spacing.y = t.space_8;+ add(ui)+ },+ )}#[cfg(test)]diff --git a/crates/ui-egui/src/ui_kit/checks.rs b/crates/ui-egui/src/ui_kit/checks.rsindex 9d48162448..8d93e05333 100644--- a/crates/ui-egui/src/ui_kit/checks.rs+++ b/crates/ui-egui/src/ui_kit/checks.rs@@ -1,5 +1,6 @@//! The only checkbox box and check glyph, shared by inline, palette, grid and menu rows.use crate::theme::Tokens;+use crate::ui_kit::BackingTooltipExt as _;use egui::{Rect, Response, Ui, pos2, vec2};/// Fixed logical size and pixel-aligned origin, independent of a caller's fonts or spacing.@@ -115,5 +116,5 @@ pub(crate) fn checkbox_at(ui: &mut Ui, rect: Rect, label: &str, value: &mut bool}paint_box(ui, rect, &response, *value, false);response.widget_info(|| egui::WidgetInfo::selected(egui::WidgetType::Checkbox, ui.is_enabled(), *value, label));- response.on_hover_text(label)+ response.backing_on_hover_text(label)}diff --git a/crates/ui-egui/src/ui_kit/choice.rs b/crates/ui-egui/src/ui_kit/choice.rsindex f2dbe1f457..04fb80bc06 100644--- a/crates/ui-egui/src/ui_kit/choice.rs+++ b/crates/ui-egui/src/ui_kit/choice.rs@@ -5,6 +5,7 @@ use super::{metrics::*,text::paint_text,};+use crate::ui_kit::BackingTooltipExt as _;use crate::ui_kit::{Container, Surface};use crate::{scenario, theme::Tokens};use egui::{Ui, vec2};@@ -200,7 +201,8 @@ pub(crate) fn segmented(ui: &mut Ui, selected: &mut usize, options: &[&str], conscenario::publish_target(target, visible);}}- let response = if let Some(reason) = reason { response.on_disabled_hover_text(reason) } else { response.on_hover_text(*text) };+ let response =+ if let Some(reason) = reason { response.backing_on_disabled_hover_text(reason) } else { response.backing_on_hover_text(*text) };if response.clicked() && segment_enabled {*selected = index;clicked = true;@@ -280,7 +282,7 @@ pub(crate) fn segmented_icons(ui: &mut Ui, selected: &mut usize, options: &[Iconresponse.widget_info(|| egui::WidgetInfo::selected(egui::WidgetType::Button, ui.is_enabled(), on, option.key));scenario::publish_handle(&format!("dialog:{}:{}", label(ui), option.key), segment.center());scenario::publish_target(option.key, segment);- let response = response.on_hover_text(&option.tip);+ let response = response.backing_on_hover_text(&option.tip);if response.clicked() {*selected = index;clicked = true;@@ -343,7 +345,7 @@ pub(crate) fn checkbox_row(ui: &mut egui::Ui, key: &str, label: &str, on: bool)painter.text(rect.left_center(), egui::Align2::LEFT_CENTER, label, egui::FontId::proportional(t.font_label), t.form_ink);response.widget_info(|| egui::WidgetInfo::selected(egui::WidgetType::Checkbox, ui.is_enabled(), on, label));crate::scenario::publish_target(&format!("sketch_palette:toggle:{key}"), rect);- response.on_hover_text(label).clicked()+ response.backing_on_hover_text(label).clicked()}/// Compact bold/italic toggles for text. Tokens: scope font/control tokens.@@ -357,9 +359,9 @@ pub(crate) fn text_emphasis(ui: &mut Ui, bold: &mut bool, italic: &mut bool, bolif !enabled {*value = false;}- let mut response = ui.add_enabled_ui(enabled, |ui| ui.toggle_value(value, text).on_hover_text(crate::i18n::tr(id))).inner;+ let mut response = ui.add_enabled_ui(enabled, |ui| ui.toggle_value(value, text).backing_on_hover_text(crate::i18n::tr(id))).inner;if !enabled {- response = response.on_disabled_hover_text(crate::i18n::tr("sketch_text.no_bold"));+ response = response.backing_on_disabled_hover_text(crate::i18n::tr("sketch_text.no_bold"));}response.widget_info(|| egui::WidgetInfo::selected(egui::WidgetType::Button, ui.is_enabled() && enabled, *value, crate::i18n::tr(id)));scenario::publish_target_as(&format!("dialog:{key}"), &format!("dialog:emphasis:{key}"), response.rect);@@ -398,7 +400,7 @@ pub(crate) fn tool_choices<'a>(ui: &mut Ui, label: &str, current: &str, choices:t.button_bevel(ui, &response, on);scenario::publish_target(&format!("sketch_palette:feature:{}", choice.key), response.rect);response.widget_info(|| egui::WidgetInfo::selected(egui::WidgetType::Button, enabled, on, choice.label));- if response.on_hover_text(choice.label).clicked() && enabled {+ if response.backing_on_hover_text(choice.label).clicked() && enabled {start = Some(choice.key);}}@@ -417,7 +419,7 @@ pub(crate) fn toggle_icon(ui: &mut Ui, row: &str, label: &str, selected: &mut boresponse.widget_info(|| egui::WidgetInfo::selected(egui::WidgetType::Button, true, *selected, crate::i18n::tr_label(label)));t.button_bevel(ui, &response, *selected);crate::scenario::publish_handle(&format!("dialog:{row}:{label}"), response.rect.center());- if response.clone().on_hover_text(crate::i18n::tr_label(label)).clicked() {+ if response.clone().backing_on_hover_text(crate::i18n::tr_label(label)).clicked() {*selected = !*selected;}scenario::publish_rect(&format!("dialog:{row}:{label}"), response.rect);@@ -575,7 +577,7 @@ pub(crate) fn thumbnail_choice(ui: &mut Ui, key: &str, text: &str, state: Thumbn}response.widget_info(|| egui::WidgetInfo::selected(egui::WidgetType::SelectableLabel, ui.is_enabled(), state.selected, text));crate::scenario::publish_target(&format!("dialog:list:{key}"), response.rect);- response.on_hover_text(text)+ response.backing_on_hover_text(text)}/// Dashed add variant for thumbnail strips, sharing control tokens and button semantics.@@ -594,7 +596,7 @@ pub(crate) fn add_choice(ui: &mut Ui, label: &str) -> egui::Response {ui.painter().add(egui::Shape::dashed_line(&outline, egui::Stroke::new(1.0, t.control_border), t.space_3, t.space_3));ui.painter().text(rect.center(), egui::Align2::CENTER_CENTER, "+", egui::FontId::proportional(t.font_subtitle), t.form_dim);response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Button, ui.is_enabled(), label));- response.on_hover_text(label)+ response.backing_on_hover_text(label)}/// A reusable draggable document-colour sample; caller supplies the existing domain payload.@@ -634,7 +636,7 @@ pub(crate) fn color_swatch<T: Send + Sync + 'static>(ui.painter().rect(rect, t.control_radius, color, t.control_border_stroke(t.border), egui::StrokeKind::Inside);}).response;- let response = ui.interact(response.rect, id.with("click"), egui::Sense::click()).on_hover_text(tip);+ let response = ui.interact(response.rect, id.with("click"), egui::Sense::click()).backing_on_hover_text(tip);if response.hovered() {ui.ctx().set_cursor_icon(egui::CursorIcon::Grab);}@@ -699,71 +701,63 @@ pub(crate) fn popup_list(let width = anchor.width().max(t.form_card_width - t.space_16 * 2.0 - t.space_2).max(content_w).min(t.form_card_width * 2.5);let popup = Container::new(ctx, Surface::Popup).area(id);let area = popup.order(egui::Order::Tooltip).fixed_pos(anchor.left_bottom() + egui::vec2(0.0, t.space_2)).show(ctx, |ui| {- Container::popup_frame(ui.style())+ let frame = Container::popup_frame(ui.style()).fill(t.control_fill).stroke(t.primary_border(t.dialog_border)).corner_radius(t.radius_lg)- .inner_margin(t.space_4)- .show(ui, |ui| {- super::scope(ui, |ui| {- ui.set_width(width);- // A long list (every parameter, #9246) scrolls past its first rows and keeps- // the chosen row in view.- let scrolls = options.len() > POPUP_LIST_ROWS;- let followed = id.with("followed");- let follow = scrolls && selected.is_some() && ctx.data(|d| d.get_temp::<Option<usize>>(followed)) != Some(selected);- ctx.data_mut(|d| d.insert_temp(followed, selected));- let scroll = egui::ScrollArea::vertical()- .id_salt(id.with("scroll"))- .max_height(t.control_height * POPUP_LIST_ROWS as f32)- .auto_shrink([false, true])- .vscroll(scrolls);- scroll.show(ui, |ui| {- for (index, option) in options.iter().enumerate() {- let (rect, response) = ui.allocate_exact_size(vec2(ui.available_width(), t.control_height), egui::Sense::CLICK);- if follow && selected == Some(index) {- ui.scroll_to_rect_animation(rect, None, egui::style::ScrollAnimation::none());- }- // A row scrolled out of view is not under the pointer.- rows.push(if ui.is_rect_visible(rect) { rect.intersect(ui.clip_rect()) } else { egui::Rect::NOTHING });- let picked = selected == Some(index);- if picked || response.hovered() {- ui.painter().rect_filled(rect, t.control_radius, if picked { t.selected_bg } else { t.hover });- }- let inner = rect.shrink2(vec2(t.space_8, 0.0));- let kind = crate::i18n::tr_label(option.kind);- let kind_width = super::metrics::label_width(ui, kind);- let text_rect = egui::Rect::from_min_max(- inner.min,- egui::pos2((inner.right() - kind_width - t.space_8).max(inner.left()), inner.bottom()),- );- super::text::paint_text(- ui,- text_rect,- option.text,- mono.clone(),- if picked { t.form_primary } else { option.color },- false,- );- ui.painter().text(inner.right_center(), egui::Align2::RIGHT_CENTER, kind, kind_font.clone(), t.form_dim);- response- .widget_info(|| egui::WidgetInfo::selected(egui::WidgetType::SelectableLabel, ui.is_enabled(), picked, option.text));- // Tip the full name first: long identifiers still clip inside a capped popup.- let tip = if option.detail.is_empty() { option.text.to_owned() } else { format!("{}\n{}", option.text, option.detail) };- let response = response.on_hover_text(tip);- crate::scenario::publish_handle(&format!("dialog:suggestion:{index}"), response.rect.center());- if response.clicked() {- chosen = Some(index);- }+ .inner_margin(t.space_4);+ Container::show_backing(ui, frame, |ui| {+ super::scope(ui, |ui| {+ ui.set_width(width);+ // A long list (every parameter, #9246) scrolls past its first rows and keeps+ // the chosen row in view.+ let scrolls = options.len() > POPUP_LIST_ROWS;+ let followed = id.with("followed");+ let follow = scrolls && selected.is_some() && ctx.data(|d| d.get_temp::<Option<usize>>(followed)) != Some(selected);+ ctx.data_mut(|d| d.insert_temp(followed, selected));+ let scroll = egui::ScrollArea::vertical()+ .id_salt(id.with("scroll"))+ .max_height(t.control_height * POPUP_LIST_ROWS as f32)+ .auto_shrink([false, true])+ .vscroll(scrolls);+ scroll.show(ui, |ui| {+ for (index, option) in options.iter().enumerate() {+ let (rect, response) = ui.allocate_exact_size(vec2(ui.available_width(), t.control_height), egui::Sense::CLICK);+ if follow && selected == Some(index) {+ ui.scroll_to_rect_animation(rect, None, egui::style::ScrollAnimation::none());+ }+ // A row scrolled out of view is not under the pointer.+ rows.push(if ui.is_rect_visible(rect) { rect.intersect(ui.clip_rect()) } else { egui::Rect::NOTHING });+ let picked = selected == Some(index);+ if picked || response.hovered() {+ ui.painter().rect_filled(rect, t.control_radius, if picked { t.selected_bg } else { t.hover });+ }+ let inner = rect.shrink2(vec2(t.space_8, 0.0));+ let kind = crate::i18n::tr_label(option.kind);+ let kind_width = super::metrics::label_width(ui, kind);+ let text_rect = egui::Rect::from_min_max(+ inner.min,+ egui::pos2((inner.right() - kind_width - t.space_8).max(inner.left()), inner.bottom()),+ );+ super::text::paint_text(ui, text_rect, option.text, mono.clone(), if picked { t.form_primary } else { option.color }, false);+ ui.painter().text(inner.right_center(), egui::Align2::RIGHT_CENTER, kind, kind_font.clone(), t.form_dim);+ response.widget_info(|| egui::WidgetInfo::selected(egui::WidgetType::SelectableLabel, ui.is_enabled(), picked, option.text));+ // Tip the full name first: long identifiers still clip inside a capped popup.+ let tip = if option.detail.is_empty() { option.text.to_owned() } else { format!("{}\n{}", option.text, option.detail) };+ let response = response.backing_on_hover_text(tip);+ crate::scenario::publish_handle(&format!("dialog:suggestion:{index}"), response.rect.center());+ if response.clicked() {+ chosen = Some(index);}- });- super::divider(ui, "completion_detail");- if let Some(option) = selected.and_then(|index| options.get(index)) {- super::text(ui, option.detail, super::Text::Note("completion_detail"));}- super::text(ui, hint, super::Text::Note("completion_hint"));- })- });+ });+ super::divider(ui, "completion_detail");+ if let Some(option) = selected.and_then(|index| options.get(index)) {+ super::text(ui, option.detail, super::Text::Note("completion_detail"));+ }+ super::text(ui, hint, super::Text::Note("completion_hint"));+ })+ });});crate::scenario::publish_rect("dialog:suggestions", area.response.rect);ctx.data_mut(|d| d.insert_temp(id.with("rows"), rows));@@ -780,5 +774,5 @@ pub(crate) fn color_thumbnail<T: Send + Sync + 'static>(ui: &mut Ui, id: egui::Iui.painter().rect(rect, t.radius_sm, color, t.control_border_stroke(t.border), egui::StrokeKind::Inside);}).response- .on_hover_text(tip)+ .backing_on_hover_text(tip)}diff --git a/crates/ui-egui/src/ui_kit/color.rs b/crates/ui-egui/src/ui_kit/color.rsindex 2295c5cf0d..9b6155ce10 100644--- a/crates/ui-egui/src/ui_kit/color.rs+++ b/crates/ui-egui/src/ui_kit/color.rs@@ -1,6 +1,7 @@//! Document RGB and optional separate opacity editing. Interface paint uses tokens; gradients are colour data.use super::{layout::label, metrics::dimension};use crate::recent_colors::{MAX_RECENT_COLORS, recent_colors, remember_color};+use crate::ui_kit::BackingTooltipExt as _;use crate::ui_kit::{Container, Surface};use crate::{i18n, scenario, theme::Tokens};use egui::{Color32, Response, Sense, Ui, ecolor::HsvaGamma, pos2, vec2};@@ -99,7 +100,7 @@ fn color_field_inner(ui: &mut Ui, rgb: &mut [u8; 3], opacity: Option<&mut f64>,response.mark_changed();}let response = response.on_hover_cursor(egui::CursorIcon::PointingHand);- if ui.style().explanation_tooltips { response.on_hover_text(i18n::tr("color.edit")) } else { response }+ if ui.style().explanation_tooltips { response.backing_on_hover_text(i18n::tr("color.edit")) } else { response }}/// Popover body, also rendered independently by the gallery. Format is global, alpha is opaque.@@ -142,7 +143,7 @@ fn color_popover_with_opacity(ui: &mut Ui, rgb: &mut [u8; 3], mut opacity: Optiofor (index, (key, name)) in [("color.gamma", "U8"), ("color.linear", "F"), ("color.hex_help", "Hex")].iter().enumerate() {let rect =egui::Rect::from_min_size(rect.min + vec2(index as f32 * rect.width() / 3.0, 0.0), vec2(rect.width() / 3.0, rect.height()));- ui.interact(rect, ui.id().with(("format_tip", index)), Sense::hover()).on_hover_text(i18n::tr(key));+ ui.interact(rect, ui.id().with(("format_tip", index)), Sense::hover()).backing_on_hover_text(i18n::tr(key));scenario::publish_handle(&format!("color:format:{name}"), rect.center());}});@@ -183,7 +184,7 @@ fn color_popover_with_opacity(ui: &mut Ui, rgb: &mut [u8; 3], mut opacity: Optioui.spacing_mut().item_spacing.y = t.space_3;ui.add(egui::Label::new(egui::RichText::new(i18n::tr("color.hex")).size(t.font_small).color(t.form_dim)));let response = super::cell_editor(ui, hex_id.with("input"), &mut hex.draft, i18n::tr("color.hex_hint"), false)- .on_hover_text(i18n::tr("color.hex_help"));+ .backing_on_hover_text(i18n::tr("color.hex_help"));publish("color:hex", &response);if response.changed()&& let Some((value, alpha)) = parse_hex(&hex.draft)@@ -258,7 +259,7 @@ fn color_popover_with_opacity(ui: &mut Ui, rgb: &mut [u8; 3], mut opacity: Optiomarker(ui, pos2(square.left() + hsv.s * square.width(), square.bottom() - hsv.v * square.height()), t.space_6);response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Other, ui.is_enabled(), i18n::tr("color.saturation_value")));publish("color:sv", &response);- response.on_hover_text(i18n::tr("color.saturation_value"));+ response.backing_on_hover_text(i18n::tr("color.saturation_value"));let (hue, response) = ui.allocate_exact_size(vec2(width, t.space_14), Sense::click_and_drag());if (response.clicked() || response.dragged())&& let Some(pos) = response.interact_pointer_pos()@@ -270,7 +271,7 @@ fn color_popover_with_opacity(ui: &mut Ui, rgb: &mut [u8; 3], mut opacity: Optiomarker(ui, pos2(hue.left() + hsv.h * hue.width(), hue.center().y), t.space_8);response.widget_info(|| egui::WidgetInfo::slider(ui.is_enabled(), f64::from(hsv.h), i18n::tr("color.hue")));publish("color:hue", &response);- response.on_hover_text(i18n::tr("color.hue"));+ response.backing_on_hover_text(i18n::tr("color.hue"));if graphical_edit {let c = Color32::from(hsv);*rgb = [c.r(), c.g(), c.b()];@@ -285,7 +286,7 @@ fn color_popover_with_opacity(ui: &mut Ui, rgb: &mut [u8; 3], mut opacity: Optioegui::StrokeKind::Inside,);publish("color:current", &response);- response.on_hover_text(i18n::tr("color.selected"));+ response.backing_on_hover_text(i18n::tr("color.selected"));if let Some(picked) = recent_row(ui, width) {*rgb = picked;picked_recent = true;@@ -394,7 +395,7 @@ fn spin_channel(ui: &mut Ui, name: &str, tip: Option<&str>, value: &mut f64, spiui.spacing_mut().item_spacing.y = t.space_3;let label = ui.add(egui::Label::new(egui::RichText::new(name).size(t.font_small).color(t.form_dim)));if let Some(tip) = tip {- label.on_hover_text(tip);+ label.backing_on_hover_text(tip);}ui.horizontal(|ui| {ui.spacing_mut().item_spacing.x = t.space_2;@@ -414,7 +415,7 @@ fn spin_channel(ui: &mut Ui, name: &str, tip: Option<&str>, value: &mut f64, spi});publish(&format!("color:channel:{name}"), &response);let response = match tip {- Some(tip) => response.on_hover_text(tip),+ Some(tip) => response.backing_on_hover_text(tip),None => response,};changed |= response.changed();@@ -477,7 +478,7 @@ fn spin_buttons(ui: &mut Ui, key: &str, height: f32) -> i32 {} else {ui.ctx().data_mut(|d| d.remove::<f64>(repeat));}- response.on_hover_text(i18n::tr(label));+ response.backing_on_hover_text(i18n::tr(label));}steps}@@ -508,7 +509,7 @@ fn recent_row(ui: &mut Ui, width: f32) -> Option<[u8; 3]> {let (row, response) = ui.allocate_exact_size(vec2(width, side), Sense::hover());publish("color:recent", &response);if colors.is_empty() {- response.on_hover_text(i18n::tr("color.recent_help"));+ response.backing_on_hover_text(i18n::tr("color.recent_help"));}for slot in 0..MAX_RECENT_COLORS {let rect = egui::Rect::from_min_size(row.min + vec2(slot as f32 * (side + gap), 0.0), vec2(side, side));@@ -522,7 +523,7 @@ fn recent_row(ui: &mut Ui, width: f32) -> Option<[u8; 3]> {let hex = format!("#{r:02x}{g:02x}{b:02x}");response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Button, true, &hex));publish(&format!("color:recent:{slot}"), &response);- let response = response.on_hover_cursor(egui::CursorIcon::PointingHand).on_hover_text(&hex);+ let response = response.on_hover_cursor(egui::CursorIcon::PointingHand).backing_on_hover_text(&hex);if response.clicked() {picked = Some([r, g, b]);}diff --git a/crates/ui-egui/src/ui_kit/container.rs b/crates/ui-egui/src/ui_kit/container.rsindex 46947dd4b6..47eb8b4f1b 100644--- a/crates/ui-egui/src/ui_kit/container.rs+++ b/crates/ui-egui/src/ui_kit/container.rs@@ -7,6 +7,225 @@ use egui::{Color32, Context, Frame, Id, Stroke, WidgetText};pub(super) type Background = fn(&egui::Painter, Frame, egui::Rect, egui::Shape) -> egui::Shape;+/// A reserved background slot for native hosts whose Frame is painted by egui.+pub(super) struct BackingSlot {+ painter: egui::Painter,+ slot: egui::layers::ShapeIdx,+}++impl BackingSlot {+ pub(super) fn reserve(ctx: &Context, layer: egui::LayerId) -> Option<Self> {+ if !crate::blur::enabled() || ctx.viewport_id() != egui::ViewportId::ROOT {+ return None;+ }+ let painter = ctx.layer_painter(layer);+ let slot = painter.add(egui::Shape::Noop);+ Some(Self { painter, slot })+ }++ pub(super) fn body<R>(&self, ui: &mut egui::Ui, body: impl FnOnce(&mut egui::Ui) -> R) -> R {+ let frame = *ui.stack().frame();+ let painter = ui.painter().clone();+ let result = body(ui);+ self.painter.set(self.slot, crate::blur::decorate(&painter, frame, ui.min_rect(), egui::Shape::Noop));+ result+ }+}++/// Keep the stock combo's placement, focus and scroll behavior. Its popup frame is+/// reserved before `show_ui` paints it, just as for the other native popup hosts.+pub(super) fn show_combo<R>(+ ui: &mut egui::Ui,+ widget: Id,+ combo: egui::ComboBox,+ body: impl FnOnce(&mut egui::Ui) -> R,+) -> egui::InnerResponse<Option<R>> {+ if !crate::blur::enabled() || ui.ctx().viewport_id() != egui::ViewportId::ROOT {+ return combo.show_ui(ui, body);+ }+ let popup = widget.with("popup");+ let slot = egui::ComboBox::is_open(ui.ctx(), widget)+ .then(|| BackingSlot::reserve(ui.ctx(), egui::LayerId::new(egui::Order::Foreground, popup)))+ .flatten();+ let mut host = None;+ let shown = combo.show_ui(ui, |ui| {+ // ComboBox calls us inside its ScrollArea, whose content Frame has no+ // fill and whose clip omits popup padding and any scrollbar. Its parent+ // owns the actual native popup Frame; finish using the final Area rect.+ if slot.is_some()+ && let Some(frame) = ui.stack().iter().find(|node| node.kind() == Some(egui::UiKind::ScrollArea)).and_then(|node| node.parent.as_ref())+ {+ let mut painter = ui.painter().clone();+ painter.set_clip_rect(ui.ctx().content_rect());+ host = Some((painter, *frame.frame()));+ }+ body(ui)+ });+ if let (Some(slot), Some((painter, frame)), Some(response)) = (slot, host, ui.ctx().read_response(popup)) {+ slot.painter.set(slot.slot, crate::blur::decorate(&painter, frame, response.rect - frame.total_margin(), egui::Shape::Noop));+ }+ shown+}++/// Native popup interaction and placement, with its backing surface reserved before contents.+pub struct BackingPopup<'a>(egui::Popup<'a>);++impl<'a> BackingPopup<'a> {+ pub fn frame(mut self, frame: Frame) -> Self {+ self.0 = self.0.frame(frame);+ self+ }+ pub fn close_behavior(mut self, value: egui::PopupCloseBehavior) -> Self {+ self.0 = self.0.close_behavior(value);+ self+ }+ pub fn width(mut self, value: f32) -> Self {+ self.0 = self.0.width(value);+ self+ }+ pub fn open(mut self, value: bool) -> Self {+ self.0 = self.0.open(value);+ self+ }+ pub fn open_memory(mut self, value: impl Into<Option<egui::SetOpenCommand>>) -> Self {+ self.0 = self.0.open_memory(value);+ self+ }+ pub fn at_pointer_fixed(mut self) -> Self {+ self.0 = self.0.at_pointer_fixed();+ self+ }+ pub fn anchor(mut self, value: impl Into<egui::PopupAnchor>) -> Self {+ self.0 = self.0.anchor(value);+ self+ }+ pub fn align(mut self, value: egui::RectAlign) -> Self {+ self.0 = self.0.align(value);+ self+ }+ pub fn align_alternatives(mut self, value: &'a [egui::RectAlign]) -> Self {+ self.0 = self.0.align_alternatives(value);+ self+ }+ pub fn gap(mut self, value: f32) -> Self {+ self.0 = self.0.gap(value);+ self+ }+ pub fn is_open(&self) -> bool {+ self.0.is_open()+ }+ pub fn get_expected_size(&self) -> Option<egui::Vec2> {+ self.0.get_expected_size()+ }+ pub fn show<R>(self, body: impl FnOnce(&mut egui::Ui) -> R) -> Option<egui::InnerResponse<R>> {+ let slot =+ self.0.is_open().then(|| BackingSlot::reserve(self.0.ctx(), egui::LayerId::new(egui::Order::Foreground, self.0.get_id()))).flatten();+ self.0.show(|ui| match slot {+ Some(slot) => slot.body(ui, body),+ None => body(ui),+ })+ }+}++pub struct BackingModal {+ modal: egui::Modal,+ id: Id,+}+impl BackingModal {+ pub fn backdrop_color(mut self, value: Color32) -> Self {+ self.modal = self.modal.backdrop_color(value);+ self+ }+ pub fn frame(mut self, value: Frame) -> Self {+ self.modal = self.modal.frame(value);+ self+ }+ pub fn show<R>(self, ctx: &Context, body: impl FnOnce(&mut egui::Ui) -> R) -> egui::ModalResponse<R> {+ if !crate::blur::enabled() || ctx.viewport_id() != egui::ViewportId::ROOT {+ return self.modal.show(ctx, body);+ }+ // Blur the preceding UI before native dimming, then blur the dialog's immediate+ // backdrop after dimming. Native Modal retains focus, input shielding and closing.+ let painter = ctx.layer_painter(egui::LayerId::new(egui::Order::Foreground, self.id));+ let backdrop = Frame::NONE.fill(self.modal.backdrop_color);+ painter.add(crate::blur::decorate(&painter, backdrop, ctx.content_rect(), egui::Shape::Noop));+ let frame = self.modal.frame.unwrap_or_else(|| Frame::popup(&ctx.global_style()));+ self.modal.frame(Frame::NONE).show(ctx, |ui| Container::show_backing(ui, frame, body).inner)+ }+}++/// Response tooltips retain native hover/disabled/stacking behavior and share backing blur.+pub trait BackingTooltipExt: Sized {+ fn backing_on_hover_ui(self, body: impl FnOnce(&mut egui::Ui)) -> Self;+ fn backing_on_disabled_hover_ui(self, body: impl FnOnce(&mut egui::Ui)) -> Self;+ fn backing_on_hover_ui_at_pointer(self, body: impl FnOnce(&mut egui::Ui)) -> Self;+ fn backing_on_hover_text(self, text: impl Into<WidgetText>) -> Self;+ fn backing_on_disabled_hover_text(self, text: impl Into<WidgetText>) -> Self;+ fn backing_on_hover_text_at_pointer(self, text: impl Into<WidgetText>) -> Self;+ fn backing_show_tooltip_ui(&self, body: impl FnOnce(&mut egui::Ui));+ fn backing_show_tooltip_text(&self, text: impl Into<WidgetText>);+}++fn show_backing_tooltip(parent: Id, tip: egui::Tooltip<'_>, body: impl FnOnce(&mut egui::Ui)) {+ let slot = tip+ .popup+ .is_open()+ .then(|| {+ BackingSlot::reserve(tip.popup.ctx(), egui::LayerId::new(egui::Order::Tooltip, egui::Tooltip::next_tooltip_id(tip.popup.ctx(), parent)))+ })+ .flatten();+ tip.show(|ui| match slot {+ Some(slot) => slot.body(ui, body),+ None => body(ui),+ });+}++impl BackingTooltipExt for egui::Response {+ fn backing_on_hover_ui(self, body: impl FnOnce(&mut egui::Ui)) -> Self {+ show_backing_tooltip(self.id, egui::Tooltip::for_enabled(&self), body);+ self+ }+ fn backing_on_disabled_hover_ui(self, body: impl FnOnce(&mut egui::Ui)) -> Self {+ show_backing_tooltip(self.id, egui::Tooltip::for_disabled(&self), body);+ self+ }+ fn backing_on_hover_ui_at_pointer(self, body: impl FnOnce(&mut egui::Ui)) -> Self {+ show_backing_tooltip(self.id, egui::Tooltip::for_enabled(&self).at_pointer().gap(12.0), body);+ self+ }+ fn backing_on_hover_text(self, text: impl Into<WidgetText>) -> Self {+ self.backing_on_hover_ui(|ui| {+ ui.set_max_width(ui.spacing().tooltip_width);+ ui.label(text);+ })+ }+ fn backing_on_disabled_hover_text(self, text: impl Into<WidgetText>) -> Self {+ self.backing_on_disabled_hover_ui(|ui| {+ ui.set_max_width(ui.spacing().tooltip_width);+ ui.label(text);+ })+ }+ fn backing_on_hover_text_at_pointer(self, text: impl Into<WidgetText>) -> Self {+ self.backing_on_hover_ui_at_pointer(|ui| {+ ui.set_max_width(ui.spacing().tooltip_width);+ ui.label(text);+ })+ }+ fn backing_show_tooltip_ui(&self, body: impl FnOnce(&mut egui::Ui)) {+ let popup = egui::Popup::from_response(self).kind(egui::PopupKind::Tooltip);+ let slot = BackingSlot::reserve(&self.ctx, egui::LayerId::new(egui::Order::Tooltip, popup.get_id()));+ popup.show(|ui| match slot {+ Some(slot) => slot.body(ui, body),+ None => body(ui),+ });+ }+ fn backing_show_tooltip_text(&self, text: impl Into<WidgetText>) {+ self.backing_show_tooltip_ui(|ui| {+ ui.label(text);+ });+ }+}+/// The feature sheet's deliberately restricted stock Window (no title, scrolling or fades)./// Keep its builder private: the marker's layer and host clip are owned here.pub(crate) struct FeatureWindow<'a> {@@ -211,13 +430,42 @@ impl Container {}/// Standard content tooltip, including the same host and padding as library samples.+ pub(crate) fn show_tooltip<R>(parent: Id, tip: egui::Tooltip<'_>, body: impl FnOnce(&mut egui::Ui) -> R) -> Option<egui::InnerResponse<R>> {+ let slot = tip+ .popup+ .is_open()+ .then(|| {+ BackingSlot::reserve(+ tip.popup.ctx(),+ egui::LayerId::new(egui::Order::Tooltip, egui::Tooltip::next_tooltip_id(tip.popup.ctx(), parent)),+ )+ })+ .flatten();+ tip.show(|ui| match slot {+ Some(slot) => slot.body(ui, body),+ None => body(ui),+ })+ }+pub(crate) fn tooltip(response: &egui::Response, text: &str) {let ctx = &response.ctx;+ let parent = response.id;let mut tip = egui::Tooltip::for_enabled(response).at_pointer();tip.popup = tip.popup.frame(Self::new(ctx, Surface::Toast).tooltip_frame(ctx));+ let slot = tip+ .popup+ .is_open()+ .then(|| BackingSlot::reserve(ctx, egui::LayerId::new(egui::Order::Tooltip, egui::Tooltip::next_tooltip_id(tip.popup.ctx(), parent))))+ .flatten();tip.show(|ui| {- ui.label(text);- crate::scenario::publish_rect("kit:tooltip", ui.min_rect());+ let body = |ui: &mut egui::Ui| {+ ui.label(text);+ crate::scenario::publish_rect("kit:tooltip", ui.min_rect());+ };+ match slot {+ Some(slot) => slot.body(ui, body),+ None => body(ui),+ }});}@@ -225,11 +473,23 @@ impl Container {/// at the pointer, so it does not cover the row's neighbours.pub(crate) fn tooltip_ui(response: &egui::Response, add: impl FnOnce(&mut egui::Ui)) {let ctx = &response.ctx;+ let parent = response.id;let mut tip = egui::Tooltip::for_enabled(response);tip.popup = tip.popup.align(egui::RectAlign::RIGHT_START).frame(Self::new(ctx, Surface::Toast).tooltip_frame(ctx));+ let slot = tip+ .popup+ .is_open()+ .then(|| BackingSlot::reserve(ctx, egui::LayerId::new(egui::Order::Tooltip, egui::Tooltip::next_tooltip_id(tip.popup.ctx(), parent))))+ .flatten();tip.show(|ui| {- add(ui);- crate::scenario::publish_rect("kit:tooltip", ui.min_rect());+ let body = |ui: &mut egui::Ui| {+ add(ui);+ crate::scenario::publish_rect("kit:tooltip", ui.min_rect());+ };+ match slot {+ Some(slot) => slot.body(ui, body),+ None => body(ui),+ }});}@@ -331,13 +591,51 @@ impl Container {self.show_frame_background(ui, frame, bounds, background, body)}+ /// Stock Frame path for backing cards; no additional inset chrome is introduced.+ pub(crate) fn show_backing<R>(ui: &mut egui::Ui, frame: Frame, body: impl FnOnce(&mut egui::Ui) -> R) -> egui::InnerResponse<R> {+ if !crate::blur::enabled()+ || frame.fill.a() == 0+ || (frame.fill.a() == 255 && ui.painter().opacity() >= 1.0)+ || ui.ctx().viewport_id() != egui::ViewportId::ROOT+ {+ return frame.show(ui, body);+ }+ let slot = ui.painter().add(egui::Shape::Noop);+ let mut prepared = frame.begin(ui);+ let inner = body(&mut prepared.content_ui);+ ui.painter().set(slot, crate::blur::decorate(ui.painter(), frame, prepared.content_ui.min_rect(), egui::Shape::Noop));+ egui::InnerResponse { inner, response: prepared.end(ui) }+ }++ /// Fill an already-reserved backing slot, preserving its original paint ordering.+ pub(crate) fn set_backing(painter: &egui::Painter, slot: egui::layers::ShapeIdx, frame: Frame, content: egui::Rect) {+ let shape = frame.paint(content);+ painter.set(slot, if crate::blur::enabled() { crate::blur::decorate(painter, frame, content, shape) } else { shape });+ }++ pub(crate) fn show_central<R>(+ ui: &mut egui::Ui,+ panel: egui::CentralPanel,+ frame: Frame,+ body: impl FnOnce(&mut egui::Ui) -> R,+ ) -> egui::InnerResponse<R> {+ if !crate::blur::enabled()+ || frame.fill.a() == 0+ || (frame.fill.a() == 255 && ui.painter().opacity() >= 1.0)+ || ui.ctx().viewport_id() != egui::ViewportId::ROOT+ {+ return panel.frame(frame).show(ui, body);+ }+ let slot = BackingSlot::reserve(ui.ctx(), ui.layer_id());+ panel.frame(frame).show(ui, |ui| match slot {+ Some(slot) => slot.body(ui, body),+ None => body(ui),+ })+ }+fn background(self, ctx: &Context, frame: Frame) -> Option<Background> {// Keep the off path to boundary checks only: no painter, shape slot or allocation.- if self.adaptive() && crate::blur::enabled() && ctx.viewport_id() == egui::ViewportId::ROOT && (1..255).contains(&frame.fill.a()) {- Some(crate::blur::decorate)- } else {- None- }+ if crate::blur::enabled() && ctx.viewport_id() == egui::ViewportId::ROOT && frame.fill.a() > 0 { Some(crate::blur::decorate) } else { None }}pub(super) fn show_frame_background<R>(@@ -405,14 +703,15 @@ impl Container {/// Manually painted chrome uses exactly the same outer and inset policy as hosts.pub(crate) fn paint_frame(painter: &egui::Painter, frame: Frame, content: egui::Rect) {- painter.add(frame.paint(content));+ let shape = frame.paint(content);+ painter.add(if crate::blur::enabled() { crate::blur::decorate(painter, frame, content, shape) } else { shape });Self::paint_inset(painter, frame.widget_rect(content), frame);}/// Semantic manually painted workspace surface; HUDs keep `paint_frame`.pub(crate) fn paint_background(self, painter: &egui::Painter, frame: Frame, content: egui::Rect) {let shape = frame.paint(content);- painter.add(if self.adaptive() && crate::blur::enabled() { crate::blur::decorate(painter, frame, content, shape) } else { shape });+ painter.add(if crate::blur::enabled() { crate::blur::decorate(painter, frame, content, shape) } else { shape });}pub(crate) fn paint_panel_frame(painter: &egui::Painter, frame: Frame, content: egui::Rect) {@@ -517,12 +816,12 @@ impl Container {egui::menu::SubMenu::new()}- pub fn menu<'a>(self, response: &egui::Response) -> egui::Popup<'a> {- egui::Popup::menu(response)+ pub fn menu<'a>(self, response: &egui::Response) -> BackingPopup<'a> {+ BackingPopup(egui::Popup::menu(response))}- pub fn context_menu<'a>(self, response: &egui::Response) -> egui::Popup<'a> {- egui::Popup::context_menu(response)+ pub fn context_menu<'a>(self, response: &egui::Response) -> BackingPopup<'a> {+ BackingPopup(egui::Popup::context_menu(response))}pub(crate) fn tooltip_frame(self, ctx: &Context) -> Frame {@@ -532,8 +831,8 @@ impl Container {.inner_margin(egui::Margin::symmetric(t.space_8 as i8, t.space_4 as i8))}- pub fn modal(self, id: Id) -> egui::Modal {- egui::Modal::new(id).area(egui::Modal::default_area(id).fade_in(false))+ pub fn modal(self, id: Id) -> BackingModal {+ BackingModal { modal: egui::Modal::new(id).area(egui::Modal::default_area(id).fade_in(false)), id }}pub fn central(self) -> egui::CentralPanel {diff --git a/crates/ui-egui/src/ui_kit/details.rs b/crates/ui-egui/src/ui_kit/details.rsindex 99dab28cf7..4ee6cbfee6 100644--- a/crates/ui-egui/src/ui_kit/details.rs+++ b/crates/ui-egui/src/ui_kit/details.rs@@ -1,4 +1,5 @@//! Description-driven details content. No tool, document or command knowledge lives here.+use crate::ui_kit::BackingTooltipExt as _;use crate::{fonts::RichTextExt as _, scenario, theme::Tokens};use egui::{RichText, Ui};@@ -233,7 +234,7 @@ fn setting(ui: &mut Ui, field: &DetailSetting, focus: bool) -> Option<DetailEvenif let DetailValue::Axis { value: vector, current } = &value&& ![[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]].contains(vector){- let response = ui.add(egui::Label::new(RichText::new(current).monospace()).wrap()).on_hover_text(current);+ let response = ui.add(egui::Label::new(RichText::new(current).monospace()).wrap()).backing_on_hover_text(current);scenario::publish_target(&format!("details:current:{}", field.id), response.rect);}changed.then(|| DetailEvent::Change(field.id.clone(), value))@@ -304,11 +305,11 @@ pub(crate) fn details(ui: &mut Ui, id: &str, description: &Details, max_height:let (rect, _) = ui.allocate_exact_size(egui::vec2(t.space_16, t.space_16), egui::Sense::hover());crate::icons::paint_icon(ui.painter(), rect, "warning", 1.0);}- ui.label(&row.label).on_hover_text(&row.label);+ ui.label(&row.label).backing_on_hover_text(&row.label);});});cells.cell(|ui| {- ui.label(RichText::new(&row.value).monospace().size(t.font_small)).on_hover_text(&row.value);+ ui.label(RichText::new(&row.value).monospace().size(t.font_small)).backing_on_hover_text(&row.value);});cells.cell(|ui| {if row.target {diff --git a/crates/ui-egui/src/ui_kit/disclosure.rs b/crates/ui-egui/src/ui_kit/disclosure.rsindex d7465bc631..8330d69e4b 100644--- a/crates/ui-egui/src/ui_kit/disclosure.rs+++ b/crates/ui-egui/src/ui_kit/disclosure.rs@@ -1,5 +1,6 @@//! One disclosure drawing for sections, trees, cards and window folds.use crate::theme::Tokens;+use crate::ui_kit::BackingTooltipExt as _;use egui::{Color32, Painter, Pos2, Rect, Response, Ui, pos2, vec2};/// Content visible: down. Content hidden: right. No animation, matching kit sections.@@ -36,7 +37,7 @@ fn disclosure_button_with_hover(ui: &mut Ui, rect: Rect, open: bool, label: &str}disclosure(ui.painter(), rect.center(), open, if response.hovered() || response.has_focus() { t.form_ink } else { t.form_dim });response.widget_info(|| egui::WidgetInfo::selected(egui::WidgetType::CollapsingHeader, ui.is_enabled(), open, label));- response.on_hover_cursor(egui::CursorIcon::PointingHand).on_hover_text(label)+ response.on_hover_cursor(egui::CursorIcon::PointingHand).backing_on_hover_text(label)}/// Dropdowns always point down, independently of popup state. Preserve their existing size.@@ -64,7 +65,7 @@ pub(crate) fn strip_toggle(ui: &mut Ui, expanded: bool, label: &str) -> Responseui.painter().galley(pos2(rect.left() + t.control_height + t.space_6, rect.center().y - title.size().y / 2.0), title, t.form_ink);}response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Button, ui.is_enabled(), label));- response.on_hover_cursor(egui::CursorIcon::PointingHand).on_hover_text(label)+ response.on_hover_cursor(egui::CursorIcon::PointingHand).backing_on_hover_text(label)}#[cfg(test)]diff --git a/crates/ui-egui/src/ui_kit/fields.rs b/crates/ui-egui/src/ui_kit/fields.rsindex a990a1c795..dbb670d2e7 100644--- a/crates/ui-egui/src/ui_kit/fields.rs+++ b/crates/ui-egui/src/ui_kit/fields.rs@@ -4,6 +4,7 @@ use super::{metrics::*,text::paint_text,};+use crate::ui_kit::BackingTooltipExt as _;use crate::ui_kit::{Container, Surface};use crate::{scenario, theme::Tokens};use egui::{Response, RichText, Ui, vec2};@@ -137,7 +138,7 @@ pub(crate) fn text_field(ui: &mut Ui, value: &mut String, hint: &str) -> (bool,/// [`text_field`] with a tooltip; returns (Enter, changed). Tokens: `same as field`.pub(crate) fn text_field_tip(ui: &mut Ui, value: &mut String, hint: &str, tip: &str) -> (bool, bool) {let (enter, changed, response) = editor(ui, value, hint, false);- response.on_hover_text(tip);+ response.backing_on_hover_text(tip);(enter, changed)}@@ -226,7 +227,7 @@ fn searchable_dropdown_with(} else {combo.icon(dropdown_arrow)};- let popup = combo.show_ui(ui, |ui| {+ let popup = super::container::show_combo(ui, ui.make_persistent_id(egui::IdSalt::new(id)), combo, |ui| {let search = ui.add(text_input(egui::TextEdit::singleline(filter)).id_salt(format!("{id}_search"))@@ -344,14 +345,16 @@ pub(crate) fn search_picker(ui: &mut Ui, p: SearchPicker<'_>) -> egui::InnerResplet mut picked = None;let response = ui.add_enabled_ui(p.enabled, |ui| {- let response = egui::ComboBox::from_id_salt(p.id)+ let combo = egui::ComboBox::from_id_salt(p.id).width(dimension(ui.available_width())).height(Tokens::get().space_24 * 20.0).selected_text(p.current).icon(dropdown_arrow)- .close_behavior(egui::PopupCloseBehavior::CloseOnClickOutside)- .show_ui(ui, |ui| picked = search_picker_popup(ui, &p, state))- .response;+ .close_behavior(egui::PopupCloseBehavior::CloseOnClickOutside);+ let response = super::container::show_combo(ui, ui.make_persistent_id(egui::IdSalt::new(p.id)), combo, |ui| {+ picked = search_picker_popup(ui, &p, state)+ })+ .response;// Closed: the next opening starts with an empty box that has the focus.if !egui::ComboBox::is_open(ui.ctx(), response.id) {ui.data_mut(|data| {@@ -507,8 +510,11 @@ fn search_picker_popup(ui: &mut Ui, p: &SearchPicker<'_>, state: egui::Id) -> OpSearchRow::Choice(choice) => {let response = search_row(ui, &compact(choice.label, SEARCH_LABEL_CAP), choice.value == p.current_value);scenario::publish_target(&format!("{}:{}", p.handles, choice.value), response.rect);- let response =- if choice.tip.is_empty() { response } else { response.on_hover_text(compact(choice.tip, SEARCH_NOTE_CAP)) };+ let response = if choice.tip.is_empty() {+ response+ } else {+ response.backing_on_hover_text(compact(choice.tip, SEARCH_NOTE_CAP))+ };if response.clicked() {picked = Some(Picked::Listed(choice.value.to_owned()));}@@ -527,7 +533,7 @@ fn search_picker_popup(ui: &mut Ui, p: &SearchPicker<'_>, state: egui::Id) -> Opif let Some(note) = note {let response = ui.add(egui::Label::new(note));if let Some(whole) = p.note.filter(|whole| whole.chars().count() > SEARCH_NOTE_SHOWN) {- response.on_hover_text(compact(whole, SEARCH_NOTE_CAP));+ response.backing_on_hover_text(compact(whole, SEARCH_NOTE_CAP));}}});@@ -625,7 +631,7 @@ fn search_group_row(ui: &mut Ui, name: &str, count: usize, open: bool) -> Responif rule_from < rule_to {painter.hline(rule_from..=rule_to, y, egui::Stroke::new(1.0, t.border));}- response.on_hover_text(crate::i18n::format("ui.agent_chat_provider_models", &[("count", &count.to_string())]))+ response.backing_on_hover_text(crate::i18n::format("ui.agent_chat_provider_models", &[("count", &count.to_string())]))}/// A `search_picker` row: as `list_picker`, but read from the left, as a list of ids is.@@ -646,7 +652,7 @@ fn search_heading(ui: &mut Ui, text: &str, height: f32) {false,);if text.chars().count() > SEARCH_LABEL_CAP {- response.on_hover_text(compact(text, SEARCH_NOTE_CAP));+ response.backing_on_hover_text(compact(text, SEARCH_NOTE_CAP));}}@@ -849,13 +855,14 @@ fn dropdown_menu_width(dimension(ui.available_width())};let selected_text = if leading_icon.is_some() { egui::WidgetText::from(dropdown_icon_text(current)) } else { current.into() };- let popup = egui::ComboBox::from_id_salt(id)+ let widget = ui.make_persistent_id(egui::IdSalt::new(&id));+ let combo = egui::ComboBox::from_id_salt(id).width(width).height(Tokens::get().space_24 * 14.0).selected_text(selected_text).icon(dropdown_arrow)- .close_behavior(close_behavior)- .show_ui(ui, add);+ .close_behavior(close_behavior);+ let popup = super::container::show_combo(ui, widget, combo, add);let response = popup.response;// The native popup closes on Escape; keep the same key from reaching the enclosing window.// Only this dropdown's shown popup owns the key, and its trigger regains keyboard focus.@@ -1214,6 +1221,8 @@ pub(crate) struct Slider {pub show_value: bool,pub integer: bool,pub workspace_accent: bool,+ /// Blur's off endpoint uses a muted hollow thumb; positive values use solid accent.+ pub off_endpoint: bool,}/// Bounded read-only code box for diagnostic payloads. Native selection and copying@@ -1232,7 +1241,7 @@ pub(crate) fn read_only_text(ui: &mut Ui, text: &str) -> Response {impl Default for Slider {fn default() -> Self {- Self { step: None, format: |v| format!("{v:.2}"), show_value: true, integer: false, workspace_accent: false }+ Self { step: None, format: |v| format!("{v:.2}"), show_value: true, integer: false, workspace_accent: false, off_endpoint: false }}}@@ -1264,6 +1273,10 @@ pub(crate) fn slider<T: egui::emath::Numeric>(ui: &mut Ui, value: &mut T, range:};ui.spacing_mut().slider_width = dimension(ui.available_width() - reserved);let mut widget = egui::Slider::new(value, range).show_value(options.show_value).handle_shape(egui::style::HandleShape::Circle);+ if options.off_endpoint {+ // Blur's step is an editing affordance, not a persisted/API quantisation rule.+ widget = widget.clamping(egui::SliderClamping::Edits);+ }if options.show_value {widget = widget.custom_formatter(move |v, _| (options.format)(v));}@@ -1295,7 +1308,15 @@ pub(crate) fn slider<T: egui::emath::Numeric>(ui: &mut Ui, value: &mut T, range:let center = egui::pos2(egui::lerp(track.x_range(), fraction), track.center().y);ui.painter().rect_filled(track, t.control_radius, t.dialog_rule);ui.painter().rect_filled(egui::Rect::from_min_max(track.min, egui::pos2(center.x, track.bottom())), t.control_radius, primary);- ui.painter().circle(center, t.space_8, t.control_fill, egui::Stroke::new(t.space_2, primary));+ let off = options.off_endpoint && value.to_f64() == 0.0;+ let fill = if off {+ egui::Color32::TRANSPARENT+ } else if options.off_endpoint {+ primary+ } else {+ t.control_fill+ };+ ui.painter().circle(center, t.space_8, fill, egui::Stroke::new(t.space_2, if off { t.form_dim } else { primary }));publish(ui, &response, egui::WidgetType::Slider);response.widget_info(|| egui::WidgetInfo::slider(ui.is_enabled(), value.to_f64(), crate::i18n::tr_label(label(ui))));scenario::publish_rect(&format!("dialog:slider_track:{}", label(ui)), slider);@@ -1641,7 +1662,7 @@ pub(crate) fn placement_field(ui: &mut Ui, id: egui::Id, value: &mut String, hin});crate::theme::TabAccent::number_focus(ui, &response);t.input_bevel(ui, &response);- response.on_hover_text(crate::i18n::tr_label(hint))+ response.backing_on_hover_text(crate::i18n::tr_label(hint))}/// Attached Library dropdown and text editor inside one bordered control.@@ -1669,7 +1690,7 @@ pub(crate) fn library_cell(ui: &mut Ui, id: egui::Id, value: &mut String, hint:if open {ui.input_mut(|i| i.consume_key(egui::Modifiers::NONE, egui::Key::Escape));}- if value.is_empty() { response.on_hover_text(crate::i18n::tr_label(hint)) } else { response }+ if value.is_empty() { response.backing_on_hover_text(crate::i18n::tr_label(hint)) } else { response }}/// Inline tree-name editor in caller-owned geometry; preserves its native focus and selection ID.diff --git a/crates/ui-egui/src/ui_kit/fields_tests.rs b/crates/ui-egui/src/ui_kit/fields_tests.rsindex 470e4387bb..fba9e19bb3 100644--- a/crates/ui-egui/src/ui_kit/fields_tests.rs+++ b/crates/ui-egui/src/ui_kit/fields_tests.rs@@ -4,6 +4,40 @@ use crate::ui_kit::*;use crate::scenario;use egui::Ui;+#[test]+fn combo_backing_zero_preserves_stock_shapes_and_semantics() {+ let fixture = |stock: bool| {+ let ctx = crate::fonts::test_context();+ let mut id = egui::Id::NULL;+ let mut semantics = String::new();+ let mut output = egui::FullOutput::default();+ for pass in 0..4 {+ if pass > 0 {+ egui::Popup::open_id(&ctx, id.with("popup"));+ }+ output = crate::test_support::frame(&ctx, egui::RawInput::default(), |ui| {+ let salt = egui::IdSalt::new("stock combo");+ let widget = ui.make_persistent_id(salt);+ let combo = egui::ComboBox::from_id_salt("stock combo").selected_text("One");+ let mut body = |ui: &mut Ui| {+ let response = ui.button("Two");+ semantics = format!("{:?}", (ui.id(), ui.max_rect(), ui.clip_rect(), response.id, response.rect));+ };+ let response = if stock { combo.show_ui(ui, &mut body) } else { container::show_combo(ui, widget, combo, &mut body) };+ id = response.response.id;+ assert_eq!(widget, id);+ semantics.push_str(&format!("{:?}", (id, response.response.rect, response.inner)));+ });+ }+ let mut shapes = Vec::new();+ for clipped in &output.shapes {+ crate::test_support::each_shape(&clipped.shape, &mut |shape| shapes.push(format!("{:?} {shape:?}", clipped.clip_rect)));+ }+ (semantics, shapes)+ };+ assert_eq!(fixture(true), fixture(false), "zero adds no shapes or slots and keeps native IDs, geometry and clip");+}+#[test]fn every_text_input_centres_its_galley_for_mono_and_proportional_fonts() {for case in ["expression", "plain", "cell", "invalid", "library", "placement", "password", "multiline", "area", "message", "search"] {diff --git a/crates/ui-egui/src/ui_kit/file_view.rs b/crates/ui-egui/src/ui_kit/file_view.rsindex 6ed0182125..c37cfdba32 100644--- a/crates/ui-egui/src/ui_kit/file_view.rs+++ b/crates/ui-egui/src/ui_kit/file_view.rs@@ -4,6 +4,7 @@ use super::{text::{paint_text, paint_text_aligned},};use crate::theme::Tokens;+use crate::ui_kit::BackingTooltipExt as _;use egui::{Align2, FontId, InnerResponse, Rect, Response, Sense, Stroke, TextureId, Ui, Vec2, pos2, vec2};pub(crate) struct RecoveryMessage<'a> {@@ -37,10 +38,10 @@ pub(crate) struct FileView;impl FileView {pub(crate) fn page<R>(ui: &mut Ui, add: impl FnOnce(&mut Ui) -> R) -> InnerResponse<R> {- super::Container::new(ui.ctx(), super::Surface::Viewport)- .central()- .frame(super::Container::new(ui.ctx(), super::Surface::Viewport).edge_frame(Tokens::get().file_background))- .show(ui, add)+ let host = super::Container::new(ui.ctx(), super::Surface::Viewport);+ let panel = host.central();+ let frame = host.edge_frame(Tokens::get().file_background);+ super::Container::show_central(ui, panel, frame, add)}pub(crate) fn content<R>(ui: &mut Ui, narrow: bool, add: impl FnOnce(&mut Ui) -> R) -> InnerResponse<R> {@@ -102,14 +103,18 @@ impl FileView {pub(crate) fn recent_list<R>(ui: &mut Ui, add: impl FnOnce(&mut Ui) -> R) -> InnerResponse<R> {let t = Tokens::get();- egui::Frame::NONE.fill(t.file_surface).stroke(t.tertiary_border(t.file_border)).corner_radius(t.radius_xl).show(ui, |ui| {- ui.spacing_mut().item_spacing.y = 0.0;- let key = ui.id().with("file_recent_index");- ui.ctx().data_mut(|data| data.insert_temp(key, 0_usize));- let result = add(ui);- ui.ctx().data_mut(|data| data.remove::<usize>(key));- result- })+ crate::ui_kit::Container::show_backing(+ ui,+ egui::Frame::NONE.fill(t.file_surface).stroke(t.tertiary_border(t.file_border)).corner_radius(t.radius_xl),+ |ui| {+ ui.spacing_mut().item_spacing.y = 0.0;+ let key = ui.id().with("file_recent_index");+ ui.ctx().data_mut(|data| data.insert_temp(key, 0_usize));+ let result = add(ui);+ ui.ctx().data_mut(|data| data.remove::<usize>(key));+ result+ },+ )}pub(crate) fn title(ui: &mut Ui, title: &str) {@@ -143,10 +148,14 @@ impl FileView {pub(crate) fn navigation<R>(ui: &mut Ui, add: impl FnOnce(&mut Ui) -> R) -> InnerResponse<R> {let t = Tokens::get();- egui::Frame::NONE.fill(t.file_rail).inner_margin(egui::Margin::symmetric(t.space_10 as i8, t.space_14 as i8)).show(ui, |ui| {- ui.spacing_mut().item_spacing.y = t.space_2;- add(ui)- })+ crate::ui_kit::Container::show_backing(+ ui,+ egui::Frame::NONE.fill(t.file_rail).inner_margin(egui::Margin::symmetric(t.space_10 as i8, t.space_14 as i8)),+ |ui| {+ ui.spacing_mut().item_spacing.y = t.space_2;+ add(ui)+ },+ )}pub(crate) fn nav_row(ui: &mut Ui, id: &str, label: &str, shortcut: &str, selected: bool, enabled: bool) -> Response {@@ -257,7 +266,7 @@ impl FileView {let painter = ui.painter().with_clip_rect(ui.clip_rect().intersect(text_rect));painter.galley(pos2(text_rect.left(), top), title.clone(), ink);painter.galley(pos2(text_rect.left(), top + title.size().y + t.space_2), caption, t.file_dim);- response.on_hover_text(format!("{label}\n{subtitle}"))+ response.backing_on_hover_text(format!("{label}\n{subtitle}"))}pub(crate) fn recent_row(ui: &mut Ui, id: &str, row: RecentRow<'_>) -> Response {@@ -356,7 +365,7 @@ impl FileView {false,);}- response.on_hover_text(row.path)+ response.backing_on_hover_text(row.path)}pub(crate) fn sample_grid(ui: &mut Ui, id: &str, samples: &[SampleCard<'_>]) -> Vec<Response> {@@ -449,12 +458,14 @@ fn recovery_panel(let t = Tokens::get();let fill = if banner { t.file_recovery } else { t.file_surface };let border = if banner { t.file_recovery_border } else { t.file_border };- egui::Frame::NONE- .fill(fill)- .stroke(if banner { Stroke::new(1.0, border) } else { t.tertiary_border(border) })- .corner_radius(t.radius_xl)- .inner_margin(egui::Margin::symmetric(t.space_16 as i8, t.space_12 as i8))- .show(ui, |ui| {+ crate::ui_kit::Container::show_backing(+ ui,+ egui::Frame::NONE+ .fill(fill)+ .stroke(if banner { Stroke::new(1.0, border) } else { t.tertiary_border(border) })+ .corner_radius(t.radius_xl)+ .inner_margin(egui::Margin::symmetric(t.space_16 as i8, t.space_12 as i8)),+ |ui| {let width = dimension(ui.available_width());let button_width = |text: &str| {ui.painter().layout_no_wrap(text.to_owned(), crate::fonts::semibold(t.font_heading), t.form_ink).size().x + t.space_14 * 2.0@@ -511,8 +522,9 @@ fn recovery_panel()});(a, b)- })- .inner+ },+ )+ .inner}fn grid_geometry(available: f32, min_width: f32, count: usize) -> (usize, f32) {@@ -556,5 +568,5 @@ fn sample_card_with_height(ui: &mut Ui, id: &str, width: f32, sample: &SampleCarlet description_top = title_top + title.size().y + t.space_8;painter.galley(pos2(inner.left(), title_top), title, t.form_ink);painter.galley(pos2(inner.left(), description_top), description, t.file_dim);- response.on_hover_text(sample.description)+ response.backing_on_hover_text(sample.description)}diff --git a/crates/ui-egui/src/ui_kit/gallery.rs b/crates/ui-egui/src/ui_kit/gallery.rsindex 9d9628c04e..b638d0f412 100644--- a/crates/ui-egui/src/ui_kit/gallery.rs+++ b/crates/ui-egui/src/ui_kit/gallery.rs@@ -778,7 +778,7 @@ const ELEMENTS: &[Element] = &[let width = 96.0;let (rect, response) = ui.allocate_exact_size(vec2(width, width * size[1] / size[0]), egui::Sense::hover());paint(ui.painter(), rect);- response.on_hover_text(*name);+ response.backing_on_hover_text(*name);}});}),@@ -837,7 +837,7 @@ const ELEMENTS: &[Element] = &[}),element!("assistant_entry", |ui, _| {let t = Tokens::get();- egui::Frame::NONE.fill(t.app_bar).show(ui, |ui| {+ crate::ui_kit::Container::show_backing(ui, egui::Frame::NONE.fill(t.app_bar), |ui| {ui.horizontal(|ui| {for state in [AssistantEntryState::Quiet,@@ -2399,7 +2399,8 @@ fn history_example(ui: &mut Ui, names: bool) {let width = crate::timeline_left::strip_width(&app);let rect = ui.allocate_space(vec2(width, 650.0)).1;ui.scope_builder(egui::UiBuilder::new().max_rect(rect.shrink(5.0)), |ui| {- ui.painter().add(Container::new(ui.ctx(), Surface::Panel).frame(ui.ctx(), Tokens::get().panel, crate::frame::Side::Left).paint(rect));+ let frame = Container::new(ui.ctx(), Surface::Panel).frame(ui.ctx(), Tokens::get().panel, crate::frame::Side::Left);+ Container::paint_frame(ui.painter(), frame, rect);crate::timeline_left::left_timeline(&mut app, ui);});}diff --git a/crates/ui-egui/src/ui_kit/history.rs b/crates/ui-egui/src/ui_kit/history.rsindex 7bf6ef5756..77da08197d 100644--- a/crates/ui-egui/src/ui_kit/history.rs+++ b/crates/ui-egui/src/ui_kit/history.rs@@ -1,4 +1,5 @@//! Shared history chips, dense name rows, drop bars and rollback markers.+use crate::ui_kit::BackingTooltipExt as _;use crate::{icons,theme::{TabAccent, Tokens},@@ -246,7 +247,7 @@ impl HistoryTransport {icons::glyphs::transport_glyph(ui.painter(), rect.center(), glyph, t.icon);let label = self.label(playing);response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Button, ui.is_enabled(), label));- response.on_hover_cursor(egui::CursorIcon::PointingHand).on_hover_text(label)+ response.on_hover_cursor(egui::CursorIcon::PointingHand).backing_on_hover_text(label)}}@@ -392,7 +393,7 @@ pub(crate) fn history_seam(ui: &mut egui::Ui, card: Rect, names: bool) -> Historlet mut tip = egui::Tooltip::for_widget(&response);let frame = super::Container::new(ui.ctx(), super::Surface::Toast).tooltip_frame(ui.ctx());tip.popup = tip.popup.anchor(seam.pill).align(egui::RectAlign::RIGHT_START).frame(frame);- tip.show(|ui| {+ crate::ui_kit::Container::show_tooltip(response.id, tip, |ui| {let t = Tokens::get();ui.label(egui::RichText::new(label).font(crate::fonts::semibold(t.font_body)).color(t.text));ui.label(egui::RichText::new(crate::i18n::tr("ui.history_edge_hint")).size(t.font_small).color(t.text_dim));diff --git a/crates/ui-egui/src/ui_kit/layout.rs b/crates/ui-egui/src/ui_kit/layout.rsindex 11d136acf1..83bd1f9fa5 100644--- a/crates/ui-egui/src/ui_kit/layout.rs+++ b/crates/ui-egui/src/ui_kit/layout.rs@@ -1,5 +1,6 @@//! Layout elements for dense cards; see `docs/ui-kit.md` for tokens and usage.use super::{metrics::*, text::paint_text};+use crate::ui_kit::BackingTooltipExt as _;use crate::{scenario, theme::Tokens};use egui::{Response, RichText, Ui, vec2};use solidcraft_engine::kernel::Continuity;@@ -103,7 +104,7 @@ pub(crate) fn catalog_footer(ui: &mut Ui, text: &str) -> Response {/// A short note with further guidance on its information icon and text.pub(crate) fn catalog_footer_with_tip(ui: &mut Ui, text: &str, tip: &str) {- catalog_footer(ui, text).on_hover_text(tip);+ catalog_footer(ui, text).backing_on_hover_text(tip);}/// A filling catalog body above a measured, bottom-anchored footer. Long detail@@ -265,7 +266,7 @@ pub(crate) fn continuity_row_explained(ui: &mut Ui, label: &str, id: &str, valueif let Some(g) = allowed.get(index) {*value = *g;}- response.on_hover_text(tip)+ response.backing_on_hover_text(tip)}/// The hover text of a continuity choice: each order's own line, which names its code.@@ -331,7 +332,7 @@ fn sized_row_body<R>(ui: &mut Ui, text: &str, height: f32, control: impl FnOnce(.layout(egui::Layout::left_to_right(egui::Align::Center)),|ui| {ui.add(egui::Label::new(RichText::new(shown.clone()).size(t.font_label).color(t.dialog_label)).truncate())- .on_hover_text(&shown)+ .backing_on_hover_text(&shown)},).inner;@@ -339,7 +340,8 @@ fn sized_row_body<R>(ui: &mut Ui, text: &str, height: f32, control: impl FnOnce(scenario::publish_rect(&format!("dialog:row_label:{text}"), label.rect);scenario::publish_rect(&format!("dialog:row_help:{text}"), help.rect);} else {- ui.add(egui::Label::new(RichText::new(shown.clone()).size(t.font_label).color(t.dialog_label)).truncate()).on_hover_text(shown);+ ui.add(egui::Label::new(RichText::new(shown.clone()).size(t.font_label).color(t.dialog_label)).truncate())+ .backing_on_hover_text(shown);}});}@@ -761,7 +763,7 @@ pub(crate) fn text_lines(ui: &mut Ui, id: &str, text: &str) {let height = ui.fonts_mut(|f| f.row_height(&font));let response = egui::ScrollArea::vertical().id_salt(id).max_height(t.control_height * 15.0).show_rows(ui, height, lines.len(), |ui, rows| {for line in lines.get(rows).unwrap_or_default() {- ui.add(egui::Label::new(RichText::new(*line).font(font.clone()).color(t.form_ink)).truncate()).on_hover_text(*line);+ ui.add(egui::Label::new(RichText::new(*line).font(font.clone()).color(t.form_ink)).truncate()).backing_on_hover_text(*line);}});scenario::publish_rect(&format!("dialog:lines:{id}"), response.inner_rect);@@ -854,17 +856,20 @@ fn text_impl(ui: &mut Ui, text: &str, style: Text<'_>, hover_hint: Option<&str>)});paint_text(ui, rect, text, font, ink, false);response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Label, ui.is_enabled(), text));- response.on_hover_text(tooltip.as_deref().unwrap_or(text))+ response.backing_on_hover_text(tooltip.as_deref().unwrap_or(text))} else if matches!(style, Text::Error(_)) {- egui::Frame::NONE- .fill(t.form_error_fill)- .corner_radius(t.control_radius)- .inner_margin(egui::Margin::symmetric(t.form_inset as i8, t.space_6 as i8))- .show(ui, |ui| {+ crate::ui_kit::Container::show_backing(+ ui,+ egui::Frame::NONE+ .fill(t.form_error_fill)+ .corner_radius(t.control_radius)+ .inner_margin(egui::Margin::symmetric(t.form_inset as i8, t.space_6 as i8)),+ |ui| {ui.set_min_width(dimension(ui.available_width()));ui.add(egui::Label::new(RichText::new(text).font(font).color(ink)).wrap())- })- .inner+ },+ )+ .inner} else if matches!(style, Text::Hint(_) | Text::Note(_) | Text::MonoNote(_)) {let width = dimension(ui.available_width());let galley = if matches!(style, Text::Note(_)) { note_galley(ui, text) } else { ui.painter().layout(text.to_owned(), font, ink, width) };@@ -877,7 +882,7 @@ fn text_impl(ui: &mut Ui, text: &str, style: Text<'_>, hover_hint: Option<&str>)let label = egui::Label::new(RichText::new(text).font(font).color(ink));ui.add(if matches!(style, Text::Inline) { label.truncate() } else { label.wrap() })};- let response = if matches!(style, Text::Hint(_)) { response.on_hover_text(text) } else { response };+ let response = if matches!(style, Text::Hint(_)) { response.backing_on_hover_text(text) } else { response };let (kind, key) = match style {Text::Hint(key) => ("hint", key),Text::Note(key) | Text::MonoNote(key) => ("note", key),@@ -906,7 +911,7 @@ pub(crate) fn summary_row(ui: &mut Ui, name: &str, summary: &str, enabled: &mutlet check = egui::Rect::from_min_size(rect.min + vec2(t.space_6, 0.0), vec2(t.space_24, rect.height()));let changed = ui.scope_builder(egui::UiBuilder::new().max_rect(check).layout(egui::Layout::left_to_right(egui::Align::Center)), |ui| {- super::checkbox(ui, "", enabled).on_hover_text(crate::i18n::tr_label("Enable rule")).changed()+ super::checkbox(ui, "", enabled).backing_on_hover_text(crate::i18n::tr_label("Enable rule")).changed()}).inner;let right = (rect.right() - dimension(actions_width) - t.space_6).max(check.right());@@ -918,7 +923,7 @@ pub(crate) fn summary_row(ui: &mut Ui, name: &str, summary: &str, enabled: &mutlet detail = egui::Rect::from_min_max(egui::pos2(text.left(), text.center().y), text.max);paint_text(ui, title, name, crate::fonts::semibold(t.font_label), t.form_ink, false);paint_text(ui, detail, summary, egui::FontId::proportional(t.font_small), t.form_dim, false);- let response = ui.interact(text, ui.id().with("summary"), egui::Sense::hover()).on_hover_text(summary);+ let response = ui.interact(text, ui.id().with("summary"), egui::Sense::hover()).backing_on_hover_text(summary);response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Label, ui.is_enabled(), format!("{name}: {summary}")));scenario::publish_rect(&format!("dialog:inline:{name}"), title);scenario::publish_rect("dialog:report:rule_report", detail);diff --git a/crates/ui-egui/src/ui_kit/menu.rs b/crates/ui-egui/src/ui_kit/menu.rsindex c512bf262d..4c18ba2df8 100644--- a/crates/ui-egui/src/ui_kit/menu.rs+++ b/crates/ui-egui/src/ui_kit/menu.rs@@ -85,7 +85,11 @@ impl Menu {} else {submenu};- submenu.show(ui, &response, content)+ let slot = super::container::BackingSlot::reserve(ui.ctx(), egui::LayerId::new(egui::Order::Foreground, popup_id));+ submenu.show(ui, &response, |ui| match slot {+ Some(slot) => slot.body(ui, content),+ None => content(ui),+ })} else if beside {let open = Self::flyout_open(ui, &response, popup_id);let popup = Container::new(ui.ctx(), Surface::Popup).menu(&response).open(open).frame(frame);diff --git a/crates/ui-egui/src/ui_kit/mod.rs b/crates/ui-egui/src/ui_kit/mod.rsindex 43d1732c7b..ce2248db9b 100644--- a/crates/ui-egui/src/ui_kit/mod.rs+++ b/crates/ui-egui/src/ui_kit/mod.rs@@ -66,7 +66,7 @@ pub(crate) use choice::*;pub(crate) use color::*;pub(crate) use compare::*;pub(crate) use confirm::{Confirm, Tone};-pub use container::{Container, DockEdges, Edge, Surface};+pub use container::{BackingTooltipExt, Container, DockEdges, Edge, Surface};pub(crate) use details::*;pub(crate) use disclosure::*;pub(crate) use drag::*;diff --git a/crates/ui-egui/src/ui_kit/name_list.rs b/crates/ui-egui/src/ui_kit/name_list.rsindex d2a4383c00..c3391b5c77 100644--- a/crates/ui-egui/src/ui_kit/name_list.rs+++ b/crates/ui-egui/src/ui_kit/name_list.rs@@ -2,6 +2,7 @@//! cells leave. Built on the kit's table grid; see `docs/ui-kit.md` for tokens and usage.use super::metrics::dimension;use super::table::{Column, Table, TableRow, table_custom};+use crate::ui_kit::BackingTooltipExt as _;use crate::{scenario, theme::Tokens};use egui::{Response, Ui, vec2};@@ -112,5 +113,5 @@ fn name_text(ui: &mut Ui, name: &str) -> Response {let id = format!("dialog:name:{name}");scenario::publish_rect(&id, rect);scenario::publish_count(&format!("{id}:cut"), f64::from(u8::from(cut)));- if cut { response.on_hover_text(name) } else { response }+ if cut { response.backing_on_hover_text(name) } else { response }}diff --git a/crates/ui-egui/src/ui_kit/navigation_menu.rs b/crates/ui-egui/src/ui_kit/navigation_menu.rsindex 1fb5ca6c11..a1f43ac310 100644--- a/crates/ui-egui/src/ui_kit/navigation_menu.rs+++ b/crates/ui-egui/src/ui_kit/navigation_menu.rs@@ -1,5 +1,6 @@//! Popup and tooltip skin from the approved navigation boards.use super::{Container, Surface, navigation::*};+use crate::ui_kit::BackingTooltipExt as _;use crate::{icons, navigation_bar::Edge, theme::Tokens};use egui::{Align2, FontId, Rect, Response, Sense, Ui, pos2, vec2};@@ -88,7 +89,7 @@ impl<'a> NavigationMenuRow<'a> {icons::paint_ink(ui.painter(), arrow, "chevron", t.form_dim);}response.widget_info(|| egui::WidgetInfo::selected(egui::WidgetType::Button, self.enabled && ui.is_enabled(), self.selected, self.label));- if cut { response.on_hover_text(self.label) } else { response }+ if cut { response.backing_on_hover_text(self.label) } else { response }}}diff --git a/crates/ui-egui/src/ui_kit/navigation_settings.rs b/crates/ui-egui/src/ui_kit/navigation_settings.rsindex 2e2cac1d0e..a67d9e12c2 100644--- a/crates/ui-egui/src/ui_kit/navigation_settings.rs+++ b/crates/ui-egui/src/ui_kit/navigation_settings.rs@@ -1,5 +1,6 @@//! Preference compositions for the approved Navigation bar board.use super::{Container, Surface, navigation::*};+use crate::ui_kit::BackingTooltipExt as _;use crate::{icons, theme::Tokens};use egui::{FontId, Rect, Response, Sense, Ui, pos2, vec2};@@ -128,7 +129,7 @@ pub(crate) fn navigation_anchor_picker(ui: &mut Ui, id: &str, selected: usize, l}response.widget_info(|| egui::WidgetInfo::selected(egui::WidgetType::RadioButton, ui.is_enabled(), on, *label));crate::scenario::publish_target(&format!("prefs:navbar:anchor:{index}"), cell);- if response.on_hover_text(*label).clicked() {+ if response.backing_on_hover_text(*label).clicked() {clicked = Some(index);}}diff --git a/crates/ui-egui/src/ui_kit/panel.rs b/crates/ui-egui/src/ui_kit/panel.rsindex e130e24b43..5db9a8abb4 100644--- a/crates/ui-egui/src/ui_kit/panel.rs+++ b/crates/ui-egui/src/ui_kit/panel.rs@@ -1,5 +1,6 @@//! Panel elements for dense cards; see `docs/ui-kit.md` for tokens and usage.use super::{actions::icon_button_at, metrics::*, text::paint_text};+use crate::ui_kit::BackingTooltipExt as _;use crate::{scenario, theme::Tokens};use egui::{Ui, vec2};@@ -204,7 +205,7 @@ impl<'a> TopHeader<'a> {if state.busy {egui::Spinner::new().size(t.space_14).paint_at(ui, self.icon);let status = state.text.as_deref().unwrap_or_else(|| crate::i18n::tr_label("Updating the preview"));- ui.interact(self.icon, ui.id().with("compute_status"), egui::Sense::hover()).on_hover_text(status);+ ui.interact(self.icon, ui.id().with("compute_status"), egui::Sense::hover()).backing_on_hover_text(status);ui.ctx().request_repaint_after(std::time::Duration::from_millis(100));} else {crate::icons::paint_icon(ui.painter(), self.icon, icon, 1.0);@@ -218,7 +219,7 @@ impl<'a> TopHeader<'a> {title_response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Label, ui.is_enabled(), title));// The buttons take the row's width first; a title that no longer fits says itself on hover.if ui.painter().layout_no_wrap(title.to_owned(), heading, t.form_ink).size().x > self.title.width() {- title_response.on_hover_text(title);+ title_response.backing_on_hover_text(title);}self.actions.show(ui, ok_enabled)}@@ -863,7 +864,7 @@ impl<'a> Panel<'a> {egui::Spinner::new().size(t.space_14).paint_at(ui, rect);scenario::publish_rect("dialog:footer:spinner", rect);let status = state.text.as_deref().unwrap_or_else(|| crate::i18n::tr_label("Updating the preview"));- ui.interact(rect, ui.id().with("compute_status"), egui::Sense::hover()).on_hover_text(status);+ ui.interact(rect, ui.id().with("compute_status"), egui::Sense::hover()).backing_on_hover_text(status);ui.ctx().request_repaint_after(std::time::Duration::from_millis(100));}},@@ -1263,7 +1264,7 @@ impl<'a> Window<'a> {(None, Some((pivot, pos))) => window.pivot(pivot).default_pos(pos),(None, None) => window.pivot(egui::Align2::CENTER_CENTER).default_pos(ctx.content_rect().center() - vec2(0.0, row_height() * 2.5)),};- let shown = window.show(ctx, |ui| {+ let shown = super::container::FeatureWindow::new(window, self.id, frame).show(ctx, |ui| {let result = add(ui);super::Container::finish_content(ui, frame);result@@ -1378,7 +1379,7 @@ fn page_list_sized<S>(ui.ctx().set_cursor_icon(egui::CursorIcon::PointingHand);}scenario::publish_target(page.handle, rect);- response.on_hover_text(label);+ response.backing_on_hover_text(label);}});});diff --git a/crates/ui-egui/src/ui_kit/preferences.rs b/crates/ui-egui/src/ui_kit/preferences.rsindex 01de54a9bc..9d79a75fc5 100644--- a/crates/ui-egui/src/ui_kit/preferences.rs+++ b/crates/ui-egui/src/ui_kit/preferences.rs@@ -2,6 +2,7 @@//! never additional application viewports; every colour and control metric comes from tokens.pub(crate) use super::preferences_figure_data::{paint_assembly_move, paint_direct_interaction, paint_measure_axis_distances, paint_tool_cursor};use super::{metrics::dimension, text::paint_text};+use crate::ui_kit::BackingTooltipExt as _;use crate::{scenario,theme::{ColorVision, Tokens},@@ -10,6 +11,79 @@ use egui::{Color32, FontId, Pos2, Rect, Response, Sense, Stroke, Ui, pos2, vec2}pub(super) const PAGE_SCROLL_GUTTER: &str = "sc_page_scroll_gutter";+pub(crate) fn blur_cost_bars(radius: f32) -> usize {+ if radius.is_finite() && radius > 0.0 { (radius / 8.0).ceil().clamp(1.0, 5.0) as usize } else { 0 }+}++fn blur_meter_width(t: &Tokens) -> f32 {+ t.space_4 * 5.0 + t.space_2 * 4.0+}++fn blur_cost_meter(ui: &mut Ui, radius: f32) {+ let t = Tokens::get();+ let (rect, response) = ui.allocate_exact_size(vec2(blur_meter_width(&t), t.control_height), Sense::hover());+ let filled = blur_cost_bars(radius);+ if filled == 0 {+ ui.painter().rect_filled(Rect::from_center_size(rect.center(), vec2(rect.width(), t.space_2)), t.radius_sm, t.form_dim);+ } else {+ let heights = [t.space_4, t.space_6, t.space_8, t.space_8 + t.space_3, t.space_14];+ for (i, height) in heights.into_iter().enumerate() {+ let bar = Rect::from_min_size(+ pos2(rect.left() + i as f32 * (t.space_4 + t.space_2), rect.center().y + t.space_8 - height),+ vec2(t.space_4, height),+ );+ ui.painter().rect_filled(bar, t.radius_sm, if i < filled { t.form_primary } else { t.dialog_rule });+ }+ }+ scenario::publish_rect("prefs:blur_cost", rect);+ response.backing_on_hover_text(crate::i18n::tr("prefs.blur_cost"));+}++/// Theme problems stay inline when space permits, with stacked text and wrapping actions otherwise.+pub(crate) fn theme_option_notice(ui: &mut Ui, id: &str, text: &str, can_undo: bool) -> (bool, bool) {+ let mut undo = false;+ let mut dismiss = false;+ let response = ui.push_id(("theme_notice", id, text), |ui| {+ let t = Tokens::get();+ let dismiss_label = crate::i18n::tr("prefs.theme_notice_dismiss");+ let actions = super::ContentWidth::button(ui, dismiss_label)+ + t.space_8+ + if can_undo { super::ContentWidth::button(ui, crate::i18n::tr("ui.undo")) + t.space_8 } else { 0.0 };+ let mut draw_actions = |ui: &mut Ui| {+ if can_undo {+ let response = super::text_button(ui, crate::i18n::tr("ui.undo"), true);+ scenario::publish_target("prefs:theme_notice_undo:guard", response.rect);+ undo = response.clicked();+ }+ let response = super::text_button(ui, dismiss_label, true);+ scenario::publish_target(&format!("prefs:theme_notice_dismiss:{id}"), response.rect);+ dismiss = response.clicked();+ };+ let width = dimension(ui.available_width());+ let text_minimum =+ ui.painter().layout_no_wrap(text.to_owned(), FontId::proportional(t.font_body), t.form_dim).size().x.min(t.form_label_width);+ if width >= actions + text_minimum {+ ui.horizontal_top(|ui| {+ let width = dimension(ui.available_width() - actions);+ ui.allocate_ui_with_layout(vec2(width, 0.0), egui::Layout::top_down(egui::Align::Min), |ui| {+ super::text(ui, text, super::Text::Hint(id));+ });+ draw_actions(ui);+ });+ } else {+ ui.allocate_ui_with_layout(vec2(width, 0.0), egui::Layout::top_down(egui::Align::Min), |ui| {+ ui.set_width(width);+ // The form normally truncates controls; a long translated action may wrap here.+ ui.style_mut().wrap_mode = Some(egui::TextWrapMode::Wrap);+ super::text(ui, text, super::Text::Hint(id));+ ui.horizontal_wrapped(draw_actions);+ });+ }+ });+ scenario::publish_rect(&format!("prefs:theme_notice:{id}"), response.response.rect);+ (undo, dismiss)+}+/// Presentation data is resolved by the caller; controls never distinguish standard/custom ids.pub(crate) struct ThemeOptionRow<'a> {pub definition: &'a crate::theme_files::OptionDef,@@ -17,6 +91,7 @@ pub(crate) struct ThemeOptionRow<'a> {pub help: String,pub choices: Vec<String>,pub reason: Option<String>,+ pub blur: bool,}#[derive(Clone, Copy)]@@ -49,7 +124,10 @@ fn theme_option_metrics(ui: &Ui, option: &ThemeOptionRow<'_>, value: Option<&cra.into_iter().map(|n| super::ContentWidth::label(ui, &format!("{n}{}", unit.as_deref().unwrap_or("")))).fold(0.0, f32::max);- theme_option_slider_minimum(&t) + t.space_8 + readout+ if option.blur {+ readout = readout.max(super::ContentWidth::label(ui, crate::i18n::tr("prefs.blur_off")));+ }+ theme_option_slider_minimum(&t) + t.space_8 + readout + if option.blur { blur_meter_width(&t) + t.space_8 } else { 0.0 }}OptionKind::Choice { values, .. } => {if values.len() > 5 {@@ -114,6 +192,9 @@ pub(crate) fn theme_options_list(for &index in cell {let Some(option) = options.get(index) else { continue };advanced |= option.definition.advanced;+ if option.blur && cell.len() == 1 {+ width = Width::Wide;+ }if let OptionKind::Choice { values, .. } = &option.definition.kind&& choice_width(values.len()) == Width::Wide{@@ -239,7 +320,8 @@ fn theme_option_control(theme_option_switch(ui, &option.label, on);}(OptionKind::Range { min, max, step, unit, .. }, OptionValue::Num(n)) => {- let available = dimension(ui.available_width() - metrics.readout - t.space_8);+ let meter = if option.blur { blur_meter_width(&t) + t.space_8 } else { 0.0 };+ let available = dimension(ui.available_width() - metrics.readout - t.space_8 - meter);// Standalone ranges fill their cell; composites retain their compact control alignment.let width =if fill_range { available } else { available.min(t.form_label_width.max(theme_option_slider_minimum(&t))) };@@ -248,7 +330,12 @@ fn theme_option_control(ui,n,*min..=*max,- super::Slider { step: Some(f64::from(*step)), show_value: false, ..Default::default() },+ super::Slider {+ step: Some(f64::from(*step)),+ show_value: false,+ off_endpoint: option.blur,+ ..Default::default()+ },);});// Keep fractional theme values visible, including sliders with fractional steps.@@ -256,10 +343,18 @@ fn theme_option_control(vec2(metrics.readout, t.control_height),egui::Layout::left_to_right(egui::Align::Center),|ui| {- super::text(ui, &format!("{}{}", *n, unit.as_deref().unwrap_or("")), super::Text::Inline);+ let label = if option.blur && *n == 0.0 {+ crate::i18n::tr("prefs.blur_off").to_owned()+ } else {+ format!("{}{}", *n, unit.as_deref().unwrap_or(""))+ };+ super::text(ui, &label, super::Text::Inline);},);scenario::publish_rect(&format!("prefs:theme_option_readout:{}", def.id), readout.response.rect);+ if option.blur {+ blur_cost_meter(ui, *n);+ }}(OptionKind::Choice { values, .. }, OptionValue::Choice(selected)) => {let labels: Vec<_> = option.choices.iter().map(String::as_str).collect();@@ -282,7 +377,7 @@ fn theme_option_control(.inner.response});- let response = response.inner.on_hover_text(&option.help);+ let response = response.inner.backing_on_hover_text(&option.help);scenario::publish_target(&format!("prefs:theme_option:{}", def.id), response.rect);if let Some(reason) = &option.reason {let note = ui.horizontal(|ui| super::settings_inline_note(ui, reason));@@ -666,7 +761,7 @@ pub(crate) fn option_card(ui: &mut Ui, label: &str, note: Option<&str>, selected}response.widget_info(|| egui::WidgetInfo::selected(egui::WidgetType::RadioButton, enabled, selected, label));scenario::publish_target(&format!("prefs:option:{label}"), rect);- let response = response.on_hover_text(label);+ let response = response.backing_on_hover_text(label);if enabled { response.on_hover_cursor(egui::CursorIcon::PointingHand) } else { response }}diff --git a/crates/ui-egui/src/ui_kit/preferences_assistant.rs b/crates/ui-egui/src/ui_kit/preferences_assistant.rsindex 783e0053f1..7cd8a77173 100644--- a/crates/ui-egui/src/ui_kit/preferences_assistant.rs+++ b/crates/ui-egui/src/ui_kit/preferences_assistant.rs@@ -1,5 +1,6 @@//! Shared concise choice cards and the agent-pointer settings specimen.use super::{metrics::dimension, text::paint_text};+use crate::ui_kit::BackingTooltipExt as _;use crate::{scenario, theme::Tokens};use egui::{FontId, Rect, Response, Sense, Stroke, Ui, pos2, vec2};@@ -136,7 +137,7 @@ fn choice_card(ui: &mut Ui, width: f32, choice: &SettingsChoice<'_>, selected: begui::WidgetInfo::selected(egui::WidgetType::RadioButton, ui.is_enabled(), selected, format!("{}: {}", choice.title, choice.detail))});scenario::publish_target(choice.key, rect);- response.on_hover_text(choice.detail).on_hover_cursor(egui::CursorIcon::PointingHand)+ response.backing_on_hover_text(choice.detail).on_hover_cursor(egui::CursorIcon::PointingHand)}/// A static preview reuses the real agent cursor artwork; it never animates or requests frames.@@ -161,7 +162,7 @@ pub(crate) fn settings_pointer_preview(ui: &mut Ui, visible: bool, speed: &str,let caption_rect = Rect::from_min_max(rect.min + vec2(t.space_8, t.space_4), pos2(rect.right() - t.space_8, rect.top() + t.space_24));paint_text(ui, caption_rect, &caption, FontId::proportional(t.font_small), t.form_dim, false);response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Label, ui.is_enabled(), &caption));- response.on_hover_text(crate::i18n::tr(if follows_camera { "ai.prefs.follow_camera_on" } else { "ai.prefs.follow_camera_off" }));+ response.backing_on_hover_text(crate::i18n::tr(if follows_camera { "ai.prefs.follow_camera_on" } else { "ai.prefs.follow_camera_off" }));}/// One muted metadata line; full commands, endpoints and tool lists remain available on hover.@@ -170,5 +171,5 @@ pub(crate) fn settings_short_note(ui: &mut Ui, text: &str) -> Response {let (rect, response) = ui.allocate_exact_size(vec2(dimension(ui.available_width()), t.space_16), Sense::hover());paint_text(ui, rect, text, FontId::proportional(t.font_small), t.form_dim, false);response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Label, ui.is_enabled(), text));- response.on_hover_text(text)+ response.backing_on_hover_text(text)}diff --git a/crates/ui-egui/src/ui_kit/preferences_cards.rs b/crates/ui-egui/src/ui_kit/preferences_cards.rsindex d775adff12..fffe60cb3f 100644--- a/crates/ui-egui/src/ui_kit/preferences_cards.rs+++ b/crates/ui-egui/src/ui_kit/preferences_cards.rs@@ -3,6 +3,7 @@//! every colour comes from `Tokens`. A card sizes to the width its container gives it and its//! figure keeps the figure's aspect ratio.use super::{metrics::dimension, preferences::centred_text};+use crate::ui_kit::BackingTooltipExt as _;use crate::{scenario, theme::Tokens};use egui::{Color32, FontId, Painter, Rect, Response, Sense, Stroke, StrokeKind, Ui, pos2, vec2};@@ -187,8 +188,8 @@ fn paint_card(ui: &mut Ui, card: &Card, width: f32, tile: bool) -> Response {let kind = if tile { egui::WidgetType::Checkbox } else { egui::WidgetType::RadioButton };response.widget_info(|| egui::WidgetInfo::selected(kind, enabled, card.selected, card.label));scenario::publish_target(&format!("prefs:card:{}", card.label), rect);- let response = response.on_hover_text(card.label);- let response = if let Some(options) = card.options { response.on_hover_text(options) } else { response };+ let response = response.backing_on_hover_text(card.label);+ let response = if let Some(options) = card.options { response.backing_on_hover_text(options) } else { response };if enabled { response.on_hover_cursor(egui::CursorIcon::PointingHand) } else { response }}@@ -388,7 +389,7 @@ pub(crate) fn help_icon(ui: &mut Ui, text: &str) -> Response {p.line_segment([pos2(rect.center().x, rect.top() + size * 0.46), pos2(rect.center().x, rect.bottom() - size * 0.24)], Stroke::new(1.2, ink));response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Label, ui.is_enabled(), text));scenario::publish_target("prefs:help_icon", rect);- response.on_hover_text(text)+ response.backing_on_hover_text(text)}/// Which items of a carousel are shown: the first one and how many fit between the two arrows.diff --git a/crates/ui-egui/src/ui_kit/preferences_figures.rs b/crates/ui-egui/src/ui_kit/preferences_figures.rsindex 09494ebec8..94267f0d1a 100644--- a/crates/ui-egui/src/ui_kit/preferences_figures.rs+++ b/crates/ui-egui/src/ui_kit/preferences_figures.rs@@ -1,6 +1,7 @@//! Deliberately composed preference illustrations. A shared orthographic projection keeps//! faces, ground contact, rotation cues and axes consistent at their small display size.use crate::theme::Tokens;+use crate::ui_kit::BackingTooltipExt as _;use egui::{Color32, Painter, Pos2, Rect, Shape, Stroke, Vec2, vec2};struct Canvas {@@ -280,7 +281,8 @@ pub(crate) fn paint_layout(ui: &mut egui::Ui, state: super::preferences::LayoutPlet dialog = panel(dialog_x, dialog_top, bw, dialog_height, "Dialogs", t.dialog_footer);crate::scenario::publish_rect("prefs:layout_preview:dialog", dialog);crate::scenario::publish_rect("prefs:layout_preview", outer);- ui.interact(outer, ui.make_persistent_id("layout_preview_help"), egui::Sense::hover()).on_hover_text(crate::i18n::tr("prefs.layout_note"));+ ui.interact(outer, ui.make_persistent_id("layout_preview_help"), egui::Sense::hover())+ .backing_on_hover_text(crate::i18n::tr("prefs.layout_note"));}#[allow(unused_imports, reason = "painted by the Preferences pages of #9875 to #9883")]diff --git a/crates/ui-egui/src/ui_kit/preferences_navigation.rs b/crates/ui-egui/src/ui_kit/preferences_navigation.rsindex 2dbaf486d0..3499421a64 100644--- a/crates/ui-egui/src/ui_kit/preferences_navigation.rs+++ b/crates/ui-egui/src/ui_kit/preferences_navigation.rs@@ -3,6 +3,7 @@ pub(crate) use super::preferences_figure_data::{paint_orbit_centre, paint_orbit_pub(crate) use super::preferences_figure_ops::{paint_navigation_axes, paint_navigation_cube};use super::{metrics::dimension, text::paint_text};use crate::theme::Tokens;+use crate::ui_kit::BackingTooltipExt as _;use egui::{FontId, Rect, Sense, Stroke, Ui, pos2, vec2};/// One mouse silhouette beside the actual mapping selector and binding legend.@@ -117,7 +118,7 @@ pub(crate) fn settings_axis_row(} else {let [label_rect, live_rect, invert_rect, speed_rect, source_rect] = axis_columns(rect);paint_text(ui, label_rect, name, FontId::proportional(t.font_label), t.form_ink, false);- ui.interact(label_rect, ui.id().with("axis_name"), Sense::hover()).on_hover_text(name);+ ui.interact(label_rect, ui.id().with("axis_name"), Sense::hover()).backing_on_hover_text(name);let live_rect = Rect::from_center_size(live_rect.center(), vec2(live_rect.width(), t.space_14));live_axis_bar_in(ui, live_rect, value, dead_zone);axis_control(ui, invert_rect, "invert", name, invert);diff --git a/crates/ui-egui/src/ui_kit/preferences_small.rs b/crates/ui-egui/src/ui_kit/preferences_small.rsindex a966a6eaf4..3971b80727 100644--- a/crates/ui-egui/src/ui_kit/preferences_small.rs+++ b/crates/ui-egui/src/ui_kit/preferences_small.rs@@ -1,5 +1,6 @@//! Shared labelled settings blocks and compact explanatory specimens.use crate::theme::Tokens;+use crate::ui_kit::BackingTooltipExt as _;use egui::{Align, FontId, Layout, Rect, Sense, Stroke, Ui, pos2, vec2};const SETTINGS_PAGE: &str = "sc_settings_page";@@ -55,7 +56,7 @@ pub(crate) fn settings_change_dot(ui: &mut Ui, label: &str) -> egui::Response {let (rect, response) = ui.allocate_exact_size(vec2(t.space_8, t.space_8), Sense::hover());ui.painter().circle_filled(rect.center(), (t.space_8 - t.space_2 / 2.0) / 2.0, t.pref_note);response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Label, ui.is_enabled(), label));- response.on_hover_text(label)+ response.backing_on_hover_text(label)}/// One compact card trigger for the pinned profile menu, without a nested input frame.@@ -101,7 +102,7 @@ pub(crate) fn settings_profile_button(ui: &mut Ui, label: &str, name: &str, edit}response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Button, ui.is_enabled(), name));crate::scenario::publish_rect("prefs:profile:sidebar_card", response.rect);- response.on_hover_text(label)+ response.backing_on_hover_text(label)}/// Compact 18 pt informational badge, with semantic foreground/background pairs.@@ -125,7 +126,7 @@ pub(crate) fn settings_state_badge(ui: &mut Ui, label: &str, tone: SettingsBadgeui.painter().galley(rect.center() - galley.size() / 2.0, galley, ink);}response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Label, ui.is_enabled(), label));- if clipped { response.on_hover_text(label) } else { response }+ if clipped { response.backing_on_hover_text(label) } else { response }}#[derive(Default)]@@ -187,11 +188,11 @@ pub(crate) fn settings_chip(ui: &mut Ui, label: &str, chip: SettingsChip<'_>) ->if let Some(key) = chip.key {// Allocate the pill in the wrapping parent before giving its action a unique identity.let mut action_ui = ui.new_child(egui::UiBuilder::new().id_salt(key).max_rect(target));- return super::quiet_icon_button_at(&mut action_ui, target, "close", remove).on_hover_text(label);+ return super::quiet_icon_button_at(&mut action_ui, target, "close", remove).backing_on_hover_text(label);}- return super::quiet_icon_button_at(ui, target, "close", remove).on_hover_text(label);+ return super::quiet_icon_button_at(ui, target, "close", remove).backing_on_hover_text(label);}- response.on_hover_text(label)+ response.backing_on_hover_text(label)}/// A labelled form block whose control column can contain several natural-height rows.diff --git a/crates/ui-egui/src/ui_kit/reports.rs b/crates/ui-egui/src/ui_kit/reports.rsindex a2410b7273..0731a7d8b5 100644--- a/crates/ui-egui/src/ui_kit/reports.rs+++ b/crates/ui-egui/src/ui_kit/reports.rs@@ -1,4 +1,5 @@//! Read-only report and library containers, sharing the form's typography and actions.+use crate::ui_kit::BackingTooltipExt as _;use crate::{scenario, theme::Tokens};use egui::{Ui, vec2};@@ -35,16 +36,19 @@ pub(crate) fn list_frame<R>(ui: &mut Ui, key: &str, add: impl FnOnce(&mut Ui) ->pub(super) fn list_frame_filled<R>(ui: &mut Ui, key: &str, fill: egui::Color32, vertical: f32, add: impl FnOnce(&mut Ui) -> R) -> R {let t = Tokens::get();- let response = egui::Frame::NONE- .fill(fill)- .stroke(t.container_border(t.dialog_rule))- .corner_radius(t.control_radius)- .inner_margin(egui::Margin::symmetric(t.space_10 as i8, vertical as i8))- .show(ui, |ui| {+ let response = crate::ui_kit::Container::show_backing(+ ui,+ egui::Frame::NONE+ .fill(fill)+ .stroke(t.container_border(t.dialog_rule))+ .corner_radius(t.control_radius)+ .inner_margin(egui::Margin::symmetric(t.space_10 as i8, vertical as i8)),+ |ui| {// Frame already subtracts its border and padding from the content width.ui.set_min_width(ui.available_width().max(0.0));add(ui)- });+ },+ );scenario::publish_rect(&format!("dialog:list:{key}"), response.response.rect);response.inner}@@ -64,7 +68,7 @@ pub(crate) fn path_chip(ui: &mut Ui, path: &str, add: impl FnOnce(&mut Ui)) {ui.painter().rect(rect, t.control_radius, t.dialog_footer, t.tertiary_border(t.dialog_rule), egui::StrokeKind::Inside);super::text::paint_text(ui, rect.shrink2(vec2(t.space_8, 0.0)), path, egui::FontId::monospace(t.font_small), t.form_dim, false);response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Label, ui.is_enabled(), path));- response.on_hover_text(path);+ response.backing_on_hover_text(path);let key = format!("dialog:cell:{path}");scenario::publish_handle(&key, rect.center());scenario::publish_rect(&key, rect);@@ -132,7 +136,7 @@ pub(crate) fn report_header(ui: &mut Ui, kind: &str, count: u64, time: &str, alifalse,);response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Label, ui.is_enabled(), alias));- response.on_hover_text(alias);+ response.backing_on_hover_text(alias);let key = format!("dialog:cell:{alias}");scenario::publish_rect(&key, rect);scenario::publish_handle(&key, rect.center());diff --git a/crates/ui-egui/src/ui_kit/review.rs b/crates/ui-egui/src/ui_kit/review.rsindex 03ee38b2cc..e287625185 100644--- a/crates/ui-egui/src/ui_kit/review.rs+++ b/crates/ui-egui/src/ui_kit/review.rs@@ -40,9 +40,13 @@ impl ReviewAndApply<'_> {});if let Some(notice) = self.notice {let t = crate::theme::Tokens::get();- egui::Frame::NONE.fill(t.accent_soft).corner_radius(t.control_radius).inner_margin(egui::Margin::same(t.space_8 as i8)).show(ui, |ui| {- text(ui, notice, Text::Note("review:physical"));- });+ crate::ui_kit::Container::show_backing(+ ui,+ egui::Frame::NONE.fill(t.accent_soft).corner_radius(t.control_radius).inner_margin(egui::Margin::same(t.space_8 as i8)),+ |ui| {+ text(ui, notice, Text::Note("review:physical"));+ },+ );}content(ui);for (label, value, key) indiff --git a/crates/ui-egui/src/ui_kit/search.rs b/crates/ui-egui/src/ui_kit/search.rsindex 9af564fab9..046e0e137e 100644--- a/crates/ui-egui/src/ui_kit/search.rs+++ b/crates/ui-egui/src/ui_kit/search.rs@@ -1,5 +1,6 @@//! Command-search composition: one expanding ribbon editor and a clipped results sheet.//! Domain ranking and command dispatch stay with the caller.+use crate::ui_kit::BackingTooltipExt as _;use crate::{icons, theme::Tokens};use egui::{FontId, Rect, Response, Sense, Stroke, Ui, pos2, vec2};@@ -124,7 +125,7 @@ impl CommandSearch {crate::scenario::publish_target("ribbon:search", r);crate::scenario::publish_target("shortcut:search", r);crate::scenario::publish_target("palette:search", r);- return ui.interact(r, egui::Id::new("sc_sbox_compact"), Sense::click()).on_hover_text(crate::i18n::tr_label("Search commands"));+ return ui.interact(r, egui::Id::new("sc_sbox_compact"), Sense::click()).backing_on_hover_text(crate::i18n::tr_label("Search commands"));}icons::paint_icon(ui.painter(),@@ -189,14 +190,13 @@ impl CommandSearch {pub(crate) fn detail(ui: &mut Ui, text: &str) {let t = Tokens::get();- egui::Frame::NONE- .fill(t.control_fill)- .stroke(t.container_border(t.dialog_rule))- .corner_radius(t.control_radius)- .inner_margin(t.space_8)- .show(ui, |ui| {+ crate::ui_kit::Container::show_backing(+ ui,+ egui::Frame::NONE.fill(t.control_fill).stroke(t.container_border(t.dialog_rule)).corner_radius(t.control_radius).inner_margin(t.space_8),+ |ui| {super::text(ui, text, super::Text::MonoNote("command_parameters"));- });+ },+ );}/// Lay out the full sheet, but allocate and paint only its unfolding height. The@@ -228,7 +228,7 @@ impl CommandSearch {}let sheet = Rect::from_min_size(origin, vec2(width, natural * progress));let frame = super::Menu::frame().inner_margin(0);- ui.painter().set(background, frame.paint(sheet.shrink(frame.stroke.width)));+ super::Container::set_backing(ui.painter(), background, frame, sheet.shrink(frame.stroke.width));// The edge-to-edge footer shares the card silhouette; keep the outer rule// above its fill, as an overflow-clipped footer would in the board.ui.painter().rect_stroke(sheet, t.radius_xl, frame.stroke, egui::StrokeKind::Inside);@@ -249,8 +249,8 @@ impl CommandSearch {super::text(ui, crate::i18n::tr(if command { "search.command_keys" } else { "search.keys" }), super::Text::Note("search_keys"));});let r = Rect::from_min_max(start, pos2(start.x + width, ui.min_rect().bottom()));- ui.painter()- .set(background, egui::Shape::rect_filled(r, egui::CornerRadius { nw: 0, ne: 0, sw: t.radius_xl, se: t.radius_xl }, t.dialog_footer));+ let frame = egui::Frame::NONE.fill(t.dialog_footer).corner_radius(egui::CornerRadius { nw: 0, ne: 0, sw: t.radius_xl, se: t.radius_xl });+ super::Container::set_backing(ui.painter(), background, frame, r);t.secondary_hline(ui.painter(), r.x_range(), r.top(), t.dialog_rule);crate::scenario::publish_rect("ribbon:search_footer", r);}diff --git a/crates/ui-egui/src/ui_kit/slider_tests.rs b/crates/ui-egui/src/ui_kit/slider_tests.rsindex d2d8c84804..8452ab2084 100644--- a/crates/ui-egui/src/ui_kit/slider_tests.rs+++ b/crates/ui-egui/src/ui_kit/slider_tests.rs@@ -2,6 +2,141 @@ use super::*;use crate::{scenario, theme::Tokens};use egui::{Rect, Ui, pos2, vec2};+#[test]+fn theme_notice_actions_fit_wrap_and_accept_native_pointer_clicks_in_both_themes() {+ const NOTICE: &str = "A theme option changed. Undo restores the previous value; dismiss keeps the current value and closes this notice.";++ fn frame(ctx: &egui::Context, width: f32, can_undo: bool, events: Vec<egui::Event>) -> (bool, bool) {+ scenario::clear_handles();+ let mut clicked = (false, false);+ crate::test_support::frame(+ ctx,+ egui::RawInput {+ screen_rect: Some(Rect::from_min_size(egui::Pos2::ZERO, vec2(1200.0, 1600.0))),+ events,+ focused: true,+ ..Default::default()+ },+ |ui| {+ let mut content = Rect::NOTHING;+ let allocated = ui.allocate_ui_with_layout(vec2(width, ui.available_height()), egui::Layout::top_down(egui::Align::Min), |ui| {+ ui.set_width(width);+ content = ui.max_rect().intersect(ui.clip_rect());+ ui.set_clip_rect(content);+ scope(ui, |ui| {+ clicked = theme_option_notice(ui, "guard", NOTICE, can_undo);+ });+ });+ for (target, present) in [("prefs:theme_notice_undo:guard", can_undo), ("prefs:theme_notice_dismiss:guard", true)] {+ let rect = scenario::rect_of(target);+ if present {+ let rect = rect.expect("notice action");+ assert!(content.contains_rect(rect), "{target} clips at width {width}: {rect:?} outside {content:?}");+ assert!(allocated.response.rect.contains_rect(rect), "{target} must be inside the allocated notice content");+ assert!(rect.is_positive());+ assert_eq!(scenario::handle_at(target), Some(rect.center()));+ } else {+ assert!(rect.is_none(), "Undo must be absent when unavailable");+ }+ }+ },+ );+ clicked+ }++ let previous = crate::theme::is_dark();+ for dark in [false, true] {+ crate::theme::set_dark(dark);+ for language in ["en", "de"] {+ let _language = crate::i18n::scope(language);+ let t = Tokens::get();+ let mut undo_width = 0.0;+ let mut dismiss_width = 0.0;+ let mut label_wrap_width = 0.0;+ test_support::frame(&crate::fonts::test_context(), vec![], |ui| {+ undo_width = ContentWidth::button(ui, crate::i18n::tr("ui.undo"));+ dismiss_width = ContentWidth::button(ui, crate::i18n::tr("prefs.theme_notice_dismiss"));+ label_wrap_width = (ContentWidth::label(ui, crate::i18n::tr("prefs.theme_notice_dismiss")) / 3.0).ceil();+ });+ let actions_width = undo_width + dismiss_width + t.space_8 * 2.0;+ let narrow_width = undo_width.max(dismiss_width);+ for (width, stacked, label_wrap) in+ [(actions_width + t.form_card_width, false, false), (narrow_width, true, false), (label_wrap_width, true, true)]+ {+ for can_undo in [true, false] {+ let ctx = crate::fonts::test_context();+ assert_eq!(frame(&ctx, width, can_undo, vec![]), (false, false));+ let text = scenario::rect_of("dialog:hint:guard").expect("notice text");+ let dismiss = scenario::rect_of("prefs:theme_notice_dismiss:guard").expect("Dismiss");+ let undo = scenario::rect_of("prefs:theme_notice_undo:guard");+ if stacked {+ assert!(dismiss.top() >= text.bottom(), "Dismiss must move below the text");+ if let Some(undo) = undo {+ assert!(undo.top() >= text.bottom(), "Undo must move below the text");+ assert!(dismiss.top() >= undo.bottom(), "actions must wrap onto separate rows at width {width}");+ }+ } else {+ assert_eq!(dismiss.top(), text.top(), "wide notices retain the inline layout");+ if let Some(undo) = undo {+ assert_eq!(undo.top(), text.top());+ assert!(dismiss.left() >= undo.right());+ }+ // The wide notice retains the original action budget and text allocation.+ let expected = width - dismiss_width - t.space_8 - if can_undo { undo_width + t.space_8 } else { 0.0 };+ assert_eq!(text.width(), expected);+ }+ if label_wrap {+ assert!(dismiss.height() > t.control_height, "an individual long action label must wrap");+ }+ for (target, expected) in [("prefs:theme_notice_undo:guard", (true, false)), ("prefs:theme_notice_dismiss:guard", (false, true))]+ {+ if expected.0 && !can_undo {+ continue;+ }+ let at = if expected.0 { undo.expect("Undo").center() } else { dismiss.center() };+ assert_eq!(frame(&ctx, width, can_undo, test_support::pointer(at, true)), (false, false), "{target} on press");+ assert_eq!(frame(&ctx, width, can_undo, test_support::pointer(at, false)), expected, "{target} on release");+ assert_eq!(frame(&ctx, width, can_undo, vec![]), (false, false), "{target} must not repeat");+ }+ }+ }+ }+ }+ crate::theme::set_dark(previous);+}++#[test]+fn blur_meter_boundaries_and_off_thumb() {+ for (radius, bars) in [(0.0, 0), (1.0, 1), (8.0, 1), (9.0, 2), (18.0, 3), (33.0, 5), (40.0, 5), (60.0, 5)] {+ assert_eq!(blur_cost_bars(radius), bars, "{radius}");+ }+ for dark in [false, true] {+ crate::theme::set_dark(dark);+ for radius in [0.0, 18.25] {+ let ctx = crate::fonts::test_context();+ let t = Tokens::get();+ let mut value = radius;+ let out = ctx.run_ui(egui::RawInput::default(), |ui| {+ scope(ui, |ui| {+ slider(ui, &mut value, 0.0..=40.0, Slider { step: Some(1.0), show_value: false, off_endpoint: true, ..Default::default() });+ });+ });+ assert_eq!(value, radius, "drawing cannot round persisted fractional values");+ let thumb = out+ .shapes+ .iter()+ .rev()+ .find_map(|s| match &s.shape {+ egui::Shape::Circle(c) if c.radius == t.space_8 => Some(c),+ _ => None,+ })+ .unwrap();+ assert_eq!(thumb.fill, if radius == 0.0 { egui::Color32::TRANSPARENT } else { t.form_primary });+ assert_eq!(thumb.stroke.color, if radius == 0.0 { t.form_dim } else { t.form_primary });+ }+ }+}+#[test]fn every_slider_option_uses_the_same_token_thumb_in_both_themes() {let previous = crate::theme::is_dark();@@ -27,6 +162,7 @@ fn every_slider_option_uses_the_same_token_thumb_in_both_themes() {show_value,integer,workspace_accent: false,+ off_endpoint: false,},);});diff --git a/crates/ui-egui/src/ui_kit/sphere.rs b/crates/ui-egui/src/ui_kit/sphere.rsindex cb2659e4b7..e19650e01d 100644--- a/crates/ui-egui/src/ui_kit/sphere.rs+++ b/crates/ui-egui/src/ui_kit/sphere.rs@@ -1,4 +1,5 @@//! Small deterministic material previews; no textures, jobs or graphics device.+use crate::ui_kit::BackingTooltipExt as _;use crate::{scenario, theme::Tokens};use egui::{Color32, Mesh, Rect, Response, Sense, Ui, pos2, vec2};use std::{collections::VecDeque, sync::Arc};@@ -208,7 +209,7 @@ pub(crate) fn sphere_preview_with_source<R>(.truncate().halign(egui::Align::Min),)- .on_hover_text(name);+ .backing_on_hover_text(name);let (line, _) = ui.allocate_exact_size(vec2(text_width, t.control_height), Sense::hover());let usage_width = (ui.painter().layout_no_wrap(usage.to_owned(), egui::FontId::proportional(t.font_caption), t.form_ink).size().x+ t.space_12)@@ -297,7 +298,7 @@ impl SphereTile<'_> {scenario::publish_target(self.id, rect);let mut tip = egui::Tooltip::for_enabled(&response);tip.popup = tip.popup.frame(super::Container::new(ui.ctx(), super::Surface::Toast).tooltip_frame(ui.ctx()));- tip.show(|ui| {+ crate::ui_kit::Container::show_tooltip(response.id, tip, |ui| {ui.label(self.tip);});responsediff --git a/crates/ui-egui/src/ui_kit/stages.rs b/crates/ui-egui/src/ui_kit/stages.rsindex 00ab369cff..c40991fb16 100644--- a/crates/ui-egui/src/ui_kit/stages.rs+++ b/crates/ui-egui/src/ui_kit/stages.rs@@ -1,5 +1,6 @@//! Numbered stage navigation in a two-row workspace card. The caller owns commands and state.use crate::theme::{TabAccent, Tokens};+use crate::ui_kit::BackingTooltipExt as _;use egui::{Rect, Sense, Ui, pos2, vec2};pub(crate) struct StageAction<'a> {@@ -214,7 +215,7 @@ impl StageBar {result.action = Some(index);}if let Some(reason) = item.reason {- response.on_disabled_hover_text(reason);+ response.backing_on_disabled_hover_text(reason);}}ui.add_space((ui.available_width() - search_width).max(0.0));diff --git a/crates/ui-egui/src/ui_kit/status.rs b/crates/ui-egui/src/ui_kit/status.rsindex 252a76d2f9..3785eb88c5 100644--- a/crates/ui-egui/src/ui_kit/status.rs+++ b/crates/ui-egui/src/ui_kit/status.rs@@ -1,4 +1,5 @@//! Status heading and constraint meter; Tokens: font_label, text, text_dim, accent, dialog_rule, sketch_accent, spacing.+use crate::ui_kit::BackingTooltipExt as _;use crate::{fonts::RichTextExt as _, theme::Tokens};use egui::{RichText, vec2};@@ -24,7 +25,7 @@ pub(crate) fn status_header(ui: &mut egui::Ui, key: &str, name: &str, status: Stui.horizontal(|ui| {let (rect, _) = ui.allocate_exact_size(vec2(t.form_icon_size, t.form_icon_size), egui::Sense::hover());crate::icons::paint_icon(ui.painter(), rect, status.icon, f32::from(t.icon.a()) / 255.0);- ui.add(egui::Label::new(RichText::new(name).semibold().size(t.font_label)).truncate()).on_hover_text(name);+ ui.add(egui::Label::new(RichText::new(name).semibold().size(t.font_label)).truncate()).backing_on_hover_text(name);});ui.horizontal(|ui| {let (dot, _) = ui.allocate_exact_size(vec2(t.space_10, t.space_10), egui::Sense::hover());diff --git a/crates/ui-egui/src/ui_kit/table.rs b/crates/ui-egui/src/ui_kit/table.rsindex 951ad063d1..7aabce200a 100644--- a/crates/ui-egui/src/ui_kit/table.rs+++ b/crates/ui-egui/src/ui_kit/table.rs@@ -1,5 +1,6 @@//! Dense editable tables. Geometry and typography share the form label-column tokens.use super::metrics::*;+use crate::ui_kit::BackingTooltipExt as _;use crate::ui_kit::{Container, Surface};use crate::{scenario, theme::Tokens};use egui::{Response, Ui, vec2};@@ -215,7 +216,7 @@ impl Table<'_> {response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Button, ui.is_enabled(), crate::i18n::tr_label(label)));scenario::publish_handle(&format!("dialog:table:{}:add", self.id), rect.center());scenario::publish_rect(&format!("dialog:table:{}:add", self.id), rect);- response.on_hover_cursor(egui::CursorIcon::PointingHand).on_hover_text(crate::i18n::tr_label(tooltip))+ response.on_hover_cursor(egui::CursorIcon::PointingHand).backing_on_hover_text(crate::i18n::tr_label(tooltip))}fn row_content(&self, ui: &mut Ui, key: &str, selected: bool, force: bool, add: impl FnOnce(&mut TableRow<'_>)) -> Response {@@ -296,7 +297,7 @@ pub(crate) fn label_actions(ui: &mut Ui, text: &str, add: impl FnOnce(&mut Ui))fn header_label(ui: &mut Ui, label: &str) {let t = Tokens::get();ui.add(egui::Label::new(egui::RichText::new(crate::i18n::tr_label(label)).size(t.font_small).strong().color(t.form_dim)).truncate())- .on_hover_text(crate::i18n::tr_label(label));+ .backing_on_hover_text(crate::i18n::tr_label(label));}/// How a table orders its rows by one column. `Listed` keeps the order the owner gave them.@@ -391,7 +392,7 @@ pub(crate) fn sort_header(ui: &mut Ui, label: &str, sort: &mut Sort) -> ResponseSort::Descending => "Back to the original order",};response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Button, ui.is_enabled(), text));- response.on_hover_cursor(egui::CursorIcon::PointingHand).on_hover_text(crate::i18n::tr_label(tip))+ response.on_hover_cursor(egui::CursorIcon::PointingHand).backing_on_hover_text(crate::i18n::tr_label(tip))}/// Column removal appears inside the hovered header only. Keeps the former × button handle.diff --git a/crates/ui-egui/src/ui_kit/tree.rs b/crates/ui-egui/src/ui_kit/tree.rsindex 76af5eee42..c97d00ffff 100644--- a/crates/ui-egui/src/ui_kit/tree.rs+++ b/crates/ui-egui/src/ui_kit/tree.rs@@ -1,5 +1,6 @@//! Shared Browser tree rows; feature modules supply content and dispatch commands.use crate::icons::glyphs::badge;+use crate::ui_kit::BackingTooltipExt as _;use crate::{icons, theme::Tokens};use egui::{Color32, FontId, Pos2, Rect, Sense, Stroke, pos2, vec2};const ROW_H: f32 = super::TREE_ROW_HEIGHT;@@ -194,8 +195,8 @@ pub(crate) fn tree_row(ui: &mut egui::Ui, id: egui::Id, row: &Row) -> RowResp {.inner;response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Button, response.enabled(), action.label));let response = match action.reason {- Some(reason) => response.on_disabled_hover_text(format!("{}\n{reason}", action.label)),- None => response.on_hover_text(action.label),+ Some(reason) => response.backing_on_disabled_hover_text(format!("{}\n{reason}", action.label)),+ None => response.backing_on_hover_text(action.label),};crate::scenario::publish_rect(action.target, rect);if action.reason.is_none() {@@ -412,16 +413,16 @@ pub(crate) fn tree_row(ui: &mut egui::Ui, id: egui::Id, row: &Row) -> RowResp {(Some(t), _) if hover_on == 2 && eye_end => {let mut at_eye = resp.clone();(at_eye.rect, at_eye.interact_rect) = (eye_r, eye_r);- at_eye.on_hover_text(t);+ at_eye.backing_on_hover_text(t);resp}- (Some(t), _) => resp.on_hover_text(t),- (None, Some(state)) if elided => resp.on_hover_text(format!("{label_display}\n{state}")),- (None, Some(state)) => resp.on_hover_text(state),+ (Some(t), _) => resp.backing_on_hover_text(t),+ (None, Some(state)) if elided => resp.backing_on_hover_text(format!("{label_display}\n{state}")),+ (None, Some(state)) => resp.backing_on_hover_text(state),(None, None) if !row.secondary.is_empty() || !row.count.is_empty() => {- resp.on_hover_text(format!("{label_display}\n{}\n{}", row.secondary, row.count))+ resp.backing_on_hover_text(format!("{label_display}\n{}\n{}", row.secondary, row.count))}- (None, None) if elided => resp.on_hover_text(label_display.to_string()),+ (None, None) if elided => resp.backing_on_hover_text(label_display.to_string()),(None, None) => resp,};out.on_control = press_on != 0 || over_action(ui.input(|i| i.pointer.press_origin()));diff --git a/crates/ui-egui/src/ui_kit/viewport_status.rs b/crates/ui-egui/src/ui_kit/viewport_status.rsindex 90e7db1875..2af81f1cbe 100644--- a/crates/ui-egui/src/ui_kit/viewport_status.rs+++ b/crates/ui-egui/src/ui_kit/viewport_status.rs@@ -1,5 +1,6 @@//! Persistent viewport status content. The caller owns items and dispatches returned actions.use super::{Button, Container, Surface};+use crate::ui_kit::BackingTooltipExt as _;use crate::{fonts::RichTextExt as _, scenario, theme::Tokens};use egui::{Id, Rect, Response, RichText, Ui, vec2};@@ -176,7 +177,7 @@ fn icon_action(ui: &mut Ui, item: &StatusItem, part: &str, icon: &str, label: &sresponse.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Button, ui.is_enabled(), label));scenario::publish_target(&target(item, part), response.rect);scenario::publish_target(&target(item, &format!("{part}_glyph")), glyph);- response.on_hover_text(hint)+ response.backing_on_hover_text(hint)}/// One pill, with native keyboard controls and no engine or camera input.diff --git a/crates/ui-egui/src/update.rs b/crates/ui-egui/src/update.rsindex f9c40eacbe..1721897708 100644--- a/crates/ui-egui/src/update.rs+++ b/crates/ui-egui/src/update.rs@@ -16,6 +16,7 @@//! The host provides the HTTP client (`Services::http_get`), so this crate stays portable and//! the browser build never checks (it updates itself through its service worker).+use crate::ui_kit::BackingTooltipExt as _;use std::path::{Path, PathBuf};use std::sync::Arc;use std::sync::mpsc::{Receiver, TryRecvError};@@ -954,7 +955,7 @@ pub fn button(app: &mut SolveApp, ui: &mut egui::Ui, span: egui::Rect, labeled:let full = crate::i18n::format("update.button_version", &[("version", &version)]);let labels = [full.as_str(), crate::i18n::tr("update.button")];let (rect, response) = crate::toolbar::offer_pill(ui, span, labeled, &labels, TAB_ROOM, "update", "titlebar:update")?;- if response.on_hover_text(crate::i18n::format("update.available", &[("version", &version)])).clicked() {+ if response.backing_on_hover_text(crate::i18n::format("update.available", &[("version", &version)])).clicked() {app.updater.open = !app.updater.open;}Some(rect)@@ -1393,7 +1394,7 @@ fn markdown(ui: &mut egui::Ui, src: &str, t: &Tokens) {ui.horizontal_wrapped(|ui| {ui.add_space(indent);for (text, url) in targets {- ui.hyperlink_to(RichText::new(text).size(t.font_caption), url).on_hover_text(url);+ ui.hyperlink_to(RichText::new(text).size(t.font_caption), url).backing_on_hover_text(url);}});};diff --git a/crates/ui-egui/src/view_angles.rs b/crates/ui-egui/src/view_angles.rsindex 35fd8dc458..e5466bc550 100644--- a/crates/ui-egui/src/view_angles.rs+++ b/crates/ui-egui/src/view_angles.rs@@ -10,6 +10,7 @@//! of the line of sight (Front 0°, Left 90°, Right −90°, Back 180°), pitch the eye's elevation//! (Top 90°, Bottom −90°), and a positive roll turns the model clockwise on screen.+use crate::ui_kit::BackingTooltipExt as _;use egui::{Align2, FontId, Rect, Sense, pos2, vec2};use serde_json::json;use solidcraft_engine::render::{Camera, ViewAngles};@@ -152,7 +153,7 @@ pub(crate) fn show(app: &mut SolveApp, ui: &mut egui::Ui, rect: Rect) {if response.hovered() {ui.ctx().set_cursor_icon(egui::CursorIcon::PointingHand);}- let response = response.on_hover_text(crate::i18n::tr("ui.view_angles_help"));+ let response = response.backing_on_hover_text(crate::i18n::tr("ui.view_angles_help"));if response.clicked() {draft = if draft.is_some() { None } else { Some(app.cam.view_angles()) };}@@ -167,7 +168,8 @@ pub(crate) fn show(app: &mut SolveApp, ui: &mut egui::Ui, rect: Rect) {.fixed_pos(chip.right_bottom() + vec2(0.0, 4.0));let mut applied = false;let card = area.show(ui.ctx(), |ui| {- Container::popup_frame(ui.style()).show(ui, |ui| {+ let frame = Container::popup_frame(ui.style());+ Container::show_backing(ui, frame, |ui| {ui.set_width(260.0);ui.label(egui::RichText::new(crate::i18n::tr("ui.view_angles")).semibold().color(t.text).size(t.font_caption));for (id, axis) in [("ui.view_angles_pitch", "pitch"), ("ui.view_angles_yaw", "yaw"), ("ui.view_angles_roll", "roll")] {@@ -183,12 +185,12 @@ pub(crate) fn show(app: &mut SolveApp, ui: &mut egui::Ui, rect: Rect) {ui.horizontal(|ui| {ui.add_enabled_ui(!locked, |ui| ui_kit::angle_field(ui, &mut value));let zero = ui_kit::button(ui, "0°", ui_kit::Button::Enabled(!locked))- .on_hover_text(crate::i18n::format("ui.view_angles_zero", &[("axis", axis_name)]));+ .backing_on_hover_text(crate::i18n::format("ui.view_angles_zero", &[("axis", axis_name)]));zeroed = zero.clicked();crate::scenario::publish_target(&format!("view_angles:zero:{axis}"), zero.rect);let mut lock = locked;let help = if locked { "ui.view_angles_unlock" } else { "ui.view_angles_lock" };- let checkbox = ui_kit::checkbox(ui, "", &mut lock).on_hover_text(crate::i18n::format(help, &[("axis", axis_name)]));+ let checkbox = ui_kit::checkbox(ui, "", &mut lock).backing_on_hover_text(crate::i18n::format(help, &[("axis", axis_name)]));crate::scenario::publish_target(&format!("view_angles:lock:{axis}"), checkbox.rect);if lock != locked {set_lock(app, axis, lock);diff --git a/crates/ui-egui/src/view_confirm.rs b/crates/ui-egui/src/view_confirm.rsindex 32c73b7040..00bb2a1421 100644--- a/crates/ui-egui/src/view_confirm.rs+++ b/crates/ui-egui/src/view_confirm.rs@@ -6,6 +6,7 @@//! below the pair while it is shown (`viewport_layout::Layout::with_content`), and the pair is//! one of the shell's covered rects, so a click on it never picks or navigates.+use crate::ui_kit::BackingTooltipExt as _;use egui::{Rect, Sense, vec2};use crate::SolveApp;@@ -110,7 +111,7 @@ pub(crate) fn show(app: &mut SolveApp, ctx: &egui::Context) {let label = crate::i18n::tr_label(choice.label);response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Button, choice.enabled, label));crate::scenario::publish_target(choice.key, at);- if response.on_hover_text(label).clicked() && choice.enabled {+ if response.backing_on_hover_text(label).clicked() && choice.enabled {clicked = Some(choice.action);}}diff --git a/crates/ui-egui/src/viewport.rs b/crates/ui-egui/src/viewport.rsindex 0d8917d62b..f8ca9c62c6 100644--- a/crates/ui-egui/src/viewport.rs+++ b/crates/ui-egui/src/viewport.rs@@ -1,6 +1,7 @@//! The 3D viewport: navigation, GPU (or CPU fallback) rendering, picking, overlays, the axis//! view and the navigation bar.+use crate::ui_kit::BackingTooltipExt as _;use crate::ui_kit::{Container, Surface};use egui::{Align2, Color32, FontId, Pos2, Rect, Sense, Shape, Stroke, pos2, vec2};use serde_json::json;@@ -5842,7 +5843,7 @@ fn toast_close(ui: &egui::Ui, rect: Rect, id: egui::Id, left: Option<f32>) -> egif response.hovered() && ui.is_enabled() {ui.ctx().set_cursor_icon(egui::CursorIcon::PointingHand);}- response.on_hover_text(label)+ response.backing_on_hover_text(label)}/// The one toast painter: its text in a card at the bottom centre of `free`, led by a dot or a@@ -5928,7 +5929,7 @@ fn paint_toast_ext(let blocked = crate::issue_report::cad_input_blocked();let card_clicked = extras.card_hint.is_some_and(|hint| {let sense = if blocked { Sense::hover() } else { Sense::click() };- ui.interact(r, egui::Id::new(("sc_toast_card", extras.close.unwrap_or_default())), sense).on_hover_text(hint).clicked()+ ui.interact(r, egui::Id::new(("sc_toast_card", extras.close.unwrap_or_default())), sense).backing_on_hover_text(hint).clicked()});let mut clicked = None;let mut buttons = Vec::with_capacity(actions.len());@@ -5953,7 +5954,7 @@ fn paint_toast_ext(}).inner;let response = match extras.tips.get(index).filter(|tip| !tip.is_empty()) {- Some(tip) => response.on_hover_text(*tip),+ Some(tip) => response.backing_on_hover_text(*tip),None => response,};if response.clicked() {@@ -6921,7 +6922,7 @@ fn signed_axis_view(app: &mut SolveApp, ui: &mut egui::Ui, rect: Rect) {&& let Some((name, d, _, _)) = tips.get(i){crate::scenario::publish_handle(&format!("axis_view_hover:{name}"), hover.unwrap_or(c));- ui.interact(Rect::from_center_size(hover.unwrap_or(c), vec2(2.0, 2.0)), ui.id().with("axis_view_tip"), Sense::hover()).on_hover_text(+ ui.interact(Rect::from_center_size(hover.unwrap_or(c), vec2(2.0, 2.0)), ui.id().with("axis_view_tip"), Sense::hover()).backing_on_hover_text(format!("View from {}. Click again to reverse. Drag to orbit{}.",name.to_uppercase(),@@ -6954,7 +6955,7 @@ fn signed_axis_view(app: &mut SolveApp, ui: &mut egui::Ui, rect: Rect) {} else if in_circle && hovered.is_none() {ui.ctx().set_cursor_icon(egui::CursorIcon::Grab);}- if hr.on_hover_text(crate::i18n::tr_label("Home view")).clicked() {+ if hr.backing_on_hover_text(crate::i18n::tr_label("Home view")).clicked() {app.animate_view("home");}}diff --git a/crates/ui-egui/tests/fixtures/theme-blur.json b/crates/ui-egui/tests/fixtures/theme-blur.jsonnew file mode 100644index 0000000000..4067375fd2--- /dev/null+++ b/crates/ui-egui/tests/fixtures/theme-blur.json@@ -0,0 +1,15 @@+{+ "format": "solidcraft-theme/1",+ "name": "Blur review",+ "base": "dark",+ "options": [+ {"id": "opacity", "type": "range", "default": 75},+ {"id": "blur", "type": "range", "default": 0},+ {"id": "tab_colours", "type": "bool", "default": true},+ {"id": "tab_fade_ms", "type": "range", "default": 120}+ ],+ "tabs": {+ "RENDER": {"panel": "#302039", "viewport_top": "#30203d", "viewport_bottom": "#493252"},+ "SKETCH": {"panel": "#123028", "viewport_top": "#103128", "viewport_bottom": "#204a3c"}+ }+}diff --git a/crates/ui-egui/tests/scenarios/prefs_theme_files.json b/crates/ui-egui/tests/scenarios/prefs_theme_files.jsonindex 3cad8ec18a..83c705fccb 100644--- a/crates/ui-egui/tests/scenarios/prefs_theme_files.json+++ b/crates/ui-egui/tests/scenarios/prefs_theme_files.json@@ -61,5 +61,41 @@{"expect":{"theme_colors":{"panel":"#18202a","viewport_top":"#182430","viewport_bottom":"#29394a"}}},{"call":"engine.execute","params":{"command":"sketch.finish","params":{}}},{"call":"ui.set","params":{"tab":"MODEL"}},- {"expect":{"theme_colors":{"panel":"#18202a","viewport_top":"#182430","viewport_bottom":"#29394a"}}}+ {"expect":{"theme_colors":{"panel":"#18202a","viewport_top":"#182430","viewport_bottom":"#29394a"}}},+ {"note":"#9810: blur intent uses ui.prefs, survives unavailable evidence fixtures and stale definitions; injected fixtures do not claim real GPU/OS support."},+ {"call":"ui.resize","params":{"width":1600,"height":1100}},+ {"call":"ui.prefs","params":{"theme_import":{"format":"solidcraft-theme/1","name":"Scenario Blur","base":"dark","options":[{"id":"opacity","type":"range","default":75},{"id":"blur","type":"range","default":0}]},"theme_options":{"scenario-tabs":{},"scenario-blur":{"blur":18.25}},"open":"Interface"}},+ {"expect":{"prefs":{"theme":"scenario-blur","theme_option_values":{"opacity":75.0,"blur":18.25},"theme_option_notices":[]},"shown_handles":["prefs:theme_option:blur"]}},+ {"call":"ui.blur","params":{"fixture":"gpu-software"}},+ {"frames":2},+ {"click":{"handle":"prefs:theme_option:blur"}},+ {"expect":{"prefs":{"theme_option_values":{"opacity":75.0,"blur":18.25},"theme_options":{"scenario-blur":{"blur":18.25}}}}},+ {"call":"ui.blur","params":{"fixture":"reduce-transparency"}},+ {"expect":{"prefs":{"theme_option_values":{"opacity":75.0,"blur":18.25}}}},+ {"call":"ui.blur","params":{"fixture":"clear"}},+ {"call":"ui.prefs","params":{"theme_options":{"scenario-blur":{"blur":60}}}},+ {"expect":{"prefs":{"theme_option_values":{"opacity":75.0,"blur":60.0}}}},+ {"call":"ui.prefs","params":{"theme_options":{"scenario-blur":{"blur":18.25}}}},+ {"call":"ui.prefs","params":{"theme_options":{"scenario-blur":{"blur":61}},"ui_scale":1.5},"fail":true},+ {"expect":{"prefs":{"theme_option_values":{"opacity":75.0,"blur":18.25},"ui_scale":1.0}}},+ {"call":"ui.blur","params":{"fixture":"guard-60"}},+ {"frames":2},+ {"expect":{"shown_handles":["prefs:theme_notice_undo:guard"]}},+ {"click":{"handle":"prefs:theme_notice_undo:guard"}},+ {"expect":{"hidden_handles":["prefs:theme_notice_undo:guard"],"prefs":{"theme_option_values":{"opacity":75.0,"blur":18.25}}}},+ {"call":"ui.blur","params":{"fixture":"clear"}},+ {"note":"Reimporting the same identity without blur leaves the old raw override untouched and exposes a dismissible unknown-entry notice."},+ {"call":"ui.prefs","params":{"theme_import":{"format":"solidcraft-theme/1","name":"Scenario Blur","base":"dark","options":[{"id":"opacity","type":"range","default":75}]}}},+ {"frames":2},+ {"expect":{"prefs":{"theme_options":{"scenario-blur":{"blur":18.25}},"theme_option_notices":[{"id":"blur","kind":"unknown_option"}]},"shown_handles":["prefs:theme_notice_dismiss:blur"]}},+ {"click":{"handle":"prefs:theme_notice_dismiss:blur"}},+ {"expect":{"hidden_handles":["prefs:theme_notice_dismiss:blur"],"prefs":{"theme_options":{"scenario-blur":{"blur":18.25}},"theme_option_notices":[{"id":"blur","kind":"unknown_option"}]}}},+ {"call":"ui.prefs","params":{"theme_import":{"format":"solidcraft-theme/1","name":"Scenario Blur","base":"dark","options":[{"id":"blur","type":"range","default":0}]}}},+ {"expect":{"prefs":{"theme_option_values":{"blur":18.25},"theme_option_notices":[]}}},+ {"call":"ui.prefs","params":{"theme_import":{"format":"solidcraft-theme/1","name":"Scenario Future Blur","base":"dark","requires":2,"options":[{"id":"blur","type":"range","default":18}]}}},+ {"frames":2},+ {"expect":{"shown_handles":["prefs:theme_notice_dismiss:newer"],"prefs":{"theme_option_defs":[],"theme_option_values":{}}}},+ {"click":{"handle":"prefs:theme_notice_dismiss:newer"}},+ {"expect":{"hidden_handles":["prefs:theme_notice_dismiss:newer"],"prefs":{"theme_option_defs":[]}}},+ {"call":"ui.prefs","params":{"button":"ok","theme":"dark"}}]diff --git a/docs/blur-behind.md b/docs/blur-behind.mdindex b92cbdc355..5a8dc03fbf 100644--- a/docs/blur-behind.md+++ b/docs/blur-behind.md@@ -1,9 +1,110 @@-# Blur behind panels (#9809)--Implementation note for PR 5 of the #8876 series. Native implementation and-manager-run harnesses are present. No preference, product UI or default changes-are introduced. No build, test, GPU run, screenshot, benchmark or pixel comparison-has been run by this worker. Direct rustfmt is the only executable formatting work.+# Blur behind panels (#9809, #9810)++Implementation note for PRs 5 and 6 of the #8876 series. Native rendering,+theme-declared controls, runtime availability and a transient quality guard are+present. Built-in themes/defaults are unchanged. No build, test, GPU run,+screenshot, benchmark or pixel comparison has been run by this worker.+The 22 ms/60-sample threshold remains a starting policy, not a measured tuning result.++## Theme controls and runtime intent++Only a theme declaring `blur` offers its registered 0..60 physical-pixel range.+The slider edits in steps of one; finite fractional persisted/API values remain+valid and merely opening the control does not round them. Zero has a muted hollow+thumb, Off readout and flat 2 px cost line. Positive values use accent fill/thumb,+a px readout, and five bars of height 4/6/8/11/14 px: `ceil(radius / 8)` are filled, saturating at five from 33 through 60 px.+The tooltip describes relative cost; it is not a timing or resource estimate.+The readout, meter and any disabled reason reserve space beside the slider.+An inactive parent prevents activation without changing the stored child value.++The app resolves availability once per UI/API composition and before positive+runtime activation. It uses the actual installed adapter's device type (cached+at installation, `Cpu` means `gpu-software`) and PR5's lazy cached renderer+capabilities, rather than renderer-name matching. Both current browser paths+are unavailable because they lack the native compositor integration. Unsupported+source/device paths and device/resource failures also fall back to ordinary painting.+There are no effect resources or markers on unavailable paths or at zero.+Opening Preferences alone does not activate a declared zero-radius effect.++Saved/raw intent is separate from runtime availability. Clearing an OS/device+restriction restores it automatically when the renderer can support it. Suspending+for a restriction never toggles the radius through zero to clear a latched resource+failure. Actual radius/host/size/background changes retain PR5's explicit recovery+boundaries; no polling loop retries a failed effect allocation every frame.++Authored declaration/ancestry and effective radius are resolved only on+`prepare_tabs`' existing theme/raw-option cache miss. Its borrowed content comparison+also catches followed reloads with unchanged id/base. Steady built-in, undeclared,+and offered-zero frames read a small copyable intent/revision: they do not order+option vectors, normalize raw maps, serialize/hash strings, or clone theme ids.+Runtime OS/device availability stays outside this cache and palette tokens.+The cache test counts normalization calls; it is not a global allocator measurement.++## Accessibility signals++The desktop injects a cached `Services::reduce_transparency` reading. Observation+starts lazily when a theme offers blur, reads on a background thread every five+seconds while needed, and repaints only when the cached signal changes. No UI-thread+registry/Objective-C IO, external processes, OS-setting writes, notification+registration or new unsafe code is used. The first unavailable/failed reading is+unknown, leaving other availability checks in charge; an idle thread stops reading+when the theme no longer offers blur.++- Windows: safe `winreg` reads HKCU+ `Software\Microsoft\Windows\CurrentVersion\Themes\Personalize\EnableTransparency`.+ `0` disables blur (system transparency off), `1` permits it; missing/unexpected+ values are unknown.+- macOS: safe objc2 `NSWorkspace::sharedWorkspace()` /+ `accessibilityDisplayShouldReduceTransparency()`, with `NSWorkspace` and+ `NSAccessibility` features and an autorelease pool on the observer thread.+- Other operating systems currently have no signal here. Unknown does not disable+ blur. Browser rendering is independently unavailable as described above.++Platform readings and propagation latency still require manager validation on+their respective systems. Evidence fixtures never modify the host OS settings.++## Automatic quality guard++The guard uses elapsed **native queue-submission intervals**, not `app.frame_ms`+(UI construction time) and not GPU timestamps. The pass owner records evidence+only after an actual composition/presentation with a visible blur marker has+been submitted. Sampling consumes each egui frame at most once and requires the+immediately preceding painted frame, continued repaint activity on both sides,+positive radius, runtime availability, and a viewport not reported minimized or+occluded. Missing/logic-only paints, idle waits, unavailability, zero, or a changed+theme revision/radius reset the streak. egui layout re-passes cannot add samples.+Monitoring requests no continuous repaint.++After **60 consecutive eligible intervals strictly over 22 ms**, lower the effective+pass tier by one, down to two down/up steps. The natural tier remains determined+by radius; the effective tier is `min(natural tier, session cap)`. Radius is never+reduced or switched off. Recompute the normalized Kawase offset for that step+count, include the cap in the source cache signature, and reset the streak.++One inline notice is offered per session. Dismiss hides it; further eligible+reductions can continue to the minimum without reannouncing it. **Undo restores+the cap from before the first guard reduction and opts out of all further automatic+reductions for this session**, including across theme changes. This is transient+UI state, not a preference, design edit or document Undo entry.++Submission intervals include CPU/event-loop scheduling, presentation pacing and+other rendering work; they do not isolate blur or GPU execution. A low-refresh or+loaded system can exceed the starting budget for unrelated reasons. A cached blur+image still counts when visibly composited. Visibility depends on host reporting;+unsupported occlusion reporting cannot be inferred. Deterministic tests exercise+threshold/eligibility behavior; hardware measurements and threshold tuning are+still manager work. No measured GPU timing claim is made.++## Theme notices++Invalid saved entries, unsupported newer requirements and guard reduction share+a compact inline notice inside the existing Preferences host, before the empty-row+return. Dismissal is session-only, bounded to 64 problem identities and keyed by+theme, problem kind and raw value/requirement identity. A changed problem reappears.+Dismiss never changes invalid raw JSON or the API's notices; defaults remain in+effect. Newer-requirements imports discard unsupported definitions, so the warning+instructs users to upgrade and **reimport the original theme**, not to expect discarded+tables to recover automatically. No controls/no notices produces no header or spacer.## Accepted CPU budget@@ -40,37 +141,38 @@ changes for blur. The egui dependency is the published 0.36.2 crate.| View background | `viewport.rs::show` emits an egui gradient mesh before the viewport callback. `render_workspace.rs::show` emits its effective preview background, shared with the blur source. Neither is contained in the GPU renderer's scene texture. || Prepare scene | `gpu.rs::ViewportCallback::prepare` calls `solidcraft_gpu::view::Renderer::prepare`. Native `set_wgpu_split` already draws scene depth/MSAA/OIT offscreen. The UI target has one sample and no depth. The resolved scene is transparent outside geometry. || Acquire/order | `vendor/egui-wgpu/src/winit.rs::Painter::paint_and_update_textures` acquires/probes the drawable before preparing callbacks. `Renderer::update_buffers` uploads meshes, runs all callback `prepare`s, then all `finish_prepare`s. The enabled frame hook supplies actual physical target extent and the effective scale, including surface clamping. |-| Build source/blur | The enabled `blur_native.rs::Source` replaces the viewport callback. Its `prepare` delegates unchanged to the original callback. Its `finish_prepare` draws the independent background/prepared viewport into S, then the blur chain, all on the same encoder. A cache hit encodes neither source nor blur passes. |-| UI composition | The native pass owner selects an installed `FrameCompositor` before beginning the UI pass. It renders the unchanged egui primitive stream into C. At semantic markers, `PanelMarker::paint` samples B; ordinary panel fill/content follow in their original order. |+| Build source | The enabled `blur_native.rs::Source` replaces the viewport callback. Its `prepare` delegates unchanged to the original callback. Its `finish_prepare` retains the independent background/prepared viewport source and availability/cache evidence. A source cache hit avoids rebuilding that source. |+| UI composition | The native pass owner initializes C from the cached source and segments the original ordered UI stream at semantic backing markers. Before each marker it runs the existing blur pyramid from current C, then the marker samples B. Ordinary fill, border and content follow. The replaced source callback is skipped during composition. || Present/capture | A final triangle presents C into the normal drawable or existing capture texture. Existing screenshot copying, queue guard, texture frees and presentation remain after that. `submitted` commits a pending source key only after queue submission. |`CallbackTrait::paint` receives an already active pass, not its encoder or target;it cannot redirect the UI or start blur passes. Callback command buffers execute-before the main encoder. Source production and its dependent blur therefore use-the same encoder and return no additional callback command buffers.--## Independent source and color contract--S, B and C are separate textures with separate jobs:--- **S** is full-target, single-sample viewport/background color. Its construction- takes the explicit background rectangle/colors, inherited clip and prepared- `ViewportCallback::Frame`. The background pipeline has a uniform-only bind- group: it cannot sample C or a panel texture. The source viewport paint uses- the same prepared renderer, with its actual screen placement/scissor.-- **B** is the final full-target linear RGBA16F Kawase result, shared by every- eligible panel in that native viewport. Intermediate down/up targets are also- RGBA16F and are distinct read/write textures on every pass.-- **C** has the UI target's format and contains the normal sharp viewport plus- egui UI/markers. Only the final presentation samples C. C never feeds S or B.--No prefix of the UI paint list is blurred. A docked panel or window can precede-the viewport in that list; this does not affect source construction. Panels,-menus, HUDs, toasts, dimension editors, cursors and input shields are excluded.-The source does include model/sketch/highlight/preview geometry, section caps,-reference images and point clouds drawn by the GPU viewport. A panel outside-the model rectangle sees the deterministic source background, not invented-geometry behind a dock. Extending the projection under docks is a separate change.+before the main encoder. The pass owner ends each UI segment before encoding its dependent blur pyramid+and starts the next segment on the same encoder. No additional callback command+buffers are returned.++## Ordered backdrop and color contract++S, B and C retain separate resources and jobs. S is the independent cached+viewport/background source used for initialization, availability and evidence.+It includes prepared model/sketch/highlight/preview geometry, section caps,+reference images and point clouds. Source construction uses the actual prepared+renderer, background colors, placement and inherited clip.++C is the current ordered UI composition. It starts from the source, then receives+ordinary egui shapes in their original order. Before each actual translucent+backing marker, the existing down/up pyramid filters current C into B. The marker+samples that result before its ordinary surface fill and contents are painted.+Thus menus, dialogs and nested cards include preceding UI in their backdrop;+they do not replace underlying panels with the model scene. B is refreshed at+each boundary rather than shared unchanged by all panels. The final presentation+samples C. Read and write targets remain separate throughout the pyramid.++This uses the existing effect resources and adds **2 × steps GPU passes per+actual backing boundary**. Source-cache hits still save source construction;+they do not eliminate the per-boundary backdrop filtering. No extra resources+or disabled-path GPU passes are introduced. Outside the model rectangle the+source remains the deterministic background; geometry is not invented under docks.Render preview uses its original product `Frame`, lighting, resolution reductionand effective preview background, including authored-scene precedence and the@@ -83,7 +185,7 @@ Source color is opaque viewport/background color. Translucent custom viewportor outside backgrounds report unavailable before effect GPU allocation; theircomposition with a transparent native window is not silently approximated.For an unorm UI target, the-first down pass decodes each source texel before bilinear interpolation; for an+first down pass decodes each composition texel before bilinear interpolation; for ansRGB target, texture sampling performs the decode. All subsequent filtering islinear. Marker output follows egui's gamma-premultiplied convention: convert Bto gamma, multiply RGB/alpha by rounded coverage and host opacity, and for an@@ -95,62 +197,41 @@ sRGB formats. The worker has not yet verified those images on hardware.## Semantic hosts, clipping and rounding-Eligible surfaces are `Panel`, `Feature`, `Palette` and `Chrome`, with nonzero,-translucent outer fill. `Container` owns eligibility; alpha alone does not select-arbitrary UI. Opaque fills have no marker. Viewport, native application bar,-Canvas, InputShield, HUDs, Toast, Window and Popup are outside the initial policy.--The app uses stock egui 0.36.2 public APIs. In the positive eligible path,-`Container::show_frame`, `show_edge` and the bounded `FeatureWindow::show`-reserve an early painter slot before invoking the original host. Once geometry-is known they populate that slot with a marker; the original shadow, fill,-stroke and contents remain in their original slots. The zero path reserves-nothing and calls the existing `Prepared::end`, `Panel::show` or `Window::show`.-No host becomes transparent, and child `UiStack` frame/background metadata,-styles, margins, stroke widths, IDs and interactions remain stock.--`show_frame` owns `Frame::begin` and uses the final content rectangle and-joined-edge corner rounding. `show_edge` captures the panel painter before the-body can narrow its clip or change opacity, then measures the actual frame-content (the response may be clamped on overflow). Its marker uses the original-host clip, including padding/borders and any host clipping. Current adaptive-edge callers use ordinary `show`; the helper deliberately exposes no animated-panel entry point.--Only `Panel::window_placed` creates an adaptive stock Window. Its small-`FeatureWindow` wrapper keeps the existing builder private and forwards only-`fixed_size`, `open` and `show`. The open flag is forwarded with a shortened borrow-lifetime; stock Window owns visibility and close-request handling. These sheets-explicitly disable native title bars, collapse, resize, scrolling and fades,-and use an explicit persistent ID and-Middle layer. The early slot is on that exact layer. The final Area response-includes the outer margins; subtracting the original total margins reconstructs-the content rectangle for marker geometry even though stock Window relocates-`inner_margin` into an internal Frame. The marker inherits the host painter's-visibility/opacity and Area's viewport clip, rather than Resize's content-only-clip. System windows (`Surface::Window`) remain outside blur eligibility.--Manual workspace ribbon cards and History retain semantic background painting;-manual HUD painting remains plain. No private storage access, extra outer-visual container, duplicate frame or search for matching colors/rectangles is-used. The tests inject a marker function into these same helpers without a GPU-to compare stock and decorated output, geometry, IDs and semantic metadata.--A marker precedes the ordinary shadow, fill, border and content on the same-layer. It retains all four final corner radii and painter-opacity. At paint it uses the final transformed callback rectangle and actual-physical scale, matching egui rectangle snapping when enabled. It changes the-GPU viewport to the full target, retains the renderer's inherited scissor, and-uses an antialiased rounded distance mask at the original unclipped rectangle.-Thus clipping an edge does not invent a new rounded corner. UVs come from screen-position, so a moved panel samples the corresponding source pixels. Distinct-retained marker uniforms prevent one panel's queue write from changing another's-draw. Marker count is bounded to 256. Nested/overlapping panels sample the same B,-never each other's fill or content.+Blur eligibility follows actual backing UI surfaces rather than a workspace-surface+whitelist. Panels, ribbon and application bars, History, system windows, modal+dialogs and their dimming backdrops, menus/submenus, popovers, canvas editors,+notifications, file-loading shields, and tooltips use the same marker policy.+Nested backing cards participate too. Zero-alpha layout frames stay transparent;+text, strokes, selection/hover tints and model geometry do not create backing markers.+The effective fill alpha includes inherited painter opacity, so a normally opaque+surface fading in can participate without treating its text as another surface.++The app uses stock egui 0.36.2 public host APIs. `show_frame`, `show_backing`,+`show_edge`, `show_central` and bounded Window reserve a slot before the original+frame paints. Native popup and tooltip wrappers keep their placement, hover gates,+stacking, close behavior and response types. Response tooltip extension methods+route native enabled/disabled and pointer-anchored variants through the same policy.+Manual backing surfaces replace their original reserved slot, preserving ordering.+The off path calls the original hosts without marker slots or effect allocations.+`show_backing` adds no inset decoration to callers which previously had none.++Modal rendering first reserves full-screen backdrop blur, then retains native+input shielding/focus/dismissal and dimming. Its visible dialog frame is painted+through `show_backing` after dimming, so the dialog samples the actual dimmed UI+beneath it. The off path remains the original native Modal. Existing host geometry,+interaction and legacy paint assertions require manager validation after this+iteration; no automated checks were run by these implementation workers.++Markers retain all four final corner radii, host clipping and painter opacity.+Clipping does not invent rounded corners, and moved surfaces sample corresponding+screen pixels. The compositor respects ordered preceding UI, so a translucent+popup above a panel blurs the panel beneath it rather than cutting through to the+model. No private storage access, global matching-color search or arbitrary+rectangle heuristic selects backing surfaces.## Radius, cache, allocation and recovery-Radius is finite physical pixels in 0..40; invalid requests are refused before+Radius is finite physical pixels in 0..60; invalid requests are refused beforemutation. Zero selects plain rendering. Positive tiers have N down and N up passes:| Radius | N | First down target |@@ -158,7 +239,10 @@ mutation. Zero selects plain rendering. Positive tiers have N down and N up pass| >0..8 | 2 | ceil-half resolution || >8..18 | 3 | ceil-half resolution || >18..30 | 4 | ceil-half resolution |-| >30..40 | 5 | ceil-half resolution |+| >30..60 | 5 | ceil-half resolution |++Radii above 40 retain the existing five-step tier and increase only its normalized+offset. Existing 0..40 values keep their original schedule and cost indication.Every subsequent dimension is ceil-halved with a minimum of one pixel. Upsamplingends at full resolution B. The original kernel has a center-plus-four-corners@@ -176,8 +260,8 @@ source/background rectangles and clip after the source layer's final globaltransform, background colors, physical target extent,effective scale, target encoding and radius. It is per device/host; installationon a replacement device retires the old state. A pending key becomes valid only-after submission. A resting repaint reuses B with zero source/blur passes; normal-UI composition/presentation still occurs. Panel-only tint/layout changes reuse+after submission. A resting repaint can reuse the source, while each painted backing boundary+still filters the current UI composition. Panel-only tint/layout changes reusethe full-target source unless they change projection, source placement or extent.No repaint timer is added to keep blur alive.@@ -211,7 +295,7 @@ readback, or GPU completion wait was added to production painting.distinguishes missing GPU/native split integration, software adapter, unsupportedfilterable/renderable formats, unsupported source context, missing source frame,resource/size refusal and lost device. The actual window adapter is classified-with the same `gpu::select::tier_of` as headless captures; no renderer-name guessing.+from its actual cached `DeviceType` (`Cpu` is software); no renderer-name guessing.Software adapters and web paths allocate no effect resources or markers.Web still uses eframe's unvendored `src/web/web_painter_wgpu.rs`, not the native@@ -226,17 +310,20 @@ The full GPU fixture in existing `gpu.rs::tests` renders actual app egui output,font textures, viewport callbacks and compositor into a readback target. Testsremain in the existing area modules; no per-issue test module was added.-PR 6 must consume the capability/reason and finite 0..40 contract, leave saved-user intent intact on fallback, and request a frame on changes. It must not create-resources by opening Preferences. There is no persistent blur preference in PR 5.+The PR6 controls consume this capability/reason and finite 0..60 contract, leave+saved intent intact on fallback, and request a frame on changes. They do not create+resources merely by opening Preferences. Blur remains a theme option, with no+independent global switch or quality preference.## Internal activation and manager-only validation-The control hook is `ui.blur {radius_px?, surface_alpha?}`. `surface_alpha` is an+The control hook is `ui.blur {radius_px?, surface_alpha?, fixture?}`. `surface_alpha` is aninternal capture-only override in 0..1; null restores ordinary fills. Transparenthost frames remain transparent. The hook returns requested radius, maximum,-capability and cumulative counters. Activation is control-only and session-only;-default construction is zero and performs no environment lookup or GPU probe.+capability, app-aware availability, transient guard/evidence state and cumulative+counters. Explicit radius activation is an internal session-only override;+ordinary product activation comes from a declared theme option. Default construction+is zero and performs no environment lookup or GPU capability probe.The adapter capability probe is cached lazily on activation or an explicit query.Counters increment at actual `create_texture`, buffer/bind-group/pipeline creation,@@ -264,12 +351,15 @@ not executed by this worker. Open-flag forwarding also covers initially hidden,closed and reopened windows, including stock close-request propagation via`ui.close_kind(egui::UiKind::Window)`. Plain `ui.close()` targets Window's nearerinternal Collapsible, even when native title/collapse controls are disabled.-The other blur tests remain; the broader `blur_` filter selects fourteen tests.+The other blur tests remain; PR5's broader `blur_` filter selected fourteen tests+before the PR6 additions listed below.Cargo.lock was restored as text to the egui 0.36.2 registry source and checksumfrom the matching local crates.io index entry; dependency versions are unchanged.The full vendored egui copy and its path patch were removed; the egui-wgpu patch-and licences remain. No cargo execution was used. Set `SOLIDCRAFT_REQUIRE_GPU=1` to require an adapter+and licences remain. PR6 additionally lists the already-locked winreg dependency+for the desktop app; dependency versions are unchanged. No cargo execution was+used. Set `SOLIDCRAFT_REQUIRE_GPU=1` to require an adapter(hardware or software); a missing adapter/device fails every blur fixture consumer.The explicit `cfg(test)` rendering fixture runs all positive compositor, cache,pixel and suspension assertions on CI software adapters independently of production@@ -277,6 +367,14 @@ software policy, retaining real adapter identity and format/device requirements.A separate production-policy test asserts that actual software adapters report`Unavailable("software adapter (gpu-software)")`, allocate no blur resources andemit no markers. Production software blur remains unavailable.+Its requested radius remains 18 throughout UI preparation: fallback must not silently+replace the request with zero. Positive fixtures use isolated harness intent so theme+preparation cannot erase their explicit radius.++`FixturePolicy::Production` and `FixturePolicy::Rendering` exist only under+`cfg(test)`. Rendering bypasses only CPU policy through State's capability result;+the shared Preferences availability resolver consumes that result instead of+independently vetoing the real software identity. No production bypass is added.To export fixed-scene 8/18/40 and zero light/dark images, counters, and warmedUI/encode/GPU-completion benchmark samples:@@ -339,3 +437,119 @@ restored UI/model settings. Current validation records belong in the PR body;the new fixture is not a substitute for that comparison. Later manager gates arewasm, layers, licences, lists, containers/clippy, then full CI before commit/merge.Worker execution counts: tests/builds/checks/cargo/xtask/UI runs/screenshots = 0.++## PR6 manager reproduction and focused validation++These instructions are prepared, **not executed or visually verified by the worker**.+Use only the manager's isolated settings instance and control port (for example+38877); do not contact, restart or change the user's preview on 38876. No host OS+setting changes are needed for the injected examples. A real OS-signal review must+be reported separately from fixture screenshots.++The original theme fixture is+`crates/ui-egui/tests/fixtures/theme-blur.json` (id `blur-review`). It offers opacity,+blur and tab colours, defaults blur to zero, and includes Sketch/Render surfaces.+Send its JSON object as `ui.prefs`' `theme_import`, together with `open:"Interface"`.+For light screenshots, copy the object in memory, change `name` to `Blur review light`+and `base` to `light` (id `blur-review-light`), and import that. Model uses the base+palette; switch to Sketch/Render separately to review the authored tab colours.+Builds, launches, authenticated transport and screenshot saving belong to the manager.++For each light/dark fixture, keep model, camera, layout, scale and window dimensions+fixed. Use normal `ui.prefs`, with the active theme id, for each **0, 8, 18, 40**:++```json+{"method":"ui.blur","params":{"fixture":"clear","surface_alpha":null}}+{"method":"ui.prefs","params":{"theme_options":{"blur-review":{"opacity":75,"blur":18}}}}+{"method":"ui.screenshot","params":{"path":"ABSOLUTE-NEW-OUTPUT-PATH.png"}}+```++At zero expect Off, a hollow muted thumb and one flat cost line; at 8/18/40 expect+one/three/five filled bars. Verify the slider consumes remaining width, the readout+and meter do not overlap, and the disabled reason remains beside its control.+Also send `blur:18.25`, reopen Preferences and query `ui.prefs`: the value must remain+18.25 until an actual edit. At opacity 75 capture matched **blur 0 versus 18** views;+repeat with opacity 100 as the opaque comparison. The fixture's opacity option+enforces PR3's readability floors; do not assume opacity 0 means invisible text.+If an explicit opacity-zero comparison is desired, send `opacity:0` at both blur+0 and 18 and report that readability floor. These are real UI captures, not `ui.render`.++To display two unavailable reasons without changing this machine's OS/adapter:++```json+{"method":"ui.blur","params":{"fixture":"gpu-software"}}+{"method":"ui.prefs","params":{}}+{"method":"ui.blur","params":{"fixture":"reduce-transparency"}}+{"method":"ui.prefs","params":{}}+{"method":"ui.blur","params":{"fixture":"clear"}}+```++Capture each disabled slider with its adjacent reason. Label these screenshots+**injected availability evidence**, include the `evidence_fixture` reply, and verify+saved blur remains 18. Clearing the fixture restores normal real capability checks;+it cannot make a software/unsupported renderer capable. Compare effect counter+deltas/live counts while unavailable; there must be no new effect work and no live+effect resources. `web-unsupported` is an optional third reason fixture.++For the guard notice, set blur 40 via `ui.prefs`, let the value apply, then send:++```json+{"method":"ui.blur","params":{"fixture":"guard-60"}}+{"method":"ui.blur","params":{}}+```++This explicitly injects sixty eligible 23 ms samples, without inventing GPU timing+or starting a repaint loop. Capture the notice with **injected guard evidence** in+its description. Repeat the fixture to exercise cap 4 → 3 → 2 (no radius change).+Click Undo (`prefs:theme_notice_undo:guard`): cap returns to 5 and `opted_out` is true;+another `guard-60`, even after switching themes, cannot reduce it. In a separate fresh+session, Dismiss (`prefs:theme_notice_dismiss:guard`) hides the notice but subsequent+injections may keep reducing to 2 without reannouncing. `fixture:"clear"` removes+the injection/legacy radius override, not Undo's session opt-out. Restart the+manager's isolated app when a fresh session policy is needed.++For raw/newer warnings, the extended existing `prefs_theme_files` scenario saves+blur through `ui.prefs`, reimports that theme without the declaration, dismisses+the now-unknown-entry notice, checks that raw JSON and API notices persist, and+reintroduces the definition to restore the saved value. It also imports `requires:2`+and dismisses its warning without adding a controls header. The unit test additionally+loads malformed raw JSON, changes it to ensure reappearance, and bounds dismissal+storage. For a manager screenshot, import a copy of the fixture with name `Future+blur review`, `requires:2`, then open Interface; retain the original file for reimport+after upgrading, as its unsupported tables are discarded.++All nine new unit tests match the **`blur_`** filter, in the existing area modules:++- `blur_availability_preserves_saved_intent_and_parent_state`+- `blur_evidence_fixtures_are_atomic_transient_and_never_fake_support`+- `blur_guard_requires_consecutive_visible_actual_paints`+- `blur_guard_threshold_idle_minimum_and_session_undo`+- `blur_intent_cache_resolves_only_when_theme_or_raw_values_change`+- `blur_meter_boundaries_and_off_thumb`+- `blur_notices_dismiss_by_problem_identity_and_preserve_raw_json`+- `blur_offered_zero_has_no_effect_work`+- `blur_slider_reserves_readout_meter_and_disabled_reason`++The existing `blur_radius_schedule_and_hostile_values` also checks capped offsets.+The zero test uses actual GPU fixture counters with a declared zero option; the+cache test asserts normalization counts on 100 repeated built-in/zero/undeclared+cache hits. Neither pretends to count the application's global allocator. The+headless UI tests inspect constructed shapes/geometry, not screenshots.++Manager-only focused filters (none run by the worker):++```powershell+cargo test --locked --profile ci -p solidcraft-ui-egui --lib blur_ -- --nocapture+cargo test --locked --profile ci -p solidcraft-ui-egui --lib theme_options_ -- --nocapture+cargo test --locked --profile ci -p solidcraft-ui-egui --test scenarios prefs_theme_files -- --nocapture+```++The zero GPU fixture uses `FixturePolicy::Production`, a declared zero option and+no harness radius override. It follows the same adapter-availability gate:+`SOLIDCRAFT_REQUIRE_GPU=1` requires any adapter, including software, and a missing+adapter/device fails. `blur_production_policy_rejects_software_adapter` separately+checks production CPU fallback; positive shader tests select `FixturePolicy::Rendering`.+The PR5 fixture policy and PR6 integration have been reconciled in source only.+GPU pixels, platform builds/APIs, wasm, actual OS propagation,+real visible slow-frame behavior, allocator traces and threshold calibration remain+unverified here. No test/build/check or app interaction has been performed by this worker.diff --git a/docs/control-protocol.md b/docs/control-protocol.mdindex 2ba3de15e0..4949c5b317 100644--- a/docs/control-protocol.md+++ b/docs/control-protocol.md@@ -235,14 +235,34 @@ The control channel is **on by default**. SolidCraft listens on `127.0.0.1` onlyso agents can drive the app without a launch flag. Every connection still needs this launch'stoken (below); nothing else on the machine, and nothing off it, can send a command.-Internal rendering harness: `ui.blur {radius_px?, surface_alpha?}` queries or sets-session-only panel blur. Radius is finite physical pixels in 0..40; the optional+Internal rendering harness: `ui.blur {radius_px?, surface_alpha?, fixture?}` queries or sets+session-only panel blur. Radius is finite physical pixels in 0..60; the optionalcapture tint is 0..1 (`null` restores ordinary fills). This is not a saved-preference. The reply contains requested radius, capability/reason and cumulative+preference. Theme-authored blur is edited with `ui.prefs {theme_options:{theme_id:{blur:18}}}`;+the theme must declare the option. Finite fractional values remain valid, although+the UI slider edits in steps of one physical pixel. The `ui.prefs` option definition's+`available`/translated `reason` describes current app/device/OS availability; its+value remains the saved/default intent while unavailable.++The `ui.blur` reply contains requested radius, renderer capability, app-aware+`available`/`reason`, `guard` (tier cap, streak, notice, session opt-out), and cumulativeactual effect counters, including live resources and encoded passes. Unsupportedsoftware/web/source contexts stay on ordinary painting. Use `ui.screenshot` forpanel evidence; `ui.render` remains a model-only capture. Activation, full egui GPUfixture and manager-run evidence commands are in [blur-behind.md](blur-behind.md).+Supplying `radius_px` selects the legacy session-only rendering harness override;+`fixture:"clear"` removes that override and any injected availability reason,+returning to theme intent. It does not revoke a quality-guard Undo opt-out.++Explicit evidence-only fixtures are `gpu-software`, `reduce-transparency`, and+`web-unsupported` (force an unavailable reason), plus `guard-60` (inject sixty+eligible 23 ms samples into the transient guard at the current positive radius).+The reply labels the active injection as `evidence_fixture`; `null` means none.+These are not end-user settings, real adapter/OS readings or performance measurements.+There is no fixture that makes an unsupported renderer available. They do not+change saved options, host OS settings or document history. All supplied fields+are validated before mutation. Capture fixture screenshots with that label in the+evidence description, and clear the fixture before checking real capabilities.| Launch | What listens ||---|---|diff --git a/vendor/egui-wgpu/src/renderer.rs b/vendor/egui-wgpu/src/renderer.rsindex e28a2579fa..774de7ee2f 100644--- a/vendor/egui-wgpu/src/renderer.rs+++ b/vendor/egui-wgpu/src/renderer.rs@@ -513,6 +513,19 @@ impl Renderer {render_pass: &mut wgpu::RenderPass<'static>,paint_jobs: &[epaint::ClippedPrimitive],screen_descriptor: &ScreenDescriptor,+ ) {+ self.render_with_mesh_offset(render_pass, paint_jobs, screen_descriptor, 0);+ }++ /// SolidCraft: continue an uploaded frame in another render pass. `mesh_offset`+ /// counts every preceding mesh, including meshes with an empty clip rectangle.+ /// Callbacks consume no mesh buffer slice. The caller preserves primitive order.+ pub fn render_with_mesh_offset(+ &self,+ render_pass: &mut wgpu::RenderPass<'static>,+ paint_jobs: &[epaint::ClippedPrimitive],+ screen_descriptor: &ScreenDescriptor,+ mesh_offset: usize,) {profiling::function_scope!();@@ -527,8 +540,8 @@ impl Renderer {// run.let mut needs_reset = true;- let mut index_buffer_slices = self.index_buffer.slices.iter();- let mut vertex_buffer_slices = self.vertex_buffer.slices.iter();+ let mut index_buffer_slices = self.index_buffer.slices.iter().skip(mesh_offset);+ let mut vertex_buffer_slices = self.vertex_buffer.slices.iter().skip(mesh_offset);for epaint::ClippedPrimitive {clip_rect,