Update spacetime-client bindings and frontend

Large update across server and web clients: regenerated/added many spacetime-client module bindings and input types (including new delete/work_delete input types and numerous procedure/reducer files), updates to server-rs API modules (bark_battle, jump_hop, wooden_fish, auth, module-runtime and shared contracts), and fixes in module-runtime behavior and domain logic. Frontend changes include new/updated components and tests (creative audio helpers, bark-battle/jump-hop/wooden-fish clients and views, unified generation pages, RPG entry views, and runtime shells), plus CSS and service updates. Documentation and operational notes updated (.hermes pitfalls and multiple PRD/docs) to cover daily-task refresh, banner asset fallback, recommend-key bug, and other platform behaviors. Tests and verification steps added/updated alongside these changes.
This commit is contained in:
2026-06-04 22:44:19 +08:00
parent 2678954627
commit 27b30f974b
326 changed files with 4374 additions and 2539 deletions

View File

@@ -80,7 +80,7 @@ pub fn default_creation_entry_event_banner_snapshots() -> Vec<CreationEntryEvent
ends_at_text: String::new(),
render_mode: "html".to_string(),
html_code: Some(
r#"<section style="box-sizing:border-box;width:100%;min-height:180px;padding:28px 30px;border-radius:24px;background:#fff7ed;color:#6f2f21;font-family:system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;"><h1 style="margin:0 0 10px;font-size:28px;">创作公告</h1><p style="margin:0;font-size:16px;line-height:1.7;">这里可以在后台替换成你的公告 HTML。</p></section>"#
r#"<section style="box-sizing:border-box;width:100%;min-height:180px;padding:28px 30px;border-radius:24px;background:linear-gradient(90deg,rgba(255,247,237,0.96) 0%,rgba(255,247,237,0.82) 48%,rgba(255,247,237,0.18) 100%),url('/creation-type-references/puzzle.webp') center/cover no-repeat;color:#6f2f21;font-family:system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;"><h1 style="margin:0 0 10px;font-size:28px;">创作公告</h1><p style="margin:0;font-size:16px;line-height:1.7;">这里可以在后台替换成你的公告 HTML。</p></section>"#
.to_string(),
),
}]
@@ -233,11 +233,16 @@ pub fn resolve_creation_entry_event_banner_responses(
event_banners_json: Option<&str>,
fallback_banner: &CreationEntryEventBannerSnapshot,
) -> Vec<CreationEntryEventBannerResponse> {
event_banners_json
let banners = event_banners_json
.and_then(|raw| decode_creation_entry_event_banner_snapshots(raw).ok())
.filter(|banners| !banners.is_empty())
.unwrap_or_else(|| vec![fallback_banner.clone()])
.into_iter()
.unwrap_or_else(default_creation_entry_event_banner_snapshots);
if banners.is_empty() {
vec![fallback_banner.clone()]
} else {
banners
}
.into_iter()
.map(build_creation_entry_event_banner_response)
.collect()
}

View File

@@ -57,7 +57,7 @@ pub const DEFAULT_CREATION_ENTRY_CATEGORY_LABEL: &str = "热门推荐";
pub const DEFAULT_CREATION_ENTRY_EVENT_TITLE: &str = "主题创作赛";
pub const DEFAULT_CREATION_ENTRY_EVENT_DESCRIPTION: &str = "用温暖的色彩,捏出秋天的故事。";
pub const DEFAULT_CREATION_ENTRY_EVENT_COVER_IMAGE_SRC: &str =
"/branding/taonier-logo-spiral-reference-concepts/taonier-spiral-bouncy-clay.png";
"/creation-type-references/puzzle.webp";
pub const DEFAULT_CREATION_ENTRY_EVENT_PRIZE_POOL_MUD_POINTS: u64 = 58_000;
pub const DEFAULT_CREATION_ENTRY_EVENT_STARTS_AT_TEXT: &str = "2024.10.20 10:00";
pub const DEFAULT_CREATION_ENTRY_EVENT_ENDS_AT_TEXT: &str = "2024.11.20 23:59";

View File

@@ -319,6 +319,35 @@ mod tests {
assert_eq!(banners, default_creation_entry_event_banner_snapshots());
}
#[test]
fn creation_entry_event_banners_none_returns_default_announcements() {
let legacy_banner = CreationEntryEventBannerSnapshot {
title: "旧结构化横幅".to_string(),
description: "旧库单条字段".to_string(),
cover_image_src:
"/branding/taonier-logo-spiral-reference-concepts/taonier-spiral-bouncy-clay.png"
.to_string(),
prize_pool_mud_points: 58_000,
starts_at_text: "2024.10.20 10:00".to_string(),
ends_at_text: "2024.11.20 23:59".to_string(),
render_mode: "structured".to_string(),
html_code: None,
};
let banners = resolve_creation_entry_event_banner_responses(None, &legacy_banner);
assert_eq!(banners.len(), 1);
assert_eq!(banners[0].render_mode, "html");
assert_eq!(banners[0].title, "创作公告");
assert!(banners[0].html_code.as_deref().unwrap_or("").contains("创作公告"));
assert!(banners[0]
.html_code
.as_deref()
.unwrap_or("")
.contains("/creation-type-references/puzzle.webp"));
assert_ne!(banners[0].cover_image_src, legacy_banner.cover_image_src);
}
#[test]
fn creation_entry_event_banners_json_accepts_announcement_html_code() {
let normalized = normalize_creation_entry_event_banners_json(