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

@@ -201,6 +201,25 @@ pub fn list_jump_hop_works(
}
}
#[spacetimedb::procedure]
pub fn delete_jump_hop_work(
ctx: &mut ProcedureContext,
input: JumpHopWorkDeleteInput,
) -> JumpHopWorksProcedureResult {
match ctx.try_with_tx(|tx| delete_jump_hop_work_tx(tx, input.clone())) {
Ok(items) => JumpHopWorksProcedureResult {
ok: true,
items,
error_message: None,
},
Err(message) => JumpHopWorksProcedureResult {
ok: false,
items: Vec::new(),
error_message: Some(message),
},
}
}
#[spacetimedb::procedure]
pub fn start_jump_hop_run(
ctx: &mut ProcedureContext,
@@ -537,6 +556,56 @@ fn list_jump_hop_works_tx(
.collect()
}
fn delete_jump_hop_work_tx(
ctx: &ReducerContext,
input: JumpHopWorkDeleteInput,
) -> Result<Vec<JumpHopWorkSnapshot>, String> {
let work = find_owned_work(ctx, &input.profile_id, &input.owner_user_id)?;
ctx.db
.jump_hop_work_profile()
.profile_id()
.delete(&work.profile_id);
if !work.source_session_id.trim().is_empty() {
if let Some(session) = ctx
.db
.jump_hop_agent_session()
.session_id()
.find(&work.source_session_id)
.filter(|session| session.owner_user_id == input.owner_user_id)
{
ctx.db
.jump_hop_agent_session()
.session_id()
.delete(&session.session_id);
}
}
for run in ctx
.db
.jump_hop_runtime_run()
.by_jump_hop_run_profile_id()
.filter(input.profile_id.as_str())
.collect::<Vec<_>>()
{
ctx.db.jump_hop_runtime_run().run_id().delete(&run.run_id);
}
for event in ctx
.db
.jump_hop_event()
.by_jump_hop_event_profile_id()
.filter(input.profile_id.as_str())
.collect::<Vec<_>>()
{
ctx.db.jump_hop_event().event_id().delete(&event.event_id);
}
list_jump_hop_works_tx(
ctx,
JumpHopWorksListInput {
owner_user_id: input.owner_user_id,
published_only: false,
},
)
}
fn start_jump_hop_run_tx(
ctx: &ReducerContext,
input: JumpHopRunStartInput,
@@ -1185,3 +1254,19 @@ fn clone_run(row: &JumpHopRuntimeRunRow) -> JumpHopRuntimeRunRow {
updated_at: row.updated_at,
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn jump_hop_delete_input_carries_owner_and_profile() {
let input = JumpHopWorkDeleteInput {
profile_id: "jump-hop-profile-1".to_string(),
owner_user_id: "user-1".to_string(),
};
assert_eq!(input.profile_id, "jump-hop-profile-1");
assert_eq!(input.owner_user_id, "user-1");
}
}