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

GLMTreePresentation display artifact when selection is set to an unexpanded node #918

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

Comments

@seandenigris
Copy link
Contributor

Originally reported on Google Code with ID 918

Execute the following Workspace script, then in the left pane, click on $X while it
is not expanded.  An display artifact appears on the first line as shown in attached
image, which is the an overlap of the the hidden third level $X and $O.  See attached
PNG.

Also the right pane locks up, which can be reset by unexpanding $A.

If you expand the $X in the right pane before clicking the $X in the left pane, the
problem does not occur.

---

    |browser |
    browser := GLMTabulator new.
    browser column: #one; column: #two.
    browser transmit to: #one; andShow: 
    [   :a |
        a tree
            rootsExpanded;
            children: [:x :i | x asString size > 1 ifTrue: [x] ifFalse: [OrderedCollection new]
] ;
            format: [ :x | x isCollection ifTrue: [x first] ifFalse: [x] ].
    ].
    browser transmit to: #two; andShow: 
    [   :a | 
        a tree
            rootsExpanded;
            children: [:x :i | x asString size > 1 ifTrue: [x] ifFalse: [OrderedCollection new]
] ;
            format: [ :x | x isCollection ifTrue: [x first] ifFalse: [x] ].
    ].
    browser transmit from: #one; to: #two port: #selection.
    browser openOn: #(($A $B ) ($C $E ($X $O)))

Reported by benjamin.t.coman on 2013-03-11 14:01:24


- _Attachment: GLMTreePresentation-artifact.png
![GLMTreePresentation-artifact.png](https://storage.googleapis.com/google-code-attachments/moose-technology/issue-918/comment-0/GLMTreePresentation-artifact.png)_
@seandenigris
Copy link
Contributor Author

To narrow in on this, put 'self halt' at the start of MorphTreeNodeMorph>>openItemPath:
Using 'browser openOn: #(($C $E ($X $O)))' as a stripped down test case go:
1. Enable Halt Once.
2. Click $X (debugger appears)
3. Enable Halt Once again prior to clicking <Proceed> button 
4. Click <Debug>

The problem occurs when I <Step Over> [^container listManager setSelectedMorph: found]

and inside #setSelectedMorph: when I <Step Over> 'self emptySelection'
and inside that when I <Step Over> 'self selectionChanged'
and following deeper 

If after point 4. above, I click quickly <Over> the lines on #openInPath:
then sometimes the error occurs on the line [found toggleExpandedState],
but if I click slowly it seems to usually does not occur there.

Now apart from trying to troubleshoot through MorphTreeNodeMorph, I notice also that
at the line [found toggleExpandedState] the arrow icon of $X changes from left pointing
to down pointing - so $X is expanded - but I don't think that should happen.   Looking
back up the stack I see GLMTreeMorphNodeModel>>expandParentPath which makes sense to
expand the parents so the selected item is visible, except that I think the selected
item should not be included in the send to #changed. 

So actually the following resolves the problem...
GLMTreeMorphNodeModel>>expandParentPath
"   self openItemPath: anArray"
    self containerTree changed: {#rootNodes. #openItemPath}, (self path collect: [:each
| each item]) removeLast.












Reported by benjamin.t.coman on 2013-03-11 15:19:04

@seandenigris
Copy link
Contributor Author

Actually that should be 
    self containerTree changed: {#rootNodes. #openItemPath}, (self path collect: [:each
| each item]) allButLast.

...except that introduces an issue of its own, not clearing the selection from the
first line.

Reported by benjamin.t.coman on 2013-03-11 16:50:44

@seandenigris
Copy link
Contributor Author

What version?

Reported by tudor@tudorgirba.com on 2013-03-11 17:05:10

@seandenigris
Copy link
Contributor Author

Just tested on a freshly downloaded Moose Suite 4.7.

Reported by benjamin.t.coman on 2013-03-11 17:38:23

@seandenigris
Copy link
Contributor Author

The attached changeset fixes the issue.

Reported by benjamin.t.coman on 2013-03-11 18:04:32


- _Attachment: [MooseIssue918.2.cs](https://storage.googleapis.com/google-code-attachments/moose-technology/issue-918/comment-5/MooseIssue918.2.cs)_

@seandenigris
Copy link
Contributor Author

I cannot seem to be able to reproduce the problem in 5.0. Ben, could you try again?

Reported by tudor@tudorgirba.com on 2013-11-19 19:45:07

@seandenigris
Copy link
Contributor Author

After confirming I could reproduce it in Moose 4.7, I am happy to report it no longer
occurs in Moose 5.0.

Reported by benjamin.t.coman on 2013-11-20 08:59:30

@seandenigris
Copy link
Contributor Author

> After confirming I could reproduce it in Moose 4.7, I am happy to report it no longer
occurs in Moose 5.0.

But I can't see where I might close this Issue myself...

Reported by benjamin.t.coman on 2013-11-21 13:22:40

@seandenigris
Copy link
Contributor Author

Reported by tudor@tudorgirba.com on 2013-11-21 13:25:22

  • Status changed: Fixed

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

1 participant