Skip to content

Commit

Permalink
Hide stream view and selection view in welcome app (#3333)
Browse files Browse the repository at this point in the history
### What
In the welcome screen blueprint, hide the selection view and
streams/time view:

`cargo rerun reset && cargo rerun` ->

<img width="1712" alt="Screenshot 2023-09-15 at 13 10 17"
src="https://github.com/rerun-io/rerun/assets/1148717/fc1743dc-74ac-4056-8c99-a7b44e493985">

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/3333) (if
applicable)

- [PR Build Summary](https://build.rerun.io/pr/3333)
- [Docs
preview](https://rerun.io/preview/eb2d7e5d9c012b5090cf4bfb5c36674c594f097d/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/eb2d7e5d9c012b5090cf4bfb5c36674c594f097d/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://ref.rerun.io/dev/bench/)
- [Wasm size tracking](https://ref.rerun.io/dev/sizes/)
  • Loading branch information
emilk authored Sep 15, 2023
1 parent 97c6aa8 commit 6f6d471
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 8 deletions.
22 changes: 22 additions & 0 deletions crates/re_viewer/src/app_blueprint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,28 @@ impl<'a> AppBlueprint<'a> {
}
}

pub fn setup_welcome_screen_blueprint(welcome_screen_blueprint: &mut StoreDb) {
for (panel_name, expanded) in [
(PanelState::BLUEPRINT_VIEW_PATH, true),
(PanelState::SELECTION_VIEW_PATH, false),
(PanelState::TIMELINE_VIEW_PATH, false),
] {
let entity_path = EntityPath::from(panel_name);
// TODO(jleibs): Seq instead of timeless?
let timepoint = TimePoint::timeless();

let component = PanelState { expanded };

let row =
DataRow::from_cells1_sized(RowId::random(), entity_path, timepoint, 1, [component]);

welcome_screen_blueprint
.entity_db
.try_add_data_row(&row)
.unwrap();
}
}

// ----------------------------------------------------------------------------

impl<'a> AppBlueprint<'a> {
Expand Down
22 changes: 14 additions & 8 deletions crates/re_viewer/src/store_hub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,26 @@ impl StoreHub {
/// screen.
pub fn new() -> Self {
re_tracing::profile_function!();
let mut blueprints = HashMap::new();
blueprints.insert(
let mut blueprint_by_app_id = HashMap::new();
let mut store_dbs = StoreBundle::default();

let welcome_screen_store_id = StoreId::from_string(
StoreKind::Blueprint,
Self::welcome_screen_app_id().to_string(),
);
blueprint_by_app_id.insert(
Self::welcome_screen_app_id(),
StoreId::from_string(
StoreKind::Blueprint,
Self::welcome_screen_app_id().to_string(),
),
welcome_screen_store_id.clone(),
);

let welcome_screen_blueprint = store_dbs.blueprint_entry(&welcome_screen_store_id);
crate::app_blueprint::setup_welcome_screen_blueprint(welcome_screen_blueprint);

Self {
selected_rec_id: None,
selected_application_id: None,
blueprint_by_app_id: blueprints,
store_dbs: Default::default(),
blueprint_by_app_id,
store_dbs,

was_recording_active: false,

Expand Down

0 comments on commit 6f6d471

Please sign in to comment.