Repository navigation
fix(ui): popup não cresce mais a cada abertura - #1
Merged
Merged
Conversation
The popup size was persisted by writing the measured size of the full representation back into its Layout.preferredWidth/Height. On a panel, Plasma's popup wrapper (CompactApplet.qml) adds a 1 px separator to that hint without always taking it back from the applet, so every save was 1 px larger: the popup grew 1 px every 500 ms while open, until Plasma's 95% screen limit. Height grew on horizontal panels, width on vertical ones, on Wayland and X11. Plasma 6's AppletPopup already remembers the size the user picks (popupWidth/popupHeight, saved on hide, restored on startup), so drop ChatAI's own persistence: the preferred size is now the constant default for a popup that was never resized. dialogWidth/dialogHeight stay in the schema for Migration.js. Also rebuild the committed .plasmoid, which still had the old main.qml, and add a live regression test plus notes in docs/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problema
Ao abrir o ChatAI pelo ícone do painel, o popup ficava um pouco maior a cada vez, sem o usuário redimensionar, até atingir o limite de 95% da tela. Em painel horizontal crescia a altura; em painel vertical, a largura. Acontecia no Wayland e no X11.
Causa
O
main.qmlsalvava o tamanho medido (saveSizeTimer→dialogWidth/dialogHeight) e o reaplicava emLayout.preferredWidth/preferredHeight. O wrapper de popups do Plasma (CompactApplet.qml) soma 1 px ao tamanho pedido, por causa da linha separadora junto ao painel, e nem sempre desconta esse pixel do applet. Cada gravação saía 1 px maior: +1 px a cada 500 ms com o popup aberto.O problema aparecia na sessão em que o Plasma ainda não tinha um tamanho salvo (widget recém-adicionado ou primeira sessão). Depois disso o Plasma guardava o tamanho já inflado. Detalhes e medições em
docs/POPUP_SIZE_BUGFIX.md.Correção
AppletPopupdo Plasma 6, que já faz isso: salva ao fechar, restaura ao iniciar e limita a 95% da tela.dialogWidth/dialogHeightcontinuam no schema, porque oMigration.jsos usa para reconhecer instalações antigas.ChatAI-Plasmoid.plasmoidcommitado foi refeito: ele ainda tinha omain.qmlantigo.tests/popup-size-regression.sh(teste numa sessão Plasma real) e documentação emdocs/.Testes (Plasma 6.7.4, Qt 6.11.2)
Também testado com mouse e teclado reais no X11:
O tamanho não mudou em nenhum desses casos. O
qmllintnão mostra avisos novos.Não testado: vários monitores (só havia uma tela) e escala definida nas Configurações do Sistema (exige novo login).
Observação: popups que já cresceram mantêm o tamanho salvo. Basta redimensionar uma vez.
🤖 Generated with Claude Code