Add manual time entry form - #163
Merged
Merged
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
It changes core time-entry form behavior (including CSRF + entity date/validation semantics) across multiple UI entry points and needs final human verification of end-to-end flows.
Pull request overview
This PR introduces a manual time entry workflow (modal + LiveComponent form) so users can log work retroactively across key pages (dashboard, projects, clients, reports), integrating with existing time entry entities and UI patterns.
Changes:
- Added a reusable “Add time entry” modal + trigger button and wired them into multiple pages and list rows (project/client).
- Implemented a
ManualTimeEntryLiveComponent +ManualTimeEntryTypeform, including CSRF handling, validation, and a duration hint. - Updated
TimeEntrydate handling/validation and expanded PHPUnit coverage for the new behavior and UI presence.
File summaries
| File | Description |
|---|---|
| tests/Twig/Components/ManualTimeEntryTest.php | New Kernel test covering manual-entry component save behavior, CSRF, and validation cases. |
| tests/Entity/TimeEntryTest.php | Adds coverage for TimeEntry date setters normalizing to Carbon and accepting null. |
| tests/Controller/ManualEntryModalPageTest.php | New WebTest ensuring the modal/trigger appears on key pages and prefill metadata is present. |
| templates/report/index.html.twig | Adds manual-entry trigger + modal include to reports page. |
| templates/project/show.html.twig | Adds project-scoped manual-entry trigger + modal include. |
| templates/project/index.html.twig | Includes the shared manual-entry modal on the projects list page. |
| templates/dashboard/index.html.twig | Adds manual-entry trigger + modal include to dashboard. |
| templates/components/ProjectList.html.twig | Adds per-row manual-entry trigger buttons with project prefill. |
| templates/components/ManualTimeEntry.html.twig | New Twig template for the manual-entry form UI (TomSelect + duration hint). |
| templates/components/ClientList.html.twig | Adds per-row manual-entry trigger buttons with client narrowing. |
| templates/components/_manual_entry_modal.html.twig | New shared modal wrapper wiring Stimulus controllers + LiveComponent. |
| templates/components/_manual_entry_button.html.twig | New shared trigger button template with optional project/client prefill. |
| templates/client/index.html.twig | Includes the shared manual-entry modal on the clients list page. |
| src/Twig/Components/ManualTimeEntry.php | New LiveComponent implementing manual entry save, flashes, and safe return redirect. |
| src/Kernel.php | Uses a typed class constant for app version (referenced from platform.yaml). |
| src/Form/TimeTrackerType.php | Refactors tracker form to extend the new shared AbstractTimeEntryType. |
| src/Form/ManualTimeEntryType.php | New form type for manual entry (adds datetime + required constraints). |
| src/Form/AbstractTimeEntryType.php | New shared form type consolidating common TimeEntry fields + CSRF token id. |
| src/Entity/TimeEntry.php | Allows DateTimeInterface inputs for date setters; adds end-after-start validation constraint. |
| platform.yaml | Reads platform version from App\Kernel::APP_VERSION. |
| assets/controllers/manual_entry_controller.ts | New Stimulus controller to narrow project options by client using TomSelect. |
| assets/controllers.json | Enables the platform modal-prefill controller (lazy). |
Review details
- Files reviewed: 22/22 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The icon-only trigger rendered as a 2px sliver next to Edit/Delete. Tabler's `.btn-icon` negative-margins the icon by the button's padding-x on all four sides, expecting `.btn`'s min-width to absorb it. That min-width calc references `--tblr-btn-line-height`, which is unset here, so it resolves to `auto`, the icon's width cancels out, and the button collapses to its borders. Use a plain `btn-sm` instead, which sizes from the icon's own min-width. Also whitespace-control the label so an empty one leaves no stray text node beside the icon.
Same `btn-sm btn-icon` collapse as the manual time entry trigger: with `btn-sm` the button's min-width resolves to 0, the icon's negative margins cancel its width, and the button renders as a 2px sliver. Measured 2x12 before, 36x28 after. `btn-icon` is fine at the default size (min-width 40px), so the mobile-only "Create new" buttons on the project, client and tag index pages are unaffected. Claude-Session: https://claude.ai/code/session_01M1uNeTMKW9ZWuRtKvTpR95
Symfony 8.1.5 to 8.1.6 and related bumps within the existing composer.json constraints; config/reference.php regenerated to match. Suite green apart from the two pre-existing failures. Claude-Session: https://claude.ai/code/session_01M1uNeTMKW9ZWuRtKvTpR95
Pass the modal title through the translator at the call site, matching the three delete modals. The Ui:Modal component already translates `title`, so this is about consistency and making the string extractable, not a runtime fix. Assert the saved duration numerically rather than on CarbonInterval's string form, which is presentation-oriented. Claude-Session: https://claude.ai/code/session_01M1uNeTMKW9ZWuRtKvTpR95
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.