Skip to content

refactor(ui): remove dead update_delete_template_button_state - #464

Merged
MarkSant merged 1 commit into
mainfrom
refactor/remove-dead-delete-template-button-state
Aug 15, 2026
Merged

refactor(ui): remove dead update_delete_template_button_state#464
MarkSant merged 1 commit into
mainfrom
refactor/remove-dead-delete-template-button-state

Conversation

@MarkSant

Copy link
Copy Markdown
Owner

O que

Remove VideoSelectorTreeManager.update_delete_template_button_state (14 linhas).

Por que

  • Sem chamadores. Nenhuma referência em src/ nem em tests/ — verificado por grep em todo o pacote.
  • No-op mesmo se chamado. Três hasattr() em sequência (delete_template_btn, roi_template_var, delete_template_btn de novo) fazem o método retornar sem efeito em qualquer estado real da GUI.
  • Literal fora do catálogo. Comparava roi_template_var contra 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 — limpo
  • mypy . — limpo (gate de pre-push)
  • pytest -q — 4202 passed, 5 skipped
  • pytest -m gui -n0 -q — 1079 passed, 1 skipped

Sem mudança de comportamento: é remoção de caminho inalcançável.

🤖 Generated with Claude Code

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>
Copilot AI lite review requested due to automatic review settings August 15, 2026 14:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() from src/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.

@MarkSant
MarkSant merged commit f4751d7 into main Aug 15, 2026
7 checks passed
@MarkSant
MarkSant deleted the refactor/remove-dead-delete-template-button-state branch August 15, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants