Skip to content

feat(time-field,time-picker,scroll-fade): new tedi-ready components #374 - #397

Merged
mart-sessman merged 40 commits into
rcfrom
feat/374-time-field-picker-tedi-ready
Jun 5, 2026
Merged

feat(time-field,time-picker,scroll-fade): new tedi-ready components #374#397
mart-sessman merged 40 commits into
rcfrom
feat/374-time-field-picker-tedi-ready

Conversation

@mart-sessman

@mart-sessman mart-sessman commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • Added Time Field and Time Picker UI: typed input with normalization, clearable control, popover/modal picker, native-picker fallback, three picker variants (scroll/slots/dropdown), and reactive-forms support.
  • Documentation
    • New responsive-inputs guidance; Storybook pages demonstrating variants, responsive/interactive cases, and reactive-forms examples.
  • Tests
    • Comprehensive unit test coverage for time utils, field, picker, and modal behaviors.
  • Chores
    • New translations for time-related UI text and minor UI/style refinements.

m2rt added 14 commits March 26, 2026 10:22
…ready

# Conflicts:
#	.claude/hooks/post-edit-test.sh
#	.claude/skills/contributing/SKILL.md
#	.claude/skills/contributing/references/a11y-review.md
#	.claude/skills/contributing/references/best-practices.md
#	.claude/skills/contributing/references/new-component.md
#	.claude/skills/contributing/references/refactoring.md
#	.claude/skills/contributing/references/stories.md
#	.claude/skills/contributing/references/testing.md
#	CLAUDE.md
#	skills/tedi-angular/references/components.md
#	skills/tedi-angular/references/forms.md
#	tedi/components/form/index.ts
@coderabbitai

coderabbitai Bot commented Apr 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 74ed0744-5ac9-478d-92bd-f531603a8e6d

📥 Commits

Reviewing files that changed from the base of the PR and between de931cd and 433b355.

📒 Files selected for processing (7)
  • .claude/skills/contributing/references/best-practices.md
  • skills/tedi-angular/references/components.md
  • tedi/components/form/time-field/time-field.component.scss
  • tedi/components/form/time-field/time-field.stories.ts
  • tedi/components/form/time-field/time-picker-modal.component.spec.ts
  • tedi/components/form/time-field/time-picker-modal.component.ts
  • tedi/services/translation/translations.ts
✅ Files skipped from review due to trivial changes (1)
  • .claude/skills/contributing/references/best-practices.md
🚧 Files skipped from review as they are similar to previous changes (6)
  • tedi/services/translation/translations.ts
  • tedi/components/form/time-field/time-picker-modal.component.spec.ts
  • tedi/components/form/time-field/time-picker-modal.component.ts
  • tedi/components/form/time-field/time-field.component.scss
  • tedi/components/form/time-field/time-field.stories.ts
  • skills/tedi-angular/references/components.md

📝 Walkthrough

Walkthrough

Adds TimeField and TimePicker components (with modal wrapper), time validation/normalization utilities, extensive unit tests and Storybook stories, translation keys, docs/contributing updates for responsive inputs, and supporting helper and test-infrastructure changes.

Changes

Time Field and Picker Form Components

Layer / File(s) Summary
Time Validation and Normalization Utilities
tedi/utils/time.util.ts, tedi/utils/time.util.spec.ts, tedi/services/translation/translations.ts
Adds isValidTime() and normalizeTime() with tests; adds translation entries for time picker/field UI strings.
TimePicker component implementation
tedi/components/form/time-picker/time-picker.component.ts
Standalone TimePickerComponent supporting scroll/dropdown/slots variants, ControlValueAccessor, keyboard navigation, focus/scroll alignment, ResizeObserver integration, and public selection APIs.
TimePicker templates, styles, stories, tests, and index
tedi/components/form/time-picker/*.html, *.scss, *.spec.ts, *.stories.ts, index.ts
Templates for each variant, SCSS, comprehensive specs covering interactions/keyboard/focus, Storybook stories demonstrating variants and reactive-forms integration, and index barrel export.
TimePicker modal wrapper
tedi/components/form/time-field/time-picker-modal.component.ts, *.html, *.scss, *.spec.ts
Modal wrapper component for mobile, draft handling, form submit/Enter-key interception, styles, and tests verifying lifecycle and keyboard behaviors.
TimeField component implementation & tests
tedi/components/form/time-field/time-field.component.ts, *.html, *.scss, *.spec.ts
Standalone TimeFieldComponent implementing ControlValueAccessor and FormFieldControl, native OS picker fallback, popover/modal custom picker, blur normalization, clear behavior, breakpoint-aware picker resolution, and extensive test coverage.
TimeField stories & index
tedi/components/form/time-field/time-field.stories.ts, index.ts
Storybook stories demonstrating sizes, states, variants, native picker, modal behavior, manual typing, and reactive-forms example; index export added.
Form module exports & projection
tedi/components/form/index.ts, tedi/components/form/form-field/form-field.component.html
Barrel exports updated to re-export time-field, time-picker, and form-field-control; form-field content projection expanded to accept tedi-time-field.
Docs, contributing guides, and references
.claude/skills/contributing/references/best-practices.md, .claude/skills/contributing/references/new-component.md, skills/tedi-angular/references/components.md, skills/tedi-angular/references/forms.md
Adds "Responsive Inputs (Breakpoint Support)" guidance, updates new-component checklist to require responsive-case stories, documents tedi-time-field and tedi-time-picker, and updates forms reference table.
Helpers, popover tweaks, and test infra
tedi/components/helpers/scroll-fade/*, tedi/components/overlay/popover/*, setup-jest.ts
ScrollFade observes inner resizes and cleans up observer; PopoverContent builds classes without "none" modifier; popover SCSS map simplified; global ResizeObserver mock added for Jest.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • ly-tempel-bitweb
  • airikej
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: introducing new tedi-ready components (time-field, time-picker) and enhancing scroll-fade, which aligns with the comprehensive changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/374-time-field-picker-tedi-ready

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mart-sessman

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Apr 7, 2026

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tedi/components/form/index.ts (1)

9-15: ⚠️ Potential issue | 🟡 Minor

Duplicate export of date-picker.component.

Lines 9 and 15 both export "./date-picker/date-picker.component". This will cause a TypeScript compilation error or unexpected behavior.

🐛 Proposed fix
 export * from "./radio-card-group/radio-card-group.component";
 export * from "./date-picker/date-picker.component";
 export * from "./feedback-text/feedback-text.component";
 export * from "./label/label.component";
 export * from "./number-field/number-field.component";
 export * from "./select";
 export * from "./toggle/toggle.component";
-export * from "./date-picker/date-picker.component";
 export * from "./form-field/form-field.component";
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tedi/components/form/index.ts` around lines 9 - 15, There are duplicate
exports of "./date-picker/date-picker.component" in the form barrel; remove the
redundant export so the module is only exported once (keep a single export line
for "./date-picker/date-picker.component" and delete the other), and verify the
remaining exports (e.g., "./feedback-text/feedback-text.component",
"./label/label.component", "./number-field/number-field.component", "./select",
"./toggle/toggle.component") are correct.
🧹 Nitpick comments (5)
tedi/components/form/time-field/time-field.component.scss (1)

53-62: Remove !important declarations to resolve specificity issues.

The !important overrides on lines 54–57 indicate specificity conflicts with base button styles and can lead to maintenance issues. Consider:

  1. Increasing selector specificity naturally (e.g., .tedi-time-field .tedi-time-field__icon)
  2. Using CSS custom properties that the button component respects
  3. Adjusting the base button component to be more customizable

The tedi-time-field__icon--static modifier class used in the HTML template (non-interactive state) does not have explicit styles, but this appears intentional—it's a semantic marker that correctly inherits from the base &__icon styles.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tedi/components/form/time-field/time-field.component.scss` around lines 53 -
62, Remove the four `!important` overrides on the `&__icon` rules to avoid
specificity fights; instead increase selector specificity (e.g., target
`.tedi-time-field .tedi-time-field__icon`) or rely on configurable CSS custom
properties the base button consumes (use the existing --button-xs-icon-size,
--form-field-button-height-sm, --button-radius-sm variables) so the icon styles
inherit normally; keep the `tedi-time-field__icon--static` modifier as-is since
it intentionally inherits from `&__icon`.
tedi/components/helpers/scroll-fade/scroll-fade.component.scss (1)

26-44: CSS nesting depth exceeds maximum of 4 levels.

The :hover pseudo-class inside &::-webkit-scrollbar-thumb creates 5 levels of nesting (.tedi-scroll-fade&__inner&--custom-scroll&::-webkit-scrollbar-thumb&:hover). As per coding guidelines, max CSS nesting depth is 4.

♻️ Proposed fix to flatten nesting
   &__inner {
     flex: 1;
     min-height: 0;
     max-height: inherit;
     overflow: auto;
     mask-image: linear-gradient(
       to bottom,
       transparent 0%,
       black var(--_tedi-scroll-fade-top),
       black calc(100% - var(--_tedi-scroll-fade-bottom)),
       transparent 100%
     );
-
-    &--custom-scroll {
-      &::-webkit-scrollbar {
-        width: 6px;
-        background-color: var(--general-surface-primary);
-      }
-
-      &::-webkit-scrollbar-thumb {
-        background: var(--general-border-primary);
-        border-radius: 100px;
-
-        &:hover {
-          background-color: var(--general-border-secondary);
-        }
-      }
-
-      &::-webkit-scrollbar-track {
-        background-color: var(--general-surface-primary);
-      }
-    }
   }
+
+  &__inner--custom-scroll {
+    &::-webkit-scrollbar {
+      width: 6px;
+      background-color: var(--general-surface-primary);
+    }
+
+    &::-webkit-scrollbar-thumb {
+      background: var(--general-border-primary);
+      border-radius: 100px;
+    }
+
+    &::-webkit-scrollbar-thumb:hover {
+      background-color: var(--general-border-secondary);
+    }
+
+    &::-webkit-scrollbar-track {
+      background-color: var(--general-surface-primary);
+    }
+  }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tedi/components/helpers/scroll-fade/scroll-fade.component.scss` around lines
26 - 44, The nesting depth exceeds the max because the &:hover pseudo inside
&::-webkit-scrollbar-thumb creates five levels; move the hover selector out to
flatten it. Concretely, remove the nested &:hover inside
&::-webkit-scrollbar-thumb and add a top-level selector targeting
&--custom-scroll::-webkit-scrollbar-thumb:hover (or the equivalent flattened
selector using &--custom-scroll and ::-webkit-scrollbar-thumb:hover) so you keep
the same styles but reduce nesting; update selectors referencing
&--custom-scroll, &::-webkit-scrollbar-thumb, and &:hover accordingly.
tedi/components/form/time-field/time-field.component.html (1)

29-49: Consider moving inline styles to CSS classes.

Lines 31 and 49 use inline style attributes. For consistency with the BEM approach and maintainability, consider using CSS classes instead.

♻️ Suggested approach

Add classes to the SCSS file:

.tedi-time-field__popover-trigger {
  display: flex;
  align-items: center;
}

.tedi-time-field__popover-content {
  padding: 0;
}

Then update the template:

     <tedi-popover
       `#popover`
-      style="display: flex; align-items: center"
+      class="tedi-time-field__popover-trigger"
       position="bottom-end"
...
-      <tedi-popover-content maxWidth="none" style="padding: 0">
+      <tedi-popover-content maxWidth="none" class="tedi-time-field__popover-content">
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tedi/components/form/time-field/time-field.component.html` around lines 29 -
49, Replace the inline styles on the tedi-popover host element and
tedi-popover-content with CSS classes: create classes (e.g.,
.tedi-time-field__popover-trigger and .tedi-time-field__popover-content) in the
component SCSS containing the styles "display: flex; align-items: center" and
"padding: 0" respectively, then remove the style attributes from the
<tedi-popover `#popover` ...> and <tedi-popover-content ...> elements and add the
corresponding class names to those elements to follow the BEM approach and keep
styling in SCSS.
tedi/components/form/time-field/time-field.component.ts (1)

194-203: Nested setTimeout pattern is fragile for timing coordination.

The double setTimeout relies on specific timing to wait for popover rendering and focus setup. This could be flaky if rendering takes longer than expected.

Consider using a more robust approach such as observing DOM changes or using Angular's lifecycle hooks if possible.

♻️ Consider using requestAnimationFrame or AfterViewInit pattern
   onPickerOpen() {
-    // First timeout waits for popover to render content in DOM.
-    // Nested timeout runs after popover's own focus setup (which also uses setTimeout).
-    setTimeout(() => {
-      this.timePicker()?.scrollToSelected();
-      setTimeout(() => {
-        this.timePicker()?.focusActiveItem();
-      });
-    });
+    // Use requestAnimationFrame to ensure DOM is ready
+    requestAnimationFrame(() => {
+      this.timePicker()?.scrollToSelected();
+      requestAnimationFrame(() => {
+        this.timePicker()?.focusActiveItem();
+      });
+    });
   }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tedi/components/form/time-field/time-field.component.ts` around lines 194 -
203, The nested setTimeouts in onPickerOpen (which calls
this.timePicker()?.scrollToSelected() and this.timePicker()?.focusActiveItem())
are fragile; replace them with a more robust coordination such as waiting for
Angular stabilization or the next animation frame: e.g., use NgZone.onStable or
requestAnimationFrame (or a MutationObserver if the popover content is dynamic)
to call scrollToSelected() after the popover DOM is rendered and then schedule
focusActiveItem() on the next animation frame (or when the zone is stable)
instead of using nested setTimeouts.
tedi/components/helpers/scroll-fade/scroll-fade.component.ts (1)

76-99: Consider using an arrow function for onScroll to ensure stable reference.

While onScroll is currently called via template binding (scroll)="onScroll()" which works correctly, the coding guidelines recommend arrow function properties for event handlers. This is a minor suggestion since the current implementation is functional.

♻️ Optional: Convert to arrow function
-  onScroll(): void {
+  onScroll = (): void => {
     const el = this.innerRef().nativeElement;
     this.updateFade(el.scrollTop, el.scrollHeight, el.clientHeight);
-  }
+  };
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tedi/components/helpers/scroll-fade/scroll-fade.component.ts` around lines 76
- 99, The onScroll method should be converted to an arrow-function property to
ensure a stable function reference for template bindings; replace the class
method onScroll() with an arrow property (keeping the same logic that reads
const el = this.innerRef().nativeElement and calls this.updateFade) so it
becomes onScroll = (): void => { ... }, leaving updateFade, ngAfterViewInit,
fade, scrolledToTop and scrolledToBottom unchanged; ensure any places that call
onScroll (template bindings) remain unchanged since the signature and behavior
are identical.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tedi/components/form/time-picker/time-picker.component.html`:
- Around line 7-9: Replace the hardcoded aria-label attributes in the
time-picker template with the tediTranslate pipe: update the listbox/role
elements that currently use aria-label="Hours" and aria-label="Minutes" to use
the translation pipe (e.g., aria-label="{{ 'timePicker.hours' | tediTranslate
}}") so the labels are localized; ensure you update the template instances in
time-picker.component.html and add the corresponding translation keys (e.g.,
timePicker.hours, timePicker.minutes) to the translations map used by the
tediTranslate service.

---

Outside diff comments:
In `@tedi/components/form/index.ts`:
- Around line 9-15: There are duplicate exports of
"./date-picker/date-picker.component" in the form barrel; remove the redundant
export so the module is only exported once (keep a single export line for
"./date-picker/date-picker.component" and delete the other), and verify the
remaining exports (e.g., "./feedback-text/feedback-text.component",
"./label/label.component", "./number-field/number-field.component", "./select",
"./toggle/toggle.component") are correct.

---

Nitpick comments:
In `@tedi/components/form/time-field/time-field.component.html`:
- Around line 29-49: Replace the inline styles on the tedi-popover host element
and tedi-popover-content with CSS classes: create classes (e.g.,
.tedi-time-field__popover-trigger and .tedi-time-field__popover-content) in the
component SCSS containing the styles "display: flex; align-items: center" and
"padding: 0" respectively, then remove the style attributes from the
<tedi-popover `#popover` ...> and <tedi-popover-content ...> elements and add the
corresponding class names to those elements to follow the BEM approach and keep
styling in SCSS.

In `@tedi/components/form/time-field/time-field.component.scss`:
- Around line 53-62: Remove the four `!important` overrides on the `&__icon`
rules to avoid specificity fights; instead increase selector specificity (e.g.,
target `.tedi-time-field .tedi-time-field__icon`) or rely on configurable CSS
custom properties the base button consumes (use the existing
--button-xs-icon-size, --form-field-button-height-sm, --button-radius-sm
variables) so the icon styles inherit normally; keep the
`tedi-time-field__icon--static` modifier as-is since it intentionally inherits
from `&__icon`.

In `@tedi/components/form/time-field/time-field.component.ts`:
- Around line 194-203: The nested setTimeouts in onPickerOpen (which calls
this.timePicker()?.scrollToSelected() and this.timePicker()?.focusActiveItem())
are fragile; replace them with a more robust coordination such as waiting for
Angular stabilization or the next animation frame: e.g., use NgZone.onStable or
requestAnimationFrame (or a MutationObserver if the popover content is dynamic)
to call scrollToSelected() after the popover DOM is rendered and then schedule
focusActiveItem() on the next animation frame (or when the zone is stable)
instead of using nested setTimeouts.

In `@tedi/components/helpers/scroll-fade/scroll-fade.component.scss`:
- Around line 26-44: The nesting depth exceeds the max because the &:hover
pseudo inside &::-webkit-scrollbar-thumb creates five levels; move the hover
selector out to flatten it. Concretely, remove the nested &:hover inside
&::-webkit-scrollbar-thumb and add a top-level selector targeting
&--custom-scroll::-webkit-scrollbar-thumb:hover (or the equivalent flattened
selector using &--custom-scroll and ::-webkit-scrollbar-thumb:hover) so you keep
the same styles but reduce nesting; update selectors referencing
&--custom-scroll, &::-webkit-scrollbar-thumb, and &:hover accordingly.

In `@tedi/components/helpers/scroll-fade/scroll-fade.component.ts`:
- Around line 76-99: The onScroll method should be converted to an
arrow-function property to ensure a stable function reference for template
bindings; replace the class method onScroll() with an arrow property (keeping
the same logic that reads const el = this.innerRef().nativeElement and calls
this.updateFade) so it becomes onScroll = (): void => { ... }, leaving
updateFade, ngAfterViewInit, fade, scrolledToTop and scrolledToBottom unchanged;
ensure any places that call onScroll (template bindings) remain unchanged since
the signature and behavior are identical.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6e783f1b-a5bc-4af9-8e0b-aae44c0c937c

📥 Commits

Reviewing files that changed from the base of the PR and between d41718c and 31df16b.

📒 Files selected for processing (23)
  • .claude/skills/contributing/references/best-practices.md
  • tedi/components/form/form-field/form-field.component.html
  • tedi/components/form/index.ts
  • tedi/components/form/time-field/index.ts
  • tedi/components/form/time-field/time-field.component.html
  • tedi/components/form/time-field/time-field.component.scss
  • tedi/components/form/time-field/time-field.component.spec.ts
  • tedi/components/form/time-field/time-field.component.ts
  • tedi/components/form/time-field/time-field.stories.ts
  • tedi/components/form/time-picker/index.ts
  • tedi/components/form/time-picker/time-picker.component.html
  • tedi/components/form/time-picker/time-picker.component.scss
  • tedi/components/form/time-picker/time-picker.component.spec.ts
  • tedi/components/form/time-picker/time-picker.component.ts
  • tedi/components/form/time-picker/time-picker.stories.ts
  • tedi/components/helpers/index.ts
  • tedi/components/helpers/scroll-fade/index.ts
  • tedi/components/helpers/scroll-fade/scroll-fade.component.html
  • tedi/components/helpers/scroll-fade/scroll-fade.component.scss
  • tedi/components/helpers/scroll-fade/scroll-fade.component.spec.ts
  • tedi/components/helpers/scroll-fade/scroll-fade.component.ts
  • tedi/components/helpers/scroll-fade/scroll-fade.stories.ts
  • tedi/services/translation/translations.ts

Comment thread tedi/components/form/time-picker/time-picker.component.html Outdated
@mart-sessman

Copy link
Copy Markdown
Contributor Author

@coderabbitai resolve

@coderabbitai

coderabbitai Bot commented Apr 8, 2026

Copy link
Copy Markdown
✅ Actions performed

Comments resolved. Approval is disabled; enable reviews.request_changes_workflow to allow explicit top-level @coderabbitai resolve or @coderabbitai approve commands.

m2rt and others added 5 commits April 8, 2026 18:32
# Conflicts:
#	skills/tedi-angular/references/components.md
#	tedi/components/form/checkbox-card/checkbox-card.component.scss
#	tedi/components/form/checkbox-card/checkbox-card.component.spec.ts
#	tedi/components/form/checkbox-card/checkbox-card.component.ts
#	tedi/components/form/checkbox/checkbox.stories.ts
#	tedi/components/form/radio-card/radio-card.component.scss
#	tedi/components/form/radio-card/radio-card.component.spec.ts
#	tedi/components/form/radio-card/radio-card.component.ts
#	tedi/components/form/radio/radio.stories.ts
…cker-tedi-ready

# Conflicts:
#	tedi/components/helpers/scroll-fade/scroll-fade.component.scss
#	tedi/components/helpers/scroll-fade/scroll-fade.component.ts
Comment thread tedi/components/form/index.ts
Comment thread tedi/components/form/time-field/time-field.stories.ts
Comment thread tedi/components/form/time-field/time-field.stories.ts
Comment thread tedi/components/form/time-field/time-field.component.scss
Comment thread tedi/components/form/time-field/time-field.stories.ts Outdated
Comment thread tedi/components/form/time-field/time-field.stories.ts
Comment thread tedi/components/form/time-field/time-field.stories.ts Outdated
Comment thread tedi/components/form/time-field/time-field.stories.ts
…ker-tedi-ready

# Conflicts:
#	skills/tedi-angular/references/components.md

@coderabbitai coderabbitai 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.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tedi/components/form/time-field/time-field.component.spec.ts (1)

18-23: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Provide a translation service mock in every TestBed setup here.

These suites test translated components but only register TEDI_TRANSLATION_DEFAULT_TOKEN. Please also mock TediTranslationService in each setup to keep tests isolated and stable.

As per coding guidelines: **/*.component.spec.ts: Do not forget to provide TediTranslationService mock and TEDI_TRANSLATION_DEFAULT_TOKEN in tests and **/*.spec.ts: Mock TediTranslationService in tests that use translated components.

Also applies to: 381-387, 443-449, 511-517, 951-956, 1029-1034, 1061-1065

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tedi/components/form/time-field/time-field.component.spec.ts` around lines 18
- 23, Test setups for TimeFieldComponent only register
TEDI_TRANSLATION_DEFAULT_TOKEN but don't provide a mocked
TediTranslationService; update the TestBed.configureTestingModule calls that
import TimeFieldComponent to also provide a mock for TediTranslationService
(e.g., provide: TediTranslationService, useValue: { translate: jest.fn(), ... }
or a minimal stub) alongside the existing TEDI_TRANSLATION_DEFAULT_TOKEN so
translated behavior is isolated and stable; locate the
TestBed.configureTestingModule blocks around TimeFieldComponent and add the
mocked provider in their providers array.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/skills/contributing/references/best-practices.md:
- Around line 182-184: The fenced code block containing the line `-
`useNativePicker: BreakpointInput<boolean> = false` — ... Accepts a breakpoint
object, e.g. `{ xs: true, md: false }`` is missing a language specifier; update
the opening backticks to include a language such as markdown (e.g., change ```
to ```markdown) so the block is properly highlighted and lint-compliant,
ensuring you only modify the opening fence and leave the content and closing
fence unchanged.

In `@tedi/components/form/time-field/time-picker-modal.component.ts`:
- Around line 78-85: The onCaptureKeydown handler is submitting on Enter before
internal tedi-time-picker keyboard handling runs; update onCaptureKeydown to
ignore Enter events that originate from or pass through a tedi-time-picker
element by checking event.composedPath() (or falling back to walking up from
event.target) and returning early if any node is an HTMLElement whose tagName
(or matches) equals 'tedi-time-picker' (or the custom element's selector); keep
the existing checks (non-Enter, HTMLButtonElement) and only call
form.requestSubmit() when the composed path does not include tedi-time-picker.

In `@tedi/components/form/time-picker/time-picker.component.spec.ts`:
- Around line 13-17: The tests configure TestBed for TimePickerComponent but
only set TEDI_TRANSLATION_DEFAULT_TOKEN and still inject the real
TediTranslationService; add a mock provider for TediTranslationService in each
TestBed.configureTestingModule (the same mock in other specs referenced) so
tests are deterministic—provide { provide: TediTranslationService, useValue:
<minimal mock object implementing any methods used by TimePickerComponent/tests>
} alongside TEDI_TRANSLATION_DEFAULT_TOKEN and imports; ensure the mock
implements the specific translation/getter methods the component relies on.

---

Outside diff comments:
In `@tedi/components/form/time-field/time-field.component.spec.ts`:
- Around line 18-23: Test setups for TimeFieldComponent only register
TEDI_TRANSLATION_DEFAULT_TOKEN but don't provide a mocked
TediTranslationService; update the TestBed.configureTestingModule calls that
import TimeFieldComponent to also provide a mock for TediTranslationService
(e.g., provide: TediTranslationService, useValue: { translate: jest.fn(), ... }
or a minimal stub) alongside the existing TEDI_TRANSLATION_DEFAULT_TOKEN so
translated behavior is isolated and stable; locate the
TestBed.configureTestingModule blocks around TimeFieldComponent and add the
mocked provider in their providers array.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: aad6ffc4-00d6-41b0-ba3a-fa7d209a309c

📥 Commits

Reviewing files that changed from the base of the PR and between 31df16b and de931cd.

📒 Files selected for processing (28)
  • .claude/skills/contributing/references/best-practices.md
  • .claude/skills/contributing/references/new-component.md
  • setup-jest.ts
  • skills/tedi-angular/references/components.md
  • skills/tedi-angular/references/forms.md
  • tedi/components/form/form-field/form-field.component.html
  • tedi/components/form/index.ts
  • tedi/components/form/time-field/time-field.component.html
  • tedi/components/form/time-field/time-field.component.scss
  • tedi/components/form/time-field/time-field.component.spec.ts
  • tedi/components/form/time-field/time-field.component.ts
  • tedi/components/form/time-field/time-field.stories.ts
  • tedi/components/form/time-field/time-picker-modal.component.html
  • tedi/components/form/time-field/time-picker-modal.component.scss
  • tedi/components/form/time-field/time-picker-modal.component.spec.ts
  • tedi/components/form/time-field/time-picker-modal.component.ts
  • tedi/components/form/time-picker/time-picker.component.html
  • tedi/components/form/time-picker/time-picker.component.scss
  • tedi/components/form/time-picker/time-picker.component.spec.ts
  • tedi/components/form/time-picker/time-picker.component.ts
  • tedi/components/form/time-picker/time-picker.stories.ts
  • tedi/components/helpers/scroll-fade/scroll-fade.component.scss
  • tedi/components/helpers/scroll-fade/scroll-fade.component.ts
  • tedi/components/overlay/popover/popover-content/popover-content.component.ts
  • tedi/components/overlay/popover/popover.component.scss
  • tedi/services/translation/translations.ts
  • tedi/utils/time.util.spec.ts
  • tedi/utils/time.util.ts
💤 Files with no reviewable changes (6)
  • tedi/utils/time.util.spec.ts
  • tedi/utils/time.util.ts
  • tedi/components/overlay/popover/popover.component.scss
  • tedi/components/form/index.ts
  • tedi/services/translation/translations.ts
  • tedi/components/overlay/popover/popover-content/popover-content.component.ts
✅ Files skipped from review due to trivial changes (5)
  • tedi/components/form/form-field/form-field.component.html
  • setup-jest.ts
  • skills/tedi-angular/references/forms.md
  • .claude/skills/contributing/references/new-component.md
  • tedi/components/form/time-field/time-picker-modal.component.scss
🚧 Files skipped from review as they are similar to previous changes (10)
  • tedi/components/helpers/scroll-fade/scroll-fade.component.scss
  • tedi/components/form/time-picker/time-picker.component.html
  • tedi/components/form/time-field/time-field.component.scss
  • tedi/components/helpers/scroll-fade/scroll-fade.component.ts
  • tedi/components/form/time-field/time-picker-modal.component.spec.ts
  • tedi/components/form/time-picker/time-picker.stories.ts
  • skills/tedi-angular/references/components.md
  • tedi/components/form/time-field/time-field.component.ts
  • tedi/components/form/time-picker/time-picker.component.scss
  • tedi/components/form/time-picker/time-picker.component.ts

Comment thread .claude/skills/contributing/references/best-practices.md Outdated
Comment thread tedi/components/form/time-field/time-picker-modal.component.ts
Comment thread tedi/components/form/time-picker/time-picker.component.spec.ts
Comment thread tedi/components/form/time-field/time-field.stories.ts
Comment thread tedi/components/form/time-field/time-field.stories.ts Outdated
Comment thread tedi/components/form/time-field/time-field.stories.ts Outdated
@mart-sessman
mart-sessman merged commit 0040e62 into rc Jun 5, 2026
20 checks passed
@mart-sessman
mart-sessman deleted the feat/374-time-field-picker-tedi-ready branch June 5, 2026 13:51
github-actions Bot pushed a commit that referenced this pull request Jun 5, 2026
# [6.5.0-rc.4](angular-6.5.0-rc.3...angular-6.5.0-rc.4) (2026-06-05)

### Features

* **time-field,time-picker,scroll-fade:** new tedi-ready components [#374](#374) ([#397](#397)) ([0040e62](0040e62))
github-actions Bot pushed a commit that referenced this pull request Jul 2, 2026
# [7.0.0](angular-6.4.0...angular-7.0.0) (2026-07-02)

### Bug Fixes

* **date-field,date-picker:** resolved conflict with formcontrol [#494](#494) ([#501](#501)) ([7721071](7721071))
* **dropdown:** overridden browser-default padding on dropdown-content [#498](#498) ([#499](#499)) ([1219cde](1219cde))
* **icon:** size input now works inside buttons and links [#435](#435) ([#497](#497)) ([e2b6a70](e2b6a70))
* **table:** state is correctly forwarded + added state docs [#477](#477) ([#478](#478)) ([9282b60](9282b60))

### Features

* **accordion:** fix mobile examples, add new inputs and stories [#467](#467) ([#483](#483)) ([c45e3e7](c45e3e7))
* Added angular v22 support [#466](#466) ([#476](#476)) ([36b1266](36b1266))
* **alert:** add tedi-alert-action slot [#460](#460) ([#461](#461)) ([ca8fc86](ca8fc86))
* **alert:** Added small size [#502](#502) ([#503](#503)) ([c6bd5aa](c6bd5aa))
* **button-group:** new tedi-ready component [#9](#9) ([#450](#450)) ([37a4d3b](37a4d3b))
* **card,card-button,timeline-card:** new tedi-ready components [#453](#453) ([#479](#479)) ([7c13043](7c13043))
* **date-field,calendar:** calendar tedi-ready [#6](#6) ([#443](#443)) ([467271a](467271a))
* **dropdown:** Added support for wrapped buttons [#468](#468) ([#469](#469)) ([056340a](056340a))
* **ellipsis:** new tedi-ready component [#472](#472) ([#475](#475)) ([a38d594](a38d594))
* **float-ui:** replaced float-ui usage in relevant components [#380](#380) ([#401](#401)) ([7aee67b](7aee67b))
* **header:** update Header component against Figma [#312](#312) ([#440](#440)) ([81b1c18](81b1c18))
* **info-button:** added inverted variant [#236](#236) ([#496](#496)) ([0a67fa8](0a67fa8))
* **pagination:** tedi-ready component [#446](#446) ([#447](#447)) ([47af78b](47af78b))
* **progressbar,attachment:** new tedi-ready components [#253](#253) ([#451](#451)) ([b2b9b5b](b2b9b5b)), closes [#482](#482)
* **select:** added tooltip, ariaLabelledby, ariaLabel [#508](#508) ([#509](#509)) ([0ee3572](0ee3572))
* **table:** added new features [#480](#480) ([#485](#485)) ([1ca8a2d](1ca8a2d))
* **table:** added selectedRowHighlight input and updated stories [#445](#445) ([c7aeb1b](c7aeb1b))
* **table:** behavioural improvements [#470](#470) ([#473](#473)) ([098a616](098a616))
* **table:** new tedi-ready component [#445](#445) ([#448](#448)) ([2d9480e](2d9480e))
* **tabs:** new tedi-ready component [#14](#14) ([#481](#481)) ([5f37a32](5f37a32))
* **time-field,time-picker,scroll-fade:** new tedi-ready components [#374](#374) ([#397](#397)) ([0040e62](0040e62))

### BREAKING CHANGES

* **icon:** button and link icon size changed, tedi-icon--size-* overrides no longer work
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.

3 participants