Skip to content

Commit 09dc911

Browse files
Wumpfemilk
andauthored
Fix panel hide buttons saving untagged blueprint (#9965)
* #6889 broke as part of tagged component effort - related to the issue of component batch pretending to know its descriptor when it actually just uses `C::descriptor` which is almost always incorrect. --------- Co-authored-by: Emil Ernerfeldt <[email protected]>
1 parent d620a64 commit 09dc911

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

crates/viewer/re_viewer/src/app_blueprint.rs

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ use re_chunk::{Chunk, RowId};
44
use re_chunk_store::LatestAtQuery;
55
use re_entity_db::EntityDb;
66
use re_log_types::EntityPath;
7-
use re_types::{
8-
ComponentBatch,
9-
blueprint::{archetypes::PanelBlueprint, components::PanelState},
10-
};
7+
use re_types::blueprint::{archetypes::PanelBlueprint, components::PanelState};
118
use re_viewer_context::{
129
CommandSender, SystemCommand, SystemCommandSender as _, blueprint_timepoint_for_writes,
1310
};
@@ -205,9 +202,14 @@ pub fn setup_welcome_screen_blueprint(welcome_screen_blueprint: &mut EntityDb) {
205202
let timepoint = re_viewer_context::blueprint_timepoint_for_writes(welcome_screen_blueprint);
206203

207204
let chunk = Chunk::builder(entity_path)
208-
.with_component_batches(RowId::new(), timepoint, [&value as &dyn ComponentBatch])
205+
.with_archetype(
206+
RowId::new(),
207+
timepoint,
208+
&PanelBlueprint::update_fields().with_state(value),
209+
)
209210
.build()
210-
.expect("Failed to build chunk - incorrect number of instances for the component");
211+
// All builtin types, no reason for this to ever fail.
212+
.expect("Failed to build chunk.");
211213

212214
welcome_screen_blueprint
213215
.add_chunk(&Arc::new(chunk))
@@ -230,9 +232,14 @@ impl AppBlueprint<'_> {
230232
let timepoint = blueprint_timepoint_for_writes(blueprint_db);
231233

232234
let chunk = Chunk::builder(entity_path)
233-
.with_component_batches(RowId::new(), timepoint, [&value as &dyn ComponentBatch])
235+
.with_archetype(
236+
RowId::new(),
237+
timepoint,
238+
&PanelBlueprint::update_fields().with_state(value),
239+
)
234240
.build()
235-
.expect("Failed to build chunk - incorrect number of instances for the component");
241+
// All builtin types, no reason for this to ever fail.
242+
.expect("Failed to build chunk.");
236243

237244
command_sender.send_system(SystemCommand::UpdateBlueprint(
238245
blueprint_db.store_id().clone(),

0 commit comments

Comments
 (0)