@meistrari/tela-build 1.89.0 → 1.89.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -14,6 +14,7 @@ Latest updates and announcements.
|
|
|
14
14
|
- [Video Player](/components/video-player) without a `poster` shows a frame from the start of the video as its thumbnail instead of an empty surface. A `poster` still takes precedence.
|
|
15
15
|
- [Video Player](/components/video-player) opens on a centered play button and a duration badge instead of the full control bar; the controls take over once playback starts.
|
|
16
16
|
- [Video Player](/components/video-player) accepts a `preview` clip that loops muted as the cover until playback starts. It holds still when the user prefers reduced motion.
|
|
17
|
+
- [Timeline Waterfall](/components/timeline-waterfall) `scrollToId` centers the row by scrolling only the timeline's own scroller. It used `scrollIntoView`, which also scrolled every scrollable ancestor, so focusing a row could shift the page or modal hosting the timeline, sideways included.
|
|
17
18
|
|
|
18
19
|
## October 15, 2026
|
|
19
20
|
|
|
@@ -645,17 +645,26 @@ describe('timelineWaterfall', () => {
|
|
|
645
645
|
},
|
|
646
646
|
},
|
|
647
647
|
})
|
|
648
|
-
const
|
|
648
|
+
const scroller = wrapper.get('.timeline-scroll')
|
|
649
|
+
const scrollTo = vi.fn()
|
|
650
|
+
Object.assign(scroller.element, { scrollTo })
|
|
649
651
|
const anchor = wrapper.find('[data-scroll-id="enqueued-only"]')
|
|
650
|
-
|
|
652
|
+
const scrollIntoView = vi.fn()
|
|
653
|
+
if (anchor.exists()) {
|
|
651
654
|
Object.assign(anchor.element, { scrollIntoView })
|
|
655
|
+
vi.spyOn(anchor.element, 'getBoundingClientRect').mockReturnValue(DOMRect.fromRect({ x: 900, y: 500, width: 100, height: 20 }))
|
|
656
|
+
}
|
|
657
|
+
vi.spyOn(scroller.element, 'getBoundingClientRect').mockReturnValue(DOMRect.fromRect({ x: 0, y: 0, width: 400, height: 200 }))
|
|
658
|
+
vi.spyOn(scroller.element, 'clientWidth', 'get').mockReturnValue(400)
|
|
659
|
+
vi.spyOn(scroller.element, 'clientHeight', 'get').mockReturnValue(200)
|
|
652
660
|
|
|
653
661
|
// Act
|
|
654
662
|
await (wrapper.vm as unknown as { scrollToId: (id: string) => Promise<void> }).scrollToId('enqueued-only')
|
|
655
663
|
|
|
656
|
-
// Assert
|
|
664
|
+
// Assert: only the timeline's own scroller moves, centering the anchor.
|
|
657
665
|
expect(anchor.exists()).toBe(true)
|
|
658
|
-
expect(scrollIntoView).
|
|
666
|
+
expect(scrollIntoView).not.toHaveBeenCalled()
|
|
667
|
+
expect(scrollTo).toHaveBeenCalledWith({ top: 410, left: 750, behavior: 'smooth' })
|
|
659
668
|
})
|
|
660
669
|
|
|
661
670
|
it('aligns a thin, status-colored queue tail with its execution bar and gives both the same details', () => {
|
|
@@ -171,9 +171,18 @@ async function scrollToId(id: string, options?: { focus?: boolean }) {
|
|
|
171
171
|
if (el)
|
|
172
172
|
break
|
|
173
173
|
}
|
|
174
|
-
|
|
174
|
+
const container = scrollEl.value
|
|
175
|
+
if (!el || !container)
|
|
175
176
|
return
|
|
176
|
-
|
|
177
|
+
// Centers the row in the timeline's own scroller; `scrollIntoView` would also scroll every
|
|
178
|
+
// scrollable ancestor, shifting the page or modal that hosts the timeline.
|
|
179
|
+
const containerRect = container.getBoundingClientRect()
|
|
180
|
+
const rect = el.getBoundingClientRect()
|
|
181
|
+
container.scrollTo({
|
|
182
|
+
top: container.scrollTop + rect.top - containerRect.top - (container.clientHeight - rect.height) / 2,
|
|
183
|
+
left: container.scrollLeft + rect.left - containerRect.left - (container.clientWidth - rect.width) / 2,
|
|
184
|
+
behavior: 'smooth',
|
|
185
|
+
})
|
|
177
186
|
}
|
|
178
187
|
|
|
179
188
|
watch(focusedRowId, (val, _prev, onCleanup) => {
|