Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions crates/viewer/re_component_ui/src/datatype_uis/enum_ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,14 @@ fn edit_view_enum_impl<
ui.markdown_ui(prev_selected_value.docstring_md());
});

combobox_response.response.widget_info(|| {
egui::WidgetInfo::labeled(
egui::WidgetType::ComboBox,
ui.is_enabled(),
current_value.to_string(),
)
});

response_with_changes_of_inner(combobox_response)
}
} else {
Expand Down
50 changes: 0 additions & 50 deletions tests/python/release_checklist/check_deselect_on_escape.py

This file was deleted.

78 changes: 78 additions & 0 deletions tests/rust/re_integration_test/tests/deselect_on_escape.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
//! Test that pressing the Escape key will back out of dialogs etc.

use re_integration_test::HarnessExt as _;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
use re_integration_test::HarnessExt as _;
//! Test that pressing the Escape key will back out of dialogs etc.
use re_integration_test::HarnessExt as _;

use re_sdk::TimePoint;
use re_sdk::log::RowId;
use re_viewer::external::re_viewer_context::ViewClass as _;
use re_viewer::external::{re_types, re_view_spatial};
use re_viewer::viewer_test_utils::{self, HarnessOptions};
use re_viewport_blueprint::ViewBlueprint;

fn make_test_harness<'a>() -> egui_kittest::Harness<'a, re_viewer::App> {
let mut harness = viewer_test_utils::viewer_harness(&HarnessOptions {
window_size: Some(egui::vec2(1024.0, 1024.0)),
..Default::default()
});
harness.init_recording();
harness.set_selection_panel_opened(false);

// Log some data
harness.log_entity("boxes3d", |builder| {
builder.with_archetype(
RowId::new(),
TimePoint::STATIC,
&re_types::archetypes::Boxes3D::from_centers_and_half_sizes(
[(0.0, 0.0, 0.0)],
[(1.0, 0.4, 0.2)],
)
.with_colors([0xFF9001FF]),
)
});

harness.clear_current_blueprint();
harness.setup_viewport_blueprint(move |_viewer_context, blueprint| {
let mut view3d =
ViewBlueprint::new_with_root_wildcard(re_view_spatial::SpatialView3D::identifier());
view3d.display_name = Some("3D view".into());
blueprint.add_view_at_root(view3d);
});

harness
}

#[tokio::test(flavor = "multi_thread")]
pub async fn test_deselect_on_escape() {
let mut harness = make_test_harness();

// Select view then press escape, view should be deselected
harness.blueprint_tree().click_label("3D view");
harness.key_press(egui::Key::Escape);
harness.snapshot_app("deselect_on_escape_1");

// Select view, click on dropdown, then press escape, view remains selected
harness.blueprint_tree().click_label("3D view");
harness.set_selection_panel_opened(true);
harness.click_label("GradientDark");
harness.snapshot_app("deselect_on_escape_2");
harness.key_press(egui::Key::Escape);
harness.snapshot_app("deselect_on_escape_3");

// Select view, open "add view or container" modal, escape, view remains selected
harness.blueprint_tree().click_label("3D view");
harness.click_label("Open menu with more options");
harness.click_label_contains("Add view or container");
harness.snapshot_app("deselect_on_escape_4");
harness.key_press(egui::Key::Escape);
harness.snapshot_app("deselect_on_escape_5");

// Select view, right click on blueprint tree, escape, view remains selected
harness.blueprint_tree().click_label("3D view");
harness.blueprint_tree().right_click_label("3D view");
harness.snapshot_app("deselect_on_escape_6");
harness.key_press(egui::Key::Escape);
harness.snapshot_app("deselect_on_escape_7");
// Whatever was selected should become deselected after pressing escape again
harness.key_press(egui::Key::Escape);
harness.set_selection_panel_opened(false);
harness.snapshot_app("deselect_on_escape_8");
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions tests/rust/re_integration_test/tests/snapshots/xtemp.png
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"xtemp"?

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.