refactor(view): decompose dialogs/bom + annotate under the 800-line cap (ADR-0001 #164)#224
Merged
Merged
Conversation
… the 800-line cap (ADR-0001 #164) annotate.rs (816 lines) exceeded the 800-line hard cap. Convert it to a folder and move the trailing free helper fns into a controls module — pure code motion, the rendered UI is pixel-identical. dialogs/annotate.rs (816) -> dialogs/annotate/mod.rs (675) dialogs/annotate/controls.rs (159) - controls.rs holds check_pip / order_preview / order_radio / bordered_style, moved verbatim (byte-for-byte) and narrowed to pub(super). - mod.rs keeps the view_annotate_dialog / view_annotate_reset_confirm method families unchanged; entry points keep pub(in crate::app::view). Behaviour preservation: the four moved fns diff byte-identical against the originals; the impl block is an unbroken slice of the original file.
…0-line cap (ADR-0001 #164) bom.rs (889 lines) exceeded the 800-line hard cap. Decompose the ~848-line view_bom_preview_body_inner into section-builder methods and split the file into a folder by concern — pure code motion, the rendered modal is pixel-identical. dialogs/bom.rs (889) -> dialogs/bom/mod.rs (230) shell + orchestrator dialogs/bom/table.rs (349) data grid dialogs/bom/sidebar.rs (364) Properties sidebar + controls - mod.rs builds header / toolbar / footer / separator inline, then calls self.bom_table() and self.bom_sidebar(); the final column![header, title_separator, toolbar_strip, main_row, footer] and main_row are unchanged. - bom_table / bom_sidebar are pub(super) helper methods on impl Signex. - Entry points view_bom_preview / view_bom_preview_body keep pub(in crate::app::view). Behaviour preservation: every child-pushing block was moved verbatim. Reassembled in call order they diff byte-identical against the original: table.rs == bom.rs 267-589 sidebar.rs == bom.rs 81-214 ++ 216-265 ++ 666-818 mod.rs == bom.rs 43-79 ++ 591-664 ++ 820-841 ++ 843-867 ++ 869-877 ++ 879-887 (plus the two injected self.bom_table()/self.bom_sidebar() calls) Column/row child order is unchanged, so z-order and layout are preserved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #223. The two dialog files that exceeded the 800-line cap after the folder move are now decomposed under it. Behaviour-preserving — dialogs render pixel-identically.
dialogs/annotate.rs (816) → annotate/ folder
annotate/mod.rsSignex)annotate/controls.rscheck_pip,order_preview,order_radio,bordered_style) — pure code motion, byte-identicaldialogs/bom.rs (889) → bom/ folder
bom/mod.rsview_bom_preview_body_innerorchestratorbom/sidebar.rsbom/table.rsThe ~848-line
view_bom_preview_body_innerwas decomposed by extracting the sidebar and table sub-Elementtrees intobom_sidebar()/bom_table()helper methods, called from the original positions. Child-push order is preserved — the finalcolumn![header, title_separator, toolbar_strip, main_row, footer]andmain_row = row![container(body), divider, container(sidebar)]are unchanged, so z-order/layout is identical; only construction order (side-effect-free) differs.No consumer edits
dialogs/mod.rsuntouched (mod bom;/mod annotate;resolve to the new folders). Entry methods keeppub(in crate::app::view); new helperspub(super).controls.rsnamed to avoid confusion with the pre-existing distinctannotate_preview.rs.Verify
cargo build -p signex-app0 errors, 52 warnings = baseline (0 new);cargo test -p signex-app334 pass;cargo clippy -p signex-app231 = baseline (delta 0);git grep -niE 'kicad' -- crates/**= 0; diff touches onlyapp/view/dialogs/.Message::/PanelMsg::reference in bom is identical old→new.Crates affected