Track tab sort keys

This commit is contained in:
2026-05-08 05:47:50 -04:00
parent bce489c119
commit 668557773b
5 changed files with 130 additions and 9 deletions
+17
View File
@@ -30,6 +30,7 @@ pub struct BrowserTab {
state: TabState,
flags: TabFlags,
split_id: Option<SplitId>,
sort_key: u64,
sync_enabled: bool,
created_at: SystemTime,
last_active_at: SystemTime,
@@ -55,6 +56,7 @@ impl BrowserTab {
state: TabState::Ready,
flags: TabFlags::default(),
split_id: None,
sort_key: 0,
sync_enabled: true,
created_at,
last_active_at: created_at,
@@ -67,6 +69,12 @@ impl BrowserTab {
self
}
#[must_use]
pub fn with_sort_key(mut self, sort_key: u64) -> Self {
self.sort_key = sort_key;
self
}
#[must_use]
pub fn id(&self) -> &TabId {
&self.id
@@ -164,6 +172,15 @@ impl BrowserTab {
self.split_id = None;
}
#[must_use]
pub fn sort_key(&self) -> u64 {
self.sort_key
}
pub fn set_sort_key(&mut self, sort_key: u64) {
self.sort_key = sort_key;
}
pub fn set_sync_enabled(&mut self, sync_enabled: bool) {
self.sync_enabled = sync_enabled;
}