Add public work read model and smooth puzzle transitions

This commit is contained in:
kdletters
2026-05-26 16:38:27 +08:00
parent 545f315cbc
commit aeee782fe0
47 changed files with 2679 additions and 79 deletions

View File

@@ -1510,7 +1510,7 @@ pub async fn list_puzzle_gallery(
let rebuild_started_at = std::time::Instant::now();
let items = state
.spacetime_client()
.list_puzzle_gallery()
.list_public_work_gallery_entries()
.await
.map_err(|error| {
puzzle_error_response(
@@ -1523,7 +1523,8 @@ pub async fn list_puzzle_gallery(
let response = build_puzzle_gallery_window_response(
items
.into_iter()
.map(|item| map_puzzle_gallery_card_response(&state, item))
.filter(|item| item.source_type == "puzzle")
.map(|item| map_public_work_puzzle_gallery_card_response(&state, item))
.collect(),
);
let cached_response = state
@@ -1881,6 +1882,7 @@ pub async fn advance_puzzle_next_level(
Err(error) if error.status() == StatusCode::UNSUPPORTED_MEDIA_TYPE => {
AdvancePuzzleNextLevelRequest {
target_profile_id: None,
prefer_similar_work: false,
}
}
Err(error) => {
@@ -1901,6 +1903,7 @@ pub async fn advance_puzzle_next_level(
run_id,
owner_user_id: principal.subject().to_string(),
target_profile_id: payload.target_profile_id,
prefer_similar_work: payload.prefer_similar_work,
advanced_at_micros: current_utc_micros(),
})
.await