Skip to content

Group open recordings by origin, dataset/appid and examples #9377

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 7 commits into from
Mar 26, 2025
Merged
Show file tree
Hide file tree
Changes from 4 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
11 changes: 8 additions & 3 deletions crates/viewer/re_redap_browser/src/collections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@ use crate::servers::Command;
/// An id for a [`Collection`].
/// //TODO(ab): this should be a properly defined id provided by the redap server
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub struct CollectionId(pub egui::Id);
pub struct CollectionId(egui::Id);

impl From<&re_uri::Origin> for CollectionId {
fn from(origin: &re_uri::Origin) -> Self {
Self(egui::Id::new(origin.clone()).with("__top_level_collection__"))
}
}

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

//TODO(ab): ideally this is provided by the server
let collection_id =
CollectionId(egui::Id::new(origin.clone()).with("__top_level_collection__"));
let collection_id = CollectionId::from(&origin);
let collection = Collection {
collection_id,
//TODO(ab): this should be provided by the server
Expand Down
14 changes: 14 additions & 0 deletions crates/viewer/re_redap_browser/src/servers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,20 @@ impl RedapServers {
let _ = self.command_sender.send(Command::AddServer(origin));
}

#[allow(clippy::needless_pass_by_value)]
pub fn select_server(&self, origin: re_uri::Origin) {
let _ = self
.command_sender
.send(Command::SelectCollection(CollectionId::from(&origin)));
}

#[allow(clippy::needless_pass_by_value)]
pub fn select_dataset(&self, origin: re_uri::Origin, _dataset: String) {
let _ = self
.command_sender
.send(Command::SelectCollection(CollectionId::from(&origin)));
}

/// Per-frame housekeeping.
///
/// - Process commands from the queue.
Expand Down
Binary file added crates/viewer/re_ui/data/icons/dataset.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions crates/viewer/re_ui/src/icons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ pub const COMPONENT_STATIC: Icon = icon_from_path!("../data/icons/component_stat

pub const APPLICATION: Icon = icon_from_path!("../data/icons/application.png");
pub const DATA_SOURCE: Icon = icon_from_path!("../data/icons/data_source.png");
pub const DATASET: Icon = icon_from_path!("../data/icons/dataset.png");
pub const RECORDING: Icon = icon_from_path!("../data/icons/recording.png");
pub const BLUEPRINT: Icon = icon_from_path!("../data/icons/blueprint.png");

Expand Down
6 changes: 6 additions & 0 deletions crates/viewer/re_viewer/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,12 @@ impl App {
self.state.display_mode = DisplayMode::RedapBrowser;
self.command_sender.send_ui(UICommand::ExpandBlueprintPanel);
}
SystemCommand::SelectRedapServer { origin } => {
self.state.redap_servers.select_server(origin);
}
SystemCommand::SelectRedapDataset { origin, dataset } => {
self.state.redap_servers.select_dataset(origin, dataset);
}

SystemCommand::LoadDataSource(data_source) => {
let egui_ctx = egui_ctx.clone();
Expand Down
Loading