From 756a3ff5ac2c1c24e5f4c220f860af112ef41cb0 Mon Sep 17 00:00:00 2001 From: Jamie Wong Date: Sun, 20 May 2018 14:42:16 -0700 Subject: [PATCH] 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 --- flamechart-style.ts | 6 ++++-- flamechart-view.tsx | 8 ++++++-- import/instruments.ts | 2 +- profile.ts | 5 +++++ 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/flamechart-style.ts b/flamechart-style.ts index 788ac63..6a7d7a3 100644 --- a/flamechart-style.ts +++ b/flamechart-style.ts @@ -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', diff --git a/flamechart-view.tsx b/flamechart-view.tsx index 8299966..a631b54 100644 --- a/flamechart-view.tsx +++ b/flamechart-view.tsx @@ -736,7 +736,7 @@ class StackTraceView extends ReloadableComponent { 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 { } rows.push(
{row}
) } - return
{rows}
+ return ( +
+
{rows}
+
+ ) } } diff --git a/import/instruments.ts b/import/instruments.ts index e839ee4..e9cb3b5 100644 --- a/import/instruments.ts +++ b/import/instruments.ts @@ -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) ) { diff --git a/profile.ts b/profile.ts index 0541e33..26e7dd3 100644 --- a/profile.ts +++ b/profile.ts @@ -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() }