Commit graph

63 commits

Author SHA1 Message Date
ba69a1b74a feat: show 6 most recently added plants on dashboard with images
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 14:37:55 +02:00
b5cdda54f8 feat: location filter, mobile overflow fixes, card scan icon
- Replace indoor/outdoor filter with dynamic location buttons
- Fix pruning strip date/badge overflow on narrow screens (flex-shrink-0, gap-2, text-nowrap, flex-wrap)
- Fix pruning calendar badges compressing on long plant names
- Re-add pruning strip to plant detail (was missing)
- Change card scan nav icon from 📷 to 🪪

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 13:11:22 +02:00
92b682a1bd feat: show Pl@ntNet reference images on confirm screen + save as thumbnail
Extract image_url from Pl@ntNet API response (medium size). Show thumbnail
in each match card on identify_confirm. On plant creation, download the
selected match's reference image and save as PlantPhoto thumbnail. Scan
photos saved as gallery photos (non-thumbnail) with fallback to first scan
photo as thumbnail when Pl@ntNet has no image.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 12:51:28 +02:00
99fd95ee80 chore: rename PlantDB to BloomBase
Rename Django project module plantdb/ → bloombase/, update all
references in manage.py, docker-compose.yml, wsgi/asgi/settings.
Replace PlantDB with BloomBase in all template titles and navbar.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-31 12:36:20 +02:00
d1e588bbc3 feat: save identify photos as plant thumbnails after wizard completes
Temp images uploaded during Pl@ntNet identification are now copied to
PlantPhoto records when the plant is created in step 3. First image is
auto-set as thumbnail. Temp files still deleted after transfer.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 22:03:33 +02:00
bee9fe0cd8 fix: catch all exceptions in identify_upload, log unexpected errors 2026-05-30 21:59:37 +02:00
6e2f477c09 fix: restore hero OOB swap after gallery innerHTML fix 2026-05-30 21:46:02 +02:00
1a9aa24ebf fix: use hx-swap=innerHTML so #photo-gallery id survives HTMX swaps 2026-05-30 21:36:54 +02:00
be9d6caf94 fix: re-fetch plant after photo upload so gallery and hero see new photo 2026-05-30 21:33:22 +02:00
cbd4ba09aa fix: revert auto-submit — keep visible file input, remove capture only 2026-05-30 21:30:44 +02:00
0f53adc6a8 fix: photo upload UX — remove camera capture, auto-submit on pick, update hero via HTMX OOB 2026-05-30 21:21:04 +02:00
fdbe821c8a feat: add frost_hardiness_c and planting_density_m2 to Species model 2026-05-30 21:04:25 +02:00
c75757a70c fix: guard against malformed API response and empty matches list 2026-05-30 21:01:47 +02:00
f308d006e4 feat: update nav, remove Perenual UI, fix delete button alignment
- Nav '+' button now links to identify_upload instead of plant_add
- Remove Perenual toggle, results section, and 'Also search Perenual'
  link from species_results partial
- Wrap Plant card / Crop thumbnail / Delete plant buttons in flex
  container for consistent mobile alignment
- Fix pre-existing test assertion to match actual crop-thumbnail URL

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 20:55:32 +02:00
e93809ccbf fix: match spec wording for no-VPC banner 2026-05-30 17:49:56 +02:00
adea702a77 feat: implement step 3 field picker view and template
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 17:48:53 +02:00
62fdbf7029 fix: show selected species name in confirm button 2026-05-30 17:46:27 +02:00
b16df6caa4 feat: implement step 2 species confirm view and template
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 17:45:35 +02:00
c10c4ebc2f feat: implement identify views and upload template
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 17:41:10 +02:00
ae919a3fce feat: wire identify URL routes and stub views 2026-05-30 17:37:46 +02:00
a2da8e6457 fix: correct misleading test name in test_plantnet 2026-05-30 17:36:47 +02:00
b884852f05 feat: add Pl@ntNet identification service
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-30 17:34:48 +02:00
ba0ca6b169 feat: card scanning, OCR improvements, crop thumbnail, VPC enrichment
- Add scan-to-plant flow: upload card photos, OCR, VPC match on confirm form
- OpenCV CLAHE + adaptive threshold preprocessing; dual psm 6/11 OCR pass
- Regex fixes for OCR misreads: height (s→5), frost (=,„,i,l,G), density, bloom months (E→I)
- Scientific name extraction: passport section + cultivar quote strategy
- Last-wins merge so back card data overrides front card garbage
- Crop thumbnail tool with Cropper.js; cropped image shown in list and detail
- VPC image always supersedes user thumbnail on detail page
- VPC sunlight mapping: zon→full_sun, halfschaduw→part_sun, schaduw→full_shade
- Auto-set thumbnail on plant created from scan

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 21:54:59 +02:00
fad4642075 feat: add per-plant watering and sunlight overrides with icon chips
Plant-level watering/sunlight fields override the species defaults.
Rendered as btn-check radio buttons in the edit form; detail page
shows the plant value (with emoji) falling back to species data.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 11:54:10 +02:00
66d26f5df7 fix: use .all instead of .exists() to respect prefetch cache in plant_detail 2026-05-28 22:00:18 +02:00
dff1c88748 feat: show plant card button on detail page when card photos exist
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 21:59:04 +02:00
52acd9e1f1 style: use prefetched queryset length in card_gallery template 2026-05-28 21:57:57 +02:00
39de3983f1 feat: add card gallery partial and plant card page templates 2026-05-28 21:56:09 +02:00
9edad5a715 feat: add delete_card_photo view and URL 2026-05-28 21:54:37 +02:00
cb5dd3dc84 style: move PlantCardPhoto import to module level in test_views 2026-05-28 21:53:38 +02:00
5e91983783 feat: add upload_card_photo view and URL
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 21:52:06 +02:00
a97bb77f32 style: add @require_GET to plant_card view 2026-05-28 21:49:42 +02:00
10a76238aa feat: add plant_card view and URL 2026-05-28 21:46:25 +02:00
3b8ebd6454 style: move PlantCardPhoto import to module level in test_models 2026-05-28 21:42:49 +02:00
4132406f15 feat: add PlantCardPhoto model
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 21:38:15 +02:00
f594105311 feat: import VPC plant by pasting URL directly in search
slug_from_query() detects VPC URLs and bare slugs (must contain a hyphen
to avoid treating single search words as slugs). When matched, the search
bypasses the keyword search and shows the plant directly as a VPC result.
Updated search hint text to make this discoverable.

Fixes: VPC search by English name (e.g. "crowfoot") is a VPC limitation —
their search only indexes Latin titles, not custom fields like Engelse naam.
The URL paste workflow is the reliable workaround.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 20:20:06 +02:00
a48ee9e73d fix: VPC image scraping and show species name on plant edit
- vpc.py: target .wp-caption img for hero image (VPC uses Elementor, not
  standard WooCommerce gallery); skip logo and placeholder images by URL pattern
- plant_edit view: pass plant.species as 'species' so the species info
  banner (including scientific name) appears on the edit form

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 18:55:16 +02:00
7fef359ae0 feat: store VPC raw scrape data and add reset button
Species.vpc_raw (JSONField) stores the full scrape payload at import time.
vpc_species_reset view restores bloom_months, sunlight, max_height_cm etc.
from that snapshot. If vpc_raw is missing (species imported before this
feature), it re-scrapes from VPC on demand and saves the result.
Reset button appears on plant detail page for any plant with a VPC species.
A 'next' hidden field returns the user to the same plant after reset.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 18:49:15 +02:00
a57415983b feat: VPC species search alongside Perenual
- New plants/services/vpc.py: search VPC (vasteplantencatalogus.nl) by
  keyword and scrape full plant detail on select
- Both searches run in parallel via ThreadPoolExecutor
- species_results partial shows results from both sources with colour-coded
  source badges (green = Perenual, blue = VPC)
- vpc_select view scrapes the detail page on select, creates Species with
  bloom_months, max_height_cm, sunlight from the VPC page
- Species.vpc_slug field (migration 0005) prevents re-importing the same plant
- beautifulsoup4 added to requirements
- Handles VPC unavailability gracefully (empty results, no error shown to user)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 18:44:06 +02:00
b88ba03884 feat: location FK, multi-photo gallery, hide pruning history
- Location model: plants now FK to Location instead of free-text CharField
- Data migration 0004 converts existing location strings to Location objects
- PlantForm uses ModelChoiceField dropdown + inline "add new location" text field
- PlantPhoto model: multiple photos per plant with is_thumbnail flag
- Plant.thumbnail_url property: picks marked thumbnail, falls back to first photo then legacy photo field
- Photo gallery partial: upload, set thumbnail (★), delete (✕) with HTMX swaps on #photo-gallery
- plant_detail: uses thumbnail_url for hero image, pruning history section removed
- plant_list search updated: location__name__icontains instead of location__icontains
- Three new URL routes: upload_photo, set_thumbnail, delete_photo
- All 53 tests updated and passing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 18:27:45 +02:00
a60c99ed93 feat: replace pruning UI with bloom months
- Add bloom_months to Plant and Species models (migration 0003)
- Swap pruning_months form field for bloom_months throughout
- Plant detail shows green bloom strip instead of pruning strip
- Dashboard shows 'Blooming now' count and list instead of overdue pruning
- Remove ✂️ pruning calendar from nav (feature hidden, backend intact)
- Update dashboard tests to reflect new context

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 17:03:25 +02:00
eb28f7453b fix: clear overdue when pruned after the scheduled month
Previously only a log in the exact scheduled month cleared overdue.
Now any log on or after the start of the scheduled month counts,
so pruning late (e.g. in May for a March schedule) correctly shows upcoming.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 16:43:15 +02:00
36e4570141 feat: month strip display, fix dashboard counter, styled month form
- Add month_strip template tag rendering JFMAMJJASOND circles,
  active months dark green, inactive light grey
- Replace raw number list in pruning_strip with visual month strip
- Restyle pruning month checkboxes as clickable circles in plant form
- Fix dashboard 'Need pruning' counter (broken filter chain always showed 0)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 15:05:13 +02:00
351d1e5523 feat: add loading spinner to species search button
Shows Bootstrap spinner via htmx-indicator during the Perenual API
call, and disables the button to prevent double-submits.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 11:24:20 +02:00
40e3419160 fix: surface Perenual API errors instead of silently returning no results
Timeout and rate-limit failures now show a warning message to the user.
Timeout increased to 10s.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 10:37:30 +02:00
d8d7899a26 fix: ensure CSRF cookie is set on plant_add page load
species_search.html has no form/csrf_token tag, so the cookie was
never set before the species select form was submitted.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 10:32:51 +02:00
34f6c3652e fix: trigger species search on button click, not on input change
Avoids burning Perenual API quota on every keystroke.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 10:23:45 +02:00
370a02e00e feat: pruning calendar grouped by urgency
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 10:06:55 +02:00
eb4dd82b88 feat: plant edit and delete with confirmation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 10:06:03 +02:00
3bc27a345f feat: add plant form with species pre-fill
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 10:05:18 +02:00