refactor(ui): remove dead update_delete_template_button_state - #464
Merged
Merged
Conversation
VideoSelectorTreeManager.update_delete_template_button_state had no callers anywhere in src/ or tests/. It guarded a delete_template_btn widget through three hasattr() checks, so it would have been a no-op even if something had called it. It also carried a hardcoded "Nenhum" sentinel compared against roi_template_var — a Portuguese literal outside the i18n catalogue that would have silently stopped matching once the UI ran in English. Dead code that fails quietly on a language switch is worse than absent code: the grep hit makes the path look covered. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the dead UI helper VideoSelectorTreeManager.update_delete_template_button_state, simplifying the VideoSelectorTreeManager class by deleting unreachable, no-op code.
Changes:
- Removed
update_delete_template_button_state()fromsrc/zebtrack/ui/components/project_views/video_selector_tree_manager.py. - Eliminated the previously hardcoded
"Nenhum"string comparison path (now fully gone with the method).
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This was referenced Aug 15, 2026
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.
O que
Remove
VideoSelectorTreeManager.update_delete_template_button_state(14 linhas).Por que
src/nem emtests/— verificado por grep em todo o pacote.hasattr()em sequência (delete_template_btn,roi_template_var,delete_template_btnde novo) fazem o método retornar sem efeito em qualquer estado real da GUI.roi_template_varcontra um"Nenhum"hardcoded. Com a interface migrada para inglês como língua-fonte, essa comparação pararia de casar em silêncio. Código morto que quebra numa troca de idioma é pior que código ausente: o hit no grep faz o caminho parecer coberto.Verificação
ruff check— limpomypy .— limpo (gate de pre-push)pytest -q— 4202 passed, 5 skippedpytest -m gui -n0 -q— 1079 passed, 1 skippedSem mudança de comportamento: é remoção de caminho inalcançável.
🤖 Generated with Claude Code