refactor(slint): extract strip_html + dates into qbz-text-utils crate

Both are pure leaves (no bin-module refs, no Slint coupling). Moved verbatim
into qbz-text-utils. Caught by adversarial review: dates.rs needs chrono's
`unstable-locales` feature (Locale + format_localized) and an inline
`qbz_i18n::current_language()` ref (no `use` line — the qbz_models::Track
trap). Bin re-exports via `pub use qbz_text_utils::{dates, strip_html};` so the
14 call sites are unchanged. `cargo check -p qbz` green.

cc
This commit is contained in:
vicrodh committed 2026-06-25 18:13:55 -06:00
1 parent 7678bceb3e
commit 6f9ad4668e
8 files changed
+26 -2

No files matched your search

+9
View File
@@ -5545,6 +5545,7 @@ dependencies = [
"qbz-playlist-import",
"qbz-plex",
"qbz-qobuz",
"qbz-text-utils",
"qbz-theme",
"qbz-ui",
"qconnect-app",
@@ -5952,6 +5953,14 @@ dependencies = [
"uuid 1.22.0",
]
[[package]]
name = "qbz-text-utils"
version = "0.1.0"
dependencies = [
"chrono",
"qbz-i18n",
]
[[package]]
name = "qbz-theme"
version = "0.1.0"
+1
View File
@@ -24,6 +24,7 @@ members = [
"qconnect-app",
"qbz-ui",
"qbz-dac-wizard",
"qbz-text-utils",
"qbz",
"qbz-credentials",
"qbz-media-controls",
+11
View File
@@ -0,0 +1,11 @@
[package]
name = "qbz-text-utils"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
description = "Shared text/date utilities (HTML stripping, localized release dates) for the qbz frontend."
[dependencies]
chrono = { workspace = true, features = ["unstable-locales"] }
qbz-i18n = { path = "../qbz-i18n" }
File renamed without changes.
+3
View File
@@ -0,0 +1,3 @@
//! Frontend-agnostic text/date utilities extracted from the qbz binary.
pub mod dates;
pub mod strip_html;
File renamed without changes.
+1
View File
@@ -47,6 +47,7 @@ i-slint-backend-winit = "=1.16.1"
qbz-music-link = { path = "../qbz-music-link" }
qbz-ui = { path = "../qbz-ui" }
qbz-dac-wizard = { path = "../qbz-dac-wizard" }
qbz-text-utils = { path = "../qbz-text-utils" }
log = { workspace = true }
env_logger = "0.11"
tokio = { workspace = true }
+1 -2
View File
@@ -30,7 +30,7 @@ mod blacklist_manager;
mod booklet;
mod commands;
mod custom_artwork;
mod dates;
pub use qbz_text_utils::{dates, strip_html};
mod discover_browse;
mod discord_rpc;
mod discover_prefs;
@@ -63,7 +63,6 @@ mod myqbz_prefs;
mod myqbz_view_prefs;
mod nav;
mod play_history;
mod strip_html;
mod playback;
mod qconnect_engine;
mod cast_service;