Skip to content

Refactor leveragers inheritance chains#1064

Draft
wadimw wants to merge 2 commits into
leveraging-priorityfrom
leveragers-cleanup
Draft

Refactor leveragers inheritance chains#1064
wadimw wants to merge 2 commits into
leveraging-priorityfrom
leveragers-cleanup

Conversation

@wadimw

@wadimw wadimw commented Jul 10, 2026

Copy link
Copy Markdown

Gets rid of the AbstractLeverager subclasses chaning in favour of self-contained SourceLeverager and others, to match CopyTmLeverager implementation from #1063.

This PR shouldn't affect leveraging behaviour - it's only for refactor/cleanup (to avoid assymetry between CopyTmLeverager and others).

TODO run AI code review

wadimw added 2 commits July 10, 2026 20:50
Removed code relevant only for target leveraging (overwrite mode checks). Folded the inherited class chain into a single SourceLeverager to better encapsulate its logic.
Deleted AbstractLeverager and its test. Extracted shared operations (addLeveragedTranslations, filterTextUnitDTOWithSameTMTextUnitId, TextUnitSearcher access) into a LeveragingUtils component. LeveragerByTmTextUnit and LeveragerByContentAndRepository no longer inherit from the same base class. SourceLeverager delegates to LeveragingUtils instead of duplicating the translation-writing logic.
@wadimw wadimw added the upstream-patched Experimental features ported from legacy branch label Jul 10, 2026
@wadimw
wadimw requested a review from ehoogerbeets July 10, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

upstream-patched Experimental features ported from legacy branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant