Commit Graph
263 Commits
Author SHA1 Message Date
Brenda Wallace 4576b1a2ed Refactor garden suggestions feature: update suggestion logic, remove unused partial, and enhance localization 2026-10-27 11:11:05 +13:00
Brenda Wallace aeccc2c5ed Add planting suggestions feature to garden pages
- 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.
2026-10-27 11:11:05 +13:00
Brenda WallaceandDaniel O'Connor 75595350bc Easier recording of harvests from the front page (#5077)
* 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>
2026-10-26 21:38:12 +10:30
Daniel O'Connorandgoogle-labs-jules[bot] e06c747c47 Fix step 4 button text overlap on mobile (#5101)
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-10-26 21:37:34 +10:30
Brenda Wallace 85b5ff9ecd Add feature flags, with job ideas as the first
Admins switch features on and off at /admin/features, kept in Flipper.
Job ideas (the page, the banners and the overlay) only show while its
flag is on. Features are off until switched on.

Closes #5050
2026-10-24 18:01:56 +13:00
Brenda Wallace bbb8a142c7 widening the range for suggsting jobs (#5034)
* Add crop_job_step association to Job model and migration

- Introduced a has_many association in CropJobStep for jobs with dependent nullify.
- Added crop_job_step reference to Job model with optional association.
- Created migration to add crop_job_step reference to jobs table with foreign key.
- Updated schema to reflect the new association.
- Added tests for crop_job_step association in Job model.

* Add ApplyCropJobTemplate service and for_crop scope to CropJobTemplate model

* Add job idea dismissal feature and related services

- Introduced JobIdeaDismissal model to manage dismissed job ideas for members.
- Added associations and validations for job idea dismissals in the Member model.
- Created JobIdeas service to generate job ideas based on templates and last year's activities.
- Implemented JobIdeas::LastYear and JobIdeas::Templates classes to fetch relevant job ideas.
- Added migration for job_idea_dismissals table and updated schema.
- Developed tests for job idea dismissal functionality and related services.

* Add PlantedLastYear service and update JobIdeas to include it

* Add action attribute to Job model and update related files

* Refactor JobIdeas service: replace LastYear and PlantedLastYear with PastJobs and PastPlantings; update related specs

* Add community and nearby job ideas sources; implement shown and more methods in JobIdeas service

* Implement job idea dismissal duration and snooze functionality; add hidden_until attribute and related specs

* Add Harvest class to JobIdeas service for managing harvest-related job ideas; implement ideas generation and related specs

* Add JobIdeas feature: implement JobIdeasController, views, and related services for job suggestions; include functionality for adding, hiding, and snoozing job ideas

* Refactor button options in job ideas view for improved readability and maintainability

* Enhance Job Ideas feature: add styling for idea cards, implement filtering options, and update controller logic to manage skipped sources; improve localization for job idea reasons and sections

* Add job ideas count and badge display; implement helper methods and update views for better visibility of job ideas

* Enhance Job Ideas feature: add UI elements for job suggestions, implement schedule display for template jobs, and improve localization; update related specs for new functionality

* Enhance Job Ideas feature: implement overlay for job suggestions, add animations for job transitions, and improve UI components; update controller and helper methods for better handling of job ideas

* Refactor Job Ideas feature: remove badge display and related tests; update UI components for better layout and visibility of job suggestions

* Refactor Jobs view and update specs: improve layout for job groups and enhance test coverage for jobs index with ideas

* Refactor Job Ideas feature: replace dismiss! with hide! method, update job count logic, and enhance UI components for better visibility and layout

* Add job ideas feature: implement ideas banner on homepage, enhance overlay logic, and add tests for job ideas display

* widen the range for suggseting jobs

* Fix comment to accurately describe planted crops timeframe in PastPlantings class
2026-10-23 22:24:12 +10:30
Brenda Wallace ca7fd81439 Tidy/login signup (#4958)
* Add authentication dialogs for sign in and sign up

- Implemented AuthDialog component to manage sign in and sign up modals.
- Created SignInModal and SignUpModal components for handling respective authentication processes.
- Added AuthFields component for reusable form fields and error handling.
- Updated various views to utilize the new authentication dialogs instead of traditional links.
- Enhanced user experience by allowing sign in and sign up actions to occur without full page reloads.
- Added feature specs for testing the functionality of the new dialogs.

* Refactor modals and input fields for improved accessibility and styling; adjust button sizes and text formatting

* Refactor authentication forms and modals for improved usability and accessibility; integrate reCAPTCHA handling and enhance error messaging

* Refactor SignUpModal layout for improved responsiveness and accessibility; organize fields into rows and enhance styling

* Refactor session view spec to streamline field checks; remove redundant test and retain essential content expectations
2026-10-17 09:26:39 +10:30
Brenda WallaceandClaude Sonnet 5.5 b7dbb84ebd Add a garden and plant from the home page without leaving it
The garden dialog now adds a garden as well as edits one (new.json and
create.json on GardensController), and a GardenPicker button opens it from the
home page. A plant_picker helper replaces the home page's separate plant
links and the plant_button partial. The plant dialog asks when it was
planted (Today, Yesterday, Enter date), using a WhenPicker shared with the
harvest dialog. Members with no garden still get the full-page plant link.

Part of #4933

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 22:21:26 +13:00
Brenda Wallace 8235aebaa1 Refactor home stats tiles layout to use grid system and update links for improved interactivity 2026-10-15 21:58:46 +13:00
Brenda Wallace 52d0ce4598 Remove link functionality from home stat tiles for simplified display 2026-10-15 21:58:46 +13:00
Brenda Wallace b812c40fbe Add URL to 'ready' stat tile for improved interactivity 2026-10-15 21:58:46 +13:00
Brenda Wallace 5241f0e081 Enhance home dashboard interactivity and styling
- Update styles for home stat tiles to improve visual consistency.
- Modify home_section helper to accept an optional id for in-page linking.
- Adjust HAML views to incorporate new id functionality and ensure proper linking.
- Add feature specs for verifying stat tile links and section presence.
2026-10-15 21:58:46 +13:00
Brenda Wallace 5c44eb6976 Redirect old timeline to friends and neighbours page and update related views 2026-10-13 20:01:21 +13:00
Brenda Wallace b386ddace2 Add ChipToggle component and refactor HarvestChart and GrowingTable to use it 2026-10-13 13:12:24 +13:00
Brenda Wallace 31978698c2 the growing/ready on the home page should also be react, so it changes without a page reload 2026-10-13 13:10:12 +13:00
Brenda Wallace 29c9cb2ef6 show harvests by count, not weight 2026-10-13 13:08:02 +13:00
Brenda Wallace eff14940ab Refactor home page recent posts display; replace old structure with new post card layout for improved aesthetics and functionality. 2026-10-12 21:59:35 +13:00
Brenda Wallace 48fa6a6eec Enhance home page layout with new post thumbnail and photo display features; update recent posts section for improved visibility and accessibility. 2026-10-12 21:59:11 +13:00
Brenda Wallace a06b281a1d overlay modal forms for the homepage 2026-10-12 21:45:53 +13:00
Brenda Wallace 37cbef43c7 Fix rendering syntax for 'blurb' section in home index view 2026-10-12 19:36:12 +13:00
Brenda Wallace 54258de6c4 Refactor home dashboard and related components
- Removed unused styles and helper methods from _garden_layout.scss, _homepage.scss, and overrides.scss.
- Updated _home_dashboard.scss to enhance button styles and added new harvest picker styles.
- Introduced HarvestPicker component for improved harvest recording functionality.
- Refactored home dashboard views to utilize new home_section helper for consistent layout.
- Simplified and optimized existing methods in application_helper.rb, activity.rb, and harvest.rb.
- Removed deprecated homepage_records methods from Activity and Harvest models.
- Updated tests to reflect changes in helper methods and removed obsolete tests.
2026-10-12 19:24:55 +13:00
Brenda Wallace 0c2b5b95fa Remove unused plantings and seeds partials along with their associated specs 2026-10-12 19:24:47 +13:00
Brenda Wallace 76a0af7d82 Implement action bar for mobile with plant and harvest options; enhance navbar search functionality 2026-10-12 19:21:26 +13:00
Brenda Wallace c83d542146 Enhance navigation and dashboard features with current section highlighting and last year's planting data 2026-10-12 19:19:43 +13:00
Brenda Wallace ef06bab74f Add crop suggestions feature and dashboard enhancements
- Introduced crop suggestions functionality allowing users to receive tailored crop recommendations based on their location and preferences.
- Implemented the ability for users to dismiss specific crop suggestions, preventing them from receiving recommendations for crops they are not interested in.
- Added a location picker for users to set their gardening location, enhancing the accuracy of crop suggestions.
- Enhanced the dashboard to display relevant statistics, including plantings and harvests, with comparisons to previous years.
- Created new views and partials for displaying statistics, crop suggestions, and user interactions on the dashboard.
- Updated routes to accommodate new features related to crop suggestions and member locations.
- Added migrations for new database tables and columns to support crop dismissal and suggestion preferences.
- Developed tests for the new features, ensuring functionality and user experience are maintained.
2026-10-12 19:12:18 +13:00
Brenda Wallace 82e8124f9c Remove garden layout teaser and associated specs from home page 2026-10-12 15:06:48 +13:00
Brenda Wallace 0fef10e45c Refactor home page styles and add sample data task for development 2026-10-12 14:32:08 +13:00
Brenda Wallace f37fa5e0df Add "Since" section to home page and update locale for new content 2026-10-12 14:24:41 +13:00
Brenda Wallace d5ff770e4d Redesign home page layout with new sections for recent plantings and improved styling; enhance hero section and update stats rendering 2026-10-12 14:14:45 +13:00
Brenda Wallace 4b69851c36 Remove unused activity, crop, discuss, harvest, and member sections from home page 2026-10-12 14:14:38 +13:00
Brenda Wallace 0882603e78 Add releases page and update homepage layout
- Introduced a new releases page linked from the homepage.
- Updated homepage to include a signed-in greeting with member avatar and season summary.
- Enhanced mobile styles for better navigation and search box visibility.
- Added season-related helper methods and tests for improved functionality.
2026-10-12 14:11:11 +13:00
Brenda Wallace c758259b17 Refactor code structure for improved readability and maintainability 2026-10-12 14:08:38 +13:00
Brenda Wallace fcd1fe0782 Redesign home page with new hero section, update signup links, and enhance styling for better user experience 2026-10-12 14:06:51 +13:00
6a208a127b Tidy up plantings#show (#4848)
* Restore the Ruby 4.0.6 upgrade

PR #4831 committed a stale Gemfile.lock over the newer one, taking
.ruby-version back to 3.2.3 and rolling back active_median, dalli,
parallel, rbs and selenium-webdriver. Dockerfile and
.devcontainer/Dockerfile still build on Ruby 4, so the Gemfile's version
check fails against the image.

Restores both files to what they were before that merge.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Tidy plantings#show, and make cards and menus consistent

This page read as a page about the crop rather than about one member's
planting, and its sections each did things their own way. Changes follow
the conventions written up in the UI consistency guide.

Identity
- Title, meta description and OpenGraph all read "<crop> planting by
  <owner>"; the hero carries a muted "planting by X in Y" subtitle and
  the scientific name moves to the crop card.
- Breadcrumb's last item is plain text, not a link to the current page.

Actions
- One actions menu per page: a quiet three-dot button in the top right of
  the hero, rendered by the new PlantingActions island, opening the
  EditPlanting, RecordHarvest, SaveSeeds, MarkFinished and AddPhoto
  dialogs that already existed for the garden list.
- Menu items are lower case, so a menu reads as a list of things you can
  do rather than a row of headings.
- Transplanting moves out of the sidebar into a dialog off that menu: it
  is done once in a planting's life and should not hold real estate.
- The second seed-saving dropdown and the loose photo buttons are gone;
  each section keeps one quiet "add" on its heading bar as the non-JS
  path.
- The plant-part icons from the server-rendered harvest form now reach
  the dialog, via icon_url on HarvestFormSerializer.

Fact cards
- Every card fills the same four slots, and the core cards always render
  so one planting's page has the same shape as the next.
- Progress reads as a percentage with "day 43 of 90" beneath; quantity
  and "grown from" merge into one card rather than both saying
  "seedling"; rating is stars and renders even when unrated.
- Dates go through I18n.l and standard_time_distance instead of
  assembling abbr_month_names by hand.
- Adds Planting#planned?, replacing three copies of age_in_days < 0.
- Perennial no longer claims the plant "grows back each year".

Cards by type
- Harvest cards get square corners, a warm accent and the harvest icon,
  and say "<crop> harvest", so they are not mistaken for plantings.
- Seed cards are drawn as seed packets: portrait, papery, torn top edge,
  printed band, small print along the foot and the year saved stamped on
  them.

Layout
- The page wrapper is .planting-show, not .planting: that is the planting
  *card's* class, and its absolutely positioned badges and quick actions
  were leaking onto this page.
- Sections are bordered blocks with their heading bar as the lid, so a
  heading and its content read as one thing.
- One spacing scale, and the hero aligns to the same left edge as
  everything below it.

Copy
- Section headings and empty states go through en.yml, in one voice.
- "Add a photo to visually track growth of this planting, to Flickr,
  iNaturalist or Pl@ntNet" was nonsense: photos come from Flickr only.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Use the harvest and seed cards site-wide, and rate a planting in place

The new harvest cards and seed packets only appeared on plantings#show.
Everywhere else either used the old thumbnails or hand-rolled its own
markup, which is what made harvests and plantings look alike in the first
place.

- members#show and members/_harvests render harvests/card. The latter also
  wrapped each card in another .card, which nested a card in a card.
- The homepage harvest list was hand-rolled markup beside a seeds section
  that already used seeds/card; both now use the shared partials.
- Homepage seed packets go in an .index-cards grid. Outside one they have
  no width, and the packet's 3:4 ratio made each half the page wide.
- harvests/_harvest and seeds/_seed chose between card and thumbnail on a
  `full:` local that nothing passes. Both render the card.

The crop pages' harvest and seed panels are lists of links in a sidebar,
not card grids, so they are left alone.

Section "add" buttons now open the same dialogs as the actions menu, via a
data-planting-dialog attribute the island listens for. Their href stays as
the fallback without JavaScript.

The rating card is now clickable: for someone who may edit the planting it
renders StarRating, which saves the new rating and puts it back if the
save fails. The card's own heading is the label, so the fieldset legend is
hidden rather than saying "Rating" twice.

"More photos" is a plain link again, and only shows when there are more
photos than the page is displaying — the photos are now paginated to 12,
where before the whole set was loaded and the link always showed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Put the like button beside the planting's name

It sat on its own below the hero, with a section's worth of space above
and below it, reading as an orphan rather than as something belonging to
the planting.

It now sits on the title line, right after the name, at its own size
rather than the title's.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Draw a border around the planting's own data

The title, facts, photos, harvests, seeds and planned activities now sit
inside one subtle border, so they read as one body of data rather than
running into the sidebar beside them.

Also drops the raised shadow from the like button. The global .btn shadow
made the heart look like a call to action it isn't.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Tidy the planting page sidebar, and the add-photo dialog

The sidebar was three blocks with three different treatments: a bare
owner card, the shared crop card, and a bordered neighbours section. They
now all use the same sections as the main column, with a heading bar each.

- The owner block leads with the avatar and who grows this where, rather
  than a heading repeating "Planted by".
- The crop card renders without its footer here. "Add to my garden" and
  "Save seeds" made no sense beside a planting you are already growing,
  and the page offers both already. crops/_crop takes actions: false;
  everywhere else keeps them.
- Partials shared with other pages bring their own .card, which inside a
  section is a box in a box, so those are flattened.

Add-photo dialog:
- It now says what it is adding to: "Add photo to chives planting",
  rather than "Add a photo to chives". Garden cards say which garden.
- While Flickr is being read the body holds roughly the height the picker
  will take and centres the spinner, instead of a short dialog with a
  spinner in the corner that jumps open when the photos arrive.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Say what kind of record a page is about in its title

"Chives" is a crop. A page about one member's chives should say "Chives
planting" in its heading, not leave the reader to work it out from the
furniture around it. The same for harvests and saved seeds.

- plantings#show: "Chives planting", subtitle "by <owner> in <garden>".
- harvests#show: "Basil harvest", subtitle "by <owner> · <date>". The
  owner was in a %small inside the h1 before.
- seeds#show: already said "seeds"; it now names who saved them.

Gardens are left as they are: a garden's name is the member's own, so the
noun belongs in the subtitle rather than appended to a name that may
already contain it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* One corner radius for all data cards, and harvest months by season

Cards used three different shapes: plantings rounded at 5%, harvests and
seed packets square. A percentage radius also draws an ellipse that
changes with the card's size, so a tall packet and a square planting card
curved differently. There is now one $card-radius, used by every data
card and by the section boxes.

Harvest months are grouped into the grower's own seasons, three months
each, named and kept together, starting at their spring — so a Wellington
gardener sees spring begin in September. Where we have no latitude we
show the plain January-to-December row rather than guessing at a
hemisphere.

The grower's location now appears in the page subtitle. It decides the
seasons and the harvest times, so it belongs with the rest of the
planting's identity rather than only as a "nearby" link in the sidebar.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Tidy the harvest months block

It was loose text at the end of the timeline partial: a bare "Harvest
months:" label, twelve badges, and a trailing "in <place>" that now
repeats the location in the page subtitle.

- Moved into its own partial with a proper label, rather than trailing
  off the timeline.
- Dropped the repeated location.
- A legend says what a highlighted month means. Nothing said so before.
- The empty state is its own muted line instead of a sentence running on
  from the label, and no longer says "we need more data" at the reader.
- Each badge carries its full month name for screen readers, and
  highlighted ones say they are harvest months. The quiet months were
  aria-hidden, so a screen reader heard the harvest months with no
  calendar around them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Give the sidebar crop block its own partial

Reusing crops/_crop inside a section meant a card inside a box: a white
strip between the green heading and the photo, the card's own shadow
sitting proud of the section, a photo that overshot the right edge, and
two corner radii disagreeing. Flattening it with negative margins was
fighting the card rather than fixing it.

plantings/_crop is written for this spot instead: the photo runs edge to
edge under the heading bar, the crop's name is title-cased with its
scientific name beneath, and the growing times are a short list rather
than three stats laid out side by side.

crops/_crop goes back to how it was, including its footer buttons, since
nothing needs to suppress them now.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Update the specs for the tidied planting page

Mostly copy and flow changes from the tidy-up, but two real bugs came out
of running them.

Bugs fixed:
- planting_actions_props didn't pass planted_at or today, which
  MarkFinishedModal needs to decide whether "today" may be offered and
  where the date box starts. Without them the dialog threw while
  rendering, and with no error boundary React tore down the whole island,
  so the actions menu vanished entirely.
- The dialogs reloaded the page from inside the save callback, tearing
  the page down while the dialog was still finishing its own update. They
  now close first and reload on the next tick.

Menu items are lower-cased in CSS, as the garden cards already do it,
rather than by calling downcase on the shared button translations. That
was mangling labels other pages show in sentence case.

Specs:
- Menu, dialog and section-heading flows updated: the actions menu opens
  dialogs rather than navigating, so recording a harvest, marking a
  planting finished, editing and transplanting all drive the dialog.
- Copy: "grows this in", "day 14 of 50", "Planned" for a future planting,
  "4 of 5", the new harvest-months wording, and the add-photo dialog
  naming what it adds to.
- The parent-seed example asserted a link to the planting, which came
  from the breadcrumb; the last crumb is the page you are on, so it is
  plain text now and the example checks the seed link instead.
- Removed spec/features/shared_examples/append_date.rb. It drove the old
  datepicker finish flow and had one caller.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Stop avatars shifting the page during feature specs

spec/features/places/searching_a_place_spec.rb intermittently failed on
"goes to members' index page": the click on "View all members >>" landed
on nothing and the browser stayed put.

Member avatars come from gravatar.com over the network and were rendered
with img-fluid and no dimensions, so they reserved no space until they
arrived. The link sits directly under that grid. Capybara found the link,
an avatar landed, the link moved, and the click missed.

rails_helper meant to prevent this, but its guard tested for Poltergeist's
url_blacklist. Poltergeist is long gone and Selenium's browser has no such
method, so the condition was always false and the block never ran.

- Give the two avatar image tags explicit width and height, so the box is
  reserved before the image loads. This fixes real layout shift for
  members too, not only the specs.
- Replace the dead guard with config.x.blank_avatars, which browser specs
  set, making avatar_uri return a blank inline GIF. Helper specs still
  assert the real Gravatar URLs.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Fix avatar URI logic to prevent layout shift in all environments

* Add waiting assertions to prevent premature content checks after saving harvest

* Refactor PlantingActions to improve dialog handling and state management
Enhance PlantingRating to prevent multiple saves and improve error messaging

* Fix date input handling in planting edit dialog

* Add neighbour planting sidebar with improved styling and layout

* Tidy crops#show, and share the record page layout

The planting page's layout was planting-specific CSS. It is now a shared
.record-page / .record-panel in _record_page.scss, and crops#show uses it:
the crop's own data inside one border, the sidebar outside, sections as
bordered blocks with a heading bar as the lid.

Along the way a duplicate section rule and two copies of the kebab button
styling collapsed into one each.

Crop page:
- Scientific and alternate names sit under the crop's name, where they
  belong, instead of having a sidebar card of their own. Wranglers add and
  edit them from the actions menu, in a dialog; the loose "Add" buttons in
  the page body are gone.
- The actions menu is the same three-dot kebab as plantings, in the top
  right of the hero. The "you are a CROP WRANGLER" banner is gone: seeing
  the menu already tells you that. Menu items have no icons now, except
  delete, which keeps its icon and its red.
- Growing facts were split three ways — prose in the hero, prediction
  cards in the main column, an OpenFarm list in the sidebar — and the
  hero prose was the same fields as the OpenFarm ones. One "Growing X"
  section of fact cards now holds all of it.
- The sidebar listed planting, harvest and seed counts directly above
  three sections with those same names. The counts are headline numbers
  in the hero instead, which also fills the space the hero was wasting.
- Main column reads top to bottom: how to grow it, how members grow it,
  varieties, companions, photos, video, where it grows, posts, history.
  Headings say something rather than naming a partial.
- Crop actions are just "Add to my garden". Recording a harvest, saving
  seeds, posting and marking a planting failed all belong to a planting
  you already have.
- The charts section rendered as an empty white strip whenever a crop had
  any plantings or harvests but no chart to draw.
- The hero photo moved to the sidebar, where it has room.

Also: the whimsical icons perch on the heading bar below them rather than
sitting inside the box, the garden picker dialog gives every row the same
shape so the names line up, and crops/_grown_for.html.haml is deleted —
nothing rendered it once its content moved into the growing cards.

Specs are not updated yet: crop_detail_page_spec clicks "Record harvest"
on this page, which no longer exists.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Refactor crop-related views and styles for improved layout and functionality

- Update styles in _crops.scss for better alignment and spacing.
- Enhance _record_page.scss with a new section footer for actions.
- Modify _alternate_names.html.haml to improve dropdown functionality for editing and deleting names.
- Change _history.html.haml header to "Edit history" for clarity.
- Adjust _info.haml to display sowing method and sun requirements prominently.
- Revise _openfarm_data.html.haml to remove unnecessary comments and clarify content.
- Update _photos.html.haml to include a section footer for the "More photos" link.
- Refine _posts.html.haml to streamline the display of posts and actions.
- Improve _scientific_names.html.haml to enhance dropdown functionality for scientific names.
- Update tests in alternate_name_spec.rb and scientific_name_spec.rb to reflect UI changes.
- Remove unused _grown_for.html.haml_spec.rb file.

* Replace language text field with a dropdown select for improved user experience

* Enhance editable forms and fact cards for improved user interaction and layout

* Refactor styles and improve layout for planting details, including muted text color updates and enhanced card displays

* Refactor crop detail page for improved SEO and user experience, including updated links and content for planting and growing information.

* Adjust section add button width for better layout on heading bar

* Update link text for consistency and clarity in crop detail page

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Daniel O'Connor <daniel.oconnor@gmail.com>
2026-10-11 16:06:15 +10:30
3dc8379238 Add a garden layout page for mapping where plants sit in a bed (#4835)
* Share the three-dots button style outside planting rows

The round three-dots toggle was scoped to .planting-row. Move it to a
generic .actions-toggle-dots so other menus can reuse it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Show the garden card actions menu as three dots

Matches the planting rows, and gives the button an aria-label naming
the garden.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Let garden cards update a planting as JSON

PATCH /plantings/:slug.json now returns the garden's refreshed card, as
create does, or the validation errors as 422. Annual plantings in the
card say whether the viewer can edit them.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Add a PATCH helper and a shared way to swap in a garden card

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Let owners edit the planted date on garden cards

The date on an annual planting row is a button with a pencil hint for
plantings the viewer can edit. It opens the browser's date picker, saves
with the tick or Enter, and swaps in the refreshed card so predictions
follow the new date.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Serve a planting's form values as JSON for the edit dialog

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Add a shared isPlainClick helper

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Edit a planting in a dialog over the garden list

Three dots > Edit opens the planting's form in a modal instead of going to
the edit page. It saves as JSON and swaps in the refreshed garden card, so
the page is never left. Ctrl/cmd-click still opens the edit page.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Drop the garden choice from the planting edit dialog

Moving a planting between gardens isn't part of quick editing. The
dialog no longer asks, or sends, which garden.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Rate a planting with stars in the edit dialog

Overall rating is five clickable stars (real radio buttons underneath, so
the keyboard works) with a Clear button, in place of a select.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Only ask for a finished date once a planting is marked finished

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Show planting menu items in lowercase

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Add an Add planting button to garden cards

The way to plant in a garden was an item in its actions menu. Put a green
button in the card header, next to the menu, that opens the same dialog.
It only shows for gardens you can plant in.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Take Plant something here out of the garden card menu

The Add planting button does that now. The card data carries its link as
plant_url, instead of it being borrowed from a menu item.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Add a gallery page of a member's past gardens

/members/:slug/gardens/past shows their inactive gardens as photo cards:
when each was in use, how many plantings, and the crops grown in it. The
owner (or a collaborator) can mark a garden active again from its card.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Replace the include in-active tickbox with a link to past gardens

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Call them inactive gardens, and explain what that page is

Rename the past gardens page to inactive gardens throughout (label, route,
action, view, styles). Move its link on the gardens page to below the
member's card, with a line saying what it holds, and add an explanation
to the page itself.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Line the breadcrumb up with the page content

The breadcrumb bar is the same colour as the page, but its side padding
pushed the text 1rem in from the edge the heading and content sit on.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Line the sidebar text up with the text in the member card

The skip link, nav links, button, blurb and inactive gardens link sat at
the card's edge while the card's own text is inset. Give them the same
inset, left-align the blurb, and add a little space between the links.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Make the sidebar nav links look like links

Link colour and underline, with the page you are on in bold and marked
aria-current.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Let garden cards record a harvest as JSON

GET /plantings/:slug/harvests/new.json gives the form's starting values
and choices; POST /harvests.json returns the garden's refreshed card, or
the validation errors as 422.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Record a harvest in a dialog over the garden list

Three dots > record harvest opens a quick entry form (how many, weight,
when, plant part, notes) in a modal, with the crop and today's date
filled in. It saves as JSON and swaps in the refreshed card, so the page
is never left. Ctrl/cmd-click still opens the full harvest page.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Pass the harvest handler to the planting row, not the perennial chip

The record harvest prop had been attached to the first matching element
in GardenCard, the perennials' CropChip, so the row's menu item fell
through to a normal link.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Share the dialog step indicator

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Record a harvest in two steps, styled like Add planting

Step 1 is what part you harvested: a big text box, with the cursor in it,
that completes from the plant parts (the crop's usual one first). Step 2
is how much: quantity, weight, when and notes, with the choice shown back
and a Change button. Same look as the Add planting dialog.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Harvest dialog: add When and Any notes steps, drop Cancel

Step 3 is when (Today, Yesterday, or Enter date), step 4 is any notes,
and that step saves. The choices so far are shown back with Change
buttons, and there is a Back button. Closing the dialog is how you cancel.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Mark the planting that has just had a harvest recorded

For a few seconds the row goes amber and gets a Harvest recorded tag, and
the notice names the garden, so it is clear which planting it was.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Only offer Yesterday when a harvest then would be after planting

The server needs a harvest to come after the planted date, so a planting
made today (or yesterday) has no Yesterday, and the date box starts the
day after it was planted.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Fix the JSON request specs, and tolerate an empty harvest param

The update helper took its hash as keywords, and the form GET sent a JSON
content type, which Rails wraps into an empty harvest param that new then
rejected. The specs are fixed, and new ignores a blank harvest param.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Put Mark as finished last in the planting menu, below a divider

It takes the planting off the list, so it goes after the everyday
actions, separated from them. The card menu and the garden page menu
match.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Show a tick on the progress bar for each harvest

Each harvest is a small tick at its date on the bar's own scale, with the
date as a tooltip and a hidden sentence for screen readers. The card data
carries the positions, worked out with the same formula as the fill.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Make the pill choice styles general, not about harvests

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Let garden cards save seeds as JSON

GET /plantings/:slug/seeds/new.json gives the form's starting values and
choices; POST /seeds.json returns a link to the new seed, or the
validation errors as 422, without queueing a flash message.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Save seeds in a dialog over the garden list

Three dots > save seeds opens a dialog in the same style as record
harvest: about how many (with quick picks), whether to offer them for
trade, and any notes. It saves as JSON and shows a notice with a link to
the seeds, so the page is never left.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Add feature specs for the save seeds and record harvest dialogs

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Let garden cards choose and add a Flickr photo as JSON

GET /photos/new.json gives a page of the member's Flickr photos (or says
to connect or reconnect Flickr), and POST /photos.json adds one to the
planting or garden and returns the garden's refreshed card, or the
validation errors as 422.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Add a small page for a Flickr connect pop-up to end on

/authentications/connected says whether Flickr got connected and closes
itself. It has no site header or footer, as it appears in a small window.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Add a photo in a dialog over the garden list, connecting Flickr there too

Three dots > add photo (on a planting or a garden) opens a dialog: choose
one of your Flickr photos by album or tag, confirm it, and it is added
without leaving the page, with the garden's card refreshed. If Flickr is
not connected, or the connection has expired, the first step connects it
in a pop-up and the dialog carries on by itself once it has worked.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Add feature specs for the add photo dialog, with Flickr stubbed

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Stop handled menu clicks reaching jquery_ujs, and close the menu

A menu item that carries a data-method (mark as finished) was still sent
as a request by jquery_ujs after a dialog had taken the click over, so the
page navigated and the change was made before the dialog could be used.
A click a dialog handles is now stopped in the menu, which also closes it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Mark a planting finished in a dialog, asking when it finished

Three dots > mark as finished opens a dialog over the list: when did it
finish, today unless you enter a date. Today is not offered for a planting
made today, as the server needs a finish after the planting. It saves as
JSON and the planting leaves the list, without leaving the page. The card
data carries the server's date for today.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Add specs for the mark as finished dialog

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Make the crop chip the planting's menu, for annuals and perennials

Clicking a chip opens the planting's menu under it (view, edit, add
photo, record harvest, save seeds, mark as finished), in place of the
three dots on annual rows, so perennials get the same menu. A caret shows
the chip opens something. Someone who can't change the planting still gets
a plain link chip. The menu items are lowercase for every planting menu.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Update the garden index spec for chip menus

An owner's planting chip is a menu now, with a View link to the planting.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Let garden cards edit a garden as JSON

GET /gardens/:slug/edit.json gives the form's values and choices, and
PATCH /gardens/:slug.json returns the garden's refreshed card, or the
validation errors as 422, without queueing a flash message.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Edit a garden in a dialog over the garden list

Three dots on a garden card > edit opens its form in a dialog, and saves
without leaving the page. A garden saved as inactive leaves the list, with
a note saying where it went.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Add feature specs for the edit garden dialog

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Update the edit garden spec: Edit on a card opens the dialog

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Re-dump schema.rb under Rails 8.1

Rails 8.1's schema dumper sorts each table's columns alphabetically, and
schema.rb was last dumped under 8.0, so the next migration rewrites the
whole file. Doing that on its own here, with no schema changes, keeps the
garden layout commit's schema diff down to what it actually adds.

The lines are identical to before, only reordered.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Add a garden layout page for mapping where plants sit in a bed

A new page at /members/:member_slug/gardens/:slug/layout shows the bed as
a grid, and the garden cards link to it as "Garden layout".

Each planting in the sidebar is a crop chip. Dragging it onto the bed
places one plant there, and the chip stays so it can be dragged again;
dragging a plant back to the sidebar takes it off the bed. Plants can go
anywhere on the bed, not just in a cell, and are drawn as circles with
the crop's icon. The owner can change the bed's size above it, and it
redraws as they type. There is also a "Remove all" button, and a "Plant
something" button that opens the same dialog as the garden cards.

Plants are a new model, one row per individual plant in a planting, so a
planting of ten tomatoes is ten plants that are placed one at a time.
That also gives per-plant state, such as one plant failing, somewhere to
go later. A planting's quantity now follows its number of plants, and
existing plantings are backfilled with one plant each per plant they say
they have, up to 100.

The layout saves the whole arrangement in one request, in a transaction,
so a bad placement leaves the bed as it was. The owner and collaborators
can arrange plants; only the owner can resize the bed or plant into it.

The members-nested gardens routes now use :slug, like the top-level
ones. They used :id, which the controller's loader never read, so those
routes could not find a garden; nothing linked to them.

The specs are not up to date with the Plant model yet, and have not
been run: the layout request, serializer and feature specs still
describe earlier versions of the page.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Add a compost bin to the garden layout, and make the bed look like soil

Dragging a plant into the compost bin deletes it, so its planting has
one fewer; dropping it anywhere else in the sidebar still just lifts it
off the bed. The save request carries the composted plant ids, since a
plant missing from the arrangement otherwise means lifted, not gone. The
plant arcs into the bin as it's dropped, unless the viewer prefers
reduced motion.

The bin sits under "About this garden", drawn there through a portal so
it stays part of the layout island, and is sticky so it stays in reach
on a long bed. There is no compost icon in the Icons8 set, so it uses
the earth worm.

The bed is now dark soil in a timber frame, with the grid as twine. The
frame is the border, so drops are measured against the soil inside it.

The sidebar is just the crop chips now, without a status line under
each.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Let plants on the garden layout be resized, and make dragging easier

Each plant can be drawn bigger or smaller, since a tomato takes more
room than basil: drag the handle on its edge. plants.diameter holds the
size in grid cells once a plant is resized; until then it follows its
crop's new default_diameter, or the parent crop's, or one cell. There is
no form for crop defaults yet. The next plant taken off a planting's
chip is the size last given to one of its plants, so shrinking one
chive shrinks the next.

Dragging is easier to follow. The browser's own drag picture all but
vanished on the soil, so a ringed circle at the plant's size follows the
pointer instead, centred where it will land. Only a plant's circle picks
it up, not the square around it, which overlapped neighbouring plants
and could pick up the wrong one. Clicking a plant no longer opens its
planting.

A crop chip dropped in the compost bin composts one of that planting's
unplaced plants. Drag state is now cleared on any drop, since a plant
composted from the bed is gone before its own drag end would fire,
which left the bin highlighted.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Point people at the garden layout, and tidy its crop chips

The garden page has a card inviting people to the layout, with a small
bed drawn in the same soil and timber: "Try out the new garden layout
tool" for those who can arrange it, "Open the garden layout" for
everyone else. It isn't shown for inactive gardens, which have nothing
growing to place.

On the gardens list the layout link is now a small "Layout" button
beside "Add planting", rather than a line of text under the owner.

The sidebar's crop chips are all the width of the sidebar, with the icon
inside the chip (the shared chip style pulled it half outside) and the
counts lined up. Plantings are listed by crop name, then date, then id;
by date alone, plantings made the same day came back in no fixed order
and reshuffled whenever a save touched them. A crop in the bed more than
once shows each planting's date, so they can be told apart.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Make a planting's plants when its garden's layout is used, not up front

Most plantings will never go on a layout, so giving every planting a
row per plant, when it was made and by backfilling the existing ones,
filled the plants table for nothing. Now a garden's growing plantings
get their plants the first time someone who can arrange the bed opens
its layout, in one insert; someone only looking makes none. The
backfill migration is gone, so there is nothing to run on deploy.

A planting's quantity only adds or removes plants once it is on a
layout. Zero now means no plants rather than one, so a planting
composted down to nothing isn't given a fresh plant next time the
layout is opened; a blank quantity still counts as one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Bring the garden layout specs up to date

The specs described the layout as it was several versions ago, with
positions and spans on plantings. They now cover plants: where they can
sit, their sizes and the fallback to the parent crop's, the 100-plant
cap, and being made when a layout is first used. The request specs cover
saving an arrangement, dragging off a chip, composting, resizing the
bed, and who may do each. The feature spec drives the page in a browser.

The garden page's layout card and the layout's save route have specs
too.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Tell people about the garden layout at the top of the home page

A card at the top of the home page, with the same small drawn bed as the
garden page's, invites people to the layout. A signed-in member is sent
to the layout of their active garden with the most growing in it, so
there is something to arrange, alphabetically between ones with the
same. A member with no active garden is asked to add one, and anyone
signed out to sign up.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Keep plants wholly on the garden layout's bed

A plant's position is its centre, so a big plant near the edge hung over
the timber frame, and ones along the bottom were cut off. Now a plant
always stays half its width from each edge: when it's dropped, resized,
or the arrangement is saved. Plants already hanging over are drawn
pulled in, and saved that way on the next change. A plant can't be made
wider than the bed, and shrinking the bed counts each plant's edge, not
just its centre.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Make it easier to tell plants apart on the garden layout

Every plant was a circle with its crop's icon, and many crops share an
icon or have none, so a bed could be a field of identical sprouts.

- A plant big enough on screen carries its crop's name beneath it.
- Pointing at a plant, or at a planting's chip in the sidebar, picks out
  all of that planting's plants and fades the rest.
- Plantings drawn with the same icon get a coloured ring, with a
  matching dot on their chip. There are five colours, which are the ones
  that stay distinguishable from each other against the soil for every
  pair, colour blind or not. They go to the plantings that share an icon
  in the order those were made, so a planting keeps its colour. Past
  five in one group, plantings go by their names.

The layout's data now says which icon each planting is drawn with, so
the page can group them.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Put stepping stones, labels and rows on the garden layout

A "Garden features" group in the layout's sidebar has three things to
drag onto the bed besides plants:

- A stepping stone: a grey pebble, moved by dragging.
- A label, such as "path" or "N": asks what it should say, sits over
  the plants like a marker, and is renamed by double-clicking it.
- A row: a furrow two cells long, whose ends can be dragged to set where
  it runs, moved by the handle at its middle, and optionally named.

Any of them goes in the compost bin to be removed. They're kept as a
list on the garden, gardens.layout_features, and saved in the same
request as the plants, so a bad one rolls back the whole save. They're
checked and written directly rather than by saving the garden, which
would geocode it on every drag. A save that doesn't send them leaves
them alone, and the bed can't be shrunk out from under one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Put the garden layout's sidebar on the left, next to the bed

The bed sits at the start of its column, sized to fit the window, so a
tall, narrow bed left the sidebar stranded far off to its right. With the
plantings and garden features on the left, the bed is always right next
to them. On a phone they still stack, with the list under the bed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Call the garden layout's planting button "Add a planting"

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Add sprinklers, taps, stakes, paths, drip lines, fences, trellises and netting

More garden features to put on the layout besides plants:

- Points: an irrigation sprinkler and a tap (their Icons8 icons on a
  white disc ringed in blue), and a stake (the round top of a post).
- Lines, drawn and reshaped like rows: a path (a wide gravel strip), a
  drip line (a thin blue pipe with emitters), a fence (a rail with posts)
  and a trellis (a strip of timber lattice).
- An area: netting, a see-through mesh over the plants it covers,
  between two corners that can be dragged to resize it.

Lines and netting share their handles: the middle to move and name it,
the ends or corners to reshape it. The types are now one table in the
layout, each with a name and a shape (point, label, line or area), and
the sidebar offers them from it. The server knows them by the same
split, checks both points of every line and area, and sends the icons as
one set, feature_icon_urls.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Call the garden layout's "Remove all" button "Clear bed"

It still lifts only the plants back to their chips; the confirmation now
says that stones, lines, netting and the rest stay where they are.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Put garden features in a toolbar above the bed, and keep the sidebar in view

With eleven garden features under the plantings, the sidebar no longer
fit on the screen. The features are now a row of small tiles above the
bed, in groups (ground, water, supports, markers), each named when
pointed at, and the sidebar is just the plantings.

The sidebar also stays in view as a tall bed is scrolled, scrolling
itself if the list of plantings is long. On a phone it still sits under
the bed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Implement bed resizing functionality with drag support

* Style the garden layout bed's edges, so they can be dragged

The bed's right edge, bottom edge and corner had their drag handling but
no styles, so they had no size or position and couldn't be grabbed. Now
they sit over the timber frame, with a pale grip showing while the bed
is pointed at, and a dashed outline shows the size the bed is being
dragged to. The bed's column no longer clips, so that outline can show
past it when the bed is dragged bigger.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Bring two garden layout feature specs up to date

A chip dropped in the middle of the bed lands within a fraction of a
pixel of the middle, not exactly on it. And shrinking the bed past
something on it now says "things", as stones and fences count too, not
"plants".

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* Wait for a garden to be reactivated before checking it

"Mark as active" sends the change in the background, and the spec looked
at the garden straight after clicking, so it failed whenever the request
hadn't finished yet. It now waits for the page to come back first.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: Daniel O'Connor <daniel.oconnor@gmail.com>
2026-09-27 11:43:40 +09:30
Brenda WallaceandClaude Sonnet 5 27f4282f5b Let plantings use a crop's alternate name
A planting can now choose one of its crop's alternate names (eg. "lauki"
for calabash, "aubergine" for eggplant) and shows it instead of the
crop's primary name.

- plantings.alternate_name_id, validated to belong to the planting's crop
- Planting#display_name, used on cards, the planting page, garden lists,
  the member page, the homepage and the RSS/ICS feeds
- planting form offers the crop's alternate names, preselecting the one
  that was searched for
- crop autosuggest shows the matched alternate name, eg.
  "aubergine (eggplant)", via matched_alternate_name in the search JSON

Part of #554

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-21 21:28:46 +12:00
Brenda WallaceandClaude Sonnet 5 9a282e7f02 Show homepage seed cards two across, with smaller list text
Three across in a half-width column left them narrow enough to wrap
mid-word.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-21 20:48:44 +12:00
Brenda WallaceandClaude Sonnet 5 0b7f4176e9 Give the homepage lists their card look back
list-group-item outside a .list-group has no background or border in
Bootstrap 5.3, as those come from variables set on .list-group. Wrap the
homepage lists and the planting page neighbours in one, white with a light
shadow.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-21 20:48:44 +12:00
Daniel O'Connor 9aaf7fcab7 Merge branch 'dev' into chore/bootstrap-5 2026-09-21 17:45:44 +09:30
Daniel O'Connor 17c3491202 Update app/views/home/_stats.html.haml 2026-09-21 12:30:56 +09:30
Brenda WallaceandClaude Opus 5 888b0d1db9 Make memcached opt-in, default to a capped in-process cache
The free Memcachier dev plan is timing out on every call in production
(58 IO::TimeoutError in a 14 minute log window). Each request pays the
0.5s socket timeout and then renders uncached anyway, so the cache is
currently pure overhead on a dyno that is already being OOM-killed.

Memcached is now used only when USE_MEMCACHED=true and MEMCACHIER_SERVERS
is present. Otherwise production uses a memory store capped at 32MB via
RAILS_CACHE_SIZE_MB, so deploying restores real caching without the
timeouts and without an addon upgrade.

The memory store is per process, so homepage_stats gets an expires_in to
bound staleness. It is the only fragment that relies on expire_fragment
rather than a versioned cache key.

Sessions are cookie-based and every other cached value is either keyed by
cache_key_with_version or carries a TTL, so nothing depends on the cache
being shared between processes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-20 21:38:42 +12:00
Brenda WallaceandClaude Sonnet 5 249881291d Keep three even columns on the home page
The planting, harvest and activity columns were .col-xl-4.col. Bootstrap 4 wrapped
the next row after three even columns at every width below the site's xl
breakpoint; Bootstrap 5's .col let the seeds column squeeze onto the same row.
Say what was meant: full width on phones, thirds from md up.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-20 18:15:08 +12:00
Brenda WallaceandClaude Sonnet 5 742599fea6 Rename Bootstrap 3/4 grid, button and form-group classes
col-xs-N -> col-N, col-md-offset-N -> offset-md-N, row-fluid -> row,
btn-block -> w-100, btn-xs -> btn-sm, form-group -> mb-3 (Bootstrap 5 dropped
form-group), and btn-default (Bootstrap 3) -> btn-outline-secondary. The three
helpers that combined btn-default with btn-secondary keep just btn-secondary.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-20 18:01:45 +12:00
Brenda WallaceandClaude Sonnet 5 1ee95263ee Rename Bootstrap 4 badge classes to Bootstrap 5
badge-info/success/... -> text-bg-info/success/..., which set the background
and a readable text colour together, and badge-pill -> rounded-pill. The site's
own badge-late, badge-harvest and similar hooks are unchanged.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-20 18:01:20 +12:00
Brenda WallaceandClaude Sonnet 5 be5ed5fca5 Rename Bootstrap 4 utility classes to their Bootstrap 5 names
text-left/right -> text-start/end, float-left/right -> float-start/end,
ml-/mr-/pl-/pr- -> ms-/me-/ps-/pe-, border-left/right -> border-start/end,
dropdown-menu-left/right -> dropdown-menu-start/end, font-weight-* -> fw-*,
font-italic -> fst-italic and sr-only -> visually-hidden. Bootstrap 5 dropped
text-justify, so the site keeps a one-line rule for it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-20 18:01:00 +12:00
fa7f460510 Refactor Plantings to remove Elasticsearch dependency (#4686)
* Refactor Plantings to remove Elasticsearch dependency

This commit refactors the Plantings controller, model, and views to use
ActiveRecord instead of Searchkick/Elasticsearch.

Key changes:
- Refactored `PlantingsController#index` to use an ActiveRecord-based
  `plantings` method.
- Moved `homepage_records` logic from `SearchPlantings` concern to the
  `Planting` model using ActiveRecord scopes.
- Removed `SearchPlantings` concern and deleted the file.
- Updated `home/_plantings.html.haml` and `plantings/index.rss.haml` to
  use dot notation for `Planting` object attributes.
- Updated specs to remove Searchkick-related setup and assertions.

Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>

* Fix Planting.reindex

* Fix test

* Mark test pending

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-06-24 22:26:49 +09:30
035210197f Prompt for updated planting rating when harvesting (#4608)
* Update planting rating when recording a harvest

- Added virtual attribute `overall_rating` to `Harvest` model.
- Updated `HarvestsController` to permit `overall_rating` and synchronize it to the associated `Planting`.
- Added a rating range field (1-5) to the harvest form.
- Added controller tests to verify that the planting rating is updated.
- Refined feature tests for harvesting.

Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>

* I have updated the system to allow for recording a planting rating when a harvest is logged. Here is a summary of the changes:

- Added a virtual attribute `overall_rating` to the `Harvest` model.
- Updated `HarvestsController` to permit `overall_rating` and synchronize it to the associated `Planting`.
- Added a rating range field (1-5) to the harvest form.
- Added controller tests to verify that the planting rating is updated correctly.
- Updated feature tests to ensure the harvest form functions as expected.

Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>

* Update database.yml

* Apply suggestions from code review

Co-authored-by: Daniel O'Connor <daniel.oconnor@gmail.com>

* Adjust wording

* Change harvest modal

* Fix tests

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-05-03 14:47:00 +09:30
Daniel O'Connor 55934bcc4a Add conditional rendering for harvest thumbnail image 2026-04-11 14:57:36 +09:30
google-labs-jules[bot] 7457edf559 Merge pull request #4380 from Growstuff/community-garden-landing-page
feat: Add community garden landing page
2025-12-03 18:20:40 +10:30
google-labs-jules[bot] 2742dba7fa feat: Add meta descriptions to pages
Adds a meta description tag to the landing, crops, plantings, harvests, seeds, and comments pages.

Also creates a new index page for comments.
2025-12-01 13:54:54 +00:00