feat(activity): enum TimelineReaction - #557
Merged
Merged
Conversation
hefeus
reviewed
Sep 9, 2026
gvieira18
approved these changes
Sep 10, 2026
hefeus
approved these changes
Sep 10, 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.
Contexto
Fatia S2 do subsistema de reações da timeline web (#539). A S1 (#541) criou a tabela
activity_user_reactions; esta entrega o conjunto fixo das 6 reações só em código — o banco guarda apenas ovalue.valueLikelikeSkyLoveloveRoseLaughlaughAmberCelebratecelebrateVioletFirefireOrangeSadsadSlateNada consome o enum ainda: ele destrava a S3 (#542), S4 (#543) e S5 (#544).
Alterações
TimelineReaction: stringemsrc/Reaction/Enums/, comuse StringifyEnume os contratosHasColor, HasDescription, HasLabel(guideline07-enum-filament-contracts). Todo getter ématchexaustivo semdefault.emoji()fica fora dos contratos —HasIcondevolveHeroicon, e o símbolo da reação é o glifo.TODO(#540)da migration — o->comment()da colunareactionpassa a vir deTimelineReaction::stringifyCases(), como os outros ~18 comments de enum do repo.tests/Unit/Reaction/TimelineReactionTest.php— contratos, valores, rótulos e glifos exatos,tryFrom()nulo fora do conjunto, e distinção entre os 6 casos.Conjunto não-ordenado, então
getColor()não segue o ramp claro→dangerda guideline: cada cor puxa a do próprio glifo, edanger/warningficaram de fora por significarem erro e alerta.Plano de Testes
make check— rector, pint e phpstan (level 7) verdes,errors: 0make test-unit— 555 passando, 2286 asserções; o arquivo novo cobre 12 testes e 93 asserçõesmake setup-test-dbaplicou a migration alterada, e o comment no Postgres confere:Available enum cases: like, love, laugh, celebrate, fire, sadSadquebra 2 testes; duplicar a cor quebra 1. Revertidas.Evidências
Sem impacto visual — o enum ainda não é renderizado. A UI de reação entra na #545 e #546.
Issues Relacionadas
Closes #540
Related to #539