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

"Show More" in connections pane jumps to top #2211

Closed
jmcphers opened this issue Feb 16, 2018 · 1 comment · Fixed by #2296
Closed

"Show More" in connections pane jumps to top #2211

jmcphers opened this issue Feb 16, 2018 · 1 comment · Fixed by #2296

Comments

@jmcphers
Copy link
Member

@jmcphers jmcphers commented Feb 16, 2018

System details

RStudio Edition : Desktop
RStudio Version : 1.1.423
OS Version      : MacOS 10.13.3
R Version       : 3.4.2

Steps to reproduce the problem

  1. Click New Connection.
  2. Connect to a data source which has several hundred objects at the top or first level.
  3. Scroll down to the last displayed object and click Show More.

Describe the problem in detail

Clicking Show More sends you back to the top of the list.

Describe the behavior you expected

It should maintain your scroll position.

@ronblum ronblum added the bug label Feb 20, 2018
@jmcphers jmcphers added this to the v1.2 milestone Feb 26, 2018
@jmcphers jmcphers removed this from the v1.2 milestone Mar 1, 2018
@jmcphers jmcphers added this to the v1.1-patch milestone Mar 1, 2018
@jmcphers
Copy link
Member Author

@jmcphers jmcphers commented Mar 1, 2018

It turns out that this only reproduces in 1.1. The problem is here:

objects_ = new CellTree(objectsModel_, null, RES, MESSAGES);
// create the top level list of objects
objects_.setDefaultNodeSize(Integer.MAX_VALUE);

Once the cell tree has been constructed, you can't change the defaultNodeSize of the root node. This is fixed in 1.2, where we supply it in the constructor instead.

// create new widget
objects_ = new CellTree(objectsModel_, null, RES, MESSAGES, Integer.MAX_VALUE);

So on 1.2 users don't get a "Show More" at all -- they just see all of the objects, all of the time.

Unfortunately the "Show More" button doesn't emit any events and it's difficult to tell if it's been clicked. The best we could do would be to attach our own click handler to the CellTree; if we receive a click destined for Show More we could save the scroll position and defer a restore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants