When clicking "Hide Completed" on the jobs notepad, an AJAX GET request was sent without an explicit 'Accept: text/html' header. Rails evaluated `request.format` as non-HTML, causing `JobsController#notepad?` to return `false` and falling back to `respond_with` rendering the full page layout inside the notepad groups element.
Here is a summary of the changes:
1. Added the 'Accept: text/html' header to transmit in `job_notepad.js`.
2. Updated `JobsController#notepad?` to treat XHR requests for the current member's jobs as notepad requests.
3. Added unit tests in `job_notepad.test.js` for the "Hide Completed" action.
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
* Add Shareon social share component to posts#show for logged in users
- Install shareon npm package
- Add shareon JS module and stylesheet imports
- Render .shareon container with requested share links on posts#show for logged in users
- Add unit and view spec tests
Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>
* Add Shareon social share component to posts#show for logged in users
- Install shareon npm package
- Add shareon JS module and stylesheet imports
- Render .shareon container with requested share links on posts#show for logged in users
- Add unit and view spec tests
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 the modal dialog for editing seed details with an inline form within the packet sheet.
- Introduce a new partial for edit fields to streamline the editing process.
- Update the seed facts display to utilize a new fact row partial for better organization and readability.
- Implement a packet panel to show packet photos and text side by side, enhancing the user interface.
- Modify the hero section to include source information as a ribbon or badge based on the presence of a photo.
- Adjust tests to reflect changes in the editing process and the new layout of the seed show page.
- Implemented Dockerfile for OCR processing with necessary dependencies.
- Enhanced read_packets.py to read and save text from seed packet photos.
- Created requirements.txt for Python dependencies.
- Updated show.html.haml to display OCR results when available.
- Added tests for displaying packet text on seed pages, including handling of markup.
- Remove scientific name fields from crop edit form (retaining for new crop request only)
- Remove recreate_names('sci_name', 'scientific') from CropsController#update
- Add and update specs to verify scientific names and their metadata remain intact on crop update
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
- Added `label` computed attribute to `PhotoResource` to indicate the side of the seed packet.
- Introduced `needs_ocr` filter in `PhotoResource` to identify photos awaiting OCR processing.
- Updated `SeedResource` to associate photos with seeds.
- Modified `photos_request_spec` to include seed relationships and test for photo labels.
- Added filtering tests for photos needing OCR in `photos_request_spec`.
- Removed obsolete Rake task for listing photos needing OCR.
- Updated `read_packets.py` to fetch photos needing OCR from the API.
The Procfile had only a web process, so a deploy never ran migrations and they
had to be run by hand after the new code was live, leaving a window where the
code expected columns that did not exist yet. A release phase runs db:migrate
before the new release goes live, and if it fails the release is stopped and the
old code keeps running.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
yarn install refuses to run on a Node that does not match package.json
"engines", so pinning Node for Heroku broke CI (which runs 24.21.0) and would
block any contributor on another Node. Heroku still reads the pin; yarn no
longer enforces it.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Heroku builds have been failing since this morning while downloading the newest
24.x, 24.22.1, from nodejs.org (curl: (92) HTTP/2 stream was not closed
cleanly). The file downloads fine elsewhere, so pin an earlier 24.x to make the
build fetch a different one. CI sets its own Node version and is not affected.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- 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.
Improve layout flexibility on mobile viewports for record pages (seeds,
plantings, harvests, gardens):
- Reduce grower avatar size on md (56px) and sm (48px) screens
- Set min-width and flex properties on record identity and actions
- Allow parent record location text to wrap on mobile devices
Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>