fix(launcher): wire FSM dispatch + correct conflict-count
The conflict-modal path bypassed the FSM extension landed in L.7: panels/detail.lua set ctx.modal_open directly and init.lua drove modal handling off the side-channel field, so STATE_MODAL_CONFLICT was unreachable at runtime (only the test-lib asserts exercised it). Now detail.lua marks ctx._pending_modal_open and init.lua dispatches the open_conflict event so state actually transitions through the fsm. Modal entry/exit is gated on state == STATE_MODAL_CONFLICT. Also fixes the conflict body line: r.missing doesn't exist on the dep-fetcher result; use #(errors) + #(conflicts) for the count displayed in the modal body.
This commit is contained in:
@@ -155,7 +155,7 @@ function M.handle_click(ctx, mx, my)
|
||||
body = {
|
||||
ctx.t("conflict_body_line1"),
|
||||
string.format(ctx.t("conflict_body_line2_fmt"),
|
||||
r and #r.missing or 0),
|
||||
r and (#(r.errors or {}) + #(r.conflicts or {})) or 0),
|
||||
},
|
||||
buttons = {
|
||||
{ id = "cancel", label = ctx.t("cancel") },
|
||||
@@ -164,7 +164,9 @@ function M.handle_click(ctx, mx, my)
|
||||
},
|
||||
module_id = entry.id,
|
||||
}
|
||||
ctx.modal_open = "conflict"
|
||||
-- C1: signal init.lua to dispatch open_conflict on the FSM
|
||||
-- so state actually transitions into STATE_MODAL_CONFLICT.
|
||||
ctx._pending_modal_open = "conflict"
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user