-
Notifications
You must be signed in to change notification settings - Fork 483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Keyboard shortcuts and minimap UX #93
Conversation
TODO: fix tests. Primary reason for this refactor is to lay the ground-work for keyboard shortcuts. - Got rid of components/TracePage#context - components/TracePage#state.viewRange changed to have `.current` and `.next` with `.next` being the "unapplied" change from the mouse UX - Minimap UX now publishes unapplied changes (user dragging on minimap) to `viewRange.next` instead of retaining them in the minimap state - Minimap rendering changed to draw highlights based on `viewRange.next` regardless of UX state
- Color generator now also provides colors in RGB - ListView now has a public API to inspect the state of the ListView scrolling - VirtualizedTraceView now has a public API to inspect the state of the trace view - SpanGraph scrubbers have wider grips - SpanGraph minimap rendering update so the spans of large traces are more visible - Tween utility class added - scroll-page util added for animating window scrolling - ScrollManager added for scrolling to prev / next visible span, sensitive to search filtering - Keyboard shortcuts added for panning left, right, up down; zoom in, out; fast pan, zoom; skip to prev / next visible span TODO - Fix tests, add tests - Reorganize a bit to make things a bit smaller and more compartmentalized (a few things are getting a little large) - Refactor viewRange.next to support animating next position for both scrubbers
- Fixed a few tests, there are still broken tests - Fixed issue in minimap when page resized - Fixed issue in timeline header row mouse zoom when resize the columns
@@ -386,4 +446,4 @@ function mapDispatchToProps(dispatch) { | |||
return bindActionCreators(actions, dispatch); | |||
} | |||
|
|||
export default connect(mapStateToProps, mapDispatchToProps)(VirtualizedTraceView); | |||
export default connect(mapStateToProps, mapDispatchToProps)(VirtualizedTraceViewImpl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@saminzadeh You had a suggestion for a better name than *Impl
(where Impl is short form of implementation)... What was that, again?
- Use options object for DraggableManager - Dont rerender CanvasSpanGraph unless trace changes - Remove rows, spans from ViewRange
- Make trace minimap colors more prounounced
package.json
Outdated
@@ -83,7 +85,7 @@ | |||
"clear-homepage": "json -I -f package.json -e 'delete this.homepage'", | |||
"deploy-docs": "./bin/deploy-docs.sh", | |||
"postpublish": "npm run build:docs && npm run deploy-docs", | |||
"add-license": "uber-licence", | |||
"add-license": "uber-licence && git co flow-typed", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why git co flow-type
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cd src
* `setAccessors` is bound in the ctor, so it can be passed as a prop to | ||
* children components. | ||
*/ | ||
setAccessors = function setAccessors(accessors: Accessors) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't you just do
{
setAccessors(accessors) {
this.accessors = accessors
}
}
And then remove all those bindings in the constructor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Investigate
* ScrollManager is intended for scrolling the TracePage. Has two modes, paging | ||
* and scrolling to the previous or next visible span. | ||
*/ | ||
export default class ScrollManager { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit impartial about the OOP vs functional style here. Seems like the codebase has a mix of it now? I can see why you went with OOP given the implementation, but do you think we should be consistent? More specifically, to reduce state and unintended side effects in modules.
describe('<CanvasSpanGraph>', () => { | ||
it('renders without exploding', () => { | ||
const items = [{ valueWidth: 1, valueOffset: 1, serviceName: 'service-name-0' }]; | ||
const wrapper = mount(<CanvasSpanGraph items={[]} valueWidth={4000} />); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do shallow rendering here instead? Mount requires more and will slow down tests from my understanding?
https://github.com/airbnb/enzyme/blob/master/docs/api/mount.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great call. mount(...)
is necessary in a few spots, but this is not one of them 👍
onClick={this._childrenToggle} | ||
/> | ||
<a | ||
className={`span-name ${isDetailExapnded ? 'is-detail-expanded' : ''}`} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exapnded misspelled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
} | ||
|
||
getViewRange = function getViewRange() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this accessors are unnecessary abstraction. Just use the prop value directly, reduce the amount of boilerplate code.
Rename the props as necessary if you feel like it helps with readability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…navigate-zoom Keyboard shortcuts and minimap UX Signed-off-by: vvvprabhakar <[email protected]>
Issues addressed:
Changes:
w
,s
)f
,b
)a
orleft
,d
orright
)shift+left
,shift+right
)up
,down
)shift+up
,shift+down
)