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

update visible list items on selection #1099

Closed
seandenigris opened this issue Aug 3, 2015 · 6 comments
Closed

update visible list items on selection #1099

seandenigris opened this issue Aug 3, 2015 · 6 comments

Comments

@seandenigris
Copy link
Contributor

Originally reported on Google Code with ID 1099

Tree/list presentation should display non-visible items when one of these items is selected.
To reproduce, execute the following script. Normally, the of items should be expanded
and 14 should be shown in the list on the left because it is the current selection
item. However, the list does not change and 14 is not shown.

browser := GLMTabulator new.
browser column: #one; column: #two.
browser transmit to: #one; andShow: [:a | 
    a list showOnly: 10; display: [:number | (1 to: number)]  ].
browser transmit to: #two; from: #one; andShow: [:a | 
    a roassal2
        initializeView: [ RTMondrianViewBuilder new ];
        painting: [:view :number  | 
        view interaction when: TRMouseDoubleClick do: [:ann | ((browser paneNamed: #one)
port:#selection) value: ann element model ].
        view shape label.
                view nodes: (1 to: number + 5).
                view edgesFrom: [:each | each // 2 ].
                view treeLayout  ]].
browser openOn: 100.
((browser paneNamed: #one) port: #selection) value: 14.




Reported by usman.bhatti on 2014-11-24 16:16:34

@seandenigris
Copy link
Contributor Author

Thanks. I think with the current list implementation we cannot handle this use case.
Imagine you would have a 100k items in your list and you would select the last item.
It would mean that we have to show the whole list, but this is precisely the point
of the paging. The same mechanism is actually used also when you write a selection
query for a group, so having 100k items is not an unusual case.

I agree that it is not intuitive, but handling it will require a new implementation
of the list. For example, we can imagine having some sort of ... in the middle of the
list and show only the selected items (in your case it would be (1,2,3,4,5,6,7,8,9,10
... 14) . We will likely get to it but not in the near future, unfortunately.

Or do you have another idea?

Reported by tudor@tudorgirba.com on 2014-11-25 11:19:34

@seandenigris
Copy link
Contributor Author

As per my understanding, PaginatedMorphTreeMorph can have two modes of expansion: incremental
mode or scroll to the page of selected element(s). 
Incremental mode expands the list up to the selected item. Paged mode shows a fixed
number of elements on each page and jump to a specific page item selected. To see it
working, execute script below:

| treeMorph aWindow aModel |
    aModel := PaginatedMorphTreeModel new rootItems: (1 to: 100) asArray.
    aWindow := aModel theme newWindowIn: World for: aModel title: 'test'.
    treeMorph := aModel defaultTreeMorph.
    treeMorph pageSize: 30.

    treeMorph buildContents.
    aWindow addMorph: treeMorph fullFrame: (LayoutFrame fractions: (0 @ 0 corner: 1 @
1) offsets: (0 @ 0 corner: 0 @ 0)).
    aWindow open.
    aModel expandItemPath: {50}.

Glamour chooses the incremental mode and effectively this mode is not adapted for 100K
items. In my opinion, we should use paged mode and it should not require drastic changes
to the current tree model in Glamour.

As for the  bug, the solution will be that the model needs to do expandItemPath: when
a selection is made and update list. And I should provide a fix once we find an agreement
on the selection display mode.

Reported by usman.bhatti on 2014-11-25 12:50:30

@seandenigris
Copy link
Contributor Author

So, here is a proposal for paged list in Glamour. The changes are not drastic. You can
try it with this script. MorphNodeTreeMorph was changed to adapt the position of children.
It is not a bug itself because original MorhTreeMorph does not allow to create children
but since subclasses do, it has to provide  this service, IMO.

browser := GLMTabulator new.
browser column: #one; column: #two.
browser transmit to: #one; andShow: [:a | 
    a tree children: [:one :two :level | level <2 ifTrue: [{level}]]; showOnly: 10; display:
[:number | (2 to: number)]  ].
browser transmit to: #two; from: #one; andShow: [:a | 
    a roassal2
        initializeView: [ RTMondrianViewBuilder new ];
        painting: [:view :number  | 
        view interaction when: TRMouseDoubleClick do: [:ann | ((browser paneNamed: #one)
port:#selection) value: ann element model ].
        view shape label.
                view nodes: (1 to: number + 5).
                view edgesFrom: [:each | each // 2 ].
                view treeLayout  ]].
browser openOn: 100.
((browser paneNamed: #one) port: #selection) value: 15


Let me know what do you think.

Reported by usman.bhatti on 2014-11-26 11:23:36


- _Attachment: [Glamour-Morphic-Renderer-usmanbhatti.300.mcz](https://storage.googleapis.com/google-code-attachments/moose-technology/issue-1099/comment-3/Glamour-Morphic-Renderer-usmanbhatti.300.mcz)_ - _Attachment: [Glamour-Morphic-Widgets-usmanbhatti.152.mcz](https://storage.googleapis.com/google-code-attachments/moose-technology/issue-1099/comment-3/Glamour-Morphic-Widgets-usmanbhatti.152.mcz)_ - _Attachment: [Morphic-Base-usmanbhatti.296.mcz](https://storage.googleapis.com/google-code-attachments/moose-technology/issue-1099/comment-3/Morphic-Base-usmanbhatti.296.mcz)_

@seandenigris
Copy link
Contributor Author

The problem with this is that it introduces paging and I specifically do not want that
:(

Reported by tudor@tudorgirba.com on 2014-11-26 11:47:33

@seandenigris
Copy link
Contributor Author

In my opinion, paging is more adapted for long lists.

-> you don't have to scroll to the 50kth element at the end to see your selection.
-> page size can be modified by the user.
-> I ve seen ppl thinking that a list is incomplete but they only know that they are
looking at a partial view when they reach at the bottom when scroll arrows appear...



Reported by usman.bhatti on 2014-11-26 12:12:34

@girba
Copy link
Member

girba commented Jun 9, 2017

This is addressed in fastlist

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

No branches or pull requests

2 participants