From 443ddcca681e0823b84b4f5380ea3a1f6568bcd9 Mon Sep 17 00:00:00 2001 From: Bendik Aagaard Lynghaug Date: Thu, 24 Sep 2026 21:35:45 +0200 Subject: [PATCH] A plan may ask for a place `type: location` on a field is portal 0.4.0's map pin, stored as lat/lon/zoom. The reference tells the model it needs `optional: true`, since a map needs a browser that can draw one. Co-Authored-By: Claude Opus 5 (1M context) --- src/build.rs | 2 +- src/plan.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/build.rs b/src/build.rs index a13dbb7..4588793 100644 --- a/src/build.rs +++ b/src/build.rs @@ -288,7 +288,7 @@ fn text() -> String { "text".to_string() } -const FIELD_TYPES: &[&str] = &["text", "email", "tel", "textarea", "date", "select"]; +const FIELD_TYPES: &[&str] = &["text", "email", "tel", "textarea", "date", "select", "location"]; fn is_id(s: &str) -> bool { !s.is_empty() && s.chars().all(|c| c.is_ascii_lowercase() || c.is_ascii_digit() || c == '_' || c == '-') diff --git a/src/plan.rs b/src/plan.rs index 6f5875b..073a441 100644 --- a/src/plan.rs +++ b/src/plan.rs @@ -102,7 +102,9 @@ needs: # the intake says about them: someone on a phone with gloves # on gets 3, a first enquiry 4 to 6, a firm's paperwork 5 to 6 collects: # the form; name is snake_case ASCII, type one of - # text (default), email, tel, textarea, date, select + # text (default), email, tel, textarea, date, select, location + # (a pin on a map, stored as lat/lon/zoom; optional: true, + # since a map needs a browser that can draw one) - { name: name } - { name: phone, type: tel } - { name: problem, type: textarea }