Skip to content

Commit e8c5ee2

Browse files
authored
Fix open issues: dehydration, reactivity, CSS, and tests (#143)
## Summary This PR builds on #142 and tackles the highest-impact open GitHub issues with PHP fixes, JS reactivity improvements, CSS cleanup, dependency narrowing, and expanded tests. ### Issues addressed - **#128 / #119** — Multiple/range pickers now dehydrate array state correctly and validate per-date instead of choking on comma-separated strings - **#131** — Cleared picker values sync `null` back to Livewire via `onChange`/`onClose` handlers - **#133** — `$set()` / entangled state updates now re-sync the Flatpickr instance via Alpine `$watch` - **#103** — Added configurable `rangeSeparator()` (defaults to ` to `) for locale-specific range parsing - **#100** — Time picker defaults to `H:i` format and dehydrates to time strings - **#141** — `locale()` accepts arrays (e.g. `firstDayOfWeek`) passed through to Flatpickr JS - **#122** — Date validation moved from dehydration into component `setUp()` so rules run before dehydration - **#130 / #125** — Removed Filament `@source` scanning from `flatpickr.css`; bundle shrank ~627KB → ~16KB and no longer hides the sidebar logo or bleeds table styles - **#126** — Production dependency narrowed to `filament/forms` + `filament/support` (`filament/filament` kept in dev for tests/builds) ### Still open / follow-up - **#96** — Dynamic `minDate`/`maxDate` from PHP closures still need a Livewire-friendly attrs refresh strategy (`wire:ignore` on the picker root limits re-rendering) - **#129** — Modal lazy-load edge cases may need further Livewire lifecycle hooks - **#104** — Manual time entry fix included via `onClose`; needs browser QA - **#53** — Year picker remains a feature request - **#124** — Filament v3 compatibility (project targets v4/v5) ## Test plan - [x] `vendor/bin/pint --test` - [x] `vendor/bin/phpstan analyse` - [x] `vendor/bin/pest --ci` (17 tests) - [x] `npm run build` - [ ] CI matrix passes - [ ] Manual QA: range/multiple edit forms, `$set()` reactivity, clear-then-save, Spanish range separator, time picker manual entry
2 parents 5c27c1b + a71ecef commit e8c5ee2

17 files changed

Lines changed: 445 additions & 103 deletions

File tree

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Path-based git attributes
22
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
33

4+
* text=auto eol=lf
5+
6+
*.php text eol=lf
7+
*.blade.php text eol=lf
8+
49
# Ignore all test and documentation with "export-ignore".
510
/.github export-ignore
611
/.gitattributes export-ignore

.github/workflows/fix-php-code-style-issues.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: "Fix PHP Code Styling"
22

33
on:
4-
push:
4+
pull_request:
55
paths:
66
- '**.php'
77

.github/workflows/phpstan.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: PHPStan
22

33
on:
44
push:
5+
branches: [main]
6+
paths:
7+
- '**.php'
8+
- 'phpstan.neon.dist'
9+
pull_request:
510
paths:
611
- '**.php'
712
- 'phpstan.neon.dist'

.github/workflows/run-tests.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ jobs:
3434
- name: Checkout code
3535
uses: actions/checkout@v5
3636

37+
- name: Configure Git line endings
38+
if: runner.os == 'Windows'
39+
shell: bash
40+
run: git config --global core.autocrlf false
41+
3742
- name: Setup PHP
3843
uses: shivammathur/setup-php@v2
3944
with:
@@ -54,5 +59,8 @@ jobs:
5459
- name: List Installed Dependencies
5560
run: composer show -D
5661

62+
- name: Check code style
63+
run: vendor/bin/pint --test
64+
5765
- name: Execute tests
5866
run: vendor/bin/pest --ci --coverage --min=0

.github/workflows/update-changelog.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66

77
permissions:
88
contents: write
9+
pull-requests: write
910

1011
jobs:
1112
update:
@@ -23,9 +24,12 @@ jobs:
2324
latest-version: ${{ github.event.release.name }}
2425
release-notes: ${{ github.event.release.body }}
2526

26-
- name: Commit updated CHANGELOG
27-
uses: stefanzweifel/git-auto-commit-action@v7
27+
- name: Create Pull Request
28+
uses: peter-evans/create-pull-request@v7
2829
with:
29-
branch: main
30-
commit_message: Update CHANGELOG
31-
file_pattern: CHANGELOG.md
30+
commit-message: Update CHANGELOG
31+
title: Update CHANGELOG for ${{ github.event.release.name }}
32+
body: |
33+
Automated changelog update for release ${{ github.event.release.name }}.
34+
branch: changelog/${{ github.event.release.tag_name }}
35+
delete-branch: true

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@
2121
],
2222
"require": {
2323
"php": "^8.2",
24-
"filament/filament": "^4.0|^5.0",
24+
"filament/forms": "^4.0|^5.0",
25+
"filament/support": "^4.0|^5.0",
2526
"spatie/laravel-package-tools": "^1.15.0"
2627
},
2728
"require-dev": {
2829
"barryvdh/laravel-ide-helper": "^3.5",
30+
"filament/filament": "^4.0|^5.0",
2931
"laravel/pint": "^1.0",
3032
"nunomaduro/larastan": "^3.1.0",
3133
"orchestra/testbench": "^9.12",

config/flatpickr.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
use Coolsam\Flatpickr\Enums\FlatpickrTheme;
4+
35
return [
4-
'theme' => \Coolsam\Flatpickr\Enums\FlatpickrTheme::DEFAULT, // Recommended: Use DEFAULT theme for better compatibility with Filament Styling and dark mode
6+
'theme' => FlatpickrTheme::DEFAULT, // Recommended: Use DEFAULT theme for better compatibility with Filament Styling and dark mode
57
];

resources/css/filament-theme.css

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
@import '../../vendor/filament/filament/resources/css/theme.css';
22

3-
@source '../../src/**/*';
43
@source '../../resources/views/**/*';
5-
@source '../../vendor/filament/**/*';
64

75
:root {
86
--flatpickr-padding-y: 0.5rem;

resources/css/index.css

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
@import "flatpickr/dist/flatpickr.min.css";
22
@import "flatpickr/dist/plugins/monthSelect/style.css";
3-
@import '../../vendor/filament/filament/resources/css/theme.css';
4-
5-
@source '../../src/**/*';
6-
@source '../../resources/views/**/*';
7-
@source '../../vendor/filament/**/*';
83

94
.flatpickr-calendar {
105
opacity: 1 !important;
11-
@apply bg-white dark:bg-gray-800 opacity-100;
6+
background-color: #fff;
7+
}
8+
9+
.dark .flatpickr-calendar {
10+
background-color: rgb(31 41 55);
1211
}
12+
1313
.flatpickr-confirm {
1414
display: inline-flex;
1515
align-items: center;

resources/dist/components/flatpickr.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)