Skip to content

Commit

Permalink
Remove selection history (#8296)
Browse files Browse the repository at this point in the history
### What
We're removing it because we're worried users will confuse it with the
new Undo feature.

After this PR, you can no longer go back in the selection history.

But, we're planning on adding hierarchy breadcrumbs to the selections
instead, which should hopefully be an even better way of understanding
and navigating selections:
* #4491


![image](https://github.com/user-attachments/assets/afb38bff-7e83-4dac-bb7f-cd27a8acca4d)
  • Loading branch information
emilk authored Dec 5, 2024
1 parent c31cf27 commit 0f16292
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 396 deletions.
14 changes: 7 additions & 7 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f47983a1084940ba9a39c077a8c63e55c619388be5476ac04c804cfbd1e63459"
dependencies = [
"accesskit",
"hashbrown 0.15.1",
"hashbrown 0.15.2",
"immutable-chunkmap",
]

Expand All @@ -71,7 +71,7 @@ checksum = "7329821f3bd1101e03a7d2e03bd339e3ac0dc64c70b4c9f9ae1949e3ba8dece1"
dependencies = [
"accesskit",
"accesskit_consumer 0.26.0",
"hashbrown 0.15.1",
"hashbrown 0.15.2",
"objc2",
"objc2-app-kit",
"objc2-foundation",
Expand Down Expand Up @@ -103,7 +103,7 @@ checksum = "24fcd5d23d70670992b823e735e859374d694a3d12bfd8dd32bd3bd8bedb5d81"
dependencies = [
"accesskit",
"accesskit_consumer 0.26.0",
"hashbrown 0.15.1",
"hashbrown 0.15.2",
"paste",
"static_assertions",
"windows 0.58.0",
Expand Down Expand Up @@ -2998,9 +2998,9 @@ dependencies = [

[[package]]
name = "hashbrown"
version = "0.15.1"
version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3"
checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289"
dependencies = [
"allocator-api2",
"equivalent",
Expand Down Expand Up @@ -3409,7 +3409,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da"
dependencies = [
"equivalent",
"hashbrown 0.15.1",
"hashbrown 0.15.2",
"serde",
]

Expand Down Expand Up @@ -3826,7 +3826,7 @@ version = "0.12.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38"
dependencies = [
"hashbrown 0.15.1",
"hashbrown 0.15.2",
]

[[package]]
Expand Down
1 change: 0 additions & 1 deletion crates/viewer/re_selection_panel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
mod defaults_ui;
mod item_title;
mod selection_history_ui;
mod selection_panel;
mod space_view_entity_picker;
mod space_view_space_origin_ui;
Expand Down
216 changes: 0 additions & 216 deletions crates/viewer/re_selection_panel/src/selection_history_ui.rs

This file was deleted.

15 changes: 2 additions & 13 deletions crates/viewer/re_selection_panel/src/selection_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ use re_viewer_context::{
use re_viewport_blueprint::{ui::show_add_space_view_or_container_modal, ViewportBlueprint};

use crate::{defaults_ui::view_components_defaults_section_ui, visualizer_ui::visualizer_ui};
use crate::{space_view_entity_picker::SpaceViewEntityPicker, ItemTitle};
use crate::{
selection_history_ui::SelectionHistoryUi,
visible_time_range_ui::visible_time_range_ui_for_data_result,
visible_time_range_ui::visible_time_range_ui_for_view,
};
use crate::{space_view_entity_picker::SpaceViewEntityPicker, ItemTitle};

// ---
fn default_selection_panel_width(screen_width: f32) -> f32 {
Expand All @@ -35,8 +34,6 @@ fn default_selection_panel_width(screen_width: f32) -> f32 {
#[derive(Default, serde::Deserialize, serde::Serialize)]
#[serde(default)]
pub struct SelectionPanel {
selection_state_ui: SelectionHistoryUi,

#[serde(skip)]
/// State for the "Add entity" modal.
space_view_entity_modal: SpaceViewEntityPicker,
Expand Down Expand Up @@ -70,15 +67,7 @@ impl SelectionPanel {
ui.panel_content(|ui| {
let hover = "The selection view contains information and options about \
the currently selected object(s)";
ui.panel_title_bar_with_buttons("Selection", Some(hover), |ui| {
let mut history = ctx.selection_state().history.lock();
if let Some(selection) =
self.selection_state_ui
.selection_ui(ui, viewport, &mut history)
{
ctx.selection_state().set_selection(selection);
}
});
ui.panel_title_bar("Selection", Some(hover));
});

// move the vertical spacing between the title and the content to _inside_ the scroll
Expand Down
7 changes: 0 additions & 7 deletions crates/viewer/re_ui/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ pub enum UICommand {
#[cfg(not(target_arch = "wasm32"))]
ZoomReset,

SelectionPrevious,
SelectionNext,

ToggleCommandPalette,

// Playback:
Expand Down Expand Up @@ -199,8 +196,6 @@ impl UICommand {
"Resets the UI zoom level to the operating system's default value",
),

Self::SelectionPrevious => ("Previous selection", "Go to previous selection"),
Self::SelectionNext => ("Next selection", "Go to next selection"),
Self::ToggleCommandPalette => ("Command palette…", "Toggle the Command Palette"),

Self::PlaybackTogglePlayPause => {
Expand Down Expand Up @@ -346,8 +341,6 @@ impl UICommand {
#[cfg(not(target_arch = "wasm32"))]
Self::ZoomReset => Some(egui::gui_zoom::kb_shortcuts::ZOOM_RESET),

Self::SelectionPrevious => Some(ctrl_shift(Key::ArrowLeft)),
Self::SelectionNext => Some(ctrl_shift(Key::ArrowRight)),
Self::ToggleCommandPalette => Some(cmd(Key::P)),

Self::PlaybackTogglePlayPause => Some(key(Key::Space)),
Expand Down
6 changes: 0 additions & 6 deletions crates/viewer/re_viewer/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -825,12 +825,6 @@ impl App {
egui_ctx.set_zoom_factor(1.0);
}

UICommand::SelectionPrevious => {
self.state.selection_state.select_previous();
}
UICommand::SelectionNext => {
self.state.selection_state.select_next();
}
UICommand::ToggleCommandPalette => {
self.cmd_palette.toggle();
}
Expand Down
2 changes: 0 additions & 2 deletions crates/viewer/re_viewer_context/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ mod item;
mod maybe_mut_ref;
mod query_context;
mod query_range;
mod selection_history;
mod selection_state;
mod space_view;
mod store_context;
Expand Down Expand Up @@ -59,7 +58,6 @@ pub use self::{
DataQueryResult, DataResultHandle, DataResultNode, DataResultTree, QueryContext,
},
query_range::QueryRange,
selection_history::SelectionHistory,
selection_state::{
ApplicationSelectionState, HoverHighlight, InteractionHighlight, ItemCollection,
ItemSpaceContext, SelectionHighlight,
Expand Down
Loading

0 comments on commit 0f16292

Please sign in to comment.