@@ -0,0 +1,66 @@
|
||||
{
|
||||
"en": {
|
||||
"prefs.viewport_status_summary": "Fold viewport status items",
|
||||
"prefs.viewport_status_summary_help": "Fold three or more viewport status items into one summary badge. Disable to keep every item in the full row.",
|
||||
"ui.viewport_status_summary_clear": "Turn everything off",
|
||||
"ui.viewport_status_summary_heading": "In this view",
|
||||
"ui.viewport_status_summary_label": "{name} and {count} more items",
|
||||
"ui.viewport_status_summary_more": "+{count}"
|
||||
},
|
||||
"ar": {
|
||||
"prefs.viewport_status_summary": "تلخيص عناصر حالة منفذ العرض",
|
||||
"prefs.viewport_status_summary_help": "اجمع ثلاثة عناصر أو أكثر لحالة منفذ العرض في شارة ملخّصة واحدة. عطّل الخيار لإبقاء كل عنصر في الصف الكامل.",
|
||||
"ui.viewport_status_summary_clear": "إيقاف كل شيء",
|
||||
"ui.viewport_status_summary_heading": "في هذا العرض",
|
||||
"ui.viewport_status_summary_label": "{name} و{count} عناصر أخرى",
|
||||
"ui.viewport_status_summary_more": "+{count}"
|
||||
},
|
||||
"de": {
|
||||
"prefs.viewport_status_summary": "Status im Ansichtsfenster zusammenfassen",
|
||||
"prefs.viewport_status_summary_help": "Drei oder mehr Statuselemente in einer Zusammenfassung anzeigen. Deaktivieren, um jedes Element in der vollständigen Zeile zu behalten.",
|
||||
"ui.viewport_status_summary_clear": "Alles ausschalten",
|
||||
"ui.viewport_status_summary_heading": "In dieser Ansicht",
|
||||
"ui.viewport_status_summary_label": "{name} und {count} weitere Elemente",
|
||||
"ui.viewport_status_summary_more": "+{count}"
|
||||
},
|
||||
"he": {
|
||||
"prefs.viewport_status_summary": "סיכום פריטי מצב בחלון התצוגה",
|
||||
"prefs.viewport_status_summary_help": "קיבוץ שלושה פריטי מצב או יותר לתג סיכום אחד. כיבוי האפשרות משאיר כל פריט בשורה המלאה.",
|
||||
"ui.viewport_status_summary_clear": "כיבוי הכול",
|
||||
"ui.viewport_status_summary_heading": "בתצוגה זו",
|
||||
"ui.viewport_status_summary_label": "{name} ועוד {count} פריטים",
|
||||
"ui.viewport_status_summary_more": "+{count}"
|
||||
},
|
||||
"ja": {
|
||||
"prefs.viewport_status_summary": "ビューポートの状態項目をまとめる",
|
||||
"prefs.viewport_status_summary_help": "3 個以上の状態項目を 1 つのサマリーバッジにまとめます。無効にすると、すべての項目を従来の行に表示します。",
|
||||
"ui.viewport_status_summary_clear": "すべて解除",
|
||||
"ui.viewport_status_summary_heading": "このビュー内",
|
||||
"ui.viewport_status_summary_label": "{name} と他 {count} 項目",
|
||||
"ui.viewport_status_summary_more": "+{count}"
|
||||
},
|
||||
"ko": {
|
||||
"prefs.viewport_status_summary": "뷰포트 상태 항목 요약",
|
||||
"prefs.viewport_status_summary_help": "상태 항목이 3개 이상이면 하나의 요약 배지로 표시합니다. 비활성화하면 모든 항목을 기존 행에 표시합니다.",
|
||||
"ui.viewport_status_summary_clear": "모두 끄기",
|
||||
"ui.viewport_status_summary_heading": "이 뷰에서",
|
||||
"ui.viewport_status_summary_label": "{name} 외 {count}개 항목",
|
||||
"ui.viewport_status_summary_more": "+{count}"
|
||||
},
|
||||
"vi": {
|
||||
"prefs.viewport_status_summary": "Tóm tắt các mục trạng thái khung nhìn",
|
||||
"prefs.viewport_status_summary_help": "Gộp từ ba mục trạng thái khung nhìn trở lên thành một huy hiệu tóm tắt. Tắt để giữ mọi mục trong hàng đầy đủ.",
|
||||
"ui.viewport_status_summary_clear": "Tắt tất cả",
|
||||
"ui.viewport_status_summary_heading": "Trong khung nhìn này",
|
||||
"ui.viewport_status_summary_label": "{name} và {count} mục khác",
|
||||
"ui.viewport_status_summary_more": "+{count}"
|
||||
},
|
||||
"zh": {
|
||||
"prefs.viewport_status_summary": "汇总视口状态项",
|
||||
"prefs.viewport_status_summary_help": "将三个或更多视口状态项折叠为一个汇总徽章。禁用后,所有项目仍显示在完整的一行中。",
|
||||
"ui.viewport_status_summary_clear": "全部关闭",
|
||||
"ui.viewport_status_summary_heading": "此视图中",
|
||||
"ui.viewport_status_summary_label": "{name} 和其他 {count} 项",
|
||||
"ui.viewport_status_summary_more": "+{count}"
|
||||
}
|
||||
}
|
||||
@@ -1069,6 +1069,7 @@ preference_settings! {
|
||||
persistent_ribbon_pressed: bool = true, PAGE_INTERFACE => check_id("prefs.persistent_ribbon_pressed");
|
||||
viewport_analysis_status: bool = true, PAGE_INTERFACE => check_id("prefs.viewport_analysis_status");
|
||||
viewport_section_status: bool = true, PAGE_INTERFACE => check_id("prefs.viewport_section_status");
|
||||
viewport_status_summary: bool = true, PAGE_INTERFACE => check_id("prefs.viewport_status_summary");
|
||||
/// Keep the SKETCH tab in the ribbon, right after MODEL, while no sketch is open; its drawing
|
||||
/// tools then start a sketch first (#7904).
|
||||
sketch_tab_always: bool = false, PAGE_INTERFACE => check_id("prefs.sketch_tab_always");
|
||||
@@ -5029,6 +5030,7 @@ mod tests {
|
||||
("persistent_ribbon_pressed", json!(false), PAGE_INTERFACE),
|
||||
("viewport_analysis_status", json!(false), PAGE_INTERFACE),
|
||||
("viewport_section_status", json!(false), PAGE_INTERFACE),
|
||||
("viewport_status_summary", json!(false), PAGE_INTERFACE),
|
||||
("sketch_tab_always", json!(true), PAGE_INTERFACE),
|
||||
("ribbon_reveal", json!(true), PAGE_INTERFACE),
|
||||
("dialog_buttons", json!("top"), PAGE_INTERFACE),
|
||||
@@ -6597,6 +6599,38 @@ mod tests {
|
||||
assert_eq!(h.app.session.doc.to_json(), design);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn viewport_status_summary_preference_checkbox_control_persists_cancels_and_resets() {
|
||||
assert!(Prefs::default().viewport_status_summary);
|
||||
assert!(lenient(&json!({"theme":"light"})).viewport_status_summary);
|
||||
assert!(lenient(&json!({"viewport_status_summary":"no"})).viewport_status_summary);
|
||||
let mut h = crate::scenario::Harness::new();
|
||||
let design = h.app.session.doc.to_json();
|
||||
let revision = h.app.session.revision;
|
||||
h.call("ui.prefs", json!({"open":"Interface"}));
|
||||
super::reveal_preference(&mut h, "prefs:viewport_status_summary");
|
||||
let checkbox = crate::scenario::handle_at("prefs:viewport_status_summary").unwrap();
|
||||
h.call("ui.click", json!({"x":checkbox.x,"y":checkbox.y}));
|
||||
assert!(!h.app.preferences.viewport_status_summary);
|
||||
assert_eq!(h.call("ui.prefs", json!({}))["result"]["viewport_status_summary"], false);
|
||||
let mut restored = SolveApp::new(Default::default(), Default::default());
|
||||
restored.load_prefs(&h.app.prefs());
|
||||
assert!(!restored.preferences.viewport_status_summary);
|
||||
h.call("ui.prefs", json!({"button":"cancel"}));
|
||||
assert!(h.app.preferences.viewport_status_summary);
|
||||
h.call("ui.prefs", json!({"open":"Interface","viewport_status_summary":false,"button":"apply"}));
|
||||
h.call("ui.prefs", json!({"button":"defaults"}));
|
||||
assert!(h.app.preferences.viewport_status_summary);
|
||||
h.call("ui.prefs", json!({"button":"cancel"}));
|
||||
assert!(!h.app.preferences.viewport_status_summary);
|
||||
for malformed in [json!("false"), json!(null), json!(0), json!([])] {
|
||||
assert!(super::set(&mut h.app, &json!({"viewport_status_summary":malformed})).is_err());
|
||||
assert!(!h.app.preferences.viewport_status_summary);
|
||||
}
|
||||
assert_eq!(h.app.session.revision, revision);
|
||||
assert_eq!(h.app.session.doc.to_json(), design);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn viewport_section_status_is_independent_of_session_policy_in_background_documents() {
|
||||
let mut app = SolveApp::new(Default::default(), Default::default());
|
||||
|
||||
@@ -106,6 +106,10 @@ pub(super) fn interface(app: &mut SolveApp, ui: &mut egui::Ui, t: &Tokens) {
|
||||
let check = setting::viewport_section_status(app, ui).on_hover_text(app.tr("prefs.viewport_section_status_help"));
|
||||
crate::scenario::publish_target("prefs:viewport_section_status", check.rect);
|
||||
});
|
||||
ui_kit::row(ui, "", |ui| {
|
||||
let check = setting::viewport_status_summary(app, ui).on_hover_text(app.tr("prefs.viewport_status_summary_help"));
|
||||
crate::scenario::publish_target("prefs:viewport_status_summary", check.rect);
|
||||
});
|
||||
// The SKETCH tab outside a sketch too (#7904).
|
||||
ui_kit::row(ui, "", |ui| {
|
||||
let check = setting::sketch_tab_always(app, ui).on_hover_text(app.tr("prefs.sketch_tab_always_note"));
|
||||
|
||||
@@ -2909,6 +2909,7 @@ pub const ESCAPE_TWICE_S: f64 = 0.4;
|
||||
|
||||
/// Global keyboard shortcuts (when no text field has focus).
|
||||
pub fn shortcuts(app: &mut SolveApp, ctx: &egui::Context) {
|
||||
crate::viewport_status::reconcile(app, ctx);
|
||||
crate::browser::update_folder_pick(app, ctx);
|
||||
if design_shown(app) {
|
||||
crate::navigation::step_key_hold(app, ctx);
|
||||
|
||||
@@ -34,7 +34,11 @@ impl Menu {
|
||||
Self::button_at(ui, |ui, _| item.show(ui), add, true)
|
||||
}
|
||||
|
||||
fn button_with<R>(ui: &mut Ui, button: impl FnOnce(&mut Ui, bool) -> Response, add: impl FnOnce(&mut Ui) -> R) -> egui::InnerResponse<Option<R>> {
|
||||
pub(crate) fn button_with<R>(
|
||||
ui: &mut Ui,
|
||||
button: impl FnOnce(&mut Ui, bool) -> Response,
|
||||
add: impl FnOnce(&mut Ui) -> R,
|
||||
) -> egui::InnerResponse<Option<R>> {
|
||||
Self::button_at(ui, button, add, false)
|
||||
}
|
||||
|
||||
|
||||
@@ -36,9 +36,30 @@ pub(crate) struct StatusItem {
|
||||
pub(crate) struct StatusPresentation {
|
||||
pub open_key: Option<String>,
|
||||
focus_ids: Vec<Id>,
|
||||
summary_popup: Option<Id>,
|
||||
summary_members: Vec<String>,
|
||||
}
|
||||
|
||||
impl StatusPresentation {
|
||||
/// Only popup/focus identities are retained; every displayed value comes from this frame.
|
||||
pub(crate) fn reconcile_summary(&mut self, ctx: &egui::Context, members: Vec<String>) {
|
||||
if self.summary_members != members {
|
||||
if let Some(id) = self.summary_popup.take() {
|
||||
egui::Popup::close_id(ctx, id);
|
||||
}
|
||||
if self.owns_focus(ctx) {
|
||||
ctx.memory_mut(|memory| {
|
||||
if let Some(id) = memory.focused() {
|
||||
memory.surrender_focus(id);
|
||||
}
|
||||
});
|
||||
}
|
||||
self.focus_ids.clear();
|
||||
self.open_key = None;
|
||||
self.summary_members = members;
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn owns_focus(&self, ctx: &egui::Context) -> bool {
|
||||
ctx.memory(|memory| memory.focused().is_some_and(|id| self.focus_ids.contains(&id)))
|
||||
}
|
||||
@@ -47,6 +68,7 @@ impl StatusPresentation {
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
pub(crate) enum StatusAction {
|
||||
Clear(String),
|
||||
ClearAll,
|
||||
Edit(String),
|
||||
}
|
||||
|
||||
@@ -209,6 +231,180 @@ pub(crate) fn viewport_status_row(
|
||||
actions
|
||||
}
|
||||
|
||||
/// Count folding is independent of viewport geometry. Newest is supplied by Session chronology.
|
||||
pub(crate) fn viewport_status_summary(
|
||||
ctx: &egui::Context,
|
||||
free: Rect,
|
||||
items: &[StatusItem],
|
||||
newest: &str,
|
||||
state: &mut StatusPresentation,
|
||||
mut key_contents: impl FnMut(&mut Ui, &str),
|
||||
) -> Vec<StatusAction> {
|
||||
let Some(latest) = items.iter().find(|item| item.id == newest) else { return Vec::new() };
|
||||
state.focus_ids.clear();
|
||||
if !items.iter().any(|item| item.has_key && state.open_key.as_deref() == Some(&item.id)) {
|
||||
state.open_key = None;
|
||||
}
|
||||
let t = Tokens::get();
|
||||
let mut actions = Vec::new();
|
||||
let container = Container::new(ctx, Surface::ViewportStatus);
|
||||
let was_open = state.summary_popup.is_some_and(|id| egui::Popup::is_id_open(ctx, id));
|
||||
let row = container
|
||||
.area(Id::new("viewport_status_summary"))
|
||||
.movable(false)
|
||||
.pivot(egui::Align2::CENTER_TOP)
|
||||
.fixed_pos(egui::pos2(free.center().x, free.top() + t.space_8))
|
||||
.show(ctx, |ui| {
|
||||
let (outline, disc) = match latest.kind {
|
||||
StatusKind::Mode => (t.accent, t.accent_soft),
|
||||
StatusKind::Result => (t.border, t.text_dim.gamma_multiply(0.1)),
|
||||
StatusKind::Attention => (t.warning, t.warning.gamma_multiply(0.12)),
|
||||
};
|
||||
let frame = container.frame(ctx, t.overlay, crate::frame::Side::Left).stroke(t.primary_border(outline)).inner_margin(t.space_4);
|
||||
container.show_frame(ui, frame, free, |ui| {
|
||||
let mut button_id = None;
|
||||
let mut summary_popup = None;
|
||||
let menu = super::Menu::button_with(
|
||||
ui,
|
||||
|ui, _| {
|
||||
let extra = crate::i18n::format("ui.viewport_status_summary_more", &[("count", &items.len().saturating_sub(1).to_string())]);
|
||||
let name = ui.painter().layout_no_wrap(latest.name.clone(), crate::fonts::semibold(t.font_label), t.text);
|
||||
let count = ui.painter().layout_no_wrap(extra, egui::FontId::monospace(t.font_small), t.text_dim);
|
||||
let attention = items.iter().any(|item| item.kind == StatusKind::Attention);
|
||||
let width = name.size().x + count.size().x + t.space_24 * 2.0 + t.space_8 * 4.0 + if attention { t.space_12 } else { 0.0 };
|
||||
let (rect, _) = ui.allocate_exact_size(vec2(width, t.control_height.max(ui.spacing().interact_size.y)), egui::Sense::hover());
|
||||
let response = super::button_at(ui, "viewport_status_summary_button", rect, "", Button::Ghost);
|
||||
if response.clicked() {
|
||||
response.request_focus();
|
||||
}
|
||||
let popup_id = egui::Popup::default_response_id(&response);
|
||||
summary_popup = Some(popup_id);
|
||||
button_id = Some(response.id);
|
||||
if response.has_focus() {
|
||||
ui.painter().rect_stroke(rect, t.control_radius, ui.visuals().selection.stroke, egui::StrokeKind::Outside);
|
||||
}
|
||||
let mut x = rect.left() + t.space_8;
|
||||
let icon =
|
||||
Rect::from_center_size(egui::pos2(x + t.space_12, rect.center().y), vec2(t.space_24 - t.space_4, t.space_24 - t.space_4));
|
||||
ui.painter().circle_filled(icon.center(), icon.width() / 2.0, disc);
|
||||
crate::icons::paint_icon(ui.painter(), icon.shrink(t.space_3), latest.kind.icon(), 1.0);
|
||||
x += t.space_24 + t.space_8;
|
||||
ui.painter().galley(egui::pos2(x, rect.center().y - name.size().y / 2.0), name.clone(), t.text);
|
||||
x += name.size().x + t.space_8;
|
||||
ui.painter().galley(egui::pos2(x, rect.center().y - count.size().y / 2.0), count.clone(), t.text_dim);
|
||||
x += count.size().x + t.space_8;
|
||||
if attention {
|
||||
let dot = egui::pos2(x + t.space_3, rect.center().y);
|
||||
ui.painter().circle_filled(dot, t.space_3, t.warning);
|
||||
scenario::publish_target("viewport_status:summary:attention", Rect::from_center_size(dot, vec2(t.space_6, t.space_6)));
|
||||
x += t.space_12;
|
||||
}
|
||||
let chevron = Rect::from_center_size(egui::pos2(x + t.space_12, rect.center().y), vec2(t.space_16, t.space_16));
|
||||
if egui::Popup::is_id_open(ctx, popup_id) {
|
||||
crate::icons::paint_ink_flipped(ui.painter(), chevron, "chevron", t.text_dim);
|
||||
} else {
|
||||
crate::icons::paint_icon(ui.painter(), chevron, "chevron", 1.0);
|
||||
}
|
||||
let label = crate::i18n::format(
|
||||
"ui.viewport_status_summary_label",
|
||||
&[("name", &latest.name), ("count", &items.len().saturating_sub(1).to_string())],
|
||||
);
|
||||
response.widget_info(|| egui::WidgetInfo::labeled(egui::WidgetType::Button, ui.is_enabled(), label.as_str()));
|
||||
scenario::publish_target("viewport_status:summary", rect);
|
||||
scenario::publish_target(&target(latest, "summary"), rect);
|
||||
response
|
||||
},
|
||||
|ui| {
|
||||
super::Menu::heading(ui, crate::i18n::tr("ui.viewport_status_summary_heading"));
|
||||
for item in items {
|
||||
ui.push_id(&item.id, |ui| {
|
||||
ui.horizontal(|ui| {
|
||||
let (icon, _) = ui.allocate_exact_size(vec2(t.space_24, t.space_24), egui::Sense::hover());
|
||||
let disc = match item.kind {
|
||||
StatusKind::Mode => t.accent_soft,
|
||||
StatusKind::Result => t.text_dim.gamma_multiply(0.1),
|
||||
StatusKind::Attention => t.warning.gamma_multiply(0.12),
|
||||
};
|
||||
ui.painter().circle_filled(icon.center(), (icon.width() - t.space_4) / 2.0, disc);
|
||||
crate::icons::paint_icon(ui.painter(), icon.shrink(t.space_4), item.kind.icon(), 1.0);
|
||||
scenario::publish_target(&target(item, "icon"), icon);
|
||||
let name = ui.label(RichText::new(&item.name).semibold().size(t.font_label));
|
||||
scenario::publish_target(&target(item, "name"), name.rect);
|
||||
let setting = RichText::new(&item.setting).monospace().size(t.font_small).color(t.text_dim);
|
||||
if item.editable {
|
||||
let response = super::button(ui, setting, Button::Ghost);
|
||||
scenario::publish_target(&target(item, "setting"), response.rect);
|
||||
state.focus_ids.push(response.id);
|
||||
if response.clicked() {
|
||||
actions.push(StatusAction::Edit(item.id.clone()));
|
||||
ui.close();
|
||||
}
|
||||
} else {
|
||||
let response = ui.label(setting);
|
||||
scenario::publish_target(&target(item, "setting"), response.rect);
|
||||
}
|
||||
if item.has_key {
|
||||
let label = crate::i18n::format("ui.viewport_status_key", &[("name", &item.name)]);
|
||||
let response =
|
||||
icon_action(ui, item, "key", "chevron", &label, &label, state.open_key.as_deref() == Some(&item.id));
|
||||
state.focus_ids.push(response.id);
|
||||
if response.clicked() {
|
||||
state.open_key = Some(item.id.clone());
|
||||
ui.close();
|
||||
}
|
||||
}
|
||||
let label = crate::i18n::format("ui.viewport_status_clear", &[("name", &item.name)]);
|
||||
let hint = crate::i18n::format("ui.viewport_status_clear_hint", &[("name", &item.name)]);
|
||||
let response = icon_action(ui, item, "close", "close", &label, &hint, false);
|
||||
state.focus_ids.push(response.id);
|
||||
if response.clicked() {
|
||||
actions.push(StatusAction::Clear(item.id.clone()));
|
||||
ui.close();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
super::Menu::separator(ui);
|
||||
let label = crate::i18n::tr("ui.viewport_status_summary_clear");
|
||||
let mut footer = super::MenuItem::new("viewport_status_clear_all", label, "");
|
||||
// Display hint only. Native popup Escape closes the list without dispatch.
|
||||
footer.shortcut = "Esc";
|
||||
let response = footer.show(ui);
|
||||
state.focus_ids.push(response.id);
|
||||
if response.clicked() {
|
||||
actions.push(StatusAction::ClearAll);
|
||||
ui.close();
|
||||
}
|
||||
},
|
||||
);
|
||||
state.summary_popup = summary_popup;
|
||||
state.focus_ids.extend(button_id);
|
||||
if was_open && !summary_popup.is_some_and(|id| egui::Popup::is_id_open(ctx, id)) && actions.is_empty() {
|
||||
menu.response.request_focus();
|
||||
}
|
||||
if menu.response.clicked() {
|
||||
state.open_key = None;
|
||||
}
|
||||
});
|
||||
});
|
||||
scenario::publish_rect("viewport_status:row", row.response.rect);
|
||||
scenario::publish_count("viewport_status:count", items.len() as f64);
|
||||
if let Some(id) = state.open_key.as_deref() {
|
||||
let card = Container::new(ctx, Surface::Popup);
|
||||
let result = card
|
||||
.area(Id::new("viewport_status_key"))
|
||||
.order(egui::Order::Background)
|
||||
.movable(false)
|
||||
.fixed_pos(row.response.rect.left_bottom() + vec2(0.0, t.space_6))
|
||||
.show(ctx, |ui| {
|
||||
let frame = card.frame(ctx, t.overlay, crate::frame::Side::Left).inner_margin(t.space_12);
|
||||
card.show_frame(ui, frame, free, |ui| key_contents(ui, id));
|
||||
});
|
||||
scenario::publish_target("viewport_status:card", result.response.rect);
|
||||
}
|
||||
actions
|
||||
}
|
||||
|
||||
/// Shared legend content; the caller supplies the existing analysis-token swatches and text.
|
||||
pub(crate) fn analysis_key(ui: &mut Ui, title: &str, along: Option<&str>, rows: &[(egui::Color32, String, bool)]) {
|
||||
let t = Tokens::get();
|
||||
|
||||
@@ -1338,6 +1338,7 @@ fn section_status_and_analysis_keep_slots_clear_independently_and_filter_escape_
|
||||
#[test]
|
||||
fn section_status_preserves_legacy_three_items_and_dialog_escape_ownership() {
|
||||
let mut h = Harness::new();
|
||||
h.app.preferences.viewport_status_summary = false;
|
||||
h.app.run("solid.box", json!({"length":10,"width":10,"height":10})).unwrap();
|
||||
h.call("ui.prefs", json!({"single_surface_analysis":false}));
|
||||
h.app.run("inspect.zebra", json!({})).unwrap();
|
||||
@@ -1837,3 +1838,238 @@ fn section_only_status_stays_below_preferences_for_paint_and_hit_testing() {
|
||||
h.call("ui.click", json!({"x":at.x,"y":at.y}));
|
||||
assert!(h.app.prefs_window.open && h.app.session.section.is_some());
|
||||
}
|
||||
|
||||
// Summary fixtures below exercise component kinds unavailable from current production producers.
|
||||
#[test]
|
||||
fn summary_component_uses_supplied_newest_and_aggregate_attention_at_three_and_four() {
|
||||
use crate::ui_kit::{StatusItem, StatusKind, StatusPresentation, viewport_status_summary};
|
||||
for count in [3, 4, 12] {
|
||||
for newest_kind in [StatusKind::Mode, StatusKind::Result, StatusKind::Attention] {
|
||||
for warning in [false, true] {
|
||||
let ctx = crate::fonts::test_context();
|
||||
let mut state = StatusPresentation::default();
|
||||
let items: Vec<_> = (0..count)
|
||||
.map(|i| StatusItem {
|
||||
id: format!("summary_{i}"),
|
||||
kind: if i == 0 {
|
||||
newest_kind
|
||||
} else if warning && i == 1 {
|
||||
StatusKind::Attention
|
||||
} else {
|
||||
StatusKind::Mode
|
||||
},
|
||||
name: format!("Source {i}"),
|
||||
setting: format!("{i} mm"),
|
||||
has_key: false,
|
||||
editable: false,
|
||||
})
|
||||
.collect();
|
||||
for width in [320.0, 1600.0] {
|
||||
let free = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(width, 600.0));
|
||||
// Measure settled native Area content, after its sizing/fade frames.
|
||||
// Production animation and every exact paint assertion remain unchanged.
|
||||
let settle_frames = (ctx.global_style().animation_time * 60.0).ceil() as usize + 2;
|
||||
for _ in 0..settle_frames {
|
||||
let mut warm = ctx.run_ui(egui::RawInput { screen_rect: Some(free), ..Default::default() }, |_| {
|
||||
viewport_status_summary(&ctx, free, &items, "summary_0", &mut state, |_, _| {});
|
||||
});
|
||||
warm.textures_delta.clear();
|
||||
}
|
||||
let mut output = ctx.run_ui(egui::RawInput { screen_rect: Some(free), ..Default::default() }, |_| {
|
||||
viewport_status_summary(&ctx, free, &items, "summary_0", &mut state, |_, _| {});
|
||||
});
|
||||
let mut name = false;
|
||||
let mut more = false;
|
||||
let mut dot = false;
|
||||
let t = Tokens::get();
|
||||
for shape in &output.shapes {
|
||||
crate::test_support::each_shape(&shape.shape, &mut |shape| match shape {
|
||||
Shape::Text(text) if text.galley.job.text == "Source 0" => name = true,
|
||||
Shape::Text(text) if text.galley.job.text == format!("+{}", count - 1) => more = true,
|
||||
Shape::Circle(circle) if circle.fill == t.warning && circle.radius == t.space_3 => dot = true,
|
||||
_ => {}
|
||||
});
|
||||
}
|
||||
output.textures_delta.clear();
|
||||
assert!(name && more, "supplied newest is the first slot at every width");
|
||||
assert_eq!(dot, warning || newest_kind == StatusKind::Attention);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn summary_three_effects() -> Harness {
|
||||
let mut h = Harness::new();
|
||||
h.app.run("solid.box", json!({"length":10,"width":10,"height":10})).unwrap();
|
||||
h.call("ui.prefs", json!({"single_surface_analysis":false}));
|
||||
h.app.run("inspect.zebra", json!({})).unwrap();
|
||||
h.app.run("inspect.continuity", json!({})).unwrap();
|
||||
h.app.run("inspect.section", json!({"plane":"XY","at":3})).unwrap();
|
||||
assert_eq!(h.app.session.status_items().len(), 3);
|
||||
h.frames(4);
|
||||
h
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn summary_count_switch_is_independent_of_width_and_legacy_preference_keeps_effects() {
|
||||
let mut h = summary_three_effects();
|
||||
for summary in [true, false] {
|
||||
h.call("ui.prefs", json!({"viewport_status_summary":summary}));
|
||||
for width in [640, 1600] {
|
||||
h.call("ui.resize", json!({"width":width,"height":900}));
|
||||
h.frames(4);
|
||||
assert_eq!(crate::scenario::rect_of("viewport_status:summary").is_some(), summary);
|
||||
for effect in h.app.session.status_items() {
|
||||
let item = crate::viewport_status::presentation(&h.app, &effect).unwrap();
|
||||
assert_eq!(crate::scenario::rect_of(&format!("viewport_status:{}:item", item.id)).is_some(), !summary);
|
||||
}
|
||||
}
|
||||
}
|
||||
h.app.run("inspect.continuity", json!({"clear":true})).unwrap();
|
||||
h.call("ui.prefs", json!({"viewport_status_summary":true}));
|
||||
for width in [640, 1600] {
|
||||
h.call("ui.resize", json!({"width":width,"height":900}));
|
||||
h.frames(4);
|
||||
assert!(crate::scenario::rect_of("viewport_status:summary").is_none());
|
||||
assert_eq!(h.app.session.status_items().len(), 2);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn summary_native_menu_escape_is_close_only_then_newest_replacement_clears_and_unfolds() {
|
||||
let mut h = summary_three_effects();
|
||||
let oldest = h.app.session.status_items().first().unwrap().id;
|
||||
h.app.run("inspect.draft", json!({})).unwrap();
|
||||
h.frames(3);
|
||||
assert_eq!(h.app.session.status_items().first().unwrap().id, oldest);
|
||||
let latest = h.app.session.newest_status_item(&[solidcraft_engine::status_items::StatusId::SurfaceAnalysis]).unwrap();
|
||||
let item = crate::viewport_status::presentation(&h.app, &latest).unwrap();
|
||||
assert!(crate::scenario::rect_of(&format!("viewport_status:{}:summary", item.id)).is_some());
|
||||
h.step(&json!({"click":{"handle":"viewport_status:summary"}})).unwrap();
|
||||
h.frames(3);
|
||||
assert!(egui::Popup::is_any_open(&h.ctx));
|
||||
assert!(crate::scenario::rect_of("menu:viewport_status_clear_all").is_some());
|
||||
let mut previous = f32::NEG_INFINITY;
|
||||
for effect in h.app.session.status_items() {
|
||||
let item = crate::viewport_status::presentation(&h.app, &effect).unwrap();
|
||||
let close = crate::scenario::rect_of(&format!("viewport_status:{}:close", item.id)).unwrap();
|
||||
assert!(close.top() > previous, "menu order follows oldest slots rather than newest activation");
|
||||
previous = close.top();
|
||||
}
|
||||
analysis_escape_relayout_frame(&mut h, |app| {
|
||||
assert_eq!(app.session.status_items().len(), 3, "footer Esc hint is not a clear-all binding");
|
||||
});
|
||||
assert!(!egui::Popup::is_any_open(&h.ctx));
|
||||
assert_eq!(h.app.session.status_items().len(), 3);
|
||||
h.step(&json!({"key":"Escape"})).unwrap();
|
||||
h.frames(3);
|
||||
assert!(h.app.session.analysis.is_none());
|
||||
assert!(h.app.session.section.is_some() && !h.app.session.continuity.is_empty());
|
||||
assert!(crate::scenario::rect_of("viewport_status:summary").is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn summary_popup_closes_on_preference_count_and_replacement_transitions() {
|
||||
for transition in ["disable", "count", "replace", "zero"] {
|
||||
let mut h = summary_three_effects();
|
||||
h.step(&json!({"click":{"handle":"viewport_status:summary"}})).unwrap();
|
||||
h.frames(3);
|
||||
assert!(egui::Popup::is_any_open(&h.ctx));
|
||||
match transition {
|
||||
"disable" => h.app.preferences.viewport_status_summary = false,
|
||||
"count" => {
|
||||
h.app.run("inspect.section", json!({"clear":true})).unwrap();
|
||||
}
|
||||
"replace" => {
|
||||
h.app.run("inspect.draft", json!({})).unwrap();
|
||||
}
|
||||
_ => crate::viewport_status::dispatch(&mut h.app, vec![crate::ui_kit::StatusAction::ClearAll]),
|
||||
}
|
||||
crate::viewport_status::reconcile(&mut h.app, &h.ctx);
|
||||
assert!(!egui::Popup::is_any_open(&h.ctx), "{transition} closes only the stale summary owner");
|
||||
assert!(!h.app.viewport_status.owns_focus(&h.ctx));
|
||||
h.frames(3);
|
||||
if transition == "zero" {
|
||||
assert!(h.app.session.status_items().is_empty());
|
||||
} else {
|
||||
assert!(h.app.session.analysis.is_some());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn summary_dispatch_reconciles_current_sources_hidden_items_and_actual_clear_failures() {
|
||||
use crate::ui_kit::StatusAction;
|
||||
let mut h = summary_three_effects();
|
||||
let old = h.app.session.status_items().into_iter().find(|e| e.command == "inspect.zebra").unwrap();
|
||||
let old = crate::viewport_status::presentation(&h.app, &old).unwrap().id;
|
||||
h.app.run("inspect.draft", json!({})).unwrap();
|
||||
crate::viewport_status::dispatch(&mut h.app, vec![StatusAction::Clear(old)]);
|
||||
assert!(h.app.session.analysis.is_some(), "stale identity cannot clear a replacement");
|
||||
// The host picker blocks actual command execution before engine dispatch.
|
||||
h.app.services.pick_open = Some(Box::new(|_| Box::pin(std::future::pending())));
|
||||
h.app.pick_open(|_, _| {});
|
||||
assert!(h.app.file_picker_busy());
|
||||
crate::viewport_status::dispatch(&mut h.app, vec![StatusAction::ClearAll]);
|
||||
assert_eq!(h.app.session.status_items().len(), 3, "failed commands never remove UI-owned copies");
|
||||
assert!(h.app.status.as_ref().is_some_and(|(_, _, error)| *error));
|
||||
h.app.file_picker = None;
|
||||
h.app.preferences.viewport_section_status = false;
|
||||
crate::viewport_status::dispatch(&mut h.app, vec![StatusAction::ClearAll]);
|
||||
assert!(h.app.session.analysis.is_none() && h.app.session.continuity.is_empty());
|
||||
assert!(h.app.session.section.is_some(), "footer scope is currently represented effects only");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn summary_footer_pointer_and_native_keyboard_dispatch_clear_all_without_a_key_binding() {
|
||||
for keyboard in [false, true] {
|
||||
let mut h = summary_three_effects();
|
||||
h.step(&json!({"click":{"handle":"viewport_status:summary"}})).unwrap();
|
||||
h.frames(3);
|
||||
if keyboard {
|
||||
assert!(h.app.viewport_status.owns_focus(&h.ctx), "opening the badge keeps keyboard traversal at the status controls");
|
||||
// Follow real native focus traversal rather than assigning a widget ID.
|
||||
let footer = crate::scenario::rect_of("menu:viewport_status_clear_all").unwrap();
|
||||
let mut reached = false;
|
||||
for _ in 0..16 {
|
||||
h.step(&json!({"key":"Tab"})).unwrap();
|
||||
reached =
|
||||
h.ctx.memory(|memory| memory.focused()).and_then(|id| h.ctx.read_response(id)).is_some_and(|response| response.rect == footer);
|
||||
if reached {
|
||||
break;
|
||||
}
|
||||
}
|
||||
assert!(reached, "native Tab reaches the footer");
|
||||
h.step(&json!({"key":"Tab", "shift":true})).unwrap();
|
||||
assert!(h.ctx.memory(|memory| memory.focused()).and_then(|id| h.ctx.read_response(id)).is_some_and(|response| response.rect != footer));
|
||||
h.step(&json!({"key":"Tab"})).unwrap();
|
||||
h.step(&json!({"key":"Space"})).unwrap();
|
||||
} else {
|
||||
h.step(&json!({"click":{"handle":"menu:viewport_status_clear_all"}})).unwrap();
|
||||
}
|
||||
h.frames(3);
|
||||
assert!(h.app.session.status_items().is_empty());
|
||||
assert!(!egui::Popup::is_any_open(&h.ctx));
|
||||
assert!(crate::scenario::rect_of("viewport_status:summary").is_none());
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn summary_preferences_cancel_restores_layout_independently_of_all_effect_policies() {
|
||||
for saved in [false, true] {
|
||||
let mut h = summary_three_effects();
|
||||
h.call("ui.prefs", json!({"viewport_status_summary":saved}));
|
||||
h.call("ui.prefs", json!({"open":"Interface"}));
|
||||
h.call("ui.prefs", json!({"viewport_status_summary":!saved}));
|
||||
analysis_escape_relayout_frame(&mut h, |app| {
|
||||
assert_eq!(app.preferences.viewport_status_summary, saved);
|
||||
assert_eq!(app.session.status_items().len(), 3);
|
||||
assert!(!app.preferences.single_surface_analysis);
|
||||
assert!(app.preferences.viewport_analysis_status && app.preferences.viewport_section_status);
|
||||
assert!(app.preferences.persistent_ribbon_pressed);
|
||||
});
|
||||
h.frames(3);
|
||||
assert_eq!(crate::scenario::rect_of("viewport_status:summary").is_some(), saved);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +101,9 @@ pub(crate) fn presentation(app: &SolveApp, effect: &Effect) -> Option<StatusItem
|
||||
}
|
||||
|
||||
fn clear(app: &mut SolveApp, effect: &Effect) {
|
||||
let _ = app.run(&effect.clear.command, serde_json::json!({"clear": effect.clear.params.clear}));
|
||||
if let Err(error) = app.run(&effect.clear.command, serde_json::json!({"clear": effect.clear.params.clear})) {
|
||||
app.set_status(error, true);
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn has_effect(app: &SolveApp) -> bool {
|
||||
@@ -125,7 +127,16 @@ pub(crate) fn escape(app: &mut SolveApp, repeat: bool) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
/// Reconcile before shortcut routing so a vanished native popup cannot own Escape invisibly.
|
||||
pub(crate) fn reconcile(app: &mut SolveApp, ctx: &egui::Context) {
|
||||
let items: Vec<_> = app.session.status_items().iter().filter_map(|effect| presentation(app, effect)).collect();
|
||||
let members =
|
||||
if app.preferences.viewport_status_summary && items.len() >= 3 { items.into_iter().map(|item| item.id).collect() } else { Vec::new() };
|
||||
app.viewport_status.reconcile_summary(ctx, members);
|
||||
}
|
||||
|
||||
pub(crate) fn show(app: &mut SolveApp, ctx: &egui::Context, viewport: egui::Rect) {
|
||||
reconcile(app, ctx);
|
||||
if !enabled(app) {
|
||||
app.viewport_status.open_key = None;
|
||||
return;
|
||||
@@ -154,13 +165,31 @@ pub(crate) fn show(app: &mut SolveApp, ctx: &egui::Context, viewport: egui::Rect
|
||||
return;
|
||||
}
|
||||
let legend = crate::viewport::analysis_legend_data(app);
|
||||
let actions = ui_kit::viewport_status_row(ctx, free, &items, &mut app.viewport_status, |ui, _| {
|
||||
let key_contents = |ui: &mut egui::Ui, _: &str| {
|
||||
if let Some((title, along, rows)) = &legend {
|
||||
ui_kit::analysis_key(ui, title, along.as_deref(), rows);
|
||||
}
|
||||
});
|
||||
};
|
||||
let newest = app.session.newest_status_item(&eligible(app)).map(|effect| identity(&effect));
|
||||
let actions = if app.preferences.viewport_status_summary && items.len() >= 3 {
|
||||
ui_kit::viewport_status_summary(ctx, free, &items, newest.as_deref().unwrap_or_default(), &mut app.viewport_status, key_contents)
|
||||
} else {
|
||||
ui_kit::viewport_status_row(ctx, free, &items, &mut app.viewport_status, key_contents)
|
||||
};
|
||||
dispatch(app, actions);
|
||||
}
|
||||
|
||||
/// Resolve requests against current represented effects, never a menu-open snapshot.
|
||||
pub(crate) fn dispatch(app: &mut SolveApp, actions: Vec<StatusAction>) {
|
||||
for action in actions {
|
||||
let effects: Vec<_> = app.session.status_items().into_iter().filter(|effect| presentation(app, effect).is_some()).collect();
|
||||
match action {
|
||||
StatusAction::ClearAll => {
|
||||
for effect in effects {
|
||||
clear(app, &effect);
|
||||
}
|
||||
app.viewport_status.open_key = None;
|
||||
}
|
||||
StatusAction::Clear(id) => {
|
||||
if let Some(effect) = effects.iter().find(|effect| identity(effect) == id) {
|
||||
clear(app, effect);
|
||||
|
||||
@@ -34,15 +34,20 @@ pub(crate) fn control(app: &mut crate::SolveApp, params: &Value) -> Result<Value
|
||||
"attention" => vec![attention()],
|
||||
"row" => vec![zebra(), section()],
|
||||
"kinds" => vec![zebra(), result(), attention()],
|
||||
"many" => vec![zebra(), section(), result(), attention()],
|
||||
"key" => vec![item("draft", StatusKind::Mode, "ui.draft", "Z · 1°".into(), true)],
|
||||
_ => return Err("preset must be off, mode, result, attention, row, kinds or key".into()),
|
||||
_ => return Err("preset must be off, mode, result, attention, row, kinds, many or key".into()),
|
||||
};
|
||||
app.viewport_status_fixture = Fixture { items, presentation: StatusPresentation::default() };
|
||||
app.viewport_status_fixture.items = items;
|
||||
Ok(json!({"preset": preset, "count": app.viewport_status_fixture.items.len()}))
|
||||
}
|
||||
|
||||
pub(crate) fn show(app: &mut crate::SolveApp, ctx: &egui::Context, viewport: egui::Rect) {
|
||||
if app.viewport_status_fixture.items.is_empty() {
|
||||
let fixture = &mut app.viewport_status_fixture;
|
||||
let folded = app.preferences.viewport_status_summary && fixture.items.len() >= 3;
|
||||
fixture.presentation.reconcile_summary(ctx, if folded { fixture.items.iter().map(|item| item.id.clone()).collect() } else { Vec::new() });
|
||||
if fixture.items.is_empty() {
|
||||
fixture.presentation.open_key = None;
|
||||
return;
|
||||
}
|
||||
let content = crate::shell::content_rect(app, viewport);
|
||||
@@ -60,7 +65,7 @@ pub(crate) fn show(app: &mut crate::SolveApp, ctx: &egui::Context, viewport: egu
|
||||
return;
|
||||
}
|
||||
let fixture = &mut app.viewport_status_fixture;
|
||||
let actions = crate::ui_kit::viewport_status_row(ctx, free, &fixture.items, &mut fixture.presentation, |ui, _| {
|
||||
let key_contents = |ui: &mut egui::Ui, _: &str| {
|
||||
let t = crate::theme::Tokens::get();
|
||||
ui.label(crate::i18n::tr("cmd.inspect_draft"));
|
||||
ui.label(egui::RichText::new(format!("{} (0.00, 0.00, 1.00)", crate::i18n::tr("ui.pull_direction"))).monospace().color(t.text_dim));
|
||||
@@ -78,10 +83,20 @@ pub(crate) fn show(app: &mut crate::SolveApp, ctx: &egui::Context, viewport: egu
|
||||
ui.label(label);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
// Deliberately use the oldest specimen as newest to exercise chronology/slot divergence.
|
||||
// This is explicit specimen metadata, never an engine activation claim.
|
||||
let newest = fixture.items.first().map(|item| item.id.as_str()).unwrap_or_default();
|
||||
let actions = if folded {
|
||||
crate::ui_kit::viewport_status_summary(ctx, free, &fixture.items, newest, &mut fixture.presentation, key_contents)
|
||||
} else {
|
||||
crate::ui_kit::viewport_status_row(ctx, free, &fixture.items, &mut fixture.presentation, key_contents)
|
||||
};
|
||||
for action in actions {
|
||||
if let StatusAction::Clear(id) = action {
|
||||
fixture.items.retain(|item| item.id != id);
|
||||
match action {
|
||||
StatusAction::Clear(id) => fixture.items.retain(|item| item.id != id),
|
||||
StatusAction::ClearAll => fixture.items.clear(),
|
||||
StatusAction::Edit(_) => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,6 +180,12 @@ fn requested_menu_icons_have_artwork_and_match_manifest() {
|
||||
h.call("ui.status_fixture", json!({"preset":preset}));
|
||||
h.frames(3);
|
||||
collect(&mut h, "viewport status specimens", &mut requested);
|
||||
if preset == "kinds" {
|
||||
click(&mut h, "viewport_status:summary");
|
||||
h.frames(3);
|
||||
collect(&mut h, "viewport status summary menu", &mut requested);
|
||||
escape(&mut h);
|
||||
}
|
||||
}
|
||||
h.call("ui.status_fixture", json!({"preset":"off"}));
|
||||
collect(&mut h, "initial browser and timeline", &mut requested);
|
||||
|
||||
@@ -224,5 +224,157 @@
|
||||
{"shot": "viewport-status-focus-dark-tritan"},
|
||||
{"click": {"handle": "viewport_status:draft:close"}},
|
||||
{"frames": 2},
|
||||
{"note": "Summary specimens only; mixed kinds and count4 are not persistent engine evidence."},
|
||||
{"call": "ui.prefs","params": {"theme": "light","color_vision": "off","viewport_status_summary": true}},
|
||||
{"call": "ui.status_fixture","params": {"preset": "kinds"}},
|
||||
{"frames": 4},
|
||||
{"expect": {"count": {"name": "viewport_status:count","value": 3}}},
|
||||
{"shot": "summary-specimen-rest-light-off"},
|
||||
{"click": {"handle": "viewport_status:summary"}},
|
||||
{"frames": 4},
|
||||
{"shot": "summary-specimen-menu-light-off"},
|
||||
{"key": "Escape"},
|
||||
{"frames": 3},
|
||||
{"expect": {"count": {"name": "viewport_status:count","value": 3}}},
|
||||
{"call": "ui.status_fixture","params": {"preset": "many"}},
|
||||
{"frames": 4},
|
||||
{"expect": {"count": {"name": "viewport_status:count","value": 4}}},
|
||||
{"click": {"handle": "viewport_status:summary"}},
|
||||
{"frames": 3},
|
||||
{"click": {"handle": "menu:viewport_status_clear_all"}},
|
||||
{"frames": 3},
|
||||
{"note": "Summary specimens only; mixed kinds and count4 are not persistent engine evidence."},
|
||||
{"call": "ui.prefs","params": {"theme": "light","color_vision": "protan","viewport_status_summary": true}},
|
||||
{"call": "ui.status_fixture","params": {"preset": "kinds"}},
|
||||
{"frames": 4},
|
||||
{"expect": {"count": {"name": "viewport_status:count","value": 3}}},
|
||||
{"shot": "summary-specimen-rest-light-protan"},
|
||||
{"click": {"handle": "viewport_status:summary"}},
|
||||
{"frames": 4},
|
||||
{"shot": "summary-specimen-menu-light-protan"},
|
||||
{"key": "Escape"},
|
||||
{"frames": 3},
|
||||
{"expect": {"count": {"name": "viewport_status:count","value": 3}}},
|
||||
{"call": "ui.status_fixture","params": {"preset": "many"}},
|
||||
{"frames": 4},
|
||||
{"expect": {"count": {"name": "viewport_status:count","value": 4}}},
|
||||
{"click": {"handle": "viewport_status:summary"}},
|
||||
{"frames": 3},
|
||||
{"click": {"handle": "menu:viewport_status_clear_all"}},
|
||||
{"frames": 3},
|
||||
{"note": "Summary specimens only; mixed kinds and count4 are not persistent engine evidence."},
|
||||
{"call": "ui.prefs","params": {"theme": "light","color_vision": "deutan","viewport_status_summary": true}},
|
||||
{"call": "ui.status_fixture","params": {"preset": "kinds"}},
|
||||
{"frames": 4},
|
||||
{"expect": {"count": {"name": "viewport_status:count","value": 3}}},
|
||||
{"shot": "summary-specimen-rest-light-deutan"},
|
||||
{"click": {"handle": "viewport_status:summary"}},
|
||||
{"frames": 4},
|
||||
{"shot": "summary-specimen-menu-light-deutan"},
|
||||
{"key": "Escape"},
|
||||
{"frames": 3},
|
||||
{"expect": {"count": {"name": "viewport_status:count","value": 3}}},
|
||||
{"call": "ui.status_fixture","params": {"preset": "many"}},
|
||||
{"frames": 4},
|
||||
{"expect": {"count": {"name": "viewport_status:count","value": 4}}},
|
||||
{"click": {"handle": "viewport_status:summary"}},
|
||||
{"frames": 3},
|
||||
{"click": {"handle": "menu:viewport_status_clear_all"}},
|
||||
{"frames": 3},
|
||||
{"note": "Summary specimens only; mixed kinds and count4 are not persistent engine evidence."},
|
||||
{"call": "ui.prefs","params": {"theme": "light","color_vision": "tritan","viewport_status_summary": true}},
|
||||
{"call": "ui.status_fixture","params": {"preset": "kinds"}},
|
||||
{"frames": 4},
|
||||
{"expect": {"count": {"name": "viewport_status:count","value": 3}}},
|
||||
{"shot": "summary-specimen-rest-light-tritan"},
|
||||
{"click": {"handle": "viewport_status:summary"}},
|
||||
{"frames": 4},
|
||||
{"shot": "summary-specimen-menu-light-tritan"},
|
||||
{"key": "Escape"},
|
||||
{"frames": 3},
|
||||
{"expect": {"count": {"name": "viewport_status:count","value": 3}}},
|
||||
{"call": "ui.status_fixture","params": {"preset": "many"}},
|
||||
{"frames": 4},
|
||||
{"expect": {"count": {"name": "viewport_status:count","value": 4}}},
|
||||
{"click": {"handle": "viewport_status:summary"}},
|
||||
{"frames": 3},
|
||||
{"click": {"handle": "menu:viewport_status_clear_all"}},
|
||||
{"frames": 3},
|
||||
{"note": "Summary specimens only; mixed kinds and count4 are not persistent engine evidence."},
|
||||
{"call": "ui.prefs","params": {"theme": "dark","color_vision": "off","viewport_status_summary": true}},
|
||||
{"call": "ui.status_fixture","params": {"preset": "kinds"}},
|
||||
{"frames": 4},
|
||||
{"expect": {"count": {"name": "viewport_status:count","value": 3}}},
|
||||
{"shot": "summary-specimen-rest-dark-off"},
|
||||
{"click": {"handle": "viewport_status:summary"}},
|
||||
{"frames": 4},
|
||||
{"shot": "summary-specimen-menu-dark-off"},
|
||||
{"key": "Escape"},
|
||||
{"frames": 3},
|
||||
{"expect": {"count": {"name": "viewport_status:count","value": 3}}},
|
||||
{"call": "ui.status_fixture","params": {"preset": "many"}},
|
||||
{"frames": 4},
|
||||
{"expect": {"count": {"name": "viewport_status:count","value": 4}}},
|
||||
{"click": {"handle": "viewport_status:summary"}},
|
||||
{"frames": 3},
|
||||
{"click": {"handle": "menu:viewport_status_clear_all"}},
|
||||
{"frames": 3},
|
||||
{"note": "Summary specimens only; mixed kinds and count4 are not persistent engine evidence."},
|
||||
{"call": "ui.prefs","params": {"theme": "dark","color_vision": "protan","viewport_status_summary": true}},
|
||||
{"call": "ui.status_fixture","params": {"preset": "kinds"}},
|
||||
{"frames": 4},
|
||||
{"expect": {"count": {"name": "viewport_status:count","value": 3}}},
|
||||
{"shot": "summary-specimen-rest-dark-protan"},
|
||||
{"click": {"handle": "viewport_status:summary"}},
|
||||
{"frames": 4},
|
||||
{"shot": "summary-specimen-menu-dark-protan"},
|
||||
{"key": "Escape"},
|
||||
{"frames": 3},
|
||||
{"expect": {"count": {"name": "viewport_status:count","value": 3}}},
|
||||
{"call": "ui.status_fixture","params": {"preset": "many"}},
|
||||
{"frames": 4},
|
||||
{"expect": {"count": {"name": "viewport_status:count","value": 4}}},
|
||||
{"click": {"handle": "viewport_status:summary"}},
|
||||
{"frames": 3},
|
||||
{"click": {"handle": "menu:viewport_status_clear_all"}},
|
||||
{"frames": 3},
|
||||
{"note": "Summary specimens only; mixed kinds and count4 are not persistent engine evidence."},
|
||||
{"call": "ui.prefs","params": {"theme": "dark","color_vision": "deutan","viewport_status_summary": true}},
|
||||
{"call": "ui.status_fixture","params": {"preset": "kinds"}},
|
||||
{"frames": 4},
|
||||
{"expect": {"count": {"name": "viewport_status:count","value": 3}}},
|
||||
{"shot": "summary-specimen-rest-dark-deutan"},
|
||||
{"click": {"handle": "viewport_status:summary"}},
|
||||
{"frames": 4},
|
||||
{"shot": "summary-specimen-menu-dark-deutan"},
|
||||
{"key": "Escape"},
|
||||
{"frames": 3},
|
||||
{"expect": {"count": {"name": "viewport_status:count","value": 3}}},
|
||||
{"call": "ui.status_fixture","params": {"preset": "many"}},
|
||||
{"frames": 4},
|
||||
{"expect": {"count": {"name": "viewport_status:count","value": 4}}},
|
||||
{"click": {"handle": "viewport_status:summary"}},
|
||||
{"frames": 3},
|
||||
{"click": {"handle": "menu:viewport_status_clear_all"}},
|
||||
{"frames": 3},
|
||||
{"note": "Summary specimens only; mixed kinds and count4 are not persistent engine evidence."},
|
||||
{"call": "ui.prefs","params": {"theme": "dark","color_vision": "tritan","viewport_status_summary": true}},
|
||||
{"call": "ui.status_fixture","params": {"preset": "kinds"}},
|
||||
{"frames": 4},
|
||||
{"expect": {"count": {"name": "viewport_status:count","value": 3}}},
|
||||
{"shot": "summary-specimen-rest-dark-tritan"},
|
||||
{"click": {"handle": "viewport_status:summary"}},
|
||||
{"frames": 4},
|
||||
{"shot": "summary-specimen-menu-dark-tritan"},
|
||||
{"key": "Escape"},
|
||||
{"frames": 3},
|
||||
{"expect": {"count": {"name": "viewport_status:count","value": 3}}},
|
||||
{"call": "ui.status_fixture","params": {"preset": "many"}},
|
||||
{"frames": 4},
|
||||
{"expect": {"count": {"name": "viewport_status:count","value": 4}}},
|
||||
{"click": {"handle": "viewport_status:summary"}},
|
||||
{"frames": 3},
|
||||
{"click": {"handle": "menu:viewport_status_clear_all"}},
|
||||
{"frames": 3},
|
||||
{"call": "ui.status_fixture","params": {"preset": "off"}}
|
||||
]
|
||||
|
||||
@@ -2,10 +2,15 @@
|
||||
|
||||
For UI-kit review, `ui.status_fixture {"preset":"mode"}` shows bounded status
|
||||
specimens in the real viewport. Presets are `off`, `mode`, `result`, `attention`,
|
||||
`row`, `kinds` and `key`; the reply carries the preset and item count. This
|
||||
`row`, `kinds`, `many` and `key`; the reply carries the preset and item count. This
|
||||
scenario fixture does not change engine state or open a dialog. `off` clears it.
|
||||
The published `viewport_status:<id>:item`, `:setting`, `:key` and `:close` handles
|
||||
support the ordinary `ui.at`, `ui.move`, `ui.click` and keyboard controls.
|
||||
With `viewport_status_summary` enabled, `kinds` (three) and `many` (four) exercise
|
||||
the summary component, using explicit specimen newest metadata. The
|
||||
`viewport_status:summary` and `menu:viewport_status_clear_all` handles open its
|
||||
native menu and activate its footer. These specimens are not persistent engine
|
||||
results; actual production sources currently supply at most three Mode items.
|
||||
|
||||
Toasts the user may close have a close (×) at their top right instead of a Close button, published
|
||||
as `toast:<name>:close`: `toast:status:close`, `toast:space_mouse_offer:close` and
|
||||
|
||||
Reference in New Issue
Block a user