Two small defects in the inactive-line muting code, both found while reviewing PR #1888.
An unreachable branch in _muted_line_theme
src/nf_metro/render/svg.py builds the muted override theme two ways: a FrozenRecord rebuild (around :3988) because a FrozenRecord cannot be dataclasses.replace-d, and a dataclasses.replace() call (around :3999) for a plain Theme.
RenderPlan.theme is typed FrozenRecord, and _emit_render_plan does theme = plan.theme, so every render takes the FrozenRecord branch. The replace() branch is unreachable from any render path (it exists to satisfy the Theme parameter annotation) and has no test coverage. Verified by instrumenting the function during a real render_string: one call, frozen=True.
Either drop the branch and narrow the annotation to what callers actually pass, or keep it and cover it. Leaving an untested unreachable branch in the muting path is how the original terminus_font_color defect stayed hidden.
A test that could pass with the feature broken
tests/test_inactive_lines.py, in the terminus-label test added by PR #1888, asserts the active case against the imported constant:
assert _icon_label_fill(svg, "b_out", "BAM") == TERMINUS_FONT_COLOR
If someone set TERMINUS_FONT_COLOR = "#888888", both the active and the muted assertion would pass while the feature rendered meaningless. A literal "#000000", or an added assertion that the active and muted fills differ, closes it.
Neither is release-blocking. See also #1894 (muted labels defeated by the chrome CSS) and #1895 (elements that do not mute at all).
Two small defects in the inactive-line muting code, both found while reviewing PR #1888.
An unreachable branch in
_muted_line_themesrc/nf_metro/render/svg.pybuilds the muted override theme two ways: aFrozenRecordrebuild (around:3988) because aFrozenRecordcannot bedataclasses.replace-d, and adataclasses.replace()call (around:3999) for a plainTheme.RenderPlan.themeis typedFrozenRecord, and_emit_render_plandoestheme = plan.theme, so every render takes the FrozenRecord branch. Thereplace()branch is unreachable from any render path (it exists to satisfy theThemeparameter annotation) and has no test coverage. Verified by instrumenting the function during a realrender_string: one call,frozen=True.Either drop the branch and narrow the annotation to what callers actually pass, or keep it and cover it. Leaving an untested unreachable branch in the muting path is how the original
terminus_font_colordefect stayed hidden.A test that could pass with the feature broken
tests/test_inactive_lines.py, in the terminus-label test added by PR #1888, asserts the active case against the imported constant:If someone set
TERMINUS_FONT_COLOR = "#888888", both the active and the muted assertion would pass while the feature rendered meaningless. A literal"#000000", or an added assertion that the active and muted fills differ, closes it.Neither is release-blocking. See also #1894 (muted labels defeated by the chrome CSS) and #1895 (elements that do not mute at all).