Skip to content

fix(l2): let Step 3 switch between risk events (for #21) - #22

Closed
ewiwi22255 wants to merge 1 commit into
codex/integrate-pr16-pr17from
fix/step3-event-switch
Closed

ewiwi22255 wants to merge 1 commit into
codex/integrate-pr16-pr17from
fix/step3-event-switch

Conversation

@ewiwi22255

Copy link
Copy Markdown
Collaborator

針對 #21 整合分支的一個小修正(1 個 bug、3 個檔案、+1 測試),base 是 codex/integrate-pr16-pr17,方便直接合進整合分支。

問題

步驟 3「選擇要分析與執行的風險事件」在有 2 個以上正式事件時切不過去:選了事件 B,rerun 又被拉回 A。原因是卡片「查看分析」和 selectbox 本身都寫 active_risk_event_id,而聯動邏輯又用它強制覆寫 selectbox 索引。main、#16#17 都有這個問題,只是以前流程跑不出多個正式事件所以沒被看到;在 #21 的隔離環境(--integration-demo)用 planner 登錄兩則情報就能重現。

修法

  • 跳轉改成一次性的 jump_to_risk_event_id,步驟 3 pop 後就清掉
  • 佔位項(index 0,id 為 None)不再被誤配
  • 事件被刪除後索引超界 → 退回佔位項
  • active_risk_event_id 保留為「目前選取」的唯讀鏡像(步驟 5 用它綁提案的來源事件)

驗證

🤖 Generated with Claude Code

With more than one formal event, picking event B in the Step 3 selectbox
snapped back to A on rerun: the card's 查看分析 button and the selectbox
both wrote active_risk_event_id, and the linkage code then used that same
mirror to force the selectbox index every run. Present on main and in both
PR #16/#17, so it only became visible once the flow could produce several
formal events.

The jump is now a one-shot jump_to_risk_event_id that Step 3 pops; the
placeholder index 0 (event id None) is no longer matched; and a stale index
after an event is deleted falls back to the placeholder. active_risk_event_id
stays a read-only mirror of the current selection (Step 5 uses it to bind
the proposal's source event).

Verified in the isolated integration app: select #6, then #5, then back.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ewiwi22255

Copy link
Copy Markdown
Collaborator Author

誤開,先關閉;修正內容保留在分支 fix/step3-event-switch,由組員決定是否採用。

@ewiwi22255 ewiwi22255 closed this Sep 14, 2026
@ewiwi22255
ewiwi22255 deleted the fix/step3-event-switch branch September 14, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant