feature: ao salvar o perfil volta novamente para o topo da página#454
feature: ao salvar o perfil volta novamente para o topo da página#454YuriSouzaDev wants to merge 5 commits into
Conversation
📝 WalkthroughWalkthroughThe profile view now listens for Livewire’s Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
app-modules/panel-app/src/Pages/ProfilePage.php (1)
150-170: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winAppend after
skill_idcompletes a skill row too.skill_idis not live and does not invokeaddSkillRow, so fillingskill_idfirst on the last row never creates the next empty row unlessproficiencyis updated afterward. Makeskill_idlive and call the append check from its state update.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app-modules/panel-app/src/Pages/ProfilePage.php` around lines 150 - 170, Update the skill_id Select in ProfilePage.php around lines 150-170 to be live and invoke addSkillRow with its parent repeater from a state-update callback, matching the proficiency field’s append behavior. Add or update coverage in ProfilePageTest.php around lines 381-429 to verify that filling skill_id first on the final row creates the next empty row.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app-modules/panel-app/src/Pages/ProfilePage.php`:
- Around line 72-80: Update ProfilePage.php around skillsToRepeater so it always
appends one null-valued empty skill row after any persisted skills, while
retaining the empty-row behavior when no skills exist. Update
ProfilePageTest.php lines 333-343 to expect both the persisted skill row and the
trailing empty row.
---
Outside diff comments:
In `@app-modules/panel-app/src/Pages/ProfilePage.php`:
- Around line 150-170: Update the skill_id Select in ProfilePage.php around
lines 150-170 to be live and invoke addSkillRow with its parent repeater from a
state-update callback, matching the proficiency field’s append behavior. Add or
update coverage in ProfilePageTest.php around lines 381-429 to verify that
filling skill_id first on the final row creates the next empty row.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: 41d027fe-e78c-4af3-aa61-0cc23fa92bb1
⛔ Files ignored due to path filters (2)
composer.lockis excluded by!**/*.lockpackage-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (3)
app-modules/panel-app/resources/views/pages/profile.blade.phpapp-modules/panel-app/src/Pages/ProfilePage.phpapp-modules/panel-app/tests/Feature/ProfilePageTest.php
…om linhas vazias Adiciona automaticamente uma nova linha de skill assim que a linha atual é preenchida (skill + proficiência), evitando cliques repetidos no botão de adicionar. Torna skill_id/proficiency obrigatórios apenas quando o campo irmão é preenchido e descarta linhas totalmente vazias no save, para que elas não bloqueiem o salvamento do perfil.
16fc1e4 to
fd1f808
Compare
… skills salvas O mount() só adicionava a linha vazia quando o perfil não tinha nenhuma skill, então quem já tinha skills salvas precisava clicar manualmente em "Adicionar" para a primeira nova skill. Agora a linha vazia é sempre anexada após as skills persistidas.
Amplia o parâmetro de addSkillRow() para Repeater|Builder|null, tipo real retornado por getParentRepeater(), e usa uma variável local tipada (list<array<string, mixed>>) para as skills filtradas no save(), eliminando os `?? []` redundantes que o PHPStan acusava como sempre presentes.
|
@gvieira18 Não tinha reparado que já tinha o PR, e não tinha visto na issue a referencia dele. Irei remover o que pode dar conflito com ele e alterar a PR e deixar somente uma mudança que fiz |
Descrição
Após salvar o perfil, a página agora rola automaticamente para o topo para que o usuário visualize imediatamente a notificação de sucesso.
Mudanças
app-modules/panel-app/src/Pages/ProfilePage.phpscroll-to-topapós o salvamento do perfil.app-modules/panel-app/resources/views/pages/profile.blade.phpscroll-to-top, realizando o scroll da página até o topo.Como testar
/profile.Testes
Testado manualmente seguindo os passos acima.