Allow Start / Finish Dates on Edit Listed Game to Be Cleared #60

Closed
opened 2024-01-14 14:53:12 -06:00 by jimmyb · 1 comment
Owner

Users need an easy way to clear the started/finished dates on an existing game list entry. The old site reportedly had a small clear link next to these fields; the rebuilt Laravel edit flow should restore that behavior so users do not have to manually fight date inputs when removing a date.

This likely relates to #348, which tracks rebuilding the user game list pages in Laravel. The current checkout already has game_lists date fields, GameListController::edit() / update() methods, nullable validation for start_date and finish_date, and owner-only update authorization through GameListPolicy. The list routes and pages.game-lists.* views are now wired, so this focused regression fix was implemented on the /list/edit/{gameList} edit flow.

Scope

  • Owner-only edit-listed-game form behavior for clearing started and finished dates.
  • Clear controls for both start date and finish date fields.
  • Server-side handling that persists cleared dates as null.
  • Validation that still accepts normal valid dates when users set them.
  • Compatibility with the list-page rebuild tracked by #348.
  • No change to public list visibility beyond accurately reflecting cleared dates after save.

Acceptance Criteria

  • A list owner editing one of their own game list entries can clear the start date field.
  • A list owner editing one of their own game list entries can clear the finish date field.
  • Clearing either field and saving persists that field as null in game_lists.
  • Users can clear one date without clearing the other.
  • Users can still enter valid dates for either field and save successfully.
  • Invalid dates are still rejected with normal validation feedback.
  • The clear controls are easy to discover near the relevant date inputs.
  • The clear controls work with keyboard interaction and do not require a full custom date widget if a standard input is sufficient.
  • Non-owners cannot access or submit another user's list-entry edit form.
  • The rebuilt list page from #348, or any existing list display, no longer shows a cleared date after the entry is updated.

Test Coverage Required

  • Feature test confirming the edit form renders clear controls for start and finish dates once the edit view exists.
  • Feature test confirming the owner can clear only the start date and the database stores null.
  • Feature test confirming the owner can clear only the finish date and the database stores null.
  • Feature test confirming both dates can be cleared in the same update.
  • Regression test confirming valid dates can still be saved.
  • Validation test confirming invalid dates are rejected.
  • Authorization test confirming a non-owner cannot update another user's list-entry dates.
  • Regression test confirming the list display from #348 does not render a date after it has been cleared.
  • Tests should use Pest and focused feature coverage.
  • Run the focused affected tests, then run vendor/bin/pint --dirty --format agent before closing the issue.

Progress Checklist

  • game_lists date fields exist
  • GameListController::update() validates start and finish dates as nullable
  • GameListController::update() assigns submitted date values to the list entry
  • Owner-only update policy exists for GameList
  • #348 tracks rebuilding the broader user game list pages and routes
  • Restore or build the list-entry edit view as part of the list rebuild
  • Add clear controls next to the start date and finish date inputs
  • Ensure blank submitted values persist as null for both date fields
  • Keep valid date entry and validation behavior intact
  • Ensure cleared dates are reflected on the rebuilt list display
  • Add tests for clearing start date, clearing finish date, clearing both, preserving valid dates, validation failures, and owner-only authorization
  • Confirm #60 remains a focused regression fix within or alongside the #348 list rebuild
Users need an easy way to clear the started/finished dates on an existing game list entry. The old site reportedly had a small clear link next to these fields; the rebuilt Laravel edit flow should restore that behavior so users do not have to manually fight date inputs when removing a date. This likely relates to #348, which tracks rebuilding the user game list pages in Laravel. The current checkout already has `game_lists` date fields, `GameListController::edit()` / `update()` methods, nullable validation for `start_date` and `finish_date`, and owner-only update authorization through `GameListPolicy`. The list routes and `pages.game-lists.*` views are now wired, so this focused regression fix was implemented on the `/list/edit/{gameList}` edit flow. ## Scope - Owner-only edit-listed-game form behavior for clearing started and finished dates. - Clear controls for both start date and finish date fields. - Server-side handling that persists cleared dates as `null`. - Validation that still accepts normal valid dates when users set them. - Compatibility with the list-page rebuild tracked by #348. - No change to public list visibility beyond accurately reflecting cleared dates after save. ## Acceptance Criteria - A list owner editing one of their own game list entries can clear the start date field. - A list owner editing one of their own game list entries can clear the finish date field. - Clearing either field and saving persists that field as `null` in `game_lists`. - Users can clear one date without clearing the other. - Users can still enter valid dates for either field and save successfully. - Invalid dates are still rejected with normal validation feedback. - The clear controls are easy to discover near the relevant date inputs. - The clear controls work with keyboard interaction and do not require a full custom date widget if a standard input is sufficient. - Non-owners cannot access or submit another user's list-entry edit form. - The rebuilt list page from #348, or any existing list display, no longer shows a cleared date after the entry is updated. ## Test Coverage Required - Feature test confirming the edit form renders clear controls for start and finish dates once the edit view exists. - Feature test confirming the owner can clear only the start date and the database stores `null`. - Feature test confirming the owner can clear only the finish date and the database stores `null`. - Feature test confirming both dates can be cleared in the same update. - Regression test confirming valid dates can still be saved. - Validation test confirming invalid dates are rejected. - Authorization test confirming a non-owner cannot update another user's list-entry dates. - Regression test confirming the list display from #348 does not render a date after it has been cleared. - Tests should use Pest and focused feature coverage. - Run the focused affected tests, then run `vendor/bin/pint --dirty --format agent` before closing the issue. ## Progress Checklist - [x] `game_lists` date fields exist - [x] `GameListController::update()` validates start and finish dates as nullable - [x] `GameListController::update()` assigns submitted date values to the list entry - [x] Owner-only update policy exists for `GameList` - [x] #348 tracks rebuilding the broader user game list pages and routes - [x] Restore or build the list-entry edit view as part of the list rebuild - [x] Add clear controls next to the start date and finish date inputs - [x] Ensure blank submitted values persist as `null` for both date fields - [x] Keep valid date entry and validation behavior intact - [x] Ensure cleared dates are reflected on the rebuilt list display - [x] Add tests for clearing start date, clearing finish date, clearing both, preserving valid dates, validation failures, and owner-only authorization - [x] Confirm #60 remains a focused regression fix within or alongside the #348 list rebuild
jimmyb self-assigned this 2026-06-03 16:26:55 -05:00
Member

Implemented and pushed in b3301e9 (Restore clear date controls on list edits).

Summary:

  • Added keyboard-accessible Clear Date controls for Started Date and Finished Date on /list/edit/{gameList}.
  • Clear controls are only visible when the corresponding date input has a value, and they stay in sync when users type, select a date, or clear a date.
  • Blank submitted date values are normalized to null before validation so cleared dates persist correctly in game_lists.
  • Kept normal valid-date saves and invalid-date validation intact.
  • Verified cleared dates no longer render as the previous date on the rebuilt list display.
  • Fixed a follow-up layout regression where the calendar icon shifted after adding the clear link.

Verification run:

php artisan test --compact tests/Feature/GameListPageTest.php --filter='edit page renders an eight four layout|edit layout hides clear date controls|owner can clear|owner can update and delete their list entry|owner cannot submit list dates outside the allowed range|owner controls appear only for the owner'
vendor/bin/pint --dirty --format agent
npm run build

Note: the focused issue tests pass when run sequentially. Avoid manually launching multiple filtered php artisan test commands in parallel against the same shared MariaDB test database because these fixtures share hardcoded IDs/usernames and cleanup ranges; that can cause unrelated 404s, missing rows, or unique-key collisions. A separate issue is being created to address parallel test isolation.

Implemented and pushed in `b3301e9` (`Restore clear date controls on list edits`). Summary: - Added keyboard-accessible `Clear Date` controls for Started Date and Finished Date on `/list/edit/{gameList}`. - Clear controls are only visible when the corresponding date input has a value, and they stay in sync when users type, select a date, or clear a date. - Blank submitted date values are normalized to `null` before validation so cleared dates persist correctly in `game_lists`. - Kept normal valid-date saves and invalid-date validation intact. - Verified cleared dates no longer render as the previous date on the rebuilt list display. - Fixed a follow-up layout regression where the calendar icon shifted after adding the clear link. Verification run: ```bash php artisan test --compact tests/Feature/GameListPageTest.php --filter='edit page renders an eight four layout|edit layout hides clear date controls|owner can clear|owner can update and delete their list entry|owner cannot submit list dates outside the allowed range|owner controls appear only for the owner' vendor/bin/pint --dirty --format agent npm run build ``` Note: the focused issue tests pass when run sequentially. Avoid manually launching multiple filtered `php artisan test` commands in parallel against the same shared MariaDB test database because these fixtures share hardcoded IDs/usernames and cleanup ranges; that can cause unrelated 404s, missing rows, or unique-key collisions. A separate issue is being created to address parallel test isolation.
Codex closed this issue 2026-06-03 17:07:16 -05:00
Sign in to join this conversation.
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MyVideoGameList/myvideogamelist.com#60
No description provided.