Changeset 267038 in webkit
- Timestamp:
- Sep 14, 2020, 1:51:40 PM (6 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 9 edited
- 2 copied
-
ChangeLog (modified) (1 diff)
-
Localizations/en.lproj/localizedStrings.js (modified) (2 diffs)
-
UserInterface/Main.html (modified) (2 diffs)
-
UserInterface/Views/ButtonNavigationItem.css (modified) (1 diff)
-
UserInterface/Views/IndeterminateProgressSpinnerNavigationItem.css (copied) (copied from trunk/Source/WebInspectorUI/UserInterface/Views/TextNavigationItem.js ) (2 diffs)
-
UserInterface/Views/IndeterminateProgressSpinnerNavigationItem.js (copied) (copied from trunk/Source/WebInspectorUI/UserInterface/Views/TextNavigationItem.js ) (2 diffs)
-
UserInterface/Views/TextNavigationItem.js (modified) (1 diff)
-
UserInterface/Views/TimelineRecordingContentView.js (modified) (2 diffs)
-
UserInterface/Views/TimelineRecordingProgressView.js (modified) (2 diffs)
-
UserInterface/Views/TimelineTabContentView.js (modified) (6 diffs)
-
UserInterface/Views/Variables.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r267031 r267038 1 2020-09-14 Patrick Angle <pangle@apple.com> 2 3 Web Inspector: Stop Recording in Timelines tab doesn't work reliably 4 https://bugs.webkit.org/show_bug.cgi?id=216416 5 6 Reviewed by Devin Rousso. 7 8 Improved UX surrounding stopping recordings. In the Frames view, the interface now shows a "Stopping Recording 9 Timeline Data" message and disables the Stop Recording button as soon as the user has pressed the button to stop 10 recording. For all timeline views, the Record/Continue/Stop buttons in the top-right are replaced with an 11 indeterminate progress spinner while recording is being stopped to better indicate that all work has not 12 completed yet. Lastly, the recording head now stops at the moment recording was stopped. After we have finished 13 stopping the recording, the timeline is updated one more time to account for any records we receive after the 14 moment the user requested recording to stop, instead of continously updating during the stopping phase, which 15 made it appear that recording was instead continuing. 16 17 * Localizations/en.lproj/localizedStrings.js: 18 * UserInterface/Main.html: Added `IndeterminateProgressSpinnerNavigationItem.css` and 19 `IndeterminateProgressSpinnerNavigationItem.js`. 20 * UserInterface/Views/ButtonNavigationItem.css: 21 (.navigation-bar .item.button.image-only): 22 * UserInterface/Views/IndeterminateProgressSpinnerNavigationItem.css: Added. 23 (.navigation-bar .item.indeterminate-progress-spinner): 24 (.navigation-bar .item.indeterminate-progress-spinner-item .indeterminate-progress-spinner): 25 * UserInterface/Views/IndeterminateProgressSpinnerNavigationItem.js: Added. 26 (WI.IndeterminateProgressSpinnerNavigationItem): 27 * UserInterface/Views/TextNavigationItem.js: Drive-by fix for misplaced `assert`. 28 (WI.TextNavigationItem): 29 * UserInterface/Views/TimelineRecordingContentView.js: Don't advanced the recording head after the user requests 30 recording to stop. 31 (WI.TimelineRecordingContentView.prototype._updateTimes): 32 (WI.TimelineRecordingContentView.prototype._updateTimelineViewTimes): 33 * UserInterface/Views/TimelineRecordingProgressView.js: Listen to the TimelineManager to show different messages 34 for Recording and Stopping, as well as disabling the Stop Recording button. 35 (WI.TimelineRecordingProgressView): 36 (WI.TimelineRecordingProgressView.prototype.set visible): 37 (WI.TimelineRecordingProgressView.prototype._updateState): 38 (WI.TimelineRecordingProgressView.prototype._handleTimelineCapturingStateChanged): 39 * UserInterface/Views/TimelineTabContentView.js: Show a progress spinner while stopping recording. 40 (WI.TimelineTabContentView): 41 (WI.TimelineTabContentView.prototype._showRecordButton): 42 (WI.TimelineTabContentView.prototype._showRecordStoppingSpinner): 43 (WI.TimelineTabContentView.prototype._showContinueButton): 44 (WI.TimelineTabContentView.prototype._updateNavigationBarButtons): 45 (WI.TimelineTabContentView.prototype._handleTimelineCapturingStateChanged): 46 * UserInterface/Views/Variables.css: New variable for navigation items with only an icon. 47 (:root): 48 1 49 2020-09-14 Devin Rousso <drousso@apple.com> 2 50 -
trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
r266670 r267038 1011 1011 localizedStrings["Recording %d"] = "Recording %d"; 1012 1012 localizedStrings["Recording Error: %s"] = "Recording Error: %s"; 1013 localizedStrings["Recording Timeline Data"] = "Recording Timeline Data"; 1013 /* Message for progress of a timeline recording. */ 1014 localizedStrings["Recording Timeline Data @ Timeline Recording Progress"] = "Recording Timeline Data"; 1014 1015 /* A type of canvas recording in the Graphics Tab */ 1015 1016 localizedStrings["Recording Type Canvas Bitmap Renderer"] = "Bitmap Renderer"; … … 1254 1255 localizedStrings["Stop recording canvas actions"] = "Stop recording canvas actions"; 1255 1256 localizedStrings["Stop recording once page loads"] = "Stop recording once page loads"; 1257 /* Message for progress of stopping a timeline recording. */ 1258 localizedStrings["Stopping Timeline Recording @ Timeline Recording Progress"] = "Stopping Timeline Recording"; 1259 localizedStrings["Stopping recording"] = "Stopping recording"; 1256 1260 localizedStrings["Stopping the \u201C%s\u201D audit"] = "Stopping the \u201C%s\u201D audit"; 1257 1261 localizedStrings["Storage"] = "Storage"; -
trunk/Source/WebInspectorUI/UserInterface/Main.html
r266480 r267038 124 124 <link rel="stylesheet" href="Views/ImageResourceContentView.css"> 125 125 <link rel="stylesheet" href="Views/IndeterminateProgressSpinner.css"> 126 <link rel="stylesheet" href="Views/IndeterminateProgressSpinnerNavigationItem.css"> 126 127 <link rel="stylesheet" href="Views/IndexedDatabaseContentView.css"> 127 128 <link rel="stylesheet" href="Views/IndexedDatabaseObjectStoreContentView.css"> … … 712 713 <script src="Views/ImageResourceContentView.js"></script> 713 714 <script src="Views/IndeterminateProgressSpinner.js"></script> 715 <script src="Views/IndeterminateProgressSpinnerNavigationItem.js"></script> 714 716 <script src="Views/IndexedDatabaseContentView.js"></script> 715 717 <script src="Views/IndexedDatabaseDetailsSidebarPanel.js"></script> -
trunk/Source/WebInspectorUI/UserInterface/Views/ButtonNavigationItem.css
r262397 r267038 39 39 40 40 .navigation-bar .item.button.image-only { 41 width: 26px;41 width: var(--image-button-navigation-item-width); 42 42 } 43 43 -
trunk/Source/WebInspectorUI/UserInterface/Views/IndeterminateProgressSpinnerNavigationItem.css
r267037 r267038 1 1 /* 2 * Copyright (C) 20 16Apple Inc. All rights reserved.2 * Copyright (C) 2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 WI.TextNavigationItem = class TextNavigationItem extends WI.NavigationItem 27 { 28 constructor(identifier, label) 29 { 30 super(identifier); 26 .navigation-bar .item.indeterminate-progress-spinner-item { 27 width: var(--image-button-navigation-item-width); 28 padding: 1px 4px; 29 } 31 30 32 console.assert(identifier); 33 34 this._element.classList.add("text"); 35 this._element.textContent = label || ""; 36 } 37 38 // Public 39 40 get text() 41 { 42 return this._element.textContent; 43 } 44 45 set text(x) 46 { 47 this._element.textContent = x || ""; 48 } 49 50 // Protected 51 52 get totalMargin() 53 { 54 return super.totalMargin + 4; /* .navigation-bar .item.text */ 55 } 56 }; 31 .navigation-bar .item.indeterminate-progress-spinner-item .indeterminate-progress-spinner { 32 margin: auto; 33 } -
trunk/Source/WebInspectorUI/UserInterface/Views/IndeterminateProgressSpinnerNavigationItem.js
r267037 r267038 1 1 /* 2 * Copyright (C) 20 16Apple Inc. All rights reserved.2 * Copyright (C) 2020 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 WI. TextNavigationItem = class TextNavigationItem extends WI.NavigationItem26 WI.IndeterminateProgressSpinnerNavigationItem = class IndeterminateProgressSpinnerNavigationItem extends WI.NavigationItem 27 27 { 28 constructor(identifier, label)28 constructor(identifier, tooltip) 29 29 { 30 console.assert(identifier); 31 30 32 super(identifier); 31 33 32 console.assert(identifier);34 this.element.classList.add("indeterminate-progress-spinner-item"); 33 35 34 this._element.classList.add("text"); 35 this._element.textContent = label || ""; 36 } 36 this._spinner = new WI.IndeterminateProgressSpinner; 37 this.element.appendChild(this._spinner.element); 37 38 38 // Public 39 40 get text() 41 { 42 return this._element.textContent; 43 } 44 45 set text(x) 46 { 47 this._element.textContent = x || ""; 48 } 49 50 // Protected 51 52 get totalMargin() 53 { 54 return super.totalMargin + 4; /* .navigation-bar .item.text */ 39 this.tooltip = tooltip ?? ""; 55 40 } 56 41 }; -
trunk/Source/WebInspectorUI/UserInterface/Views/TextNavigationItem.js
r248818 r267038 28 28 constructor(identifier, label) 29 29 { 30 console.assert(identifier); 31 30 32 super(identifier); 31 32 console.assert(identifier);33 33 34 34 this._element.classList.add("text"); -
trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js
r261109 r267038 464 464 } 465 465 466 this._timelineOverview.endTime = Math.max(endTime, currentTime); 467 468 this._currentTime = currentTime; 469 this._timelineOverview.currentTime = currentTime; 466 if (WI.timelineManager.capturingState !== WI.TimelineManager.CapturingState.Stopping) { 467 // Only update end time while not stopping, otherwise the interface contues scrolling. 468 this._timelineOverview.endTime = Math.max(endTime, currentTime); 469 470 if (WI.timelineManager.capturingState !== WI.TimelineManager.CapturingState.Inactive) { 471 // Only update current time while active/starting or else the interface continues scrolling. 472 this._currentTime = currentTime; 473 this._timelineOverview.currentTime = currentTime; 474 } 475 } 470 476 471 477 if (this.currentTimelineView) … … 850 856 851 857 timelineView.startTime = this._timelineOverview.selectionStartTime; 852 timelineView.currentTime = this._currentTime; 853 timelineView.endTime = endTime; 858 859 if (WI.timelineManager.capturingState !== WI.TimelineManager.CapturingState.Stopping) { 860 // Only update end time while not stopping, otherwise the interface contues scrolling. 861 timelineView.endTime = endTime; 862 863 if (WI.timelineManager.capturingState !== WI.TimelineManager.CapturingState.Inactive) { 864 // Only update current time while active/starting or else the interface continues scrolling. 865 timelineView.currentTime = this._currentTime; 866 } 867 } 854 868 } 855 869 -
trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingProgressView.js
r243024 r267038 32 32 this.element.classList.add("recording-progress"); 33 33 34 let status Element = document.createElement("div");35 status Element.classList.add("status");36 statusElement.textContent = WI.UIString("Recording Timeline Data"); 37 this. element.append(statusElement);34 let statusGroup = this.element.appendChild(document.createElement("div")); 35 statusGroup.className = "status"; 36 37 this._statusElement = statusGroup.appendChild(document.createElement("span")); 38 38 39 39 let spinner = new WI.IndeterminateProgressSpinner; 40 status Element.append(spinner.element);40 statusGroup.appendChild(spinner.element); 41 41 42 42 this._stopRecordingButtonElement = document.createElement("button"); 43 43 this._stopRecordingButtonElement.textContent = WI.UIString("Stop Recording"); 44 44 this._stopRecordingButtonElement.addEventListener("click", () => WI.timelineManager.stopCapturing()); 45 this.element.append (this._stopRecordingButtonElement);45 this.element.appendChild(this._stopRecordingButtonElement); 46 46 } 47 47 … … 61 61 this._visible = x; 62 62 this.element.classList.toggle("hidden", !this._visible); 63 64 if (this._visible) { 65 WI.timelineManager.addEventListener(WI.TimelineManager.Event.CapturingStateChanged, this._handleTimelineCapturingStateChanged, this); 66 this._updateState(); 67 } else 68 WI.timelineManager.removeEventListener(WI.TimelineManager.Event.CapturingStateChanged, this._handleTimelineCapturingStateChanged, this); 63 69 } 70 71 // Private 72 73 _updateState() { 74 switch (WI.timelineManager.capturingState) { 75 case WI.TimelineManager.CapturingState.Starting: 76 case WI.TimelineManager.CapturingState.Active: 77 this._statusElement.textContent = WI.UIString("Recording Timeline Data", "Recording Timeline Data @ Timeline Recording Progress", "Message for progress of a timeline recording."); 78 this._stopRecordingButtonElement.disabled = false; 79 break; 80 case WI.TimelineManager.CapturingState.Stopping: 81 this._statusElement.textContent = WI.UIString("Stopping Timeline Recording", "Stopping Timeline Recording @ Timeline Recording Progress", "Message for progress of stopping a timeline recording."); 82 this._stopRecordingButtonElement.disabled = true; 83 break; 84 case WI.TimelineManager.CapturingState.Inactive: 85 // When inactive this view should be hidden by its parent, so keep the state the same to avoid possibly 86 // flickering to a different state just before the parent hides us. 87 break; 88 } 89 } 90 91 _handleTimelineCapturingStateChanged(event) 92 { 93 this._updateState(); 94 } 95 64 96 }; -
trunk/Source/WebInspectorUI/UserInterface/Views/TimelineTabContentView.js
r266537 r267038 50 50 this._recordButton.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this._recordButtonClicked, this); 51 51 52 this._recordStoppingSpinner = new WI.IndeterminateProgressSpinnerNavigationItem("record-stopping", WI.UIString("Stopping recording")); 53 this._recordStoppingSpinner.visibilityPriority = WI.NavigationItem.VisibilityPriority.High; 54 this._recordStoppingSpinner.hidden = true; 55 52 56 this._continueButton = new WI.ButtonNavigationItem("record-continue", WI.UIString("Continue without automatically stopping"), "Images/Resume.svg", 13, 13); 53 57 this._continueButton.visibilityPriority = WI.NavigationItem.VisibilityPriority.High; … … 56 60 57 61 this.contentBrowser.navigationBar.insertNavigationItem(this._recordButton, 0); 58 this.contentBrowser.navigationBar.insertNavigationItem(this._continueButton, 1); 62 this.contentBrowser.navigationBar.insertNavigationItem(this._recordStoppingSpinner, 1); 63 this.contentBrowser.navigationBar.insertNavigationItem(this._continueButton, 2); 59 64 60 65 if (WI.sharedApp.isWebDebuggable()) { … … 65 70 viewModeGroup.visibilityPriority = WI.NavigationItem.VisibilityPriority.High; 66 71 67 this.contentBrowser.navigationBar.insertNavigationItem(viewModeGroup, 2);72 this.contentBrowser.navigationBar.insertNavigationItem(viewModeGroup, 3); 68 73 this.contentBrowser.navigationBar.addEventListener(WI.NavigationBar.Event.NavigationItemSelected, this._viewModeSelected, this); 69 74 } … … 453 458 { 454 459 this._recordButton.hidden = false; 460 this._recordStoppingSpinner.hidden = true; 455 461 this._continueButton.hidden = true; 456 462 } 457 463 464 _showRecordStoppingSpinner() 465 { 466 this._recordButton.hidden = true; 467 this._recordStoppingSpinner.hidden = false; 468 this._continueButton.hidden = true; 469 } 470 458 471 _showContinueButton() 459 472 { 460 473 this._recordButton.hidden = true; 474 this._recordStoppingSpinner.hidden = true; 461 475 this._continueButton.hidden = false; 462 476 } … … 464 478 _updateNavigationBarButtons() 465 479 { 466 if (!WI.modifierKeys.altKey || !WI.timelineManager.willAutoStop()) 480 if (WI.timelineManager.capturingState === WI.TimelineManager.CapturingState.Stopping) 481 this._showRecordStoppingSpinner(); 482 else if (!WI.modifierKeys.altKey || !WI.timelineManager.willAutoStop()) 467 483 this._showRecordButton(); 468 484 else … … 473 489 { 474 490 let enabled = WI.timelineManager.capturingState === WI.TimelineManager.CapturingState.Active || WI.timelineManager.capturingState === WI.TimelineManager.CapturingState.Inactive; 475 476 this._toggleRecordingShortcut.disabled = !enabled; 477 this._toggleNewRecordingShortcut.disabled = !enabled; 491 let stopping = WI.timelineManager.capturingState === WI.TimelineManager.CapturingState.Stopping; 492 493 this._toggleRecordingShortcut.disabled = !enabled || stopping; 494 this._toggleNewRecordingShortcut.disabled = !enabled || stopping; 478 495 479 496 this._recordButton.toggled = WI.timelineManager.isCapturing(); -
trunk/Source/WebInspectorUI/UserInterface/Views/Variables.css
r266480 r267038 214 214 215 215 --reference-page-link-size: 20px; 216 217 --image-button-navigation-item-width: 26px; 216 218 } 217 219
Note:
See TracChangeset
for help on using the changeset viewer.