Track tab opener relationships

This commit is contained in:
2026-05-08 05:07:19 -04:00
parent 1d90b5bc37
commit 06c37f89b0
3 changed files with 48 additions and 0 deletions
+13
View File
@@ -26,6 +26,7 @@ pub struct BrowserTab {
profile_id: ProfileId,
title: String,
url: UrlText,
parent_tab_id: Option<TabId>,
state: TabState,
flags: TabFlags,
split_id: Option<SplitId>,
@@ -49,6 +50,7 @@ impl BrowserTab {
profile_id,
title: title.into(),
url,
parent_tab_id: None,
state: TabState::Ready,
flags: TabFlags::default(),
split_id: None,
@@ -57,6 +59,12 @@ impl BrowserTab {
}
}
#[must_use]
pub fn with_parent_tab_id(mut self, parent_tab_id: TabId) -> Self {
self.parent_tab_id = Some(parent_tab_id);
self
}
#[must_use]
pub fn id(&self) -> &TabId {
&self.id
@@ -82,6 +90,11 @@ impl BrowserTab {
&self.url
}
#[must_use]
pub fn parent_tab_id(&self) -> Option<&TabId> {
self.parent_tab_id.as_ref()
}
#[must_use]
pub fn display_url(&self) -> String {
self.url.display_url()