Skip to content

Commit b1d3cf2

Browse files
committed
Properly list examples
1 parent 602c356 commit b1d3cf2

File tree

7 files changed

+238
-61
lines changed

7 files changed

+238
-61
lines changed

crates/viewer/re_redap_browser/src/collections.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@ use crate::servers::Command;
1515
/// An id for a [`Collection`].
1616
/// //TODO(ab): this should be a properly defined id provided by the redap server
1717
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
18-
pub struct CollectionId(pub egui::Id);
18+
pub struct CollectionId(egui::Id);
19+
20+
impl From<&re_uri::Origin> for CollectionId {
21+
fn from(origin: &re_uri::Origin) -> Self {
22+
CollectionId(egui::Id::new(origin.clone()).with("__top_level_collection__"))
23+
}
24+
}
1925

2026
/// An individual collection of recordings within a catalog.
2127
pub struct Collection {
@@ -142,8 +148,7 @@ async fn stream_catalog_async(origin: re_uri::Origin) -> Result<Collection, Stre
142148
.await?;
143149

144150
//TODO(ab): ideally this is provided by the server
145-
let collection_id =
146-
CollectionId(egui::Id::new(origin.clone()).with("__top_level_collection__"));
151+
let collection_id = CollectionId::from(&origin);
147152
let collection = Collection {
148153
collection_id,
149154
//TODO(ab): this should be provided by the server

crates/viewer/re_redap_browser/src/servers.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,18 @@ impl RedapServers {
150150
let _ = self.command_sender.send(Command::AddServer(origin));
151151
}
152152

153+
pub fn select_server(&self, origin: re_uri::Origin) {
154+
let _ = self
155+
.command_sender
156+
.send(Command::SelectCollection(CollectionId::from(&origin)));
157+
}
158+
159+
pub fn select_dataset(&self, origin: re_uri::Origin, _dataset: String) {
160+
let _ = self
161+
.command_sender
162+
.send(Command::SelectCollection(CollectionId::from(&origin)));
163+
}
164+
153165
/// Per-frame housekeeping.
154166
///
155167
/// - Process commands from the queue.
318 Bytes
Loading

crates/viewer/re_ui/src/icons.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ pub const COMPONENT_STATIC: Icon = icon_from_path!("../data/icons/component_stat
122122

123123
pub const APPLICATION: Icon = icon_from_path!("../data/icons/application.png");
124124
pub const DATA_SOURCE: Icon = icon_from_path!("../data/icons/data_source.png");
125+
pub const DATASET: Icon = icon_from_path!("../data/icons/dataset.png");
125126
pub const RECORDING: Icon = icon_from_path!("../data/icons/recording.png");
126127
pub const BLUEPRINT: Icon = icon_from_path!("../data/icons/blueprint.png");
127128

crates/viewer/re_viewer/src/app.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,12 @@ impl App {
553553
self.state.display_mode = DisplayMode::RedapBrowser;
554554
self.command_sender.send_ui(UICommand::ExpandBlueprintPanel);
555555
}
556+
SystemCommand::SelectRedapServer { origin } => {
557+
self.state.redap_servers.select_server(origin);
558+
}
559+
SystemCommand::SelectRedapDataset { origin, dataset } => {
560+
self.state.redap_servers.select_dataset(origin, dataset);
561+
}
556562

557563
SystemCommand::LoadDataSource(data_source) => {
558564
let egui_ctx = egui_ctx.clone();

0 commit comments

Comments
 (0)