···11+# Plan: Bean "More Details" Expandable Section
22+33+## Context
44+The bean creation modal is already fairly large. Power users want fields like producer (farm/estate) and elevation, but adding them visibly would overwhelm casual users. Solution: move variety + new fields into a collapsible "More Details" section that auto-expands on edit when populated.
55+66+## Phase 1: Data Layer
77+88+**`lexicons/social.arabica.alpha.bean.json`** — Add `producer` (string, maxLength 200) and `elevation` (string, maxLength 100) as optional properties.
99+1010+**`internal/models/models.go`** — Follow Variety/Process pattern exactly:
1111+- Add `MaxProducerLength = 200`, `MaxElevationLength = 100` constants
1212+- Add `Producer`, `Elevation` string fields to `Bean`, `CreateBeanRequest`, `UpdateBeanRequest`
1313+- Add length validation in both `Validate()` methods
1414+1515+**`internal/atproto/records.go`** — Add producer/elevation to `BeanToRecord()` and `RecordToBean()` using same `if != ""` / type-assertion pattern as variety/process.
1616+1717+## Phase 2: Handlers
1818+1919+**`internal/handlers/entities.go`** — Add `Producer: r.FormValue("producer")` and `Elevation: r.FormValue("elevation")` to both `HandleBeanCreate` and `HandleBeanUpdate` form decoders.
2020+2121+## Phase 3: Modal UI (main change)
2222+2323+**`internal/web/components/dialog_modals.templ`**:
2424+1. **Remove** the variety input from the "Origin Details" fieldset (keep roaster, roast level, process there)
2525+2. **Add** a new expandable section between "Origin Details" and "Notes & Rating":
2626+ - Go helper `beanMoreDetailsInit(bean)` returns `{ showMore: true }` or `{ showMore: false }` based on whether variety/producer/elevation have values
2727+ - When collapsed: shows `+ More details (variety, producer, elevation)` as a quiet text link
2828+ - When expanded: shows a fieldset with variety, producer, elevation inputs
2929+ - Alpine.js `x-show` keeps inputs in DOM even when hidden (fields submit as empty strings = correct behavior)
3030+3. **Add** `"producer"` and `"elevation"` cases to `getStringValue()` helper
3131+3232+## Phase 4: Display Views
3333+3434+**`internal/web/pages/bean_view.templ`**:
3535+- Add `DetailField` entries for Producer and Elevation in the detail grid
3636+- Add `producer` and `elevation` to `beanBaseJSON()` for edit round-tripping
3737+- Pick appropriate icons (check existing icon set, add IconMountain if needed)
3838+3939+**`internal/ogcard/entities.go`**:
4040+- Optionally append producer to the details line in `DrawBeanCard` (elevation too niche for OG cards)
4141+4242+**Skip adding to BeanSummary and BeanCard** — these are detail-level fields; the card/summary already shows origin/variety/roast/process and would get cluttered.
4343+4444+## Phase 5: Verify
4545+4646+```bash
4747+templ generate
4848+go vet ./...
4949+go build ./...
5050+```
5151+5252+Manual checks:
5353+- Create bean without expanding More Details — variety/producer/elevation should save as empty
5454+- Create bean with all three fields — should persist and display on view page
5555+- Edit a bean with populated fields — More Details section should auto-expand
5656+5757+## Files Modified
5858+- `lexicons/social.arabica.alpha.bean.json`
5959+- `internal/models/models.go`
6060+- `internal/atproto/records.go`
6161+- `internal/handlers/entities.go`
6262+- `internal/web/components/dialog_modals.templ` (main UI change)
6363+- `internal/web/pages/bean_view.templ`
6464+- `internal/ogcard/entities.go`