Skip to content

Commit 4fd5eec

Browse files
authored
Fix table UI not saying switch to when opening a certain links (#11237)
1 parent ce2bfd7 commit 4fd5eec

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

crates/utils/re_smart_channel/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,14 @@ impl SmartChannelSource {
130130
}
131131
}
132132

133+
/// Same as [`Self::redap_uri`], but strips any extra query or fragment from the uri.
134+
pub fn stripped_redap_uri(&self) -> Option<RedapUri> {
135+
self.redap_uri().map(|uri| match uri {
136+
RedapUri::Catalog(_) | RedapUri::Entry(_) | RedapUri::Proxy(_) => uri,
137+
RedapUri::DatasetData(uri) => RedapUri::DatasetData(uri.without_query_and_fragment()),
138+
})
139+
}
140+
133141
/// Loading text for sources that load data from a specific source (e.g. a file or a URL).
134142
///
135143
/// Returns `None` for any source that receives data dynamically through SDK calls or similar.

crates/viewer/re_component_ui/src/variant_uis/redap_uri_button.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub fn redap_uri_button(
3838
if db
3939
.data_source
4040
.as_ref()
41-
.is_some_and(|source| source.redap_uri().as_ref() == Some(&uri))
41+
.is_some_and(|source| source.stripped_redap_uri().as_ref() == Some(&uri))
4242
{
4343
Some(db.store_id().clone())
4444
} else {
@@ -50,7 +50,7 @@ pub fn redap_uri_button(
5050
.connected_receivers
5151
.sources()
5252
.iter()
53-
.any(|source| source.redap_uri().as_ref() == Some(&uri));
53+
.any(|source| source.stripped_redap_uri().as_ref() == Some(&uri));
5454

5555
// Show the link left aligned and justified, so the whole cell is clickable.
5656
let put_justified_left_aligned = |ui: &mut Ui, link| {

0 commit comments

Comments
 (0)