diff --git a/devtools/client/themes/toolbox.css b/devtools/client/themes/toolbox.css index 6bab440280d3..0b54d264e067 100644 --- a/devtools/client/themes/toolbox.css +++ b/devtools/client/themes/toolbox.css @@ -527,6 +527,9 @@ border-radius: 4.5px; top: calc(50% - 3.5px); background: var(--replaying-marker-background); +} + +.webreplay-player .animate .message { transition-duration: 100ms; } diff --git a/devtools/client/webreplay/components/WebReplayPlayer.js b/devtools/client/webreplay/components/WebReplayPlayer.js index f7f0a806d541..fa7b56a7c290 100644 --- a/devtools/client/webreplay/components/WebReplayPlayer.js +++ b/devtools/client/webreplay/components/WebReplayPlayer.js @@ -137,6 +137,7 @@ class WebReplayPlayer extends Component { hoveredMessageOffset: null, unscannedRegions: [], cachedPoints: [], + shouldAnimate: true, start: 0, end: 1, }; @@ -286,8 +287,10 @@ class WebReplayPlayer extends Component { unscannedRegions, cachedPoints, }; + if (recording) { newState.recordingEndpoint = executionPoint; + newState.shouldAnimate = true; } this.setState(newState); @@ -305,7 +308,7 @@ class WebReplayPlayer extends Component { messages = sortBy(messages, message => getMessageProgress(message)); - this.setState({ messages, visibleMessages }); + this.setState({ messages, visibleMessages, shouldAnimate: false }); } } @@ -704,8 +707,11 @@ class WebReplayPlayer extends Component { render() { const percent = this.getVisiblePercent(this.state.executionPoint); const recording = this.isRecording(); + const { shouldAnimate } = this.state; return div( - { className: "webreplay-player" }, + { + className: "webreplay-player", + }, div( { id: "overlay", @@ -716,7 +722,11 @@ class WebReplayPlayer extends Component { onMouseLeave: this.onPlayerMouseLeave, }, div( - { className: "overlay-container " }, + { + className: classname("overlay-container", { + animate: shouldAnimate, + }), + }, div({ className: "commands" }, ...this.renderCommands()), div( {