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

CHE-2308. Use own size of part when part stack size is too small for the content of the part #2931

Closed
wants to merge 2 commits into from

Conversation

RomanNikitenko
Copy link
Member

@RomanNikitenko RomanNikitenko commented Oct 28, 2016

What does this PR do?

We use default size for all part stacks now.
After applying my changes we will have next behavior:

  • for example you open Git History first, it uses 550 width. You open Pull Request panel while Git History was still displayed, it uses 550 width too.
  • you open Git History first, it uses 550 width. You close Git History and then open Pull Request panel while nothing was displayed on the right part, it uses default size (260) width.
  • you open Pull Request first, it uses 260 width. You open Git History while Pull Request was still displaying on the right, it uses 550 width.
  • you open Pull Request first, it uses 260 width. You close Pull Request and then open Git History panel while nothing was displayed on the right part, it uses 550 width.

This behavior will be apply for all part stacks.
We use default size (260) for all parts except Git history part (it will be 550).

What issues does this PR fix or reference?

#2308

history_pullreq_menu

Signed-off-by: Roman Nikitenko [email protected]

@slemeur
Copy link
Contributor

slemeur commented Oct 28, 2016

Looks good for Git History.
Does that mean that it changed the default sizes for all panels displayed on the right?

I'm asking this because, obviously the default width for the Pull Request Panel and the Git History should not be the same - it should depend on the feature displayed.

@RomanNikitenko
Copy link
Member Author

@slemeur
You are right, these changes apply for tooling part stack, so for Pull Request Panel as well as for the Git History.
As far as I remember we had issue some times ago to avoid jumps when we are switching between parts of the same part stack: between Events and Processes area for example. So I have applied this behavior for Pull request panel and Git History panel.
But I'm interested in your opinion - WDYT?

@codenvy-ci
Copy link

Build # 831 - FAILED

Please check console output at https://ci.codenvycorp.com/job/che-pullrequests-build/831/ to view the results.

@slemeur
Copy link
Contributor

slemeur commented Oct 28, 2016

I think that changing the sizes of the panel, once it has been opened would be ugly.

Imagine the following use case:
1- Open Pull Request panel --> small width for right part
2- Open Git History panel --> large width for right part
3- Open Pull Request panel --> small width for right part
It will show a lot of redrawing which would not really be friendly to the user.

There are probably a tradeoff possible, by increasing the width of the right part - only if the user try to display a panel which require it.

We would have the following use cases:
1- Open Pull Request panel --> small width for right part
2- Open Git History panel --> large width for right part
3- Open Pull Request panel --> width for right part stay large
And until the user has not opened git history we keep displaying it small.

This way we avoid constant redrawing and situation where the right part is too small for the content of the panel.

Does it make sense to you?

Maybe - for the time being it is overkill, but we can fill an improvement for that behavior.

@RomanNikitenko
Copy link
Member Author

@slemeur
So do you prefer different default size for Git History panel and for Pull request panel?

Before my changes we had default size for both panel: 260
After my changes default size for both panel is: 750

Do you prefer follow default size:

  • for Git History panel - 750
  • for Pull request panel - 260

@slemeur
Copy link
Contributor

slemeur commented Oct 28, 2016

Yeah, but I'd like the width being updated only if more space is needed.

So for example:

  • you open Git History first, it uses 750 width. You open Pull Request panel while Git History was still displayed, it uses 750 width too.
  • you open Git History first, it uses 750 width. You close Git History and then open Pull Request panel while nothing was displayed on the right part, it uses 260 width.
  • you open Pull Request first, it uses 260 width. You open Git History while Pull Request was still displaying on the right, it uses 750 width.
  • you open Pull Request first, it uses 260 width. You close Pull Request and then open Git History panel while nothing was displayed on the right part, it uses 750 width.

750 by default for all panel is too much.

@RomanNikitenko
Copy link
Member Author

RomanNikitenko commented Nov 2, 2016

thank you, Stevan!
Now it more clear for me.
But I still have questions.
Current behavior also includes the following: we remember size when user resizes a part stack. For example:

  • user opens Processes panel with default size = 260
  • user resizes it to 550
  • user closes Processes panel

At this moment we remember 550 as size for bottom part stack.
So we will use 550 size when user opens Processes panel or Events panel as well.
I think we need to override this behavior for right part stack, otherwise corresponding the new behavior imagine the following use case:

  • user opens Git History first, it uses default size.
  • user resizes it to a half of screen size.
  • user opens Pull Request panel while Git History was still displayed - we remember this size as size for right part stack
  • Pull Request panel is displayed with a half of screen size.

What size we need to remember for right part stack?
Do we need to remember own size for each part (not for part stack)?
So do we need to have different way of handling left, right and bottom part stacks?

@slemeur
Copy link
Contributor

slemeur commented Nov 3, 2016

Thanks Roman.

We need to find a solution which will be the same for each part stacks, not only for right part stack - otherwise it will be confusing for the user.

I think that it does not change the main goal that we want to achieve, we want to avoid situations where the user will see the size changing as he is switching between panels.

Let's keep the rule defined with the previous comments and override it once the user manually resized a part (all: left, right, bottom). If a user manually resized a part, we use it as default for all panels of the part.

@codenvy-ci
Copy link

Build # 1153 - FAILED

Please check console output at https://ci.codenvycorp.com/job/che-pullrequests-build/1153/ to view the results.

@codenvy-ci
Copy link

Build # 1395 - FAILED

Please check console output at https://ci.codenvycorp.com/job/che-pullrequests-build/1395/ to view the results.

@TylerJewell
Copy link

@vparfonov @RomanNikitenko - lets plan to update these files and get them merged in the next sprint. If you have 30 minutes this week, it would be nice to go ahead and do that now. Cleaning up old PRs.

…the content of the part

Signed-off-by: Roman Nikitenko <[email protected]>
@RomanNikitenko RomanNikitenko changed the title CHE-2308. Change default size for tooling part stack CHE-2308. Use own size of part when part stack size is too small for the content of the part Jan 19, 2017
@RomanNikitenko
Copy link
Member Author

@slemeur @vparfonov I have updated pull request - please review.

@slemeur
Copy link
Contributor

slemeur commented Jan 19, 2017

@RomanNikitenko: Have you applied the latest comment I gave on this PR?

btw - you can use reviewers for the PR, it helps anybody to see who must validate the PR before merging it.
screen shot 2017-01-19 at 15 06 07

@codenvy-ci
Copy link

@RomanNikitenko
Copy link
Member Author

@slemeur

  • I have updated video which displays new behavior
  • thank you for your advice about reviewers - I will use it!


if (activePart != null) {
updateWorkBenchPartSize();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please add comments on new blocks you are added?
It will help developers to understand the logic of the code.

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!

}
}

private boolean isSizeOverridden(double size) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please add a little comments on methods?

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!

@codenvy-ci
Copy link

Build # 1697 - FAILED

Please check console output at https://ci.codenvycorp.com/job/che-pullrequests-build/1697/ to view the results.

@RomanNikitenko RomanNikitenko added the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Jan 20, 2017
@RomanNikitenko
Copy link
Member Author

Fixed by #3799

@RomanNikitenko RomanNikitenko deleted the CHE-2308 branch March 1, 2017 16:02
@benoitf benoitf removed the status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. label Nov 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants