Archive closed browser tabs

This commit is contained in:
2026-05-07 19:53:32 -04:00
parent 82df2b4502
commit e0eb5b51b2
9 changed files with 150 additions and 5 deletions
+43
View File
@@ -0,0 +1,43 @@
use std::time::SystemTime;
use crate::BrowserTab;
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum ArchiveSource {
ManualClose,
AutoArchive,
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct ArchivedTab {
tab: BrowserTab,
archived_at: SystemTime,
source: ArchiveSource,
}
impl ArchivedTab {
#[must_use]
pub fn new(tab: BrowserTab, source: ArchiveSource) -> Self {
Self { tab, archived_at: SystemTime::now(), source }
}
#[must_use]
pub fn tab(&self) -> &BrowserTab {
&self.tab
}
#[must_use]
pub fn archived_at(&self) -> SystemTime {
self.archived_at
}
#[must_use]
pub fn source(&self) -> &ArchiveSource {
&self.source
}
#[must_use]
pub fn into_tab(self) -> BrowserTab {
self.tab
}
}
+2
View File
@@ -1,3 +1,4 @@
mod archive;
mod command;
mod error;
mod identifiers;
@@ -7,6 +8,7 @@ mod split;
mod tab;
mod url_text;
pub use archive::{ArchiveSource, ArchivedTab};
pub use command::{CommandIntent, CommandScope};
pub use error::DomainError;
pub use identifiers::{ProfileId, SpaceId, SplitId, TabId, WebViewId};