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:
Calic
2026-06-11 03:10:56 +02:00
parent 89b7b060d1
commit a49aa3ef2b
2 changed files with 18 additions and 8 deletions

View File

@@ -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