git.lucas.co / cce-browser
web browser (Servo)
git clone https://git.lucas.co/cce-browser.git

commitd19a50674b09fc08bfb0de5bf7a7c510e87bd5c7
parent53b8323552
authorLucas Galante <lsgalante12@gmail.com>
date2026-10-02 14:47
refactor(pages): the state dir from cce_ui::config::cce_state_dir

`<state_home>/cce/browser` as before; the base is cce-ui's state_home()
(cce-ui f31c86b) instead of a hand-rolled $XDG_STATE_HOME lookup. The one
difference: a relative $XDG_STATE_HOME now counts as unset, as the XDG
spec says. History, bookmarks, tabs and the profile do not move.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

 src/pages.rs | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/pages.rs b/src/pages.rs
index ee5f2c2..280c8d1 100644
--- a/src/pages.rs
+++ b/src/pages.rs
@@ -39,11 +39,7 @@ struct Entry {
 /// `~/.local/state/cce/browser` — history and bookmarks live here directly,
 /// Servo's own persisted state in a `profile` subdirectory under it.
 pub(crate) fn state_dir() -> PathBuf {
-    let base = match std::env::var("XDG_STATE_HOME") {
-        Ok(x) if !x.is_empty() => PathBuf::from(x),
-        _ => PathBuf::from(std::env::var("HOME").unwrap_or_default()).join(".local/state"),
-    };
-    base.join("cce").join("browser")
+    cce_ui::config::cce_state_dir().join("browser")
 }
 
 fn now() -> u64 {