Skip to content

Commit 843ad2a

Browse files
authored
Use partition id in the recording panel (#11157)
1 parent 2718727 commit 843ad2a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

crates/viewer/re_data_ui/src/item_ui.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//!
33
//! TODO(andreas): This is not a `data_ui`, can this go somewhere else, shouldn't be in `re_data_ui`.
44
5+
use re_entity_db::entity_db::EntityDbClass;
56
use re_entity_db::{EntityTree, InstancePath};
67
use re_format::format_uint;
78
use re_log_types::{ApplicationId, EntityPath, TableId, TimeInt, TimeType, Timeline, TimelineName};
@@ -693,10 +694,17 @@ pub fn entity_db_button_ui(
693694
String::default()
694695
};
695696

697+
// We try to use a name that has the most chance to be familiar to the user:
698+
// - The recording name has to be explicitly set by the user, so use it if it exists.
699+
// - For remote data, partition id have a lot of visibility too, so good fall-back.
700+
// - Lacking anything better, the start time is better than a random id and caters to the local
701+
// workflow where the same logging process is run repeatedly.
696702
let recording_name = if let Some(recording_name) =
697703
entity_db.recording_info_property::<Name>(&RecordingInfo::descriptor_name())
698704
{
699705
Some(recording_name.to_string())
706+
} else if let EntityDbClass::DatasetPartition(url) = entity_db.store_class() {
707+
Some(url.partition_id.clone())
700708
} else {
701709
entity_db
702710
.recording_info_property::<Timestamp>(&RecordingInfo::descriptor_start_time())

0 commit comments

Comments
 (0)