Skip to content

4768 client - Add explicit clear button for TIME property inputs#4837

Merged
ivicac merged 4 commits intomasterfrom
4768
Apr 23, 2026
Merged

4768 client - Add explicit clear button for TIME property inputs#4837
ivicac merged 4 commits intomasterfrom
4768

Conversation

@ivicac
Copy link
Copy Markdown
Contributor

@ivicac ivicac commented Apr 23, 2026

Chrome's does not provide a native clear button,
so users had no way to clear a Time field. Expose an explicit X via the
existing trailingAction slot that reuses the debounced save path so the
empty -> null coercion already in useProperty stays the single source of
truth.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an explicit clear (“X”) affordance for TIME property inputs (to compensate for Chrome lacking a native clear UI for <input type="time">) while reusing the existing debounced save/coercion logic so clearing persists null rather than an empty string.

Changes:

  • Expose a new handleInputClear() handler from useProperty to reset local input/error state and invoke the existing debounced save path.
  • Render a TIME-only trailing clear button in Property.tsx when a time value is present.
  • Add/extend tests to cover the trailingAction click pattern and document the TIME-clear behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
client/src/pages/platform/workflow-editor/components/properties/hooks/useProperty.ts Adds handleInputClear to reset value/error state and trigger debounced persistence (empty → null coercion preserved).
client/src/pages/platform/workflow-editor/components/properties/hooks/tests/timeFieldClear.test.ts Adds a new test file to codify TIME-clear expectations (currently duplicates logic / doesn’t verify debounce semantics).
client/src/pages/platform/workflow-editor/components/properties/components/property-input/PropertyInput.test.tsx Adds a unit test ensuring trailingAction click handlers fire (supports TIME clear button pattern).
client/src/pages/platform/workflow-editor/components/properties/Property.tsx Renders a trailing clear button for TIME inputs with a non-empty value, wired to handleInputClear.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Chrome's <input type="time"> does not provide a native clear button,
so users had no way to clear a Time field. Expose an explicit X via the
existing trailingAction slot that reuses the debounced save path so the
empty -> null coercion already in useProperty stays the single source of
truth.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ivicac and others added 2 commits April 23, 2026 11:54
The null-coercion for DATE/DATE_TIME/TIME is already covered in
saveInputValueResolvedValue.test.ts, so re-declaring it here risks drift
from useProperty.ts. Also rename the remaining assertion to reflect what
it actually checks (save callback invocation, not debounce semantics).

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

Calling inputRef.focus() synchronously after setInputValue('') flipped
PropertyInput's isFocused to true in the same React batch, so the
value-sync effect skipped and the stale time remained visible until the
next blur. Schedule focus() via requestAnimationFrame so the empty value
commits while isFocused is still false.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed for 'client'

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@ivicac ivicac merged commit 2650574 into master Apr 23, 2026
6 of 7 checks passed
@ivicac ivicac deleted the 4768 branch April 23, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Date/Datetime return empty string instead of null; Time field cannot be cleared

2 participants