-
Notifications
You must be signed in to change notification settings - Fork 32
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
Center rows when selected #211
Center rows when selected #211
Conversation
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.
Looks good to me. @PatrickTasse could you please have review in respect of the visible rows and background fetching implementation.
protected navigate(rowIndex: number) { | ||
this.ensureVisible(rowIndex); | ||
protected navigate(rowIndex: number, center?: boolean) { | ||
center ? this.centerRow(rowIndex) : this.ensureVisible(rowIndex); |
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 that the center flag should be propagated to ensureVisible() where it would be used only when a row needs to be revealed. That is, if calling selectAndReveal() on a row that is already visible, I don't think the row should be centered and the vertical offset should be unchanged. The user might have scrolled to put the focused row in a specific desired place.
Also, perhaps the trigger of this issue is that the horizontal scroll bar of the left tree can hide the text of the last displayed tree row. The bottom left corner of the timegraph output component is unused, I wonder if it could be used for the tree's horizontal scroll bar? (This is a separate issue, on theia-trace-extension).
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 didn't realize navigate was called even when a row is clicked in the timeline-chart. That is annoying behavior... Nice catch.
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.
Signed-off-by: Will Yang <william.yang@ericsson.com>
40e92f8
to
d979c43
Compare
Adds the method TimeGraphChart#centerRow which has logic to adjust the vertical offset to center a row given it's index.
Fixes: theia-trace-extension #773
Signed-off-by: Will Yang william.yang@ericsson.com