Consolidate `show_change` and `show_item_change` into a Single Display API
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 2.1k
- Avg merge
- 4d 21h
- Merged PRs (30d)
- 31
Description
## Summary
Consolidate the importer change preview entrypoints `show_change` and `show_item_change` into one unified method that renders both album and singleton match previews.
## Why
Current display flow duplicates orchestration across two public functions that perform the same high-level job: render a preview of proposed metadata changes before user confirmation. A single entrypoint will reduce duplication and keep preview behavior consistent across albums and singletons.
## Problem
- Two parallel entrypoints increase maintenance cost.
- Shared logic is split between album and singleton wrappers.
- Behavioral adjustments to preview formatting require touching both paths.
- Importer/session code must branch only to select display function.
## Scope
- Introduce one public display function for match preview rendering.
- Route album and singleton previews through that function.
- Keep type-specific rendering details encapsulated in existing representation classes (or equivalent split internals).
- Update importer/session call sites to use the unified API.
- Preserve existing output formatting unless explicitly changed.
## Non-Goals
- Redesign preview layout, colors, or prompt UX.
- Remove internal album/singleton representation classes if they still provide value.
## Acceptance Criteria
- [ ] One public preview entrypoint replaces `show_change` and `show_item_change` at call sites.
- [ ] Album and singleton flows produce equivalent preview output to current behavior.
- [ ] No importer prompt behavior regression in interactive mode.
- [ ] Tests cover both album and singleton preview paths through the unified function.
## Validation
- Targeted importer UI tests pass for album and singleton confirmation flows.
- Existing autotagger/importer suite passes without preview regressions.
Contributor guide
Research direction
Start by locating the importer/session call sites for show_change and show_item_change, then trace their album and singleton preview flows. Compare the existing output and targeted importer UI tests before routing both paths through one public entrypoint. Done means both preview paths retain equivalent formatting and confirmation behavior, with coverage for each and the importer suite passing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100