Skip to content

[Component Audit] DateTimeInput: keep cleared calendars empty - #7298

Merged
cixzhang merged 4 commits into
mainfrom
night-watch-component-audit/DateTimeInput/2026-10-10
Oct 10, 2026
Merged

cixzhang merged 4 commits into
mainfrom
night-watch-component-audit/DateTimeInput/2026-10-10

Conversation

@cixzhang

Copy link
Copy Markdown
Contributor

User impact

People who select a date from DateTimeInput’s calendar, clear the field, and reopen the calendar no longer see the previous date still highlighted. The visible empty field and Calendar selection now describe the same state.

Audit result

  • Component: core/DateTimeInput
  • Repository base: 0d8dadb0d815cbd3091a5e93a8e98095651b840b
  • Exact reviewed head: 5e000a582a7b33e0643c974df8ec3147015b41cc
  • Rubric: 1.16.6
  • Before: 88.6/C with 1 BLOCK
  • After: 95.0/A with 0 open BLOCKs
  • Sensitivity: fixing only the open BLOCK and changing nothing else projected 93.4/A; the regression evidence and complete documented anatomy account for the remaining movement.

Findings fixed

  • B15 / V3 — stale controlled selection. DateTimeInput passed undefined to Calendar after clear, which released Calendar into uncontrolled mode and revived its prior internal selection. The component now passes explicit controlled-empty null, using Calendar’s current controlled-empty contract without changing DateTimeInput’s public API.
  • V3 / B16 — missing clear regression. A focused controlled test now proves select → clear → reopen leaves zero selected Calendar gridcells. It failed on the base with one selected gridcell and passes on this head.
  • X4 / T7 — incomplete anatomy projection. Consumer docs and the required draft observational contract now map the field surface, clock icon, and time option to the theme targets already shipped by the component.

The clear-state diagnosis and original regression shape came from @korkt-kim’s focused fix. The changeset preserves that attribution alongside @cixzhang.

Authority and compatibility

  • spec:AST-043 remains the current owner of picker presentation, precedence, compatibility mapping, and native fallback behavior; none changes here.
  • family:input-fields continues to own controlled optimistic changes, busy state, field geometry, status, and disabled reasons.
  • DateTimeInput.spec.md is a draft observational record. It adds no current product authority and introduces no new prop, default, role, interaction, or migration.
  • The behavior fix is patch-compatible: DateTimeInput still clears through onChange(undefined); only its internal Calendar boundary remains explicitly controlled-empty.

Evidence

  • Red before: shows no selected calendar days after clearing received one selected gridcell on the base source.
  • Green after: the same test receives zero selected gridcells.
  • Recurring browser endpoint: ClearedCalendarSelection selects March 20, clears, reopens, asserts zero selected gridcells, and leaves the reopened empty Calendar as an opted-in stable visual frame.
  • Visual scope: no CSS, geometry, token, role, or DOM anatomy changes. The intended pixel change is only the absence of Calendar’s existing selected-day representation after clear.
  • Independent review: the first exact-head pass found four documentation/evidence precision issues; all were corrected. Final review result: CLEAN at 5e000a582a7b33e0643c974df8ec3147015b41cc.

Needs Review

No owner decision blocks this audit. Three pre-existing code-health FIX groups remain recorded rather than expanded into this behavior repair: Effect-based touch-draft synchronization, Effect-based prop-driven layer closure, and Effect-based trigger registration. They are separately refactorable and do not invalidate the restored clear path.

Writing rubric results

  • R1 narration: two change-oriented phrases were found in the first draft and rewritten as present-system compatibility facts.
  • R2 research: none; audit measurements remain in this pull request.
  • R3 evidence references: no pull request, issue, or commit is used as specification evidence.
  • R4 rejected alternatives: none.
  • R5 change references: none in the record.
  • R6 open questions: none; the draft claims no new component-local decision.

Testing

  • pnpm exec vitest run packages/core/src/DateTimeInput/DateTimeInput.test.tsx packages/core/src/DateTimeInput/DateTimeInputTouch.test.tsx packages/core/src/DateTimeInput/NativePickerSegments.test.tsx packages/core/src/DateTimeInput/Presentation.test.tsx --maxWorkers=4 — 212 passed.
  • pnpm -F @astryxdesign/core typecheck — passed.
  • pnpm -F @astryxdesign/storybook typecheck — passed after package build.
  • pnpm build — passed.
  • pnpm storybook:build — passed.
  • pnpm lint:strict — passed with 0 errors; repository-existing warnings only.
  • pnpm check:knowledge and commit hooks — passed.
  • Local Chromium could not start in the managed host environment; exact-head Linux CI owns axe, RTL, Storybook interaction, and stable visual evidence.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 10, 2026
@astracat-bot

astracat-bot Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 10, 2026, 1:16 PM UTC

@vercel

vercel Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 10, 2026 1:07pm UTC

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

Previews ready: Storybook and Sandbox were built with this PR's docsite. CI evidence will be added when available.

View Storybook for this PR · View Sandbox for this PR

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the focused fix and the clear audit trail. Keeping the calendar explicitly controlled-empty after a clear resolves the contradictory state where the field was empty but the previous day still appeared selected, and it does so without changing the public API or the clear callback contract.

I verified the select → clear → reopen sequence leaves no selected day, alongside the related DateTimeInput test suites and knowledge checks. The new component record stays a draft observation for owner review and does not change any governing requirement. No changes are requested.

[Automated review]

@cixzhang
cixzhang merged commit d49061c into main Oct 10, 2026
44 checks passed
@cixzhang
cixzhang deleted the night-watch-component-audit/DateTimeInput/2026-10-10 branch October 10, 2026 13:28

This branch was successfully deployed

1 active deployment
Preview — 5e000a58 Deployed Oct 10, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant