1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// SPDX-License-Identifier: MPL-2.0
// SPDX-FileCopyrightText: 2026 FernTech
//! `SettingsKey<bool>` constants for the per-scope toggles.
//!
//! These keys live in the **app's** `SettingsStore` (i.e. `general.toml`),
//! mirrored from the `ConsentStore`'s on every mutation. The mirror
//! exists so the toggles survive even if the consent file is deleted
//! by hand — and so power users editing `general.toml` directly can
//! flip the toggles without going through the widget.
//!
//! The widget reads from the `ConsentStore`'s `Signal<ConsentState>`,
//! not from these keys; the keys are the persistence projection, not
//! the source of truth. `ConsentStore::grant` / `set_scope` updates
//! both.
//!
//! Endpoint and region overrides also live here. They are read once,
//! at `TelemetryBundle::open` time, and never observed mid-session
//! (changing the recipient mid-session would violate the Art. 13
//! notice the user consented to, so the endpoint is read once and held).
use SettingsKey;
// ----- consent scopes (mirror of ConsentStore.scope) -----
pub const TELEMETRY_ANONYMOUS_METRICS: =
new;
pub const TELEMETRY_CRASH_REPORTS: =
new;
pub const TELEMETRY_FEATURE_FLAGS: =
new;
// ----- runtime overrides -----
/// Optional endpoint override. When `Some(url)`, the adapter uses this
/// URL instead of its compiled-in default. Read once at startup; the
/// adapter holds it by value for the rest of the session.
///
/// Empty string is treated as "no override" (so power users editing
/// the TOML can clear the field without removing the line).
pub const TELEMETRY_ENDPOINT_OVERRIDE: =
new;
/// Optional human-readable label for the data-residency region —
/// surfaced verbatim by the consent widget. When the user points at
/// a self-hosted endpoint they may want to label it ("EU self-hosted",
/// "Frankfurt", etc.).
pub const TELEMETRY_REGION_OVERRIDE: =
new;