From 91d2884ec0f78ccd831adaed841c23a91df525c8 Mon Sep 17 00:00:00 2001 From: Petru Paler Date: Thu, 1 Jan 2026 13:52:45 +0000 Subject: [PATCH] feat: add notes field to 7 forms missing it MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added optional notes field to forms that support it in their payloads but were missing the UI input: - cohort_form (Create Animal Cohort) - hatch_form (Record Hatch) - promote_form (Promote Animal) - tag_add_form (Add Tag) - tag_end_form (End Tag) - attrs_form (Update Attributes) - move_form (Move Animals) Uses consistent LabelTextArea pattern matching existing forms like outcome_form and status_correct_form. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- src/animaltrack/web/templates/actions.py | 42 ++++++++++++++++++++++++ src/animaltrack/web/templates/move.py | 9 ++++- 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/src/animaltrack/web/templates/actions.py b/src/animaltrack/web/templates/actions.py index 5cac000..3c62207 100644 --- a/src/animaltrack/web/templates/actions.py +++ b/src/animaltrack/web/templates/actions.py @@ -268,6 +268,13 @@ def cohort_form( id="origin", name="origin", ), + # Optional notes + LabelTextArea( + "Notes", + id="notes", + name="notes", + placeholder="Optional notes", + ), # Event datetime picker (for backdating) event_datetime_field("cohort_datetime", datetime_value, datetime_ts), # Hidden nonce for idempotency @@ -386,6 +393,13 @@ def hatch_form( cls="text-xs text-stone-400 mt-1", ), ), + # Optional notes + LabelTextArea( + "Notes", + id="notes", + name="notes", + placeholder="Optional notes", + ), # Event datetime picker (for backdating) event_datetime_field("hatch_datetime"), # Hidden nonce for idempotency @@ -498,6 +512,13 @@ def promote_form( value=traits_value, placeholder="Color markings, size, personality...", ), + # Optional notes + LabelTextArea( + "Notes", + id="notes", + name="notes", + placeholder="Optional notes", + ), # Hidden fields Hidden(name="animal_id", value=animal.animal_id), Hidden(name="nonce", value=str(ULID())), @@ -589,6 +610,13 @@ def tag_add_form( name="tag", placeholder="Enter tag name", ), + # Optional notes + LabelTextArea( + "Notes", + id="notes", + name="notes", + placeholder="Optional notes", + ), # Event datetime picker (for backdating) event_datetime_field("tag_add_datetime"), # Hidden fields for selection context @@ -778,6 +806,13 @@ def tag_end_form( P("No active tags on selected animals", cls="text-sm text-stone-400"), cls="p-3 bg-slate-800 rounded-md", ), + # Optional notes + LabelTextArea( + "Notes", + id="notes", + name="notes", + placeholder="Optional notes", + ), # Event datetime picker (for backdating) event_datetime_field("tag_end_datetime"), # Hidden fields for selection context @@ -991,6 +1026,13 @@ def attrs_form( id="repro_status", name="repro_status", ), + # Optional notes + LabelTextArea( + "Notes", + id="notes", + name="notes", + placeholder="Optional notes", + ), # Event datetime picker (for backdating) event_datetime_field("attrs_datetime"), # Hidden fields for selection context diff --git a/src/animaltrack/web/templates/move.py b/src/animaltrack/web/templates/move.py index d304ed5..6aa2512 100644 --- a/src/animaltrack/web/templates/move.py +++ b/src/animaltrack/web/templates/move.py @@ -5,7 +5,7 @@ from collections.abc import Callable from typing import Any from fasthtml.common import H2, Div, Form, Hidden, Option, P, Span -from monsterui.all import Alert, AlertT, Button, ButtonT, LabelInput, LabelSelect +from monsterui.all import Alert, AlertT, Button, ButtonT, LabelInput, LabelSelect, LabelTextArea from ulid import ULID from animaltrack.models.reference import Location @@ -103,6 +103,13 @@ def move_form( id="to_location_id", name="to_location_id", ), + # Optional notes + LabelTextArea( + "Notes", + id="notes", + name="notes", + placeholder="Optional notes", + ), # Event datetime picker (for backdating) event_datetime_field("move_datetime"), # Hidden fields for selection context