fix(panel-app): DatePicker não-nativo para data de nascimento - #457
Conversation
Replace the native date input with a non-native Filament DatePicker in a personal section so adjacent-month days are no longer ambiguous. Fixes he4rt#397 Co-authored-by: Cursor <cursoragent@cursor.com>
Make the current day easier to spot in dark mode with primary text and a ring. Co-authored-by: Cursor <cursoragent@cursor.com>
Add a calendar icon to the birthdate field and open the picker when the icon is clicked. Co-authored-by: Cursor <cursoragent@cursor.com>
Leave the nickname input in the media header so this change stays compatible with the nickname validation flow in he4rt#401. Only birthdate moves to the DatePicker. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the nickname markup aligned with 4.x and cover birthdate in a dedicated test so merges with he4rt#401 stay cleaner. Co-authored-by: Cursor <cursoragent@cursor.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThe profile page now uses a separate Filament Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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: 3
🤖 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 103-110: Update the ProfilePage save flow to use the dehydrated
$formData['birthdate'] value when constructing the DTO, rather than
$this->data['birthdate']. Preserve the DatePicker format('Y-m-d') output and
leave the component configuration unchanged.
- Around line 108-109: Update the DatePicker minDate and maxDate calls in the
profile date field to use date-only bounds via today()->subYears(120) and
today(), replacing the current now()-based values. Leave the surrounding picker
configuration unchanged.
- Around line 110-117: Update the suffix-icon interaction in the ProfilePage
date picker so keyboard users can activate the calendar affordance. Make the
suffix action focusable and provide an accessible name, or handle relevant
keyboard events to invoke the existing date-picker trigger, while preserving the
current click behavior and action-wrapper guard.
🪄 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: 53f1a5b4-b570-4a90-9872-a78e18a10606
📒 Files selected for processing (4)
app-modules/panel-app/resources/views/components/profile-media-header.blade.phpapp-modules/panel-app/src/Pages/ProfilePage.phpapp-modules/panel-app/tests/Feature/ProfilePageTest.phpresources/css/filament/app/theme.css
Render the Filament birthdate picker in the media header next to nickname via a dedicated schema, preserving the original layout. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Bruna, o CI tá vermelho aqui e acho que passou batido. O shard 1/2 quebra em Rodei local pra entender e o motivo é que os dois schemas dividem o mesmo state path: $this->form->fill([... 'headline' => ..., 'seniority_level' => ..., ...]); // $data = tudo
$this->birthdateForm->fill(['birthdate' => ...]); // $data = só birthdateO Testei aqui dando um state path próprio pro birthdateForm e passa tudo, 17/17 incluindo o teu teste novo: // propriedade nova na página
public ?array $birthdateData = [];
// birthdateForm()
->statePath('birthdateData');
// save()
$birthdateData = $this->birthdateForm->getState();
// ...
'birthdate' => $birthdateData['birthdate'] ?? null,Outra coisa, bem menor: o |
Filament fill() replaces the whole state path, so sharing data wiped headline and other fields on mount.
There was a problem hiding this comment.
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)
106-112: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winAdd a clickable suffix action for the date picker.
The current
DatePickerfield only sets display/format/bounds and does not definesuffixIcon()orsuffixAction(). Add an accessible suffix action that callstogglePanelVisibility()so users can open the picker by clicking the calendar icon.🤖 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 106 - 112, Update the DatePicker::make('birthdate') configuration to include a clickable, accessible suffix action using the calendar icon that invokes togglePanelVisibility(). Preserve the existing label, formatting, native mode, and date bounds.Source: MCP tools
🤖 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.
Outside diff comments:
In `@app-modules/panel-app/src/Pages/ProfilePage.php`:
- Around line 106-112: Update the DatePicker::make('birthdate') configuration to
include a clickable, accessible suffix action using the calendar icon that
invokes togglePanelVisibility(). Preserve the existing label, formatting, native
mode, and date bounds.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: 89188d75-5423-4be3-b914-61822c0762a1
📒 Files selected for processing (1)
app-modules/panel-app/src/Pages/ProfilePage.php
Summary
<input type="date">nativo do perfil por umDatePickerdo Filament (native(false)), na seção Pessoal, junto com o nickname.Fixes #397
Test plan
/app/profilee confirmar que "Data de Nascimento" usa o DatePicker do Filament (não o nativo do browser)Mergir o PR #401 antes e resolver conflitos!!!!