Refine creation tab UX, generation flow, and bindings
Large changes across frontend, backend and docs to align creation-tab and generation-page behavior with new product UI/UX and Spacetime bindings. Updated hermes decision-log and pitfalls with concrete rules (banner carousel, font sizing, unread-dot tokens, template-card layout, direct card->entry routing, separation of account balance vs prize pools, removal of global page card shell, generation progress milestones and unified circular progress, and background video handling). Added GenerationProgressHero component and media assets, plus generation-related UI/tests updates (CustomWorldGenerationView, BarkBattleGeneratingView, creation hub/cards, platform entry routing, index tests). Backend and contract updates include new category fields in admin API types and admin UI form/list, spacetime-client/module/migration changes and generated bindings script. Misc: many tests adjusted, new docs and plan files added, and several server-rs crate changes to support the updated creation/ generation workflows.
This commit is contained in:
@@ -251,6 +251,9 @@ fn map_admin_creation_entry_type_config(
|
||||
visible: entry.visible,
|
||||
open: entry.open,
|
||||
sort_order: entry.sort_order,
|
||||
category_id: entry.category_id,
|
||||
category_label: entry.category_label,
|
||||
category_sort_order: entry.category_sort_order,
|
||||
updated_at_micros: entry.updated_at_micros,
|
||||
}
|
||||
}
|
||||
@@ -275,6 +278,9 @@ fn validate_admin_creation_entry_config(
|
||||
visible: payload.visible,
|
||||
open: payload.open,
|
||||
sort_order: payload.sort_order,
|
||||
category_id: payload.category_id.trim().to_string(),
|
||||
category_label: payload.category_label.trim().to_string(),
|
||||
category_sort_order: payload.category_sort_order,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -143,6 +143,15 @@ pub(crate) fn default_creation_entry_config_response() -> CreationEntryConfigRes
|
||||
title: module_runtime::DEFAULT_CREATION_ENTRY_MODAL_TITLE.to_string(),
|
||||
description: module_runtime::DEFAULT_CREATION_ENTRY_MODAL_DESCRIPTION.to_string(),
|
||||
},
|
||||
event_banner: module_runtime::CreationEntryEventBannerSnapshot {
|
||||
title: module_runtime::DEFAULT_CREATION_ENTRY_EVENT_TITLE.to_string(),
|
||||
description: module_runtime::DEFAULT_CREATION_ENTRY_EVENT_DESCRIPTION.to_string(),
|
||||
cover_image_src: module_runtime::DEFAULT_CREATION_ENTRY_EVENT_COVER_IMAGE_SRC
|
||||
.to_string(),
|
||||
prize_pool_mud_points: module_runtime::DEFAULT_CREATION_ENTRY_EVENT_PRIZE_POOL_MUD_POINTS,
|
||||
starts_at_text: module_runtime::DEFAULT_CREATION_ENTRY_EVENT_STARTS_AT_TEXT.to_string(),
|
||||
ends_at_text: module_runtime::DEFAULT_CREATION_ENTRY_EVENT_ENDS_AT_TEXT.to_string(),
|
||||
},
|
||||
creation_types: module_runtime::default_creation_entry_type_snapshots(0),
|
||||
updated_at_micros: 0,
|
||||
})
|
||||
@@ -259,5 +268,8 @@ mod tests {
|
||||
assert!(baby_object_match.open);
|
||||
assert_eq!(baby_object_match.badge, "\u{53ef}\u{521b}\u{5efa}");
|
||||
assert_eq!(baby_object_match.sort_order, 90);
|
||||
assert_eq!(baby_object_match.category_id, "character");
|
||||
assert_eq!(baby_object_match.category_label, "\u{89d2}\u{8272}\u{521b}\u{4f5c}");
|
||||
assert_eq!(baby_object_match.category_sort_order, 40);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -874,6 +874,7 @@ fn match3d_regenerated_asset_keeps_stable_identity_and_side_assets() {
|
||||
container_image_object_key: None,
|
||||
status: "image_ready".to_string(),
|
||||
error: None,
|
||||
..Default::default()
|
||||
});
|
||||
let mut generated_asset = test_match3d_generated_item_asset(99, "新草莓");
|
||||
generated_asset.image_src =
|
||||
@@ -1062,6 +1063,7 @@ fn match3d_background_asset_requires_background_and_container_images() {
|
||||
container_image_object_key: None,
|
||||
status: "image_ready".to_string(),
|
||||
error: None,
|
||||
..Default::default()
|
||||
};
|
||||
let with_container = Match3DGeneratedBackgroundAsset {
|
||||
container_prompt: Some("果园容器".to_string()),
|
||||
@@ -1108,6 +1110,7 @@ fn match3d_default_cover_prefers_generated_container_ui_image() {
|
||||
container_image_object_key: None,
|
||||
status: "image_ready".to_string(),
|
||||
error: None,
|
||||
..Default::default()
|
||||
}),
|
||||
status: "image_ready".to_string(),
|
||||
error: None,
|
||||
@@ -1169,7 +1172,7 @@ fn match3d_cover_reference_prompt_marks_reference_images() {
|
||||
|
||||
#[test]
|
||||
fn match3d_cover_edit_prompt_preserves_uploaded_image() {
|
||||
let prompt = build_match3d_cover_edit_prompt("水果封面");
|
||||
let prompt = build_match3d_cover_uploaded_reference_prompt("水果封面");
|
||||
|
||||
assert!(prompt.contains("上传的封面图作为第一优先级"));
|
||||
assert!(prompt.contains("保留主图的主体、构图、视角和主要配色"));
|
||||
@@ -1212,6 +1215,7 @@ fn match3d_fallback_work_profile_keeps_generated_background_asset() {
|
||||
),
|
||||
status: "image_ready".to_string(),
|
||||
error: None,
|
||||
..Default::default()
|
||||
}),
|
||||
status: "image_ready".to_string(),
|
||||
error: None,
|
||||
@@ -1349,6 +1353,7 @@ fn match3d_agent_session_response_hydrates_persisted_ui_assets() {
|
||||
),
|
||||
status: "image_ready".to_string(),
|
||||
error: None,
|
||||
..Default::default()
|
||||
}),
|
||||
status: "image_ready".to_string(),
|
||||
error: None,
|
||||
@@ -1424,6 +1429,7 @@ fn match3d_agent_session_response_keeps_draft_ui_assets_without_work_detail_hydr
|
||||
),
|
||||
status: "image_ready".to_string(),
|
||||
error: None,
|
||||
..Default::default()
|
||||
}),
|
||||
status: "image_ready".to_string(),
|
||||
error: None,
|
||||
@@ -1807,6 +1813,7 @@ fn match3d_work_summary_marks_complete_generated_assets_ready() {
|
||||
),
|
||||
status: "image_ready".to_string(),
|
||||
error: None,
|
||||
..Default::default()
|
||||
}),
|
||||
..test_match3d_generated_item_asset(1, "草莓")
|
||||
}];
|
||||
|
||||
@@ -516,6 +516,10 @@ impl AppState {
|
||||
visible: enabled,
|
||||
open: enabled,
|
||||
sort_order: i32::try_from(config.creation_types.len()).unwrap_or(i32::MAX),
|
||||
category_id: module_runtime::DEFAULT_CREATION_ENTRY_CATEGORY_ID.to_string(),
|
||||
category_label: module_runtime::DEFAULT_CREATION_ENTRY_CATEGORY_LABEL
|
||||
.to_string(),
|
||||
category_sort_order: 0,
|
||||
updated_at_micros: 0,
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user