Skip to content

feature: ao salvar o perfil volta novamente para o topo da página#454

Open
YuriSouzaDev wants to merge 5 commits into
he4rt:4.xfrom
YuriSouzaDev:fix/adicao-repetitiva
Open

feature: ao salvar o perfil volta novamente para o topo da página#454
YuriSouzaDev wants to merge 5 commits into
he4rt:4.xfrom
YuriSouzaDev:fix/adicao-repetitiva

Conversation

@YuriSouzaDev

@YuriSouzaDev YuriSouzaDev commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

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.php
    • Dispara o evento scroll-to-top após o salvamento do perfil.
  • app-modules/panel-app/resources/views/pages/profile.blade.php
    • Adiciona um listener para o evento scroll-to-top, realizando o scroll da página até o topo.

Como testar

  1. Acessar /profile.
  2. Alterar qualquer informação do perfil.
  3. Salvar o formulário.
  4. Verificar que, após o salvamento, a página rola automaticamente para o topo e a mensagem de sucesso fica visível.

Testes

Testado manualmente seguindo os passos acima.

@YuriSouzaDev
YuriSouzaDev requested a review from a team July 26, 2026 17:17
@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The profile view now listens for Livewire’s scroll-to-top event after initialization and smoothly scrolls the window to the top. The profile page class and cover-upload feature test also contain closing-terminator changes without described functional logic changes.

Suggested labels: bug, profile, difficulty:easy

Suggested reviewers: danielhe4rt

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The diff shown does not implement the #427 skill auto-add or empty-row handling, so the linked issue goals aren't satisfied. Add the ProfilePage skill-row logic: auto-create rows, validate only partially filled rows, and discard empty rows on save.
Out of Scope Changes check ⚠️ Warning The scroll-to-top listener is not part of #427 and looks like extra UX work beyond the linked skill-form fix. Remove it or tie it to a linked requirement if it is meant to be in scope.
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Title check ✅ Passed The title clearly states the main change: scrolling the profile page to the top after saving.
Description check ✅ Passed The description matches the intended UX change and references the relevant page view and save flow.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Append after skill_id completes a skill row too. skill_id is not live and does not invoke addSkillRow, so filling skill_id first on the last row never creates the next empty row unless proficiency is updated afterward. Make skill_id live 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

📥 Commits

Reviewing files that changed from the base of the PR and between 5c8d0bf and 16fc1e4.

⛔ Files ignored due to path filters (2)
  • composer.lock is excluded by !**/*.lock
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • app-modules/panel-app/resources/views/pages/profile.blade.php
  • app-modules/panel-app/src/Pages/ProfilePage.php
  • app-modules/panel-app/tests/Feature/ProfilePageTest.php

Comment thread app-modules/panel-app/src/Pages/ProfilePage.php Outdated
…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.
@YuriSouzaDev
YuriSouzaDev force-pushed the fix/adicao-repetitiva branch from 16fc1e4 to fd1f808 Compare July 26, 2026 17:24
… 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

Copy link
Copy Markdown
Member

@YuriSouzaDev #443 ?

@YuriSouzaDev

YuriSouzaDev commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

@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

@YuriSouzaDev YuriSouzaDev changed the title Fix/adicao repetitiva feature: ao salvar o perfil volta novamente para o topo da página Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants