Fixes for details view (#44)

This contains 2 fixes for the details view
The first is that the padding in the scrolling view was causing the last frame to be clipped
The second is that we were uselessly displaying "(speedscope root)" in the stack trace view.

This also removes some sketch specific stuff from the keyed archive expanding code

Fixes #32
This commit is contained in:
Jamie Wong
2018-05-20 14:42:16 -07:00
committed by GitHub
parent 9edd5ce7ed
commit 756a3ff5ac
4 changed files with 16 additions and 5 deletions
+4 -2
View File
@@ -72,11 +72,13 @@ export const style = StyleSheet.create({
width: '100vw',
bottom: 0,
},
stackTraceViewPadding: {
padding: 5,
},
stackTraceView: {
height: Sizes.DETAIL_VIEW_HEIGHT,
overflow: 'auto',
lineHeight: `${FontSize.LABEL + 2}px`,
padding: 5,
overflow: 'auto',
},
stackChit: {
display: 'inline-block',
+6 -2
View File
@@ -736,7 +736,7 @@ class StackTraceView extends ReloadableComponent<StackTraceViewProps, {}> {
render() {
const rows: JSX.Element[] = []
let node: CallTreeNode | null = this.props.node
for (; node; node = node.parent) {
for (; node && !node.isRoot(); node = node.parent) {
const row: (JSX.Element | string)[] = []
const {frame} = node
@@ -764,7 +764,11 @@ class StackTraceView extends ReloadableComponent<StackTraceViewProps, {}> {
}
rows.push(<div className={css(style.stackLine)}>{row}</div>)
}
return <div className={css(style.stackTraceView)}>{rows}</div>
return (
<div className={css(style.stackTraceView)}>
<div className={css(style.stackTraceViewPadding)}>{rows}</div>
</div>
)
}
}
+1 -1
View File
@@ -601,7 +601,7 @@ function expandKeyedArchive(
// Sanity checks
if (
root.$version !== 100000 ||
(root.$archiver !== 'MSArchiver' && root.$archiver !== 'NSKeyedArchiver') ||
root.$archiver !== 'NSKeyedArchiver' ||
!isDictionary(root.$top) ||
!isArray(root.$objects)
) {
+5
View File
@@ -68,6 +68,11 @@ export class Frame extends HasWeights {
export class CallTreeNode extends HasWeights {
children: CallTreeNode[] = []
isRoot() {
return this.frame === rootFrame
}
constructor(readonly frame: Frame, readonly parent: CallTreeNode | null) {
super()
}