-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Update freeagent extension #24255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update freeagent extension #24255
Conversation
- Merge branch \'contributions/merge-1767780738708\' - Pull contributions - Add flexible hours input parsing to timeslip form
|
Thank you for the update! 🎉 Due to our current reduced availability, the initial review may take up to 10-15 business days. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a bug in the FreeAgent extension where time entries in HH:MM format (e.g., "4:30") were incorrectly parsed, sending only the hours portion to the API. The fix introduces proper time parsing logic that handles both HH:MM and decimal formats, with validation to prevent invalid inputs.
Key Changes:
- Added
parseHours()function to correctly convert both HH:MM and decimal time formats - Enhanced form validation to catch and display errors for invalid time inputs
- Improved user guidance with updated placeholder text and informational tooltip
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| extensions/freeagent/src/create-timeslip.tsx | Added parseHours function with validation logic and updated form submission to use it |
| extensions/freeagent/CHANGELOG.md | Documented the bug fix and new time format support |
Greptile SummaryFixed a bug where entering time in HH:MM format (e.g.,
Confidence Score: 5/5
Important Files Changed
|
Greptile's behavior is changing!From now on, if a review finishes with no comments, we will not post an additional "statistics" comment to confirm that our review found nothing to comment on. However, you can confirm that we reviewed your changes in the status check section. This feature can be toggled off in your Code Review Settings by deselecting "Create a status check for each PR". |
pernielsentikaer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, approved 🔥
|
Published to the Raycast Store: |
1 similar comment
|
Published to the Raycast Store: |
|
🎉 🎉 🎉 We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag. |
Description
Problem
When entering time in HH:MM format (e.g., 4:30 for 4 hours 30 minutes), the form was incorrectly sending only 4 hours to FreeAgent. This was because parseFloat("4:30") stops parsing at the colon and returns 4.
Solution
Added a parseHours function that properly handles both time formats:
Invalid inputs (negative values, minutes ≥ 60, non-numeric strings) now show a validation error instead of silently failing.
Changes
Screencast
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare placed outside of themetadatafolder