Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always enable entity path filter editor #5331

Merged
merged 1 commit into from
Feb 28, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 0 additions & 8 deletions crates/re_viewer/src/ui/rerun_menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,14 +375,6 @@ fn experimental_feature_ui(
));
}

re_ui
.checkbox(
ui,
&mut app_options.experimental_entity_filter_editor,
"Entity filter DSL",
)
.on_hover_text("Show an entity filter DSL when selecting a space-view.");

re_ui
.checkbox(
ui,
Expand Down
60 changes: 25 additions & 35 deletions crates/re_viewer/src/ui/selection_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -837,43 +837,33 @@ fn blueprint_ui_for_space_view(
viewport: &mut Viewport<'_, '_>,
space_view_id: &SpaceViewId,
) {
if ctx.app_options.experimental_entity_filter_editor {
if let Some(space_view) = viewport.blueprint.space_view(space_view_id) {
if let Some(query) = space_view.queries.first() {
if let Some(new_entity_path_filter) =
entity_path_filter_ui(ui, viewport, space_view_id, &query.entity_path_filter)
{
let timepoint = blueprint_timepoint_for_writes();
let expressions_component = QueryExpressions::from(&new_entity_path_filter);

let row = DataRow::from_cells1_sized(
RowId::new(),
query.id.as_entity_path(),
timepoint,
1,
[expressions_component],
)
.unwrap();

ctx.command_sender
.send_system(SystemCommand::UpdateBlueprint(
ctx.store_context.blueprint.store_id().clone(),
vec![row],
));

space_view.set_entity_determined_by_user(ctx);
}

ui.add_space(ui.spacing().item_spacing.y);
if let Some(space_view) = viewport.blueprint.space_view(space_view_id) {
if let Some(query) = space_view.queries.first() {
if let Some(new_entity_path_filter) =
entity_path_filter_ui(ui, viewport, space_view_id, &query.entity_path_filter)
{
let timepoint = blueprint_timepoint_for_writes();
let expressions_component = QueryExpressions::from(&new_entity_path_filter);

let row = DataRow::from_cells1_sized(
RowId::new(),
query.id.as_entity_path(),
timepoint,
1,
[expressions_component],
)
.unwrap();

ctx.command_sender
.send_system(SystemCommand::UpdateBlueprint(
ctx.store_context.blueprint.store_id().clone(),
vec![row],
));

space_view.set_entity_determined_by_user(ctx);
}
}
} else {
let response = ui.button("Add/remove Entity").on_hover_text(
"Adjust the query expressions to add or remove Entities from the Space View",
);

if response.clicked() {
viewport.show_add_remove_entities_modal(*space_view_id);
ui.add_space(ui.spacing().item_spacing.y);
}
}

Expand Down
4 changes: 0 additions & 4 deletions crates/re_viewer_context/src/app_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ pub struct AppOptions {
/// Enable experimental dataframe space views.
pub experimental_dataframe_space_view: bool,

pub experimental_entity_filter_editor: bool,

/// Toggle query clamping for the plot visualizers.
pub experimental_plot_query_clamping: bool,

Expand Down Expand Up @@ -52,8 +50,6 @@ impl Default for AppOptions {

experimental_dataframe_space_view: false,

experimental_entity_filter_editor: false,

experimental_plot_query_clamping: false,

experimental_visualizer_selection: false,
Expand Down
8 changes: 1 addition & 7 deletions crates/re_viewport/src/space_view_entity_picker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,10 @@ impl SpaceViewEntityPicker {
ctx: &ViewerContext<'_>,
viewport_blueprint: &ViewportBlueprint,
) {
let title = if ctx.app_options.experimental_entity_filter_editor {
"Edit entity path query"
} else {
"Add/remove Entities"
};

self.modal_handler.ui(
ctx.re_ui,
egui_ctx,
|| re_ui::modal::Modal::new(title).default_height(640.0),
|| re_ui::modal::Modal::new("Add/remove Entities").default_height(640.0),
|_, ui, open| {
let Some(space_view_id) = &self.space_view_id else {
*open = false;
Expand Down