re_redap_browser 0.36.1

The UI and communication to implement the in-viewer redap server browser.
Documentation
//! This crates implements the Redap browser feature, including the communication and UI aspects of
//! it.

mod context;
mod entries;
mod folder_card_ui;
mod server_modal;
mod servers;

use std::sync::LazyLock;

use re_uri::Scheme;
pub use re_viewer_context::open_url::EXAMPLES_ORIGIN;

pub use self::entries::{Entries, Entry, EntryInner};
pub use self::servers::{Command, RedapServers, Server};

/// Origin used to show the local ui in the redap browser.
///
/// Not actually a valid origin.
pub static LOCAL_ORIGIN: LazyLock<re_uri::Origin> = LazyLock::new(|| re_uri::Origin {
    scheme: Scheme::RerunHttps,
    host: url::Host::Domain(String::from("_local_recordings.rerun.io")),
    port: 443,
});

/// Utility function to switch to the examples screen.
pub fn switch_to_welcome_screen(command_sender: &re_viewer_context::CommandSender) {
    use re_viewer_context::{SystemCommand, SystemCommandSender as _};

    command_sender.send_system(SystemCommand::SetRoute(
        re_viewer_context::Route::welcome_page(),
    ));
    command_sender.send_system(SystemCommand::set_selection(
        re_viewer_context::Item::welcome_page(),
    ));
}