From c16b7394331aa6d504e6286d01348416b492cf6b Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 8 Aug 2026 07:55:17 +0000 Subject: [PATCH 1/4] feat(web): offer common date/time format presets, with a custom fallback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #452. The Date format / Time format fields on Farm settings were plain free-text inputs accepting any string up to 32 chars — server-side validation (BeAUsableFormat) only rejects a string that literally throws as a .NET custom format, so something like "asdf" saved successfully and rendered as a garbled date everywhere, rather than being caught at entry. Replaces the free-text field with a dropdown of common presets (MM/dd/yyyy, dd/MM/yyyy, yyyy-MM-dd for date; h:mm tt, HH:mm for time) plus a "Custom…" option that reveals the original free-text field for anything not listed — so most people never need to know format-pattern syntax, while the escape hatch (and the server's own validation of it) stays available. No backend change: this is purely about how most users arrive at a value, not what's accepted. A stored value that isn't blank and doesn't match a preset opens the dropdown directly on "Custom…" with the real value already in the revealed field, rather than silently falling back to "Follow the locale" and discarding it on the next save — handled via a separate *Custom boolean per field rather than deriving it purely from the value, since picking "Custom…" from an empty/follow-locale start doesn't change the value at all, so a purely-derived flag would immediately collapse back to "Follow the locale" and the field would never appear. Rewrote one existing test that fired a raw DOM `change` event with a whitespace value directly on what's now a setDateFormat(e.target.value)} /> + + {dateFormatCustom && ( + + )} + {timeFormatCustom && ( + + )}
{/* Disabled while a logo write is in flight too (`busy` covers every From d50040d1add26b638fb28af8e745cda6135fd648 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 8 Aug 2026 08:01:42 +0000 Subject: [PATCH 2/4] docs(web): explain the date/time format preset dropdown in Help + glossary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit codex review of PR #463: farmSettingsIntro and glossaryFarmSettingsDef already said date/time formats are optional (still true, so not wrong), but neither explained the new preset-dropdown + Custom workflow this PR introduced — a user-visible behavior change with no way to discover it from the Help page. Adds a dedicated Help bullet (farmSettingsDateTimeFormat, matching the existing per-topic pattern — farmSettingsTimezone/Currency/Logo/ CountingUnit each get their own
  • ) and extends the Farm settings glossary definition with the one clause. es/tl machine-drafted, matching every other string in these catalogs pending the native-speaker review tracked in #182 (Phase 1.5). --- web/src/i18n/en.ts | 12 ++++++++++-- web/src/i18n/es.ts | 9 ++++++++- web/src/i18n/tl.ts | 9 ++++++++- web/src/routes/HelpPage.tsx | 4 ++++ 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/web/src/i18n/en.ts b/web/src/i18n/en.ts index c6e8636d6..a0d2dd13f 100644 --- a/web/src/i18n/en.ts +++ b/web/src/i18n/en.ts @@ -2427,6 +2427,13 @@ export const en = { + "Animated images are refused rather than flattened. What gets stored is a rebuilt copy: camera and " + "location details are stripped out on the way in — a photo taken on a phone carries where it was " + "taken, and for a farm that is its address. Remove it and the sidebar goes back to the Cluckwork mark.", + // #452 — the preset dropdown + Custom escape hatch for date/time format + // overrides, replacing what used to be a bare free-text field. + farmSettingsDateTimeFormat: + "Date format and time format offer a few common choices in a " + + "dropdown — pick one and you are done. Need something not listed? Choose " + + "Custom… to type your own; the same rules the presets follow still apply " + + "(the server checks it either way), so an unusable value is refused rather than saved.", farmSettingsSquareLogo: "Use a square logo. It shows small in the sidebar, so a simple, tightly-cropped mark " + "— a symbol or a single letter — reads much better there than a wide wordmark or a detailed picture, " @@ -2740,8 +2747,9 @@ export const en = { glossaryFarmSettingsTerm: "Farm settings", glossaryFarmSettingsDef: "The farm's name, timezone, locale, currency and unit system, plus optional first day of week and " - + "date/time formats. Setup → Farm settings; owners and managers edit, everyone reads — formatting " - + "money and dates is not a permission.", + + "date/time formats — picked from a preset dropdown, or typed as a custom .NET format string. " + + "Setup → Farm settings; owners and managers edit, everyone reads — formatting money and dates is " + + "not a permission.", glossaryCurrencyLockTerm: "Currency lock", glossaryCurrencyLockDef: diff --git a/web/src/i18n/es.ts b/web/src/i18n/es.ts index a3565b6c3..71152dcdf 100644 --- a/web/src/i18n/es.ts +++ b/web/src/i18n/es.ts @@ -2042,6 +2042,12 @@ export const es = { + "es una copia reconstruida: los detalles de cámara y ubicación se eliminan al ingresar — una foto " + "tomada en un teléfono lleva dónde se tomó, y para una granja eso es su dirección. Elimínelo y la " + "barra lateral vuelve a la marca de Cluckwork.", + farmSettingsDateTimeFormat: + "Formato de fecha y formato de hora ofrecen algunas opciones " + + "comunes en un menú desplegable — elija una y listo. ¿Necesita algo que no está en la lista? " + + "Elija Personalizado… para escribir el suyo; las mismas reglas que siguen las " + + "opciones predefinidas siguen aplicando (el servidor lo verifica de todos modos), así que un " + + "valor inutilizable se rechaza en lugar de guardarse.", farmSettingsSquareLogo: "Use un logotipo cuadrado. Se muestra pequeño en la barra lateral, así que una " + "marca simple y bien recortada — un símbolo o una sola letra — se ve mucho mejor ahí que un " @@ -2377,7 +2383,8 @@ export const es = { glossaryFarmSettingsTerm: "Configuración de la granja", glossaryFarmSettingsDef: "El nombre de la granja, la zona horaria, la configuración regional, la moneda y el sistema de " - + "unidades, además del primer día de la semana y los formatos de fecha/hora, opcionales. " + + "unidades, además del primer día de la semana y los formatos de fecha/hora, opcionales — elegidos " + + "de un menú de opciones predefinidas, o escritos como una cadena de formato .NET personalizada. " + "Configuración → Configuración de la granja; propietarios y gerentes editan, todos pueden leer — " + "dar formato a montos y fechas no es un permiso.", diff --git a/web/src/i18n/tl.ts b/web/src/i18n/tl.ts index 43e3b426a..a4231205e 100644 --- a/web/src/i18n/tl.ts +++ b/web/src/i18n/tl.ts @@ -2122,6 +2122,12 @@ export const tl = { + "ginawang kopya ang na-save: tinatanggal ang mga detalye ng camera at lokasyon papasok — ang isang " + "larawang kinunan sa telepono ay may kasamang kung saan ito kinuha, at para sa isang bukid, iyon " + "ang address nito. Alisin ito at babalik ang sidebar sa Cluckwork mark.", + farmSettingsDateTimeFormat: + "Nag-aalok ang format ng petsa at format ng oras ng ilang karaniwang " + + "pagpipilian sa isang dropdown — pumili at tapos na. Kailangan ng hindi nakalista? Piliin ang " + + "Custom… para mag-type ng sarili mo; sinusunod pa rin ang parehong mga panuntunan " + + "na sinusunod ng mga preset (sinusuri pa rin ito ng server), kaya tinatanggihan ang hindi magagamit " + + "na value sa halip na i-save.", farmSettingsSquareLogo: "Gumamit ng parisukat na logo. Maliit itong lumalabas sa sidebar, kaya isang simple " + "at maigsing-crop na marka — isang simbolo o iisang letra — ang mas magandang tingnan doon kaysa " @@ -2464,7 +2470,8 @@ export const tl = { glossaryFarmSettingsTerm: "Mga Setting ng Bukid", glossaryFarmSettingsDef: "Ang pangalan ng bukid, time zone, locale, currency, at unit system, kasama ang opsyonal na unang " - + "araw ng linggo at mga format ng petsa/oras. Setup → Mga Setting ng Bukid; nag-e-edit ang mga " + + "araw ng linggo at mga format ng petsa/oras — pinipili mula sa dropdown ng mga preset, o " + + "ini-type bilang custom na .NET format string. Setup → Mga Setting ng Bukid; nag-e-edit ang mga " + "may-ari at manager, nakakabasa ang lahat — hindi permission ang pag-format ng pera at petsa.", glossaryCurrencyLockTerm: "Currency lock", diff --git a/web/src/routes/HelpPage.tsx b/web/src/routes/HelpPage.tsx index 3c14faa17..4f9b2aa7a 100644 --- a/web/src/routes/HelpPage.tsx +++ b/web/src/routes/HelpPage.tsx @@ -391,6 +391,10 @@ export function HelpPage() {
  • }} />
  • + {/* #452 — preset dropdown + Custom escape hatch for date/time format overrides. */} +
  • + }} /> +
  • }} />
  • From 142d52b4bfe4b141b3b5130096042cea1e34a03b Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 8 Aug 2026 08:07:19 +0000 Subject: [PATCH 3/4] docs(web): stop overclaiming the custom format's validation guarantee MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit codex follow-up on PR #463 (its own commit 99617b4 never made it to this branch — same sandbox git-remote limitation as before — applied the equivalent fix myself): the Help bullet said "an unusable value is refused rather than saved," but BeAUsableFormat only rejects a string that literally throws as a .NET format — something like "asdf" passes and renders as garbage, which is exactly the OTHER half of #452 (tightening that validator) this PR deliberately left as a follow-up. Softened the claim to match what the server actually guarantees today. --- web/src/i18n/en.ts | 4 ++-- web/src/i18n/es.ts | 5 ++--- web/src/i18n/tl.ts | 5 ++--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/web/src/i18n/en.ts b/web/src/i18n/en.ts index a0d2dd13f..ecd532870 100644 --- a/web/src/i18n/en.ts +++ b/web/src/i18n/en.ts @@ -2432,8 +2432,8 @@ export const en = { farmSettingsDateTimeFormat: "Date format and time format offer a few common choices in a " + "dropdown — pick one and you are done. Need something not listed? Choose " - + "Custom… to type your own; the same rules the presets follow still apply " - + "(the server checks it either way), so an unusable value is refused rather than saved.", + + "Custom… to type your own — only a value the server cannot use at all is " + + "rejected, so check it renders the way you expect after saving.", farmSettingsSquareLogo: "Use a square logo. It shows small in the sidebar, so a simple, tightly-cropped mark " + "— a symbol or a single letter — reads much better there than a wide wordmark or a detailed picture, " diff --git a/web/src/i18n/es.ts b/web/src/i18n/es.ts index 71152dcdf..2df7aa484 100644 --- a/web/src/i18n/es.ts +++ b/web/src/i18n/es.ts @@ -2045,9 +2045,8 @@ export const es = { farmSettingsDateTimeFormat: "Formato de fecha y formato de hora ofrecen algunas opciones " + "comunes en un menú desplegable — elija una y listo. ¿Necesita algo que no está en la lista? " - + "Elija Personalizado… para escribir el suyo; las mismas reglas que siguen las " - + "opciones predefinidas siguen aplicando (el servidor lo verifica de todos modos), así que un " - + "valor inutilizable se rechaza en lugar de guardarse.", + + "Elija Personalizado… para escribir el suyo — solo se rechaza un valor que el " + + "servidor no puede usar en absoluto, así que verifique cómo se muestra después de guardar.", farmSettingsSquareLogo: "Use un logotipo cuadrado. Se muestra pequeño en la barra lateral, así que una " + "marca simple y bien recortada — un símbolo o una sola letra — se ve mucho mejor ahí que un " diff --git a/web/src/i18n/tl.ts b/web/src/i18n/tl.ts index a4231205e..a077de877 100644 --- a/web/src/i18n/tl.ts +++ b/web/src/i18n/tl.ts @@ -2125,9 +2125,8 @@ export const tl = { farmSettingsDateTimeFormat: "Nag-aalok ang format ng petsa at format ng oras ng ilang karaniwang " + "pagpipilian sa isang dropdown — pumili at tapos na. Kailangan ng hindi nakalista? Piliin ang " - + "Custom… para mag-type ng sarili mo; sinusunod pa rin ang parehong mga panuntunan " - + "na sinusunod ng mga preset (sinusuri pa rin ito ng server), kaya tinatanggihan ang hindi magagamit " - + "na value sa halip na i-save.", + + "Custom… para mag-type ng sarili mo — isang value lang na talagang hindi " + + "magagamit ng server ang tinatanggihan, kaya tingnan kung paano ito lumalabas pagkatapos i-save.", farmSettingsSquareLogo: "Gumamit ng parisukat na logo. Maliit itong lumalabas sa sidebar, kaya isang simple " + "at maigsing-crop na marka — isang simbolo o iisang letra — ang mas magandang tingnan doon kaysa " From 15bf2691a3c428a11ed16789cad545b5047222da Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 8 Aug 2026 17:32:51 +0000 Subject: [PATCH 4/4] docs(web): remove impossible "check it renders" advice from Help text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit codex review of PR #463: the previous fix told admins to "check it renders the way you expect after saving" — impossible advice. specs/product/GLOSSARY.md:482-489 already documents that locale, unit system and the date/time format overrides are "stored and validated, and nothing renders through them yet" (money still prints as 12.34 USD, dates as ISO) — confirmed by a repo-wide search finding no SPA consumer of dateFormatOverride/timeFormatOverride outside the settings form itself. Rewrote the Help/es/tl text to match: the presets are safe choices, a custom value is only checked well enough to save (not proven correct), and nothing displays through this setting yet, so a broken custom value wouldn't be visible today either. --- web/src/i18n/en.ts | 5 +++-- web/src/i18n/es.ts | 6 ++++-- web/src/i18n/tl.ts | 6 ++++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/web/src/i18n/en.ts b/web/src/i18n/en.ts index ecd532870..d49e94d12 100644 --- a/web/src/i18n/en.ts +++ b/web/src/i18n/en.ts @@ -2432,8 +2432,9 @@ export const en = { farmSettingsDateTimeFormat: "Date format and time format offer a few common choices in a " + "dropdown — pick one and you are done. Need something not listed? Choose " - + "Custom… to type your own — only a value the server cannot use at all is " - + "rejected, so check it renders the way you expect after saving.", + + "Custom… to type your own; the presets are all safe choices, but a custom value " + + "is only checked well enough to save, not to prove it looks right — nothing in Cluckwork displays " + + "dates or times through this setting yet, so a broken custom value would not be visible today.", farmSettingsSquareLogo: "Use a square logo. It shows small in the sidebar, so a simple, tightly-cropped mark " + "— a symbol or a single letter — reads much better there than a wide wordmark or a detailed picture, " diff --git a/web/src/i18n/es.ts b/web/src/i18n/es.ts index 2df7aa484..334d81059 100644 --- a/web/src/i18n/es.ts +++ b/web/src/i18n/es.ts @@ -2045,8 +2045,10 @@ export const es = { farmSettingsDateTimeFormat: "Formato de fecha y formato de hora ofrecen algunas opciones " + "comunes en un menú desplegable — elija una y listo. ¿Necesita algo que no está en la lista? " - + "Elija Personalizado… para escribir el suyo — solo se rechaza un valor que el " - + "servidor no puede usar en absoluto, así que verifique cómo se muestra después de guardar.", + + "Elija Personalizado… para escribir el suyo; las opciones predefinidas son " + + "siempre seguras, pero un valor personalizado solo se verifica lo suficiente para guardarlo, no " + + "para comprobar que se ve bien — nada en Cluckwork muestra fechas u horas mediante esta " + + "configuración todavía, así que un valor personalizado incorrecto no sería visible hoy.", farmSettingsSquareLogo: "Use un logotipo cuadrado. Se muestra pequeño en la barra lateral, así que una " + "marca simple y bien recortada — un símbolo o una sola letra — se ve mucho mejor ahí que un " diff --git a/web/src/i18n/tl.ts b/web/src/i18n/tl.ts index a077de877..1204262c8 100644 --- a/web/src/i18n/tl.ts +++ b/web/src/i18n/tl.ts @@ -2125,8 +2125,10 @@ export const tl = { farmSettingsDateTimeFormat: "Nag-aalok ang format ng petsa at format ng oras ng ilang karaniwang " + "pagpipilian sa isang dropdown — pumili at tapos na. Kailangan ng hindi nakalista? Piliin ang " - + "Custom… para mag-type ng sarili mo — isang value lang na talagang hindi " - + "magagamit ng server ang tinatanggihan, kaya tingnan kung paano ito lumalabas pagkatapos i-save.", + + "Custom… para mag-type ng sarili mo; palaging ligtas ang mga preset, pero " + + "sinusuri lang ang custom value nang sapat para ma-save, hindi para patunayan na tama ang " + + "itsura nito — wala pang nagpapakita ng petsa o oras gamit ang setting na ito sa Cluckwork, " + + "kaya hindi makikita ngayon ang isang maling custom value.", farmSettingsSquareLogo: "Gumamit ng parisukat na logo. Maliit itong lumalabas sa sidebar, kaya isang simple " + "at maigsing-crop na marka — isang simbolo o iisang letra — ang mas magandang tingnan doon kaysa "