diff --git a/src/devtools/views/Profiler/Profiler.css b/src/devtools/views/Profiler/Profiler.css index 65c8c6bf6c..682532e88a 100644 --- a/src/devtools/views/Profiler/Profiler.css +++ b/src/devtools/views/Profiler/Profiler.css @@ -62,10 +62,6 @@ border-top: 1px solid var(--color-border); } -.InspectedProperties { - padding: 0.5rem; -} - .VRule { height: 20px; width: 1px; diff --git a/src/devtools/views/Profiler/Profiler.js b/src/devtools/views/Profiler/Profiler.js index 4199efe1c2..5de8973a76 100644 --- a/src/devtools/views/Profiler/Profiler.js +++ b/src/devtools/views/Profiler/Profiler.js @@ -11,6 +11,8 @@ import CommitRanked from './CommitRanked'; import FilterModal from './FilterModal'; import RecordToggle from './RecordToggle'; import SnapshotSelector from './SnapshotSelector'; +import SidebarCommitInfo from './SidebarCommitInfo'; +import SidebarInteractions from './SidebarInteractions'; import styles from './Profiler.css'; @@ -124,6 +126,19 @@ function SuspendingProfiler() { break; } + let sidebar = null; + switch (tab) { + case 'interactions': + sidebar = ; + break; + case 'flame-chart': + case 'ranked-chart': + sidebar = ; + break; + default: + break; + } + return (
@@ -157,11 +172,7 @@ function SuspendingProfiler() {
- }> - {/* TODO (profiler) Dynamic information */} -
Commit information
-
- + }>{sidebar}
); diff --git a/src/devtools/views/Profiler/SidebarCommitInfo.css b/src/devtools/views/Profiler/SidebarCommitInfo.css new file mode 100644 index 0000000000..d36c4aec11 --- /dev/null +++ b/src/devtools/views/Profiler/SidebarCommitInfo.css @@ -0,0 +1,34 @@ +.Toolbar { + height: 2.25rem; + padding: 0 0.5rem; + flex: 0 0 auto; + display: flex; + align-items: center; + border-bottom: 1px solid var(--color-border); + border-top: 1px solid var(--color-border); +} + +.Content { + padding: 0.5rem; +} + +.List { + list-style: none; + margin: 0; + padding: 0; +} + +.ListItem { + margin: 0 0 0.25rem; +} + +.Label { + overflow: hidden; + text-overflow: ellipsis; + font-weight: bold; +} + +.Value { + font-family: var(--font-family-monospace); + font-size: var(--font-size-monospace-normal); +} diff --git a/src/devtools/views/Profiler/SidebarCommitInfo.js b/src/devtools/views/Profiler/SidebarCommitInfo.js new file mode 100644 index 0000000000..e2c8c987c1 --- /dev/null +++ b/src/devtools/views/Profiler/SidebarCommitInfo.js @@ -0,0 +1,58 @@ +// @flow + +import React, { Fragment, useContext } from 'react'; +import { ProfilerContext } from './ProfilerContext'; +import { formatDuration, formatTime } from './utils'; +import { StoreContext } from '../context'; + +import styles from './SidebarCommitInfo.css'; + +export type Props = {||}; + +export default function SidebarCommitInfo(_: Props) { + const { selectedCommitIndex, rendererID, rootID } = useContext( + ProfilerContext + ); + + const { profilingCache } = useContext(StoreContext); + const { commitDurations, commitTimes } = profilingCache.ProfilingSummary.read( + { + rendererID: ((rendererID: any): number), + rootID: ((rootID: any): number), + } + ); + + if (selectedCommitIndex === null) { + return 'TODO'; + } + + return ( + +
Commit information
+
+
    +
  • + :{' '} + + {formatTime(commitTimes[selectedCommitIndex])}s + +
  • +
  • + :{' '} + + {formatDuration(commitDurations[selectedCommitIndex])}ms + +
  • +
  • + : +
      +
    • +
      Coming soon
      +
    • +
    +
  • +
+
+
+ ); +} diff --git a/src/devtools/views/Profiler/SidebarInteractions.css b/src/devtools/views/Profiler/SidebarInteractions.css new file mode 100644 index 0000000000..8c1e8510a8 --- /dev/null +++ b/src/devtools/views/Profiler/SidebarInteractions.css @@ -0,0 +1,13 @@ +.Toolbar { + height: 2.25rem; + padding: 0 0.5rem; + flex: 0 0 auto; + display: flex; + align-items: center; + border-bottom: 1px solid var(--color-border); + border-top: 1px solid var(--color-border); +} + +.Content { + padding: 0.5rem; +} diff --git a/src/devtools/views/Profiler/SidebarInteractions.js b/src/devtools/views/Profiler/SidebarInteractions.js new file mode 100644 index 0000000000..101b62215c --- /dev/null +++ b/src/devtools/views/Profiler/SidebarInteractions.js @@ -0,0 +1,24 @@ +// @flow + +import React, { Fragment, useContext } from 'react'; +import { ProfilerContext } from './ProfilerContext'; +import { StoreContext } from '../context'; + +import styles from './SidebarInteractions.css'; + +export type Props = {||}; + +export default function SidebarInteractions(_: Props) { + const { selectedCommitIndex, rendererID, rootID } = useContext( + ProfilerContext + ); + + const { profilingCache } = useContext(StoreContext); + + return ( + +
Interaction
+
Coming soon
+
+ ); +}