- Added useDraftAutosave hook to handle automatic saving of post drafts.
- Enhanced PostEditor component to include a preview tab that fetches and displays rendered markdown.
- Updated Post model to manage draft state and associated published_at timestamp.
- Introduced card_photo association to Post for representing a primary image.
- Modified post form to support draft saving and publishing actions.
- Updated navigation to include links to drafts.
- Added tests for draft saving, preview functionality, and card photo validation.
- Created migrations for new database fields related to drafts and card photos.
On a seed's own page, the owner now chooses which side of the packet a photo
is of with one small button group, the current choice lit, in place of a badge
and up to three long text links that wrapped in a narrow card. Everyone else
sees just a badge. The unused "mark as" locale keys are removed.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Keep every packet label when a side is photographed again, and use the newest
photo of a side. Before, giving a second photo the same label cleared the
older photo's, which let it back into the crop's photos and default picture.
Carry the label through the HTML photo picker (its search form and the links
that add a photo), so a packet photo added without JavaScript is labelled.
Have the OCR script treat any network failure on an image (DNS, timeout) as
that image failing, so the rest of the batch still runs.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The text read from a packet is kept in seeds.packet_text but is not on any form
or page yet: the OCR script will fill it in a follow-up. The column's migration
comment had an apostrophe that broke its string, so it did not run.
- Introduced a Rake task `packets:needing_ocr` to list photos of seed packets that lack text, outputting results as JSON lines.
- Created a Python script `read_packets.py` to process the output of the Rake task, downloading images and performing OCR to extract text.
- Updated model specs for `Crop` to ensure proper handling of photos associated with different seeds.
- Refactored API request specs for `Photos` and `Seeds`, removing unnecessary attributes from the response.
- Added tests for the new Rake task to ensure correct functionality and output format.
- Deleted the packet_lines.js and packet_reader.js files along with their tests.
- Removed the packet_text.js file and its tests, which handled parsing of packet text.
- Eliminated the corresponding HTML for the packet reader button in the seed form.
- Updated package.json to remove tesseract.js dependency.
- Cleaned up related helper specs for packet image URLs.
- Added `tesseract.js` as a dependency in `package.json`.
- Created a new spec file for `PhotosHelper` to test `packet_image_urls` method.
- Enhanced `Crop` model tests to ensure packet photos do not interfere with crop photos.
- Introduced validation tests for `Seed` model, covering row spacing and variety constraints.
- Updated API response in `seeds_request_spec.rb` to include variety, batch number, and row spacing.
- Updated `yarn.lock` to reflect new dependencies and versions.
* Add 'This week' reschedule option for jobs
- Add JobList.week_date helper returning the Friday of the current week.
- Add move_week translation key in config/locales/en.yml.
- Render 'This week' option in app/views/jobs/_reschedule.haml when week_date is after tomorrow.
- Add unit specs in spec/services/job_list_spec.rb and view specs in spec/views/jobs/_reschedule.haml_spec.rb.
Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>
* Remove low value tests
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Brenda Wallace <brenda@wallace.net.nz>
- Introduced a suggestions section on the garden show page to display what can be planted now.
- Added a new view partial for garden suggestions.
- Updated the plant picker to allow selection of a specific garden.
- Enhanced navigation menu to include a link to planting suggestions.
- Added relevant translations for the new feature.
- Implemented feature specs to ensure suggestions display correctly for the user's garden.
Update the offcanvas drawer header on small devices to wrap the
signed-in member's profile avatar image and login name in a link
pointing to the member's profile page.
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
* Implement AddSeedsPicker component and enhance planting selection UI; update styles and serializers for better seed management
* Enhance PlantingPicker component: add hints and titles for harvest and seed actions; update test to reflect changes in seed saving behavior
* Enhance harvest recording: allow harvesting from crops without plantings; update forms and modals for better user experience
* Refactor code structure for improved readability and maintainability
* Remove AddSeedsPicker component and its associated tests
* Add planting picker functionality for harvesting and seed saving
- Introduced PlantingPickersController to handle JSON responses for member's plantings.
- Updated HomeHelper to include crop ID in planting picker properties.
- Refactored PlantPicker and PlantSomethingModal components to support multiple gardens.
- Created PlantingFlow component to manage planting actions (harvest and save seeds).
- Implemented RecordDialog component to handle server-rendered links for harvesting and seed saving.
- Updated various views to include data attributes for triggering the record dialog.
- Added routes for planting picker and corresponding request specs for testing.
- Adjusted styles in _plantings.scss for better layout and spacing.
* Add job management features including job creation and wishlist functionality
* Remove WishlistJobsController and associated views and tests
* Add suggestion links rendering and fix routes formatting
* Refactor AddJobModal and JobPicker components to simplify props and enhance user experience
* Update seed addition test to check dialog presence and current path
* Apply suggestion from @CloCkWeRX
---------
Co-authored-by: Daniel O'Connor <daniel.oconnor@gmail.com>
* Fix missing en.seeds.updated translation
Add missing updated key under the seeds scope in config/locales/en.yml
and add controller test verifying flash notice on seed update.
Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>
* Update SeedsController test route parameter to use slug
Seeds routes use param: :slug. Updated test parameter key from id to slug.
Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
* Replace bootstrap datepicker with native HTML5 date inputs
Convert planting and seed date text fields to native HTML5 date fields
(`f.date_field`), matching existing date inputs across the app. Remove
bootstrap-datepicker JS/CSS imports, legacy site wrapper scripts,
package dependency, and update test specs.
Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>
* Fix spec
* Fix spec
* Fix spec
* Drop expectations about removed control
* Fix specs
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>