feat(intent): month/week fields first-class on every surface - type-aware now defaults, formatted labels, my/partner pickers - #6528
Merged
Conversation
…pe-aware now defaults, formatted labels, my/partner pickers
Adopting a month field (type: month, the YYYY-MM string + month-picker
widget) on a real reporting-period column surfaced three gaps:
- A schedules/generates 'defaults: <field>: now' rendered
java.time.LocalDate.now() unconditionally; against a month/week field
(a plain String on the generated entity) the emitted job does not even
compile - and the client-Java batch is all-or-nothing. 'now' is now
rendered in the TARGET field's own shape (YYYY-MM / YYYY-Www / LocalDate),
resolved from the local intent for same-model targets and from the owner
.model's widget types for cross-model ones (TargetInfo gains
propertyWidgets - month/week are indistinguishable from VARCHAR at the
JDBC level, so the widget type is the only cross-model carrier).
- A '|format' label token only formatted TemporalAccessor values, so a
month field's label degraded to the raw '2026-07'. formatLabelValue now
parses a YYYY-MM string back to a YearMonth (fail-soft: a non-month
value or a pattern demanding day fields keeps the raw string).
- The my/partner form and document templates had no MONTH/WEEK branches -
a month field fell to a plain text input on exactly the surfaces a
period-carrying personal record renders on. All four templates now emit
the same x-h-month-picker / x-h-week-picker the power form does.
IntentEmissionCoverageIT: Claim gains a month 'period' (schedule default
'Period: now', label '{period|yyyy MMMM}'); asserts the YearMonth job
emission, the pickers on the power AND my forms, the YearMonth.parse label
branch, and at runtime a created record's Name reading '... 2026 July'.
GlueSchedulesTest covers the month/week/date 'now' shapes. Assistant
guide updated (defaults 'now' shape, label month formatting).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adopting a `type: month` field (the YYYY-MM string + month-picker widget) on a real reporting-period column surfaced three gaps that together made the type unusable on a document families' period columns:
1. `defaults: : now` emits code that cannot compile against a month/week target
A schedules/generates default rendered `java.time.LocalDate.now()` unconditionally. A month/week field is a plain `String` on the generated entity (VARCHAR at the JDBC level), so the emitted job fails javac - and since client Java compiles as one all-or-nothing batch, one such default takes every module's beans down.
`now` is now rendered in the TARGET field's own shape:
The target field's logical type is resolved from the local intent for same-model targets, and from the owner model's widget types for cross-model ones: `CrossModelSupport.TargetInfo` gains `propertyWidgets` (name -> widgetType), because month/week are indistinguishable from any other VARCHAR at the JDBC level - the `.model` widget type is the only cross-model carrier of the logical type.
2. A `|format` label token degrades a month value to the raw string
`formatLabelValue` only formatted `TemporalAccessor` values, so `label: "{period|yyyy MMMM}"` stored `2026-07` instead of `2026 July`. The generated repository now parses a `YYYY-MM` string back to a `YearMonth` when a pattern is present - fail-soft: a non-month value, or a pattern demanding fields a month lacks (`dd`), keeps the raw string.
3. The my/partner surfaces render a month field as a plain text input
The manage form and document templates had MONTH/WEEK branches; the four my/partner form and document templates did not, so a month field degraded to a bare text input on exactly the surfaces a period-carrying personal record renders on. All four now emit the same `x-h-month-picker` / `x-h-week-picker` blocks the power form does.
Coverage
Additionally verified on an isolated instance with a two-model workspace (a consumer module's schedule generating into another model's month field): the emitted job carries the YearMonth shape resolved through the owner `.model`, the full client-Java batch compiles, and a POSTed record's computed label formats the month.
🤖 Generated with Claude Code