fix(align): 6단계 완료 후 "측정 시작" 버튼 활성화 — FINAL_CONFIRM 인식

기존 finalStop 조건이 `phase == LR_BALANCE` 만 인정했는데, 실제로는
LR_BALANCE 에서 imbal 통과 즉시 `phase = FINAL_CONFIRM` 으로 바뀌어
반환되므로 이 조건에 걸리지 않았음. FINAL_CONFIRM 5프레임 도달 후
STOP + align_complete 반환 시점에도 phase 는 FINAL_CONFIRM 이라
finalStop=false → isLocked 유지 안 됨 → 버튼 disabled.

수정: state=="commit" && phase==FINAL_CONFIRM && action==STOP 을
진짜 정렬 완료로 인정. Accum 중은 이미 앞 branch 로 빠지므로 안전.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-07-07 09:24:33 +09:00
parent e808b5bc57
commit 49aab7b175
@@ -939,10 +939,13 @@ fun PlacementGuideView(appState: AppState) {
placementScore = 5
} else {
directionHint = localizedMsg
// STOP 액션은 두 경우 — CH3_STABILIZE 의 "위치 유지" (still in progress) vs
// LR_BALANCE 의 "정렬 완료" (truly done). 후자만 finalStop 으로 GREEN lock.
// STOP 액션은 여러 경우 — CH3_STABILIZE 위치 유지 / LR_BALANCE 유예 STOP /
// FINAL_CONFIRM 완료. 2026-07-07 fix: 진짜 완료는 FINAL_CONFIRM commit STOP.
// 이전 로직은 LR_BALANCE STOP 만 인정 → FINAL_CONFIRM 진입 즉시 phase 가
// 바뀌면서 GREEN lock 이 풀려 "측정 시작" 버튼이 활성화 안 되는 버그가 있었다.
val finalStop = st.action == com.medithings.vesiscan.managers.AlignAction.STOP &&
v2Aligner.phase == com.medithings.vesiscan.managers.AlignGuide4Stage.Phase4.LR_BALANCE
st.state == "commit" &&
v2Aligner.phase == com.medithings.vesiscan.managers.AlignGuide4Stage.Phase4.FINAL_CONFIRM
directionIcon = when (st.action) {
com.medithings.vesiscan.managers.AlignAction.MOVE_UP -> "arrow.up"
com.medithings.vesiscan.managers.AlignAction.MOVE_DOWN -> "arrow.down"