Add diagnostics privacy controls

This commit is contained in:
2026-05-09 04:47:45 -04:00
parent e30fce9213
commit 4e85f31dac
7 changed files with 230 additions and 20 deletions
+42
View File
@@ -37,3 +37,45 @@ impl HistoryRecordingPolicy {
}
}
}
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub enum DiagnosticsReportingPolicy {
#[default]
Minimal,
Paused,
}
impl DiagnosticsReportingPolicy {
pub const ALL: &[Self] = &[Self::Minimal, Self::Paused];
#[must_use]
pub fn reports_diagnostics(self) -> bool {
matches!(self, Self::Minimal)
}
#[must_use]
pub fn name(self) -> &'static str {
match self {
Self::Minimal => "Minimal Diagnostics",
Self::Paused => "Paused Diagnostics",
}
}
#[must_use]
pub fn detail(self) -> &'static str {
match self {
Self::Minimal => {
"Send startup, crash, WebView crash, sync error, plugin crash, and update result codes."
}
Self::Paused => "Keep diagnostics local for review and privacy exports.",
}
}
#[must_use]
pub fn status(self) -> &'static str {
match self {
Self::Minimal => "Diagnostics reporting is on",
Self::Paused => "Diagnostics reporting is paused",
}
}
}