Skip to content

Improving usability of the plantings editor - #4816

Merged
Br3nda merged 51 commits into
devfrom
feat/planting-editor
Sep 22, 2026
Merged

Br3nda merged 51 commits into
devfrom
feat/planting-editor

Conversation

@Br3nda

@Br3nda Br3nda commented Sep 20, 2026 •

Copy link
Copy Markdown
Member

Allowing quicker editing of annual planting data, when entering your spring garden data.

(I'll do perennials in the next PR)

edit planting date in place
image

edit planting in modal form without leaving the page
image

quicker recording of harvests without leaving the page
image

adding photos
image

image image

Also in this PR

The crop chip is the planting's menu, for annuals and perennials, in place of the three dots. Click it for view, edit, add photo, record harvest, save seeds and, last below a divider, mark as finished. A caret on the chip shows it opens something. Someone who can't change the planting still gets a plain link. Items are lowercase.

Dialogs over the list, each saving without leaving the page, in one style (steps, no cancel button, close to cancel):

  • Record harvest, four steps: which part (a text box that completes plant parts, with the cursor in it), how much, when (today, yesterday or a date), then notes. The planting that got the harvest is marked for a few seconds.
  • Save seeds, three steps: about how many, whether to offer them for trade, and notes.
  • Add photo: choose one of your Flickr photos (by album or tag), confirm, add. If Flickr isn't 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.
  • Mark as finished: when did it finish, today unless you enter a date.
  • Edit garden, from the garden card's own menu. A garden saved as inactive leaves the list, with a note saying where it went.

Harvest ticks on the progress bar: each harvest is a small tick at its date, on the bar's own scale (tooltip with the date, and a hidden sentence for screen readers). Plantings with no bar show no ticks.

Add planting button in each garden card's header, in place of the "Plant something here" menu item.

Inactive gardens page (/members/:slug/gardens/inactive), replacing the "include in-active" tickbox on the gardens list: a gallery of photo cards (years in use, planting count, crops grown), and the owner can mark a garden active again from its card.

Layout tidy: the breadcrumb lines up with the page content, sidebar text lines up with the text in the member card, and the sidebar nav links look like links (the current page is bold).

Notes for review

  • The React garden cards use some same-origin JSON endpoints (session cookie and CSRF token, not part of the public API). Each returns the garden's refreshed card, or validation errors as 422, so the list updates in place:
    • PATCH /plantings/:slug.json and GET /plantings/:slug/edit.json
    • GET /plantings/:slug/harvests/new.json and POST /harvests.json
    • GET /plantings/:slug/seeds/new.json and POST /seeds.json (returns a link to the seed, not a card)
    • GET /photos/new.json and POST /photos.json
    • GET /gardens/:slug/edit.json and PATCH /gardens/:slug.json
  • GET /authentications/connected is the small page the Flickr connect pop-up ends on. It says whether Flickr got connected and closes itself.
  • Menu items that carry a data-method (mark as finished) were still sent as a request by jquery_ujs after a dialog had taken the click over. The shared menu component now stops a click a dialog handles, and closes the menu.
  • Flickr is stubbed in the specs. To try the add photo dialog for real you need GROWSTUFF_FLICKR_KEY and GROWSTUFF_FLICKR_SECRET in .env.
  • New specs: request specs for each JSON endpoint above, spec/features/gardens/ specs for the record harvest, save seeds, add photo, mark as finished and edit garden dialogs and the inactive gardens page, and additions to the garden card serializer spec.

🤖 Generated with Claude Code

Br3nda and others added 28 commits September 21, 2026 08:07
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 <[email protected]>
Matches the planting rows, and gives the button an aria-label naming
the garden.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Co-Authored-By: Claude Sonnet 5 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
/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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Link colour and underline, with the page you are on in bold and marked
aria-current.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Co-Authored-By: Claude Sonnet 5 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
@Br3nda
Br3nda requested a review from CloCkWeRX September 20, 2026 21:03
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 <[email protected]>
Br3nda and others added 13 commits September 21, 2026 15:34
/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 <[email protected]>
… 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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
An owner's planting chip is a menu now, with a View link to the planting.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Brings in the fixes from review of the Bootstrap 5 PR: the photo edit
page's save button, grey finished progress bars, and the generic modal's
close button order.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@CloCkWeRX
CloCkWeRX added this pull request to stack #4821 September 21, 2026 08:08
@CloCkWeRX
CloCkWeRX removed this pull request from stack #4821 September 21, 2026 08:15
Base automatically changed from chore/bootstrap-5 to dev September 21, 2026 09:01
@Br3nda

Br3nda commented Sep 21, 2026

Copy link
Copy Markdown
Member Author

@CloCkWeRX i moved somethings around since the screen shots, and rather than explain them, i'd like to see if you can find how to do things or if the UI is confusing now

so, from your personal plantings list try to:

  • edit the garden name
  • add a planting
  • edit the planted date
  • add a harvest
  • save seeds
  • add a photo (need flickr api)
  • finish the planting

@CloCkWeRX

Copy link
Copy Markdown
Collaborator

Ah, too fast :)
I will, just... sitting down for food

@CloCkWeRX

Copy link
Copy Markdown
Collaborator

Profile > Gardens list, I was a bit confused by lack of plant something here option:
image

Prod does have it as a quick modal:
image

(Maybe not actually a change in this PR)

@Br3nda

Br3nda commented Sep 21, 2026

Copy link
Copy Markdown
Member Author

@CloCkWeRX can you run yarn build. I think you don't have the latest js running

@Br3nda

Br3nda commented Sep 21, 2026

Copy link
Copy Markdown
Member Author

@CloCkWeRX also a shift-refresh to be sure your browser hasn't catched the css

@Br3nda

Br3nda commented Sep 21, 2026

Copy link
Copy Markdown
Member Author

should look like this
image

@CloCkWeRX

Copy link
Copy Markdown
Collaborator

Will give it a go in the morning.
I do recall initially having the same issue with thousand_island as was in CI before, but it went away after an assets precompile. Was running via bin/Dev.

@Br3nda

Br3nda commented Sep 22, 2026

Copy link
Copy Markdown
Member Author

@CloCkWeRX good to merge now?

@Br3nda
Br3nda merged commit a7fd476 into dev Sep 22, 2026
16 of 17 checks passed
@Br3nda
Br3nda deleted the feat/planting-editor branch September 22, 2026 05:42
@CloCkWeRX

Copy link
Copy Markdown
Collaborator

Go for it. Even if its wrong, I'll test it mroe realistically in the middle of gardening.

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