Skip to content

Commit

Permalink
Add command palette action for resetting to the default blueprint (#9088
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Wumpf authored Feb 20, 2025
1 parent 8a7b22f commit 651133e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
9 changes: 8 additions & 1 deletion crates/viewer/re_ui/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ pub enum UICommand {
OpenRerunDiscord,

ResetViewer,
ClearActiveBlueprint,
ClearActiveBlueprintAndEnableHeuristics,

#[cfg(not(target_arch = "wasm32"))]
Expand Down Expand Up @@ -137,9 +138,14 @@ impl UICommand {
"Reset the Viewer to how it looked the first time you ran it, forgetting all stored blueprints and UI state",
),

Self::ClearActiveBlueprint => (
"Reset to default blueprint",
"Clear active blueprint and use the default blueprint instead. If no default blueprint is set, this will use a heuristic blueprint."
),

Self::ClearActiveBlueprintAndEnableHeuristics => (
"Reset to heuristic blueprint",
"Re-populate viewport with automatically chosen views"
"Re-populate viewport with automatically chosen views using default visualizers"
),

#[cfg(not(target_arch = "wasm32"))]
Expand Down Expand Up @@ -311,6 +317,7 @@ impl UICommand {
Self::Quit => smallvec![cmd(Key::Q)],

Self::ResetViewer => smallvec![ctrl_shift(Key::R)],
Self::ClearActiveBlueprint => smallvec![],
Self::ClearActiveBlueprintAndEnableHeuristics => smallvec![],

#[cfg(not(target_arch = "wasm32"))]
Expand Down
4 changes: 4 additions & 0 deletions crates/viewer/re_viewer/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -860,6 +860,10 @@ impl App {
}

UICommand::ResetViewer => self.command_sender.send_system(SystemCommand::ResetViewer),
UICommand::ClearActiveBlueprint => {
self.command_sender
.send_system(SystemCommand::ClearActiveBlueprint);
}
UICommand::ClearActiveBlueprintAndEnableHeuristics => {
self.command_sender
.send_system(SystemCommand::ClearActiveBlueprintAndEnableHeuristics);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub enum SystemCommand {
/// To force using the heuristics, use [`Self::ClearActiveBlueprintAndEnableHeuristics`].
///
/// UI note: because of the above ambiguity, controls for this command should only be enabled if
/// a default blueprint is set.
/// a default blueprint is set or the behavior is explicitly explained.
ClearActiveBlueprint,

/// Clear the active blueprint and enable heuristics.
Expand Down

0 comments on commit 651133e

Please sign in to comment.