chore: cargo fmt across workspace; add analytics domain to CSP
Build and Deploy / build-and-push (push) Successful in 4m46s

- Apply cargo fmt to solitaire_engine, solitaire_server formatting.
- solitaire_server/src/lib.rs: add https://analytics.aleshym.co to
  script-src, img-src, and connect-src so the analytics beacon loads
  without a CSP violation.
- docs and README updates.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
funman300
2026-06-02 12:21:32 -07:00
parent baf524ec75
commit 1cdb78caf2
25 changed files with 229 additions and 130 deletions
@@ -97,7 +97,11 @@ pub(crate) fn format_move_body(m: &ReplayMove) -> String {
match m {
ReplayMove::StockClick => "stock cycle".to_string(),
ReplayMove::Move { from, to, .. } => {
format!("{} \u{2192} {}", format_saved_pile(from), format_saved_pile(to))
format!(
"{} \u{2192} {}",
format_saved_pile(from),
format_saved_pile(to)
)
}
}
}
+2 -4
View File
@@ -25,15 +25,14 @@
mod format;
mod input;
mod update;
#[cfg(test)]
mod tests;
mod update;
pub(crate) use self::format::*;
pub(crate) use self::input::*;
pub(crate) use self::update::*;
use bevy::prelude::*;
use crate::events::{DrawRequestEvent, MoveRequestEvent, StateChangedEvent, UndoRequestEvent};
use crate::font_plugin::FontResource;
use crate::platform::SHOW_KEYBOARD_ACCELERATORS;
@@ -44,6 +43,7 @@ use crate::ui_theme::{
STATE_SUCCESS, STATE_SUCCESS_HC, TEXT_PRIMARY, TEXT_PRIMARY_HC, TEXT_SECONDARY, TYPE_BODY,
TYPE_CAPTION, TYPE_HEADLINE, VAL_SPACE_1, VAL_SPACE_2, VAL_SPACE_4, Z_DROP_OVERLAY,
};
use bevy::prelude::*;
// ---------------------------------------------------------------------------
// Z-index — see `ui_theme::Z_MODAL_SCRIM` (200) for the next layer above.
@@ -316,7 +316,6 @@ pub struct ReplayOverlayScrubNotch;
#[derive(Component, Debug)]
pub struct ReplayOverlayScrubNotchLabel;
/// Marker on the keybind-hint footer row at the bottom edge of the
/// banner. Carries two `Text` children: a vim-style mode indicator
/// (`▌ NORMAL │ replay`) on the left and the keybind hint
@@ -1270,4 +1269,3 @@ fn win_move_marker_pct(state: &ReplayPlaybackState) -> Option<f32> {
let frac = (idx as f32 / total as f32).clamp(0.0, 1.0);
Some(frac * 100.0)
}
+17 -6
View File
@@ -854,8 +854,7 @@ fn scrub_notch_labels_carry_helper_strings() {
let mut texts = scrub_notch_label_texts(&mut app);
texts.sort();
let mut expected: Vec<String> =
scrub_notch_labels().iter().map(|s| s.to_string()).collect();
let mut expected: Vec<String> = scrub_notch_labels().iter().map(|s| s.to_string()).collect();
expected.sort();
assert_eq!(
texts, expected,
@@ -1106,10 +1105,22 @@ fn move_log_active_row_text(app: &mut App) -> String {
#[test]
fn format_pile_uses_one_indexed_lowercase_names() {
assert_eq!(format_pile(&KlondikePile::Stock), "waste");
assert_eq!(format_pile(&KlondikePile::Foundation(Foundation::Foundation1)), "foundation 1");
assert_eq!(format_pile(&KlondikePile::Foundation(Foundation::Foundation3)), "foundation 3");
assert_eq!(format_pile(&KlondikePile::Tableau(Tableau::Tableau1)), "tableau 1");
assert_eq!(format_pile(&KlondikePile::Tableau(Tableau::Tableau7)), "tableau 7");
assert_eq!(
format_pile(&KlondikePile::Foundation(Foundation::Foundation1)),
"foundation 1"
);
assert_eq!(
format_pile(&KlondikePile::Foundation(Foundation::Foundation3)),
"foundation 3"
);
assert_eq!(
format_pile(&KlondikePile::Tableau(Tableau::Tableau1)),
"tableau 1"
);
assert_eq!(
format_pile(&KlondikePile::Tableau(Tableau::Tableau7)),
"tableau 7"
);
}
/// Move-body formatter renders `StockClick` as a label and
@@ -1,10 +1,10 @@
use bevy::prelude::*;
use super::*;
use super::format::{
format_active_move_row, format_foundations_row, format_kth_next_row,
format_kth_recent_row, format_move_log_header, format_progress, format_stock_waste_row,
format_active_move_row, format_foundations_row, format_kth_next_row, format_kth_recent_row,
format_move_log_header, format_progress, format_stock_waste_row,
};
use super::*;
use crate::layout::LayoutResource;
use crate::replay_playback::ReplayPlaybackState;
use crate::resources::GameStateResource;