@@ -20,9 +20,17 @@ import {AnimationUI} from './AnimationUI.js';
2020
2121const UIStrings = {
2222 /**
23- *@description Timeline hint text content in Animation Timeline of the Animation Inspector
23+ *@description Timeline hint text content in Animation Timeline of the Animation Inspector if no effect
24+ * is shown.
25+ * Animation effects are the visual effects of an animation on the page.
2426 */
25- selectAnEffectAboveToInspectAnd : 'Select an effect above to inspect and modify.' ,
27+ noEffectSelected : 'No animation effect selected' ,
28+ /**
29+ *@description Timeline hint text content in Animation Timeline of the Animation Inspector that instructs
30+ * users to select an effect.
31+ * Animation effects are the visual effects of an animation on the page.
32+ */
33+ selectAnEffectAboveToInspectAnd : 'Select an effect above to inspect and modify' ,
2634 /**
2735 *@description Text to clear everything
2836 */
@@ -54,9 +62,13 @@ const UIStrings = {
5462 */
5563 animationPreviews : 'Animation previews' ,
5664 /**
57- *@description Empty buffer hint text content in Animation Timeline of the Animation Inspector
65+ *@description Empty buffer hint text content in Animation Timeline of the Animation Inspector.
66+ */
67+ waitingForAnimations : 'Currently waiting for animations' ,
68+ /**
69+ *@description Empty buffer hint text content in Animation Timeline of the Animation Inspector that explains the panel.
5870 */
59- waitingForAnimations : 'Waiting for animations.. .' ,
71+ animationDescription : 'On this page you can inspect and modify animations.' ,
6072 /**
6173 *@description Tooltip text that appears when hovering over largeicon replay animation button in Animation Timeline of the Animation Inspector
6274 */
@@ -89,6 +101,9 @@ const MIN_TIMELINE_CONTROLS_WIDTH = 120;
89101const DEFAULT_TIMELINE_CONTROLS_WIDTH = 150 ;
90102const MAX_TIMELINE_CONTROLS_WIDTH = 720 ;
91103
104+ const ANIMATION_EXPLANATION_URL =
105+ 'https://developer.chrome.com/docs/devtools/css/animations' as Platform . DevToolsPath . UrlString ;
106+
92107let animationTimelineInstance : AnimationTimeline ;
93108
94109export class AnimationTimeline extends UI . Widget . VBox implements
@@ -150,8 +165,16 @@ export class AnimationTimeline extends UI.Widget.VBox implements
150165 this . createHeader ( ) ;
151166 this . #animationsContainer = this . contentElement . createChild ( 'div' , 'animation-timeline-rows' ) ;
152167 this . #animationsContainer. setAttribute ( 'jslog' , `${ VisualLogging . section ( 'animations' ) } ` ) ;
168+ const emptyBufferHint = this . contentElement . createChild ( 'div' , 'animation-timeline-buffer-hint' ) ;
169+ const noAnimationsPlaceholder = new UI . EmptyWidget . EmptyWidget (
170+ i18nString ( UIStrings . waitingForAnimations ) , i18nString ( UIStrings . animationDescription ) ) ;
171+ noAnimationsPlaceholder . appendLink ( ANIMATION_EXPLANATION_URL ) ;
172+ noAnimationsPlaceholder . show ( emptyBufferHint ) ;
173+
153174 const timelineHint = this . contentElement . createChild ( 'div' , 'animation-timeline-rows-hint' ) ;
154- timelineHint . textContent = i18nString ( UIStrings . selectAnEffectAboveToInspectAnd ) ;
175+ const noEffectSelectedPlaceholder = new UI . EmptyWidget . EmptyWidget (
176+ i18nString ( UIStrings . noEffectSelected ) , i18nString ( UIStrings . selectAnEffectAboveToInspectAnd ) ) ;
177+ noEffectSelectedPlaceholder . show ( timelineHint ) ;
155178
156179 /** @const */ this . #defaultDuration = 100 ;
157180 this . #durationInternal = this . #defaultDuration;
@@ -351,8 +374,6 @@ export class AnimationTimeline extends UI.Widget.VBox implements
351374 this . #previewContainer. setAttribute ( 'jslog' , `${ VisualLogging . section ( 'film-strip' ) } ` ) ;
352375 UI . ARIAUtils . markAsListBox ( this . #previewContainer) ;
353376 UI . ARIAUtils . setLabel ( this . #previewContainer, i18nString ( UIStrings . animationPreviews ) ) ;
354- const emptyBufferHint = this . contentElement . createChild ( 'div' , 'animation-timeline-buffer-hint' ) ;
355- emptyBufferHint . textContent = i18nString ( UIStrings . waitingForAnimations ) ;
356377 const container = this . contentElement . createChild ( 'div' , 'animation-timeline-header' ) ;
357378 const controls = container . createChild ( 'div' , 'animation-controls' ) ;
358379 this . #currentTime = controls . createChild ( 'div' , 'animation-timeline-current-time monospace' ) ;
0 commit comments