feat(slider): new TEDI-ready component #3 - #526
Conversation
* tooltip is now controllable and trigger position can be changed dynamically
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughThis PR adds a new ChangesSlider Component
Tooltip Controlled Open State and Interactive Trigger
Estimated code review effort: 4 (Complex) | ~50 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant SliderComponent
participant FormControl
User->>SliderComponent: input, pointer, focus, and hover events
SliderComponent->>SliderComponent: clamp value and compute progress
SliderComponent->>FormControl: onChange/onTouched callbacks
SliderComponent->>SliderComponent: render tooltip, labels, feedback, and addon slot
sequenceDiagram
participant Consumer
participant TooltipComponent
participant OverlayRef
participant requestAnimationFrame
Consumer->>TooltipComponent: set open = true and trackPosition = true
TooltipComponent->>TooltipComponent: compute isOpen from open model
TooltipComponent->>requestAnimationFrame: start tracking loop
requestAnimationFrame->>TooltipComponent: tick
TooltipComponent->>OverlayRef: updatePosition() and arrow placement
Consumer->>TooltipComponent: set open = false
TooltipComponent->>requestAnimationFrame: cancel tracking loop
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Stylelint (17.14.0)tedi/components/form/slider/slider.component.scssConfigurationError: Could not find "stylelint-config-recess-order". Do you need to install the package or use the "configBasedir" option? 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. Comment |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (3)
tedi/components/form/slider/slider.component.html (1)
48-51: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winBEM element notation used on a sub-component.
.tedi-slider__thumb-anchoris applied to<tedi-tooltip-trigger>, which is its own Angular component, not a simple DOM node oftedi-slider. Per guidelines, sub-components that are their own Angular components should get a separate BEM block rather than an__elementof the parent block.As per coding guidelines, "use separate BEM blocks for sub-components that are their own Angular components, and use `__` elements only for simple DOM nodes within a single component template."♻️ Proposed fix
- <tedi-tooltip-trigger - class="tedi-slider__thumb-anchor" - [interactive]="false" - ></tedi-tooltip-trigger> + <tedi-tooltip-trigger + class="tedi-slider-thumb-anchor" + [interactive]="false" + ></tedi-tooltip-trigger>(rename the matching selector in
slider.component.scssaccordingly)🤖 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/slider/slider.component.html` around lines 48 - 51, The `tedi-slider__thumb-anchor` class is using parent block element BEM notation on the standalone `tedi-tooltip-trigger` sub-component, which should have its own block name instead. Update the class in `slider.component.html` to a separate BEM block for the tooltip trigger, and rename the matching selector in `slider.component.scss` so the styling stays aligned with the new class name.Source: Coding guidelines
tedi/components/form/slider/slider.stories.ts (1)
44-131: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winMissing
argTypesentries for some public inputs.
name,ariaLabel,ariaLabelledby, andariaValuetextare publicSliderComponentinputs (andariaLabelis even used as an arg override in other stories) but have noargTypesentry, so they won't show up in the Storybook controls/docs table.As per path instructions, "ensure `argTypes` includes every public input/model, provide a Default story, and include significant state/visual variants."♻️ Proposed fix
valueFormatter: { control: false }, inputId: { control: false }, + name: { + control: "text", + table: { category: "inputs", type: { summary: "string" } }, + }, + ariaLabel: { + control: "text", + table: { category: "inputs", type: { summary: "string" } }, + }, + ariaLabelledby: { + control: "text", + table: { category: "inputs", type: { summary: "string" } }, + }, + ariaValuetext: { + control: "text", + table: { category: "inputs", type: { summary: "string" } }, + }, },🤖 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/slider/slider.stories.ts` around lines 44 - 131, The Slider story’s argTypes block is missing several public inputs, so add entries for name, ariaLabel, ariaLabelledby, and ariaValuetext alongside the existing SliderComponent controls. Update the slider.stories.ts argTypes definition so these props appear in Storybook docs/controls, matching the pattern used for label, value, and the other inputs. Keep the Default story and other variants intact while ensuring every public input/model is represented.Source: Path instructions
tedi/components/overlay/tooltip/tooltip-trigger/tooltip-trigger.component.ts (1)
140-142: 🎯 Functional Correctness | 🔵 TrivialNo cleanup when
interactivetoggles fromtruetofalse.The early return skips resolving/attaching a new interactive element, but any DOM mutations from a prior pass while
interactivewastrue(injected<span>wrapper,tabindex,tedi-tooltip-trigger--focusclass,aria-describedby) are never undone. The spec file avoids exercising this transition by creating a fresh fixture for theinteractive: falsecase rather than toggling on the same instance, suggesting this gap is already known.At minimum, reset
interactiveElementtonullon the "no longer interactive" branch soaria-describedbydoesn't linger on a stale element; a full fix would also need to track and revert the tabindex/class/wrapper changes made wheninteractivewas previouslytrue.🤖 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/overlay/tooltip/tooltip-trigger/tooltip-trigger.component.ts` around lines 140 - 142, The interactive toggle path in tooltip-trigger.component.ts leaves prior DOM changes behind when `interactive` switches from true to false. Update `ngAfterContentChecked` in `TooltipTriggerComponent` so the non-interactive branch clears `interactiveElement` and also reverts any state applied during the interactive path, including the injected wrapper, tabindex, `tedi-tooltip-trigger--focus` class, and `aria-describedby` on the trigger element.
🤖 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 `@tedi/components/form/slider/slider.component.html`:
- Around line 1-11: The `hideLabel="keep-space"` path in `slider.component.html`
currently only applies `tedi-slider__label--reserve-space`, and the matching
SCSS makes that label invisible to assistive tech. Update the
`.tedi-slider__label--reserve-space` styling in the slider SCSS so it preserves
layout space without hiding the label from screen readers, while keeping the
existing `sr-only` behavior for `hideLabel() === true`. Verify the `label()`,
`hideLabel()`, and `tedi-slider__label--reserve-space` combinations still match
the documented accessibility behavior.
In `@tedi/components/form/slider/slider.component.scss`:
- Around line 8-10: The .tedi-slider__label--reserve-space rule is using
visibility: hidden, which removes the label from the accessibility tree instead
of only reserving layout space. Update the styling used by SliderComponent’s
hideLabel keep-space behavior so the label stays accessible to assistive
technology while remaining visually hidden, and keep the class name aligned with
the existing tedi-slider__label--reserve-space convention.
In
`@tedi/components/overlay/tooltip/tooltip-trigger/tooltip-trigger.component.ts`:
- Around line 63-68: The `TooltipTriggerComponent.onTouchEnd` path leaves
`isTouch` stuck true when `tooltip.openWith()` is `"none"` because the early
return skips the reset. Update `onTouchEnd` so the `isTouch` reset always runs,
even when you skip `tooltip.toggleTooltip()`, and keep the touch guard behavior
in `onClick`, `onMouseEnter`, `onMouseLeave`, `onFocusIn`, and `onFocusOut`
intact. Use the `TooltipTriggerComponent` and `onTouchEnd` symbols to locate the
fix.
In `@tedi/components/overlay/tooltip/tooltip.component.ts`:
- Around line 100-103: Guard the Tooltip component’s imperative state updates in
controlled mode: in `showTooltip()`, `hideTooltip()`, and the `onEscape()` path,
return early when `open()` is defined so `internalOpen` is not mutated for
`isOpen`-controlled tooltips. Keep the controlled/uncontrolled behavior
consistent in `tooltip.component.ts` by only updating `internalOpen` and
detaching `horizontalPush` when the component is actually uncontrolled.
In `@tedi/components/overlay/tooltip/tooltip.stories.ts`:
- Line 33: The Tooltip Storybook setup is missing controls/docs entries for the
new public inputs on TooltipComponent, so update tooltip.stories.ts to add
argTypes for open and trackPosition alongside the existing openWith entries.
Also add a Storybook story variant in the Tooltip stories (e.g. a Controlled
story) that demonstrates openWith="none" combined with open and trackPosition so
the new interaction mode is visible in controls and docs.
---
Nitpick comments:
In `@tedi/components/form/slider/slider.component.html`:
- Around line 48-51: The `tedi-slider__thumb-anchor` class is using parent block
element BEM notation on the standalone `tedi-tooltip-trigger` sub-component,
which should have its own block name instead. Update the class in
`slider.component.html` to a separate BEM block for the tooltip trigger, and
rename the matching selector in `slider.component.scss` so the styling stays
aligned with the new class name.
In `@tedi/components/form/slider/slider.stories.ts`:
- Around line 44-131: The Slider story’s argTypes block is missing several
public inputs, so add entries for name, ariaLabel, ariaLabelledby, and
ariaValuetext alongside the existing SliderComponent controls. Update the
slider.stories.ts argTypes definition so these props appear in Storybook
docs/controls, matching the pattern used for label, value, and the other inputs.
Keep the Default story and other variants intact while ensuring every public
input/model is represented.
In
`@tedi/components/overlay/tooltip/tooltip-trigger/tooltip-trigger.component.ts`:
- Around line 140-142: The interactive toggle path in
tooltip-trigger.component.ts leaves prior DOM changes behind when `interactive`
switches from true to false. Update `ngAfterContentChecked` in
`TooltipTriggerComponent` so the non-interactive branch clears
`interactiveElement` and also reverts any state applied during the interactive
path, including the injected wrapper, tabindex, `tedi-tooltip-trigger--focus`
class, and `aria-describedby` on the trigger element.
🪄 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: 2a4cd315-0ad0-4dd7-80f8-05265a0b6554
📒 Files selected for processing (12)
skills/tedi-angular/references/components.mdtedi/components/form/index.tstedi/components/form/slider/index.tstedi/components/form/slider/slider.component.htmltedi/components/form/slider/slider.component.scsstedi/components/form/slider/slider.component.spec.tstedi/components/form/slider/slider.component.tstedi/components/form/slider/slider.stories.tstedi/components/overlay/tooltip/tooltip-trigger/tooltip-trigger.component.tstedi/components/overlay/tooltip/tooltip.component.spec.tstedi/components/overlay/tooltip/tooltip.component.tstedi/components/overlay/tooltip/tooltip.stories.ts
feat(tooltip): offset can now be customized
There was a problem hiding this comment.
♻️ Duplicate comments (1)
tedi/components/overlay/tooltip/tooltip.stories.ts (1)
75-89: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick winStill missing
argTypesforopenandtrackPosition.This was previously flagged: the newly added
TooltipComponentinputsopen(model) andtrackPositionhave no correspondingargTypesentries, so they won't appear in Storybook controls/docs. A "Controlled" story variant demonstratingopenWith="none"+open+trackPositionis also still absent.As per path instructions, "document every public
input()/model()inargTypes" and "include Default story plus per-visual-variant and per-significant-state stories."🤖 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/overlay/tooltip/tooltip.stories.ts` around lines 75 - 89, Add the missing Storybook documentation for TooltipComponent by updating TooltipComponent stories to include argTypes entries for the public model/input properties open and trackPosition alongside the existing openWith setup, so they appear in controls/docs. Also add a new “Controlled” story variant using TooltipComponent with openWith="none" plus open and trackPosition wired in, following the existing story patterns in tooltip.stories.ts.Source: Path instructions
🤖 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.
Duplicate comments:
In `@tedi/components/overlay/tooltip/tooltip.stories.ts`:
- Around line 75-89: Add the missing Storybook documentation for
TooltipComponent by updating TooltipComponent stories to include argTypes
entries for the public model/input properties open and trackPosition alongside
the existing openWith setup, so they appear in controls/docs. Also add a new
“Controlled” story variant using TooltipComponent with openWith="none" plus open
and trackPosition wired in, following the existing story patterns in
tooltip.stories.ts.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: df54ccf2-de0f-4d96-a6fc-78ff1054b01f
📒 Files selected for processing (6)
skills/tedi-angular/references/components.mdtedi/components/form/slider/slider.component.htmltedi/components/form/slider/slider.component.scsstedi/components/form/slider/slider.stories.tstedi/components/overlay/tooltip/tooltip.component.tstedi/components/overlay/tooltip/tooltip.stories.ts
💤 Files with no reviewable changes (1)
- tedi/components/form/slider/slider.component.scss
🚧 Files skipped from review as they are similar to previous changes (3)
- tedi/components/form/slider/slider.component.html
- skills/tedi-angular/references/components.md
- tedi/components/overlay/tooltip/tooltip.component.ts
# [7.1.0](angular-7.0.1...angular-7.1.0) (2026-08-06) ### Bug Fixes * **date-field:** changed min and max date defaults, exposed inputs [#590](#590) ([#591](#591)) ([30edbb3](30edbb3)) * **date-field:** date-field now passes value correctly to text-field [#592](#592) ([#593](#593)) ([5bc496e](5bc496e)) * **date-picker:** fix DatePicker focus ring [#560](#560) ([#574](#574)) ([17f675d](17f675d)) * **dropdown:** skip close on certain events [#544](#544) ([#545](#545)) ([f9be659](f9be659)) * **form-field,date-field,text-field,time-field:** value no longer cuts early [#561](#561) ([#571](#571)) ([17322fc](17322fc)) * **pagination:** community pagination results rendered twice [#548](#548) ([2ba2bb3](2ba2bb3)) * **popover,search,header:** fix Header a11y violations and document HeaderTop [#601](#601) ([#602](#602)) ([86312a9](86312a9)) * **popover:** fixed popover outside-click inside modal being registered as inside [#582](#582) ([#583](#583)) ([139406b](139406b)) * **select,dropdown,popover:** hideOnScroll no longer closes overlay when scrolling its content [#562](#562) ([#567](#567)) ([3120825](3120825)) * **select:** keep typed text and tags in view while searching [#566](#566) ([#584](#584)) ([6afc148](6afc148)) * **select:** truncate over-wide tags in a single row [#586](#586) ([#598](#598)) ([68dcb27](68dcb27)) * **table:** scrollable table now scrolls top on page change [#549](#549) ([#550](#550)) ([9771fc3](9771fc3)) * **tabs:** added anchor support [#594](#594) ([#597](#597)) ([c9a3a98](c9a3a98)) * **text-field,time-field:** caret no longer clipped at the start of the input [#575](#575) ([#576](#576)) ([644d3f5](644d3f5)) * **text-field:** support bare disabled attribute via booleanAttribute transform [#558](#558) ([#559](#559)) ([fad56f8](fad56f8)) * **textgroup:** label doesn't shrink when width is fixed [#506](#506) ([#531](#531)) ([4e9d713](4e9d713)) ### Features * **breadcrumbs:** new TEDI-ready component [#512](#512) ([#518](#518)) ([6691cd2](6691cd2)) * **date-field:** added hideOnScroll [#563](#563) ([#595](#595)) ([0dfad0f](0dfad0f)) * **header:** add Header top [#311](#311) ([#504](#504)) ([1e2eff2](1e2eff2)) * **info-button:** focus ring offset reduced [#517](#517) ([#521](#521)) ([b7d06d3](b7d06d3)) * **input-group:** new TEDI-ready component [#18](#18) ([#532](#532)) ([c1728c0](c1728c0)) * **label-row,info-tooltip:** new components [#515](#515) ([#525](#525)) ([1e33865](1e33865)) * **popover:** add Header popover variant under Popover [#442](#442) ([#523](#523)) ([a668b55](a668b55)) * **search:** add new TEDI-ready component [#524](#524) ([#539](#539)) ([f637542](f637542)) * **select:** added virtual scroll [#552](#552) ([#553](#553)) ([26e10ee](26e10ee)) * **slider:** new TEDI-ready component [#3](#3) ([#526](#526)) ([d2bf13a](d2bf13a)) * **table:** added getRowId and clearFilters [#565](#565) ([#589](#589)) ([1cf94a1](1cf94a1))
Summary by CodeRabbit
[sliderAddon]projection.open,openWith="none",trackPosition, configurableoffset, and aninteractiveoption on the trigger.openWith="none"and improved controlled positioning/updates.