Split the grown component modules by family #652
Labels
No labels
bug
duplicate
enhancement
help wanted
high priority
invalid
L
low priority
M
medium priority
needs refinement
optional
question
S
security
technical improvement
UX Improvement
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
local-it/mitgliederverwaltung#652
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
The UI unification collected the shared components in two modules on purpose. Since then they have grown to 1196 and 1097 lines, and each holds one component family that is large and stands apart from the rest. The filter-builder component from #641 also ended at 653 lines instead of the 600 that issue aimed for. Measured on
main777fc938.lib/mv_web/components/form.excombobox/1+combobox_*helpers (l. 553–970)lib/mv_web/components/overlay.exmodal/1,confirm_dialog/1,confirm_match?/2(l. 675–1083)lib/mv_web/components/add_filter_builder_component.exremember_row_order/1,assign_row_chips/1,put_row/4,insert_after/3,pending_chip_id/1(l. 316–396)Scope
MvWeb.Components.Combobox: movecombobox/1with its private helpers out ofform.ex. The server side already lives inlib/mv_web/combobox.ex; update its moduledoc reference.combobox/1renders the privatehelp/1component ofform.ex(5 uses). Share it deliberately (a public,@doc falsefunction component or a small shared module); do not duplicate it.MvWeb.Components.Dialog: movemodal/1,confirm_dialog/1andconfirm_match?/2out ofoverlay.ex.Overlaykeeps everything anchored to a trigger (tooltip, popover, menu). Update the aliases and doc references inlive_helpers.ex,member_deletion.exandgroup_deletion.ex.add_filter_builder_component.exinto a pure module next tofilter_chips.ex(e.g.MemberLive.Index.FilterRowOrder) with unit tests on lists; the component keeps only the socket assigns.MvWeb.html_helpers/0(lib/mv_web.ex) and add them to@component_modulesintest/mv_web/components/import_surface_test.exs. The@surfacelist stays unchanged — that test is the guard that no caller notices the move.form_combobox_test.exs,overlay_modal_test.exs,overlay_confirm_dialog_test.exs,confirm_match_property_test.exs) so each test file names the module it tests. No behavior test is deleted.Risk
Low: no visible change, and the imported surface stays the same.
Out of scope
input/1further:form.exkeeps the input family (~780 lines after the move). A component module may be large when it holds one family.Acceptance criteria
form.ex≤ ~800,overlay.ex≤ ~700,add_filter_builder_component.ex≤ 600 lines.import_surface_test.exsgreen with an unchanged@surface; no caller outsidelib/mv_web.ex, the helper aliases and the tests changes.just ci-dev,just typecheckandjust test-all(incl.:ui) green; one commit per family.Note for #541 (Credo ratchet)
Do not set a hard line limit for
lib/mv_web/components/: count per component family, or exemptattr/@doclines. Otherwiseform.excrosses the limit again with the input family alone.