PhoenixKitStaff.Web.SkillFormLive (PhoenixKitStaff v0.5.0)

Copy Markdown View Source

Create or edit a skill, including its per-skill proficiency levels.

The levels editor is staged in @staged_levels (the source of truth) and rendered inside #skill-form but outside <.multilang_fields_wrapper>, so it survives language switches (the wrapper re-mounts its subtree on switch). Each level-name input's DOM id is keyed on @current_lang so morphdom replaces the node on a switch and the value refreshes to the active language; validate merges only the active language's typed names back into the staged list. Structural edits (add / seed / reorder / remove) are event-driven so a reconnect can't strand them. On save the staged list is injected as attrs["levels"] and normalised by Skill.changeset/2.