Skip to content
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

Merged

Conversation

williamsyang-work
Copy link
Contributor

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

Copy link
Collaborator

@bhufmann bhufmann left a 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);
Copy link
Contributor

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).

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the horizontal scrollbar issue, that's only applicable if only one chart component is open. IE, if we have multiple open, that only applies to the bottom one.

image

Signed-off-by: Will Yang <william.yang@ericsson.com>
@bhufmann bhufmann merged commit 1f50903 into eclipse-cdt-cloud:master Sep 13, 2022
@williamsyang-work williamsyang-work deleted the center-rows-when-selected branch August 21, 2024 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Select and reveal of time graph rows should be consistently on top or middle of screen
3 participants