nightly-1943b145-ls250
Pre-release
Pre-release
·
23 commits
to nightly
since this release
CI Report:
https://ci-tests.linuxserver.io/linuxserver/beets/nightly-1943b145-ls250/index.html
LinuxServer Changes:
No changes
Remote Changes:
Refactor of layout utils (#6442)
This PR refactors import-match layout rendering by centralizing layout
selection and line generation in beets.util.layout, simplifying the
ShowChange display path, and tightening the layout
data model.
What Changed
- Added
get_layout_lines()andget_layout_method()in
beets.util.layoutso layout selection (columnvsnewline) is
handled in one place. - Replaced
Sidefrom a mutableTypedDictwith an immutable
NamedTuplethat exposes derived helpers (rendered, prefix/suffix
widths, and rendered width). - Simplified
split_into_lines()from a 3-width tuple API to
(first_width, width)and removed legacy last-line empty-string
handling. - Refactored
beets.ui.commands.import_/display.pyShowChangeto call
get_layout_lines()directly and removed duplicate per-class
layout-selection logic. - Updated tracklist width calculation to use
Sidehelpers and explicit
width assignment via_replace(width=...). - Reworked
ShowChangetests into snapshot-style assertions for both
newlineandcolumnlayouts, and updated util layout tests to the new
split_into_lines()signature.
Why
- Reduces duplicated wrapping/layout logic across UI code paths.
- Makes layout behavior easier to reason about and test at the utility
boundary. - Narrows the display layer to orchestration while keeping
transformation/rendering logic in reusable utilities. - Improves maintainability by moving from loosely typed dict mutation to
a typed, self-describing data structure.