fix: reset big fish initial creation progress
This commit is contained in:
@@ -26,3 +26,7 @@
|
||||
2. 新建拼图创作工作区后,顶部创作进度显示 `0%`。
|
||||
3. 发送第一条用户消息后,进度按模型回包或后续操作正常推进。
|
||||
4. 生成草稿、生成资产、发布等后续阶段的进度值不受本次调整影响。
|
||||
|
||||
## 2026-04-27 复核记录
|
||||
|
||||
大鱼吃小鱼创建链路曾回退为 `progress_percent = 20`。本次重新将 `create_big_fish_session_tx` 的初始进度锁定为 `0`,并用 `INITIAL_BIG_FISH_CREATION_PROGRESS_PERCENT` 常量表达该约束,避免欢迎语或初始锚点占位再次被误计为创作进度。
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
use crate::big_fish::tables::{big_fish_agent_message, big_fish_creation_session};
|
||||
use crate::*;
|
||||
|
||||
const INITIAL_BIG_FISH_CREATION_PROGRESS_PERCENT: u32 = 0;
|
||||
|
||||
#[spacetimedb::procedure]
|
||||
pub fn create_big_fish_session(
|
||||
ctx: &mut ProcedureContext,
|
||||
@@ -182,7 +184,8 @@ pub(crate) fn create_big_fish_session_tx(
|
||||
owner_user_id: input.owner_user_id.clone(),
|
||||
seed_text: input.seed_text.trim().to_string(),
|
||||
current_turn: 0,
|
||||
progress_percent: 20,
|
||||
// 中文注释:欢迎语和初始锚点只建立工作台上下文,不能提前抬高创作进度。
|
||||
progress_percent: INITIAL_BIG_FISH_CREATION_PROGRESS_PERCENT,
|
||||
stage: BigFishCreationStage::CollectingAnchors,
|
||||
anchor_pack_json: serialize_anchor_pack(&anchor_pack)
|
||||
.map_err(|error| error.to_string())?,
|
||||
@@ -707,6 +710,11 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn initial_big_fish_creation_progress_starts_from_zero() {
|
||||
assert_eq!(INITIAL_BIG_FISH_CREATION_PROGRESS_PERCENT, 0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn big_fish_direct_work_content_ignores_empty_created_session() {
|
||||
let empty_session =
|
||||
|
||||
Reference in New Issue
Block a user