Repository navigation
fix(tui): fit views to the terminal and navigate Configure by row - #73
Merged
Merged
Conversation
Views were drawn at a fixed 100 columns, so narrower terminals wrapped lines and broke box borders. Widths were also measured in runes, which misaligned boxes and overflowed lines with Japanese text, and tall views pushed the header off screen. - Size every view from the window width (capped at 100), cut lines with an ellipsis instead of wrapping, measure display columns via x/ansi, stack the estimate below the form under 92 columns, and clip the body so the header and footer stay visible. - Configure: up/down/tab move a visible focus between rows and left/right change only the focused value (languages and services cycle both ways); text fields no longer let arrows or shortcuts change other settings; Wolf RPG bool options toggle as checkboxes; each service shows its own hint; proxies only appear for Google. - Fix the duplicated "› ›" marker and the hard-coded Portuguese step names in the header. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DKhrqPXPWEC98hdu6bNzpj
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.
Description
A TUI desenhava tudo com 100 colunas fixas e ignorava o tamanho do terminal. Em janelas menores o terminal quebrava as linhas e as bordas das caixas desmontavam. Este PR faz as telas se ajustarem ao terminal e reorganiza a navegação da tela Configurar.
O que quebrava
m.widthera lido noWindowSizeMsg, mas nunca usado: separadores e caixas tinham 100 colunas fixas.truncatee%-Nscontavam runes, não colunas. Texto japonês ocupa 2 colunas por letra e estourava a tela de Revisão.› ›duplicado em Abrir Jogo e nomes das etapas do cabeçalho fixos em português.Tamanho da tela (
pkg/ui/tui/layout.go)…em vez de quebradas, e a largura é medida em colunas visíveis comcharmbracelet/x/ansi.● Configurar 2/4quando não cabe, e os atalhos do rodapé quebram nos separadores·.…/マップ001.json); campos de digitação mostram o fim do texto, onde está o cursor.Navegação em Configurar
›) entre as linhas; ←→ mudam só o valor da linha em foco (‹ valor ›). Idiomas e serviços agora giram nos dois sentidos.booldo Wolf RPG viram caixa de marcar (espaço ou ←→) em vez de digitartrue/false.ui_hint_*; novatui_hint_memory). Antes "Grátis e sem chave" aparecia para todos.s,d,xe espaço continuam funcionando.Mudança de comportamento: Tab antes pulava direto para os campos de texto; agora vai para a próxima linha.
Dependência:
github.com/charmbracelet/x/ansijá estava nogo.modcomo indireta (vem do lipgloss) e passou a direta.Type of change
How Has This Been Tested?
I have tested my changes locally
gofmt -l,go vet ./...ego test ./...passam.Testes novos em
pkg/ui/tui/app_test.go:TestConfigureNavigatesByFocusedRow: ←→ mudam só a linha em foco, voltam nas pontas, e digitar num campo não acionas/d/xnem troca o serviço.TestConfigureBoolFieldTogglesInsteadOfTyping: espaço desliga o padrãotruede uma opção do Wolf.TestViewsFitTerminalWidth: nenhuma linha de nenhuma tela passa da largura (60, 80 e 120 colunas) com nome de jogo, caminho e segmento em japonês, e as bordas da caixa de Configurar ficam alinhadas.TestViewKeepsHeaderWhenTerminalIsShort: em 70x20 a tela não passa de 20 linhas e cabeçalho e rodapé continuam visíveis.Testes ajustados à nova navegação:
TestConfigureShowsExtractorOptionsAndAcceptsInput,TestConfigureChangesReestimateAndReachTheJob(agora também confere que digitar não dispara estimativa a cada tecla) eTestLanguageCyclePreservesOrder.A saída de
View()foi inspecionada em 50, 70, 100 e 110 colunas. Não foi testado numa sessão real de terminal.Checklist:
docs/PYTHON_PARITY.mdcita os atalhoss/d, que continuam valendo)Fora do escopo: o fundo da TUI (
StyleApp) some depois de um trecho colorido na mesma linha, e os rótulos/ajudas das opções do extrator (pkg/job/schema.go) só existem em português.🤖 Generated with Claude Code
https://claude.ai/code/session_01DKhrqPXPWEC98hdu6bNzpj