fix(l2): let Step 3 switch between risk events (for #21) - #22
Closed
ewiwi22255 wants to merge 1 commit into
Closed
ewiwi22255 wants to merge 1 commit into
ewiwi22255 wants to merge 1 commit into
Conversation
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>
Collaborator
Author
|
誤開,先關閉;修正內容保留在分支 fix/step3-event-switch,由組員決定是否採用。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
針對 #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,步驟 3pop後就清掉None)不再被誤配active_risk_event_id保留為「目前選取」的唯讀鏡像(步驟 5 用它綁提案的來源事件)驗證
python -m pytest tests/ -q→ 505 passed(整合 PR #16 與 #17:統一風險資料驗證及 L1–L3 流程 #21 的 504 + 新增tests/test_step3_event_switch.py)🤖 Generated with Claude Code