git clone https://garage44.eu/jeroen/cartopolis.gitcartopolis-agent · 2026-11-26T20:18:36Z
build(ui): the component library with press states and refined type Pins mithril to c76404c7: every tappable component shows a press, hover only with a mouse, lighter type and warm press tints.
Cargo.lock | 16 ++++++++--------
crates/cartopolis/Cargo.toml | 4 ++--
crates/mithril_bevy/Cargo.toml | 2 +-
crates/mithril_bevy/src/fade.rs | 19 +++++++++++++++----
4 files changed, 26 insertions(+), 15 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
index 8c830e59..e21149c2 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -6639,7 +6639,7 @@ dependencies = [
[[package]]
name = "mithril"
version = "0.1.0"
-source = "git+https://code.garage44.eu/jeroen/mithril.git?rev=40568aae#40568aae4874193b0d6e5895daad66647a66cb70"
+source = "git+https://code.garage44.eu/jeroen/mithril.git?rev=c76404c7#c76404c73fd66afc3cd80cf87d2317b5890ca471"
dependencies = [
"mithril_components",
"mithril_dom",
@@ -6664,7 +6664,7 @@ dependencies = [
[[package]]
name = "mithril_components"
version = "0.1.0"
-source = "git+https://code.garage44.eu/jeroen/mithril.git?rev=40568aae#40568aae4874193b0d6e5895daad66647a66cb70"
+source = "git+https://code.garage44.eu/jeroen/mithril.git?rev=c76404c7#c76404c73fd66afc3cd80cf87d2317b5890ca471"
dependencies = [
"mithril_validation",
"mithril_view",
@@ -6673,7 +6673,7 @@ dependencies = [
[[package]]
name = "mithril_dom"
version = "0.1.0"
-source = "git+https://code.garage44.eu/jeroen/mithril.git?rev=40568aae#40568aae4874193b0d6e5895daad66647a66cb70"
+source = "git+https://code.garage44.eu/jeroen/mithril.git?rev=c76404c7#c76404c73fd66afc3cd80cf87d2317b5890ca471"
dependencies = [
"js-sys",
"mithril_view",
@@ -6684,7 +6684,7 @@ dependencies = [
[[package]]
name = "mithril_macro"
version = "0.1.0"
-source = "git+https://code.garage44.eu/jeroen/mithril.git?rev=40568aae#40568aae4874193b0d6e5895daad66647a66cb70"
+source = "git+https://code.garage44.eu/jeroen/mithril.git?rev=c76404c7#c76404c73fd66afc3cd80cf87d2317b5890ca471"
dependencies = [
"proc-macro2",
"quote",
@@ -6695,17 +6695,17 @@ dependencies = [
[[package]]
name = "mithril_signals"
version = "0.1.0"
-source = "git+https://code.garage44.eu/jeroen/mithril.git?rev=40568aae#40568aae4874193b0d6e5895daad66647a66cb70"
+source = "git+https://code.garage44.eu/jeroen/mithril.git?rev=c76404c7#c76404c73fd66afc3cd80cf87d2317b5890ca471"
[[package]]
name = "mithril_style"
version = "0.1.0"
-source = "git+https://code.garage44.eu/jeroen/mithril.git?rev=40568aae#40568aae4874193b0d6e5895daad66647a66cb70"
+source = "git+https://code.garage44.eu/jeroen/mithril.git?rev=c76404c7#c76404c73fd66afc3cd80cf87d2317b5890ca471"
[[package]]
name = "mithril_validation"
version = "0.1.0"
-source = "git+https://code.garage44.eu/jeroen/mithril.git?rev=40568aae#40568aae4874193b0d6e5895daad66647a66cb70"
+source = "git+https://code.garage44.eu/jeroen/mithril.git?rev=c76404c7#c76404c73fd66afc3cd80cf87d2317b5890ca471"
dependencies = [
"mithril_signals",
"unicode-segmentation",
@@ -6714,7 +6714,7 @@ dependencies = [
[[package]]
name = "mithril_view"
version = "0.1.0"
-source = "git+https://code.garage44.eu/jeroen/mithril.git?rev=40568aae#40568aae4874193b0d6e5895daad66647a66cb70"
+source = "git+https://code.garage44.eu/jeroen/mithril.git?rev=c76404c7#c76404c73fd66afc3cd80cf87d2317b5890ca471"
dependencies = [
"mithril_signals",
]
diff --git a/crates/cartopolis/Cargo.toml b/crates/cartopolis/Cargo.toml
index d405b14c..c7d2d6a7 100644
--- a/crates/cartopolis/Cargo.toml
+++ b/crates/cartopolis/Cargo.toml
@@ -208,7 +208,7 @@ postcard = { workspace = true }
bytes.workspace = true
# The component library and its Bevy backend, for the `ui-probe` feature
# (docs/mockups/component-library, phase 3); not in a shipped build yet.
-mithril = { git = "https://code.garage44.eu/jeroen/mithril.git", rev = "40568aae", optional = true }
+mithril = { git = "https://code.garage44.eu/jeroen/mithril.git", rev = "c76404c7", optional = true }
mithril_bevy = { path = "../mithril_bevy", optional = true }
# The splash's street plan and mark, rasterised once into an image for the
# library's Bevy backend (`lib_splash`). Already in the lock through another
@@ -217,7 +217,7 @@ tiny-skia = { version = "0.11", default-features = false, features = ["std", "si
# The library's design tokens, typed: cartopolis' own `Tokens` (`theme::tokens`)
# are what the web's `theme.css` is written from and what the Bevy backend
# draws with. Bevy-free and dependency-free, so every lane carries it.
-mithril_style = { git = "https://code.garage44.eu/jeroen/mithril.git", rev = "40568aae" }
+mithril_style = { git = "https://code.garage44.eu/jeroen/mithril.git", rev = "c76404c7" }
# wgpu itself, for the adapter's `DeviceType`/`Backend` and the vendored
# `wgpu::meter` (`upload_meter`, `shot_harness`), which bevy does not
# re-export. The one bevy links (the `crates/wgpu` patch); `std` and `wgsl`
diff --git a/crates/mithril_bevy/Cargo.toml b/crates/mithril_bevy/Cargo.toml
index a0ded3b7..1647e515 100644
--- a/crates/mithril_bevy/Cargo.toml
+++ b/crates/mithril_bevy/Cargo.toml
@@ -14,7 +14,7 @@ publish = false
doctest = false
[dependencies]
-mithril = { git = "https://code.garage44.eu/jeroen/mithril.git", rev = "40568aae" }
+mithril = { git = "https://code.garage44.eu/jeroen/mithril.git", rev = "c76404c7" }
# The client's image decoders, so a lone `cargo check -p mithril_bevy` resolves
# bevy_image the way the client does (zstd needs a backend named).
bevy_image.workspace = true
diff --git a/crates/mithril_bevy/src/fade.rs b/crates/mithril_bevy/src/fade.rs
index 3b5d9841..8574f4c8 100644
--- a/crates/mithril_bevy/src/fade.rs
+++ b/crates/mithril_bevy/src/fade.rs
@@ -85,7 +85,9 @@ fn duration(tree: &UiTree, entity: Entity) -> f32 {
value.map_or(0.0, |v| {
// Only a transition that names a colour (or `all`) fades one.
if c.other.get("transition-duration").is_none()
- && !["background", "border", "all"].iter().any(|p| v.contains(p))
+ && !["background", "border", "all"]
+ .iter()
+ .any(|p| v.contains(p))
{
return 0.0;
}
@@ -174,10 +176,16 @@ mod tests {
#[test]
fn a_transition_says_its_time_in_ms_or_s() {
- assert_eq!(first_time("background 140ms cubic-bezier(0.2, 0, 0, 1)"), 0.14);
+ assert_eq!(
+ first_time("background 140ms cubic-bezier(0.2, 0, 0, 1)"),
+ 0.14
+ );
assert_eq!(first_time("0ms"), 0.0);
assert_eq!(first_time("color 0.3s ease, background 1s"), 0.3);
- assert_eq!(first_time("background var(--m-duration) var(--m-ease)"), 0.14);
+ assert_eq!(
+ first_time("background var(--m-duration) var(--m-ease)"),
+ 0.14
+ );
assert_eq!(first_time("none"), 0.0);
}
@@ -198,6 +206,9 @@ mod tests {
assert_eq!(f.shown(10.0).bg, c(0.0).bg);
assert_eq!(f.shown(11.0).bg, c(1.0).bg);
let mid = f.shown(10.1).bg.to_srgba().red;
- assert!(mid > 0.5 && mid < 1.0, "fast out: past half way at half time, {mid}");
+ assert!(
+ mid > 0.5 && mid < 1.0,
+ "fast out: past half way at half time, {mid}"
+ );
}
}