Skip to content

Add command palette action for resetting to the default blueprint #9088

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

Merged
merged 1 commit into from
Feb 20, 2025
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
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