Skip to content

Conversation

@dashed
Copy link
Member

@dashed dashed commented Jul 31, 2019

Continuation of #13920

NOTES

  • this PR revises the transaction view to be a two column split-view as per Crissy's updated designs (SEN-866)

  • transactions with no descendant spans are now properly displayed (SEN-873)

  • for transaction events, the events interfaces within the eventsv2 modal are replaced with only the transaction view component

  • design is still influx; don't be surprised that there are no tests.

TODO

  • add in Billy's feedback from feat(apm): Initial transactions view #13920

  • expanded span detail

  • span title tree (first column)

  • overhaul the minimap (with panning)

  • span bar error visual cue for non-top-level span (needs a test case)

  • warning: start/end timestamp are equal

  • warning: start/end timestamp are reversed

  • drag view window (without changing its window size)

  • select window size by dragging mouse cursor along the minimap

  • reorg files

  • bug: minimap view handles do not show in firefox (this entails converting svg elements to divs)

  • span bar specialization for equal timestamps + warning

  • guarantee trace end timestamp

  • it'll be cool to have this PR in feat(eventsv2) Remove transactionSlug and groupSlug #14257

  • showDetail variable name

  • span duration text placement.

  • add all the docs.

Deferred to a followup PR

  • span bar error visual cue for top-level span (SDK team says this metadata will be added)
  • russian doll-ing of spans for collapsed span trees (maybe)

Closes SEN-866
Closes SEN-873

@dashed dashed added the WIP label Jul 31, 2019
@dashed dashed self-assigned this Jul 31, 2019
@dashed dashed force-pushed the apm/transactions-view-v1 branch from c48f2fe to c1b3039 Compare July 31, 2019 12:24
@dashed dashed force-pushed the apm/transactions-view-v1 branch 4 times, most recently from e08d532 to b8815d9 Compare August 2, 2019 16:00
Copy link
Member

@lynnagara lynnagara Aug 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would showDetail be a bit clearer / more in line with showSpanTree?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lynnagara I don't quite follow; are you suggesting to rename showDetail to showSpanTree? 🤔

If so, it would be the wrong name since span-descendants aren't displayed within the span detail component.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha no sorry, I thought showDetail might be better than displayDetail, since we use the show- prefix with the span tree stuff

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 3dac2a6

@dashed dashed force-pushed the apm/transactions-view-v1 branch 4 times, most recently from b9476c5 to 6795cc8 Compare August 6, 2019 15:46
@dashed dashed marked this pull request as ready for review August 6, 2019 16:07
@dashed dashed requested a review from markstory August 6, 2019 16:07
@dashed
Copy link
Member Author

dashed commented Aug 6, 2019

This PR is somewhat ready for review. The last few remaining tasks entails reorganizing, refactoring, and splitting up files.

Copy link
Member

@lynnagara lynnagara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a very quick glance but it's quite a large PR. If time permits, it could be nice to split this into smaller, easier to review chunks with tests and more documentation/comments. It'd also be nice to have a Percy test so it's easier for reviewers to spot the visual changes in these new screens.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

data-test-id prefix should only be used in tests and was mentioned previously that it might one day be stripped as part of the build process

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, why do we need to use querySelectorAll to select the element? Can't we pass the refs or something like that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lynnagara I refactored to make use of refs here 5a8bb7f

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to have some docs and tests on some of these functions

@dashed
Copy link
Member Author

dashed commented Aug 7, 2019

@lynnagara Kudos for taking a look over this PR 👏 ; I really appreciate it.

I agree that this PR has gotten longer than I had anticipated. 😞 I'll see if I can split this PR into two parts.

@dashed dashed force-pushed the apm/transactions-view-v1 branch from 3f47d07 to 846c4f5 Compare August 7, 2019 03:17
document.body.style.userSelect = 'none';
this.previousUserSelect = setBodyUserSelect({
userSelect: 'none',
MozUserSelect: 'none',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is M capitalized for Moz but not ms?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@markstory Good question. I had to look this up to double check.

I got this from https://stackoverflow.com/a/31998812

Vendor prefixes other than ms should begin with a capital letter.

from: https://reactjs.org/docs/dom-elements.html#style

}
default: {
const _exhaustiveCheck: never = bounds;
return _exhaustiveCheck;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be an exception?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@markstory it doesn't need to be.

I didn't add one because this file is consumed only by other typescript files. So we defer to the TS engine to ensure we've added all necessary the cases for the switch statement. This relies on --strictNullChecks being enabled.

AFAIK, there are two documented ways to do exhaustive checks for switch-case: https://www.typescriptlang.org/docs/handbook/advanced-types.html#exhaustiveness-checking

position: sticky;
left: 0;
top: 0;
z-index: 99999999999;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use theme.zIndex here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've decided to collate the z-indices locally 3fe6709

margin-right: 8px;
z-index: 99999;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another place we should use theme.zIndex.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've decided to collate the z-indices locally 3fe6709

@dashed dashed requested review from lynnagara and markstory August 7, 2019 20:23
@lynnagara
Copy link
Member

Is netlify preview working? Would be useful for this one

Copy link
Member

@lynnagara lynnagara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we share any renderSpan code between spanTree vs minimap? Looks very similar at a glance.

const results = this.renderSpan({
spanNumber: acc.nextSpanNumber,
treeDepth: treeDepth + 1,
numOfHiddenSpansAbove: acc.numOfHiddenSpansAbove,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is a "hidden" span?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screen Shot 2019-08-07 at 5 35 38 PM

Hidden spans are spans that are out of view due to the chosen view window.

This is useful for tall span trees so we can collapse unnecessary real-estate space in terms of height for better UX.

@dashed dashed force-pushed the apm/transactions-view-v1 branch from 17020b4 to d6322d9 Compare August 7, 2019 22:19
@dashed
Copy link
Member Author

dashed commented Aug 7, 2019

@lynnagara I'm unsure how to access events v2 from sentry-test org in netlify. It doesn't seem possible.

Regarding renderSpan() in both the minimap and spanTree implementation, I'm aware of their similarities. I prefer to duplicate some parts rather than attempting to abstract the function.


Thanks for the feedback 👍

@dashed dashed removed the WIP label Aug 8, 2019
@dashed dashed force-pushed the apm/transactions-view-v1 branch from 9b973bc to d3b87d2 Compare August 8, 2019 18:59
@dashed dashed merged commit c0fa8e0 into master Aug 8, 2019
@dashed dashed deleted the apm/transactions-view-v1 branch August 8, 2019 19:38
@github-actions github-actions bot locked and limited conversation to collaborators Dec 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants