Skip to content

docs(edit-content): spec for #37465 Date/Time field width, clearing and picker footer - #37542

Open
adrianjm-dotCMS wants to merge 9 commits into
mainfrom
issue-37465-calendar-field-width-clear-picker-footer
Open

adrianjm-dotCMS wants to merge 9 commits into
mainfrom
issue-37465-calendar-field-width-clear-picker-footer

Conversation

@adrianjm-dotCMS

Copy link
Copy Markdown
Member

PR 1 of 2 — spec only

This PR carries spec.md alone. No implementation, no tests, no product code.
Per the Spec-Kit flow,
implementation starts only once another dev approves this spec — approval, not merge:
PR 2 branches off this branch and is opened without waiting for this one to land.

Related to #37465

What the feature is

The three temporal field types in the new Edit Contentlet — Date, Time and
Date and time — are the only fields that look and behave differently from their neighbours.
They sit narrower than their column, they cannot be emptied once a value is set, and the picker
overlay's footer offers a Clear action the author does not need there while hiding the one thing
they do need: which timezone the value is interpreted in.

Four independently shippable user stories: P1 clearing on the field → P1 timezone in the
picker footer → P2 a server-accurate Today / NowP3 full-column width.
24 functional requirements, 8 success criteria, 8 assumptions.

Two things the code said that the issue did not

Both are load-bearing for the priorities, so they are worth a reviewer's attention:

  1. The timezone renders today only when the field also carries a hint. The field's footer row
    is drawn only when there is a hint or a required error, so on a Date-and-time field with a
    timezone and no hint the timezone is never shown at all. That makes User Story 2 a coverage fix
    rather than a relocation, which is why it is P1.
  2. The current Today action reads the browser's clock, not the server's, so it can set the
    wrong calendar day when the server is in another timezone. FR-013 and SC-005 make correcting
    that explicit instead of leaving it as a side effect of rebuilding the footer.

Two decisions the issue left open

Resolved with the developer before writing, rather than carried as [NEEDS CLARIFICATION].
Recorded as Assumptions 2 and 3 so it is visible they were decided, not guessed:

Question Decision Requirement
Where does the hint live once the timezone leaves the field footer? Back in the field footer, dropping the current label-tooltip special case FR-009
Does Today / Now close the picker? Keep the existing per-type behaviour — closes on Date-only, stays open on Date-and-time and Time-only FR-014a

Overlap with #37464

#37464 (Standardize field hint and required-error presentation) is open with no spec and no
branch, so this spec assumes #37465 lands first. FR-009 removes the timezone from the field
footer entirely, which makes #37464's timezone-vs-hint criterion moot. FR-016 records the
obligation to withdraw that criterion from #37464 on merge
— bookkeeping across two issues, not
code, and it states in-line that acting on it needs developer approval. If #37464 lands first
instead, FR-008/FR-009 still apply unchanged and only the withdrawal direction reverses.

Explicitly out of scope

Hint and required-error styling and wording (owned by #37464); moving the timezone under the
label; any change to how values are stored or converted between the server timezone and UTC; the
legacy Edit Contentlet screen; the picker's header, day grid and time spinner.

Reviewing this

The spec is the contract PR 2 will be judged against, so the useful questions are about the
requirements, not the code: are FR-001…FR-019 testable as written, is the out-of-scope boundary
where you would draw it, and are Assumptions 2 and 3 the calls you would have made.

checklists/requirements.md passed 16/16 on the first validation pass with 0 [NEEDS CLARIFICATION]
markers; it is gitignored per the repo's spec-folder commit policy, so it is not in this diff.

🤖 Generated with Claude Code

…nd picker footer

PR 1 of 2. Spec only — no implementation.

Two facts verified against the code rather than taken from the issue shape
the priorities:

- The timezone renders today only when the field also carries a hint, because
  the field's footer row is drawn only when there is a hint or a required
  error. On a Date-and-time field with a timezone and no hint it is never
  shown at all, so moving it into the picker is a coverage fix, not a
  relocation.
- The current Today action reads the browser's clock, so it can set the wrong
  calendar day when the server is in another timezone. FR-013 and SC-005 make
  correcting that explicit.

Two open decisions were resolved with the developer before writing and are
recorded as Assumptions 2 and 3: the hint returns to the field footer
(FR-009), and Today/Now keeps the existing per-type picker-close behaviour
(FR-014a).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@claude

claude Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Claude finished @adrianjm-dotCMS's task in 1m 28s —— View job


Spec review — #37465 Date/Time field width, clearing, picker footer

This PR carries spec.md alone. I reviewed the requirements for internal consistency and testability, and cross-checked them against what the PR description claims. The requirements themselves are mostly clean and testable; the findings below are all spec-vs-description drift where the narrative in the PR body no longer matches the committed spec — which matters because the spec is the contract PR 2 is judged against.

New Issues

  • 🟠 High: specs/37465-calendar-field-width-clear-picker-footer/spec.mdFR-016 does not exist in the spec, but the PR body treats it as load-bearing. Requirements jump FR-015bFR-017. The PR body's entire "Overlap with Standardize field hint and required-error presentation in the new Edit Contentlet #37464" section rests on "FR-016 records the obligation to withdraw that criterion from Standardize field hint and required-error presentation in the new Edit Contentlet #37464 on merge." That obligation now has no requirement backing it anywhere in the spec — the cross-issue bookkeeping was dropped (or never landed) but the description still advertises it. Decide one way: re-add FR-016 (the Standardize field hint and required-error presentation in the new Edit Contentlet #37464 withdrawal obligation, stating it needs developer approval before acting), or intentionally drop it and remove the "Overlap with Standardize field hint and required-error presentation in the new Edit Contentlet #37464" section from the PR body so a PR-2 reviewer isn't looking for a requirement that isn't there. Fix this →

  • 🟡 Medium: spec.md:83User Story 2 priority contradicts the PR description. The PR body states the priorities are P1 clearing → P1 timezone → P2 Today/Now → P3 width, and argues "that makes User Story 2 a coverage fix rather than a relocation, which is why it is P1." But the spec titles US2 "Timezone label moves into the picker (Priority: P2)" and frames it as "A presentation change to an existing label; the author is not blocked without it." The spec has exactly one P1 (US1). The coverage insight is genuinely captured in the "Verified current behaviour" table and in SC-003 ("up from only those fields that happen to carry a hint today"), so the content is consistent — only the priority label and the US2 framing are stale. Either bump US2 to P1 and reframe it as a coverage fix, or correct the PR body. As written, a reviewer can't tell whether timezone visibility is a P1 commitment.

  • 🟡 Medium: spec.mdThe spec has no Assumptions section, but the PR body cites "8 assumptions" and "Assumptions 2 and 3". The description says two open decisions were "Recorded as Assumptions 2 and 3." There is no Assumptions section in the spec — those two decisions were folded into FR-009 and FR-014a instead (which is fine, and arguably cleaner). But the PR body still points reviewers at assumptions that don't exist. Also minor: the body says "24 functional requirements, 8 success criteria" and "FR-001…FR-019", while the spec actually runs to FR-020 and includes SC-005a/006a/006b beyond the 8 numbered SCs. Reconcile the counts and the "FR-001…FR-019" range so the description matches the artifact.

On testability (reviewer's explicit question)

FR-001FR-020 are testable as written — each has a matching acceptance scenario or success criterion, and the two areas that could have been vague are pinned down well: FR-012/SC-005a fix "current time" to second precision, and FR-013 names the concrete getCurrentServerTime / convertServerTimeToUtc path rather than hand-waving "server time." The out-of-scope boundary (styling/wording owned by #37464, storage/conversion untouched, legacy screen excluded) is drawn where I'd draw it. Assumptions 2 and 3 (hint back in field footer; keep per-type close behaviour) are reasonable calls.

The three findings above are all documentation drift between the spec and its PR description — none touch product code, and none block on their own. The FR-016 gap is the one worth resolving before sign-off, since the #37464 coordination it describes currently has no home in the spec.
· branch issue-37465-calendar-field-width-clear-picker-footer

…ooter

Scope addition beyond the issue, decided in spec review: the picker footer
gains a second button that confirms the selection on Date-and-time and
Time-only fields. On those two types the picker no longer writes to the field
as the author clicks — it holds a pending selection that reaches the field
only on Accept, and dismissing without Accept discards it.

Date-only is deliberately excluded: applying the gate there would turn the
most common case, setting a plain date, from one interaction into two. It
keeps today's behaviour exactly and shows no Accept button.

Three consequences were inferred rather than stated and are flagged for a
reviewer: Accept styled as the primary action, Accept always enabled, and the
gate applying only to picker selections and not to typed input.

FR-016a records that #37465's own acceptance criteria now contradict the spec
on three points and must be corrected. Like FR-016 it records the obligation
only — editing the issue needs developer approval.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…picker footer"

This reverts commit e39d460.

The Accept button was a scope addition proposed during spec review. The
developer decided to build what the issue's acceptance criteria already
specify instead, so the spec returns to the single-button footer with the
value applied on selection.

That also drops FR-016a, which existed only to record that the issue's
criteria contradicted the Accept gate. With the gate gone there is no
contradiction and #37465 needs no correction.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
FR-016 said "the criterion", following the singular wording of #37465's own
body. Checking #37464's description found four passages written around the
timezone line under the input, not one: the timezone-versus-hint collision
criterion, the criterion for a timezone with no hint, the test asserting the
collision case, and the refinement-table row deciding it.

FR-009 removes that line, so all four describe an element that will no longer
be on the screen. FR-016 now lists each with its location in the issue and
requires them to be withdrawn together — dropping only the collision
criterion would leave the other three pointing at the same absent element.

Still bookkeeping only: it edits a different issue, after merge, and needs
developer approval.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…r review

Review on PR #37542 found three places where the spec asserted something it
then never checked. None is a defect; all three would have let PR 2 be judged
against a contract with holes in it.

- FR-014a said the picker stays open on Date-and-time and Time-only and closes
  on Date-only, and no acceptance scenario or success criterion covered it.
  That is the one place the picker's lifecycle is deliberately non-uniform, so
  it is also the likeliest thing to regress unnoticed while the footer is
  rebuilt. Added US3 scenarios 9-11, one per type, and SC-006a.

- Assumption 6 pinned "current time" to second precision, but FR-012 and
  FR-013 said only "the current time" and nothing tested it — an assumption no
  implementation could be measured against. The precision now lives in FR-012
  with SC-005a to check it, and the assumption points at both.

- FR-009 read "removed for all three field types", which asks for the removal
  of an element a Date-only field never rendered. Reworded to name the types
  that render one today, matching the verified-behaviour table and US2.

Both new criteria were checked against the implementation before being
written: the open/closed assertions already exist in the child spec, and
second precision holds in the unit test and in the verified save/reopen
round-trip.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@adrianjm-dotCMS
adrianjm-dotCMS marked this pull request as ready for review September 15, 2026 16:20
adrianjm-dotCMS added a commit that referenced this pull request Sep 15, 2026
…ng labels (#37465)

Review on PR #37542 surfaced a real bug: getCurrentServerTime(null) returned
UTC clock components reinterpreted as local, while every other timezone-less
path in this field (convertServerTimeToUtc, convertUtcToServerTime) treats a
missing zone as "use the browser's local clock as-is". The mismatch meant
Today/Now displayed one time and stored another, off by the browser's UTC
offset — permanently, if the timezone request fails outright rather than
merely arriving late.

Falls back to the browser's own local clock instead, matching the convention
already used elsewhere. No change to the conversion helpers themselves, so
FR-017's storage guarantees are untouched.

Also: the footer's timezone text now truncates (min-w-0 + truncate, with a
title attribute carrying the full label) rather than being able to push the
Today/Now button out of the overlay on a very long zone name.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
… after review

Second round of review on PR #37542. One finding was a real bug, not a spec
gap:

- FR-013 didn't say what Today/Now does when the system timezone hasn't
  loaded yet. Traced it into calendar-field.util.ts: getCurrentServerTime(null)
  returned UTC clock components read as local time, while every other
  timezone-less path in this field (convertServerTimeToUtc,
  convertUtcToServerTime) treats a missing zone as "use local as-is". The
  mismatch meant a value set with no timezone loaded displayed one time and
  stored another, off by the browser's UTC offset — permanently, if the
  timezone request fails outright. FR-013 now states the fallback; SC-006c
  checks it. Fixed in the implementation on the impl branch, not just
  documented here.

- The "very long timezone labels" edge case had no FR/SC backing it. Added
  FR-008b and pointed the edge case at it.

- The footer action had no keyboard-reachability requirement, unlike the
  clear control's FR-007a. Added FR-015b, symmetric wording, plus SC-006b.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@adrianjm-dotCMS
adrianjm-dotCMS added this pull request to stack #37557 September 15, 2026 18:39
…#37465

Third round of review on PR #37542. Two findings:

FR-013's browser-clock fallback (added last round to fix the display/storage
offset bug) meant that if the system timezone genuinely never resolves — its
load request has no retry, confirmed in libs/global-store's withSystem — the
shortcut can set the browser's day instead of the server's. SC-005 demanded
the server's day in 100% of attempts and SC-006c claimed no offset "whether
or not the timezone has loaded": neither was satisfiable in that state as
worded, so an implementer couldn't tell whether the fallback was required
behaviour or a defect.

Resolved with the developer, asked directly rather than assumed: keep the
fallback. A button that goes permanently dead on a timezone-service failure
is worse than one that stays internally consistent (display matches storage)
in a case the field already tolerated before this feature — the fallback is
exactly the field's pre-#37465 behaviour, narrowed to the one case where the
server's zone is genuinely unknown. SC-005 now scopes to "timezone already
resolved"; SC-006c now claims only display/storage agreement, not day
accuracy; FR-013 states the scoping explicitly; a new Assumption 9 records
the decision and why. No code change needed — calendar-field.util.ts already
matched this before the spec did.

Also fixed a broken in-doc link: [FR-016](#fr-016) doesn't resolve because
FR-016 is a bold list item, not a heading. Replaced with plain text, matching
the "see FR-008b" convention already used elsewhere in the spec.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…l gaps (#37465)

Audited the spec for anything reading as an unresolved decision or a
deferred question, per the developer's request — not the review comments,
the spec's own language.

Two kinds of problem, both closed:

Three Assumptions (2, 3, 9) said "confirmed with the developer" / "Decided
with the developer". None was missing content — each already stated the
full rule and its rationale. The attribution was the problem, not the
decision: it reads as an unresolved negotiation even though the paragraph
right after it settles the question. Dropped the attribution in all three;
the rule now stands on its own like every other Assumption.

Two items were genuinely unresolved, caught by external review of PR
#37542 rather than by this pass:

- SC-005a still claimed the shortcut "matches the server's clock"
  unconditionally, after SC-005/SC-006c had already been scoped to the
  resolved-timezone case in the prior commit. Reworded to claim precision
  only; US3 scenarios 4-7 got the same resolved-timezone caveat.
- FR-009 never stated what governs the field footer's visibility once the
  timezone line is gone. Added FR-009a. Verified against text-field's
  actual template before writing it, not assumed: the sibling pattern is
  mutually exclusive (error or hint, never both), while this field's
  footer stacks them (error first, hint below) — a first draft of FR-009a
  claimed parity with the siblings and was wrong; caught and corrected
  before this commit, with the divergence pointed at Out of scope.

FR-016's "requires developer approval" was checked and left alone: it
gates editing #37464 after merge, correctly scoped as bookkeeping. A
sweep for approval/sign-off/pending/TBD/left-to/open-item found nothing
else.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Tightens the spec so every requirement states what is built, with no
assumptions, deferred decisions or conditional branches left for a
reader to resolve.

- Drops the Assumptions section. Its substantive content already lived
  in the FRs; the one rule that didn't (no per-field configuration)
  becomes FR-020.
- Today/Now always resolves through the existing getCurrentServerTime /
  convertServerTimeToUtc path, as the issue's acceptance criterion
  requires. The browser-clock fallback is gone from FR-013, and with it
  SC-006c and the timezone-resolved caveats on SC-005, SC-005a and the
  US3 scenarios.
- Today/Now leaves the picker open on all three field types, the same as
  selecting a day or time (hideOnDateTimeSelect is false for all three,
  per #36156). FR-014a previously claimed Date-only closes "as a
  completed date selection does today", which is not what the field
  does.
- Width is defined as 100% of the column in single- and multi-column
  layouts; the undefined "narrow viewport" and "supported viewport
  width" wording is removed from FR-004, SC-002 and US4.
- The issue's read-only clause is noted as not valid in FR-006: these
  fields have no read-only state.
- Removes the timezone-unavailable scenario, the late-arrival and long
  label edge cases, FR-008b, FR-009a and FR-016 with its section, and
  the "Relationship to #37464" section.
- Reframes the timezone change as what it is: a relocation of an
  existing label. Conversion already worked. User Story 2 drops from P1
  to P2; the Today shortcut remains the one timezone-related defect.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant