Repository navigation
Enquetes: enviar pelo menu de anexo e ler as recebidas - #471
Merged
Merged
Conversation
WhatsApp Web's type for a poll is poll_creation; the normalizer waited for pollCreation, so polls showed as unsupported. Polls now read as the question followed by each option with its votes, Enter opens a list of the options, and the attachment menu's last item sends a poll through a new dialog. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PHFmZNcEwFvxPVKgfFYLgg
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PHFmZNcEwFvxPVKgfFYLgg
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PHFmZNcEwFvxPVKgfFYLgg
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PHFmZNcEwFvxPVKgfFYLgg
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PHFmZNcEwFvxPVKgfFYLgg
Reads votes and casts them through WhatsApp Web's own poll modules (measured over CDP): new /poll-votes and /vote-poll routes, a check-box list in the poll window, and counts refreshed into the message rows. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PHFmZNcEwFvxPVKgfFYLgg
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PHFmZNcEwFvxPVKgfFYLgg
Puppeteer ships only a function's own text to the page, so the module-level helpers were undefined there. The test now serializes each function the same way. The poll window also freezes its list while it refreshes and no longer lets the initial ticks mask the user's own vote. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PHFmZNcEwFvxPVKgfFYLgg
Owner
Author
|
The "Run test suite" check failed with 4 failures, all in Generated by Claude Code |
While a single-answer poll is focused, Tab reaches a list of its options and ticking one votes at once. The poll window still confirms with Vote. The new-poll dialog's Remove button stays disabled until an option exists. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PHFmZNcEwFvxPVKgfFYLgg
The list is hidden and forgotten when the conversation closes or the list mode switches, and a tick is dropped if its poll is no longer in the open conversation. A failed vote restores the ticks, an older result never speaks over a newer tick, the voted item is the focused one, and counts are not rewritten while the list has focus. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PHFmZNcEwFvxPVKgfFYLgg
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PHFmZNcEwFvxPVKgfFYLgg
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PHFmZNcEwFvxPVKgfFYLgg
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.
Requested by Gabriel · project thread
Before: uma enquete recebida aparecia como mensagem incompatível (o tipo do WhatsApp Web é
poll_creation, e o normalizador esperavapollCreation), e não havia como enviar enquetes.After: a enquete recebida é lida como a pergunta e depois cada opção com seus votos (mais votadas primeiro); Enter abre uma janela com a lista (ListCtrl). O último item do menu de anexo, "Enquete", abre o diálogo "Nova enquete" (pergunta, opções adicionadas uma a uma, até 12, e "permitir várias respostas") e envia pela rota
/send-poll-message, agora auditada como as demais rotas de envio.How: lógica pura em
client/core/polls.py; envio emclient/main_window/poll_sending.py(5xx nunca é reenviado); diálogos emclient/ui/dialogs/; strings nos 7 idiomas e changelog na versão não lançada.Fora deste PR: votar em enquetes. O wa-js 4.6.1 não tem API de voto, então precisa de medição numa sessão real do WhatsApp Web; por isso a janela ainda não tem caixas de seleção, e a contagem de votos só aparece se o dado chegar na mensagem.
🤖 Generated with Claude Code
https://claude.ai/code/session_01PHFmZNcEwFvxPVKgfFYLgg
Generated by Claude Code