fix(timepicker)!: errors following a full review of the component (#DS-5482) - #1992
Draft
artembelik wants to merge 2 commits into
Draft
fix(timepicker)!: errors following a full review of the component (#DS-5482)#1992artembelik wants to merge 2 commits into
artembelik wants to merge 2 commits into
Conversation
`KbqTimepicker` implements `KbqFormFieldControl`, which declares `value`, `id`, `placeholder`, `required`, `disabled`, `focused`, `empty` and `errorState` as plain members — those stay plain accessors. The four inputs the timepicker owns are signals now. `min` and `max` parsed in their setters and reported the parsed result, so a value the date adapter could not read came back as `null`. They report what was bound; the parsed values stay internal, drive the validators and re-run them from an effect. `kbqValidationTooltip` was a setter-only input that subscribed to `incorrectInput` every time it ran and never unsubscribed — re-binding it stacked another subscription and the last one outlived the directive. It is an effect with a teardown. `format` clamps through the input's transform, and the two side effects its setter carried are subsumed by the locale effect that already re-read the placeholder. That effect no longer returns early on a consumer-provided placeholder, so a locale change reformats the rendered time either way. The generated id comes from the CDK `_IdGenerator`, and the six members that stay accessors say why instead of carrying stale migration TODOs. BREAKING CHANGE: `KbqTimepicker.format`, `min`, `max` and `kbqValidationTooltip` are signal inputs; `min` and `max` report the bound value rather than the parsed one; generated ids changed shape. Reported and partly rewritten by the `timepicker-signals` schematic. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Visit the preview URL for this PR (updated for commit 8ba92c0): https://koobiq-next--prs-1992-as4benoa.web.app (expires Mon, 07 Sep 2026 07:37:51 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: c9e37e518febda70d0317d07e8ceb35ac43c534c |
The validation tooltip teardown had no test, so nothing proved the leak was fixed. It does now — the test fails against a no-op cleanup and passes against the real one. Injections that are never reassigned are `readonly`. Co-Authored-By: Claude Opus 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.
What
A full review of
timepicker, in the same shape as the 20.3.0 component reviews.What stays a plain accessor, and why
KbqTimepickerimplementsKbqFormFieldControl, which declaresvalue,id,placeholder,required,disabled,focused,emptyanderrorStateas plain members. Those stay accessors — the interface is how the form field reads them. The six of them carried// TODO: Skipped for migration because:comments from the automated tooling; they say the actual reason now.minandmaxreported something other than what was boundA value the date adapter could not read came back as
nullfrom the getter. They report what was bound now; the parsed values are internal computeds that still drive the validators, re-run from an effect.kbqValidationTooltipleaked a subscription per bindingRe-binding the input stacked another subscription, and the last one outlived the directive. It is a signal input driven by an effect with an
onCleanupteardown.format's side effects were already coveredIts setter clamped the value, refreshed the placeholder and re-rendered the view. The clamp is the input's transform; the other two are subsumed by the locale effect that already re-read
timeFormatPlaceholder— which readsformat(), so it re-runs on a format change too.That effect also stopped returning early on a consumer-provided placeholder. It used to skip the value reformat along with the placeholder update, so a locale change left the rendered time in the old locale whenever the consumer had set their own placeholder.
The existing "Display time corresponding to timeformat" tests — including the unsupported-format fallback and the format-change re-render — pass unchanged, which is the evidence that moving the side effects preserved behavior.
Also
_IdGeneratorinstead of a module counter (kbq-timepicker-1→kbq-timepicker-a1), andthis.id = this.idin the constructor is replaced by initialising the backing field.disabledandrequireddeclarebooleanAttributeinstead of callingcoerceBooleanPropertyinside their setters.Migration
timepicker-signalsruns fromng update @koobiq/components@20. It rewritesformatreads and reports the rest.minandmaxare deliberately not rewritten: appending()would compile and hand back a different value for anything the adapter could not parse.There is no template pass —
kbqTimepickeris an attribute on a native<input>.Documented in
docs/guides/migration.{en,ru}.md, section 18.Testing
timepicker.spec.ts: 64 → 67 tests. New coverage for the format clamp through the transform,min/maxreporting the bound value, and the validators re-running whenminchanges.timepicker-signals/index.spec.ts: 10 tests.packages/components(5164 tests) andpackages/schematics(492 tests) suites pass.check-apiis in sync.BREAKING CHANGE
🤖 Generated with Claude Code