Skip to content

Show growing degree days on a planting, and tidy the planting fact cards - #5524

Merged
CloCkWeRX merged 25 commits into
mainfrom
planting-growing-degree-days
Nov 15, 2026
Merged

CloCkWeRX merged 25 commits into
mainfrom
planting-growing-degree-days

Conversation

@Br3nda

@Br3nda Br3nda commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

What

A new fact card on the planting page shows the growing degree days a planting has had, out of how many the crop needs.

  • Reads "412 of about 850 needed", or "412 so far" when we don't know what the crop needs.
  • Annuals only. Perennials don't get the card.
  • No card when there is no weather for the planting's days (no garden location, no temperatures collected, or not planted yet), so missing data never reads as "0".
  • A question-mark popover explains that these are not calendar days. The same popover is now on the short code card.
image image image

https://en.wikipedia.org/wiki/Growing_degree-day

Also in here

  • Progress is a ring, in the same colours as the old bar.
  • "Grown in" has a larger icon, plainer wording, a solid sun and a tree for shade. When it isn't set, the owner sees the same orange prompt as "Grown from".
  • The rating stars stay on one row, so the fact cards line up.
  • The first section in a record page column no longer has the global section top margin, so the sidebar starts level with the main panel. This affects every record page that uses the shared layout.

Notes

  • The heat so far is the simple (high + low) / 2 minus the base, with no upper cap. The base is EcoCrop's lowest growing temperature, or 10 °C.
  • Days with partial weather coverage still add up to a low total. Nothing flags that yet.
  • Specs added for the calculation, the card, the help popovers, the ring and the "Grown in" states. I couldn't run the browser feature specs locally (Chrome won't start here).

Assisted by Claude

- Implement `heat_so_far` and `heat_needed` methods in the PredictHarvest module to calculate the heat accumulated and required for crops.
- Enhance the GrowingDegreeDays service with a `total` method to sum heat readings.
- Add corresponding tests for the new methods in planting and growing degree days specs.
Reads "412 of about 850 needed", or "412 so far" when the crop's need
isn't known. A question-mark popover says they are not calendar days.
Fills clockwise with the percentage in the middle, in the same colours
as the progress bar. It stops at full for a planting that has run late.
Says to write the code on your plant label to find that exact plant
later. The question-mark button is now a shared partial, which the
growing degree days card uses too.
The icon is larger, with amber for full sun. It uses a solid sun, and a
tree for shade, and the words under it say "full sun" or "partial shade".
A planting with no temperature readings for its days showed "0 of about
N needed", which read as a cold season. It now shows no card.
- Update planting and crop chip components to display variety in brackets.
- Enhance planting serializer to include variety information.
- Modify views to show variety details when available.
- Add tests for variety functionality in planting model and serializers.
- Removed the planting_event_icon helper method as it was no longer needed.
- Updated CropChip component to accept a label prop for better flexibility in displaying crop names.
- Modified PlantingChip component to use the new label prop instead of variety.
- Adjusted GardenCard and GardenCards tests to reflect changes in planting structure.
- Enhanced PlantingTimeline to utilize markers for event rendering, allowing for more dynamic label positioning.
- Updated Planting model to provide a with_variety method for consistent naming.
- Refactored serializers to include the new label structure for planting chips.
- Improved tests for planting timeline and chips to ensure correct rendering and data handling.
- Updated views to align with new timeline and planting structures, ensuring proper display of events and seasons.
@Br3nda

Br3nda commented Nov 14, 2026

Copy link
Copy Markdown
Member Author

Two translation fixes coming in the next push to this PR

The shared season names (seasons.spring) had the wrong word for spring in two languages:

  • German: "Feder" → "Frühling"
  • French: "Ressort" → "Printemps"

"Feder" and "Ressort" both mean a mechanical spring, not the season. They look like a machine translation of the English word "spring" without context. The seed packet translations in the same files (seeds.ui.seasons.spring) already use "Frühling" and "Printemps".

This PR also makes two more places use the shared season names (the garden page header and the dashboard's season line), so the wrong words would have shown there too.

No other translations were changed. A German or French speaker is welcome to check.

The season tints live in one table, used by the weather charts, the
timeline and the suggestions page, and the icons in one map. The garden
header and the dashboard's season line now use the shared translations.
Fixes spring in German ("Feder") and French ("Ressort"), which were the
words for a mechanical spring.
- Added hardiness_found method to Crop and Planting models to determine frost tolerance based on crop lineage.
- Updated nursery_seedlings method to include alternate_name in the query.
- Improved styling for fact cards in the gardens page and added edit link functionality.
- Enhanced serializers to include alternate names and updated expected finish events in planting timelines.
- Added localization support for growth degree days and planting events in multiple languages.
- Updated tests to reflect changes in planting behavior and ensure accurate display of planting information.
@Br3nda
Br3nda enabled auto-merge November 14, 2026 20:51
@Br3nda
Br3nda added this pull request to the merge queue Nov 15, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 15, 2026
@CloCkWeRX
CloCkWeRX merged commit 50cb38c into main Nov 15, 2026
16 checks passed
@CloCkWeRX
CloCkWeRX deleted the planting-growing-degree-days branch November 15, 2026 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants