#8078·grommet

TimeInput - code cleanup & alignment to grommet standards

Author: britt6612Created Aug 25, 2026Updated Sep 18, 2026

We should go through the TimeInput code and make any cleanups and ensure it is consistent with our standards throughout the rest of the codebase.

Some items to look at:

  • look into refactor and simplify the architecture to fully leverage the segmented input model (TimeInput.js)

  • Memoize displaySections and derived segment formatting structures to reduce render-path calculation overhead (TimeInput.js)

  • Centralize top-level keyboard intent handling and clean up complex arrow/digit routing logic inside segment keydown listeners (TimeInput.js)

  • Optimize complex multi-branch click boundary calculations in onDisplayMouseDown or extract into a clean utility handler (TimeInput.js)

  • Streamline announceCurrentValue and getSectionValueAnnouncement logic to reduce dependency array footprint and function re-creation churn (TimeInput.js)

  • Ensure strict accessibility parity for focus restoration when switching between segment navigation and the picker drop (TimeInput.js)

  • Add comprehensive regression tests in TimeInput-test.tsx covering partial changes

Review TimeInput code and determine if additional cleanups are needed.

Anticipated effort: medium-high