Administrator
|
I had a "simple" goal: to change Calypso's class pane to a tree. After an
hour or two, I didn't feel any closer! I'm wondering if it's my process or something else. A few questions: 1. Is there a heuristic for finding relevant documentation? We have lots of docs, but there seem to be a lot of separate locations for it. I think I searched on the Nabble ML mirror for "Calypso" posts on either Pharo list. After digging around, I found a discussion where Steph was working on a [] booklet, which I read and was helpful for understanding the model but didn't directly address my issue (not that it should, this is pretty low-level hacking!). Then I tackled the class comments, which are VERY thorough, but it's hard (at least for me) to piece together the overall design from the individual parts. 2. How do we make sophisticated designs discoverable? I remember one of my Aha! moments when I discovered Smalltalk was using Morphic halos on a menu item and easily finding the code it used underneath. Things like that do not generally seem possible anymore in my experience. I thought to myself, packages are already in a tree, let me dig there! I got a bit worried when I saw what seemed to be a mini-DSL for tree making instead of simple message sends: ClyFullBrowser >> #newPackageView ... treeStructure: { ClyProjectChildItem -> #prepareProjectItemsQueryFrom:in:. RPackage -> #prepareClassGroupQueryFrom:in: }; But I pressed on and tried to duplicate that logic: ClyFullBrowser >> #newClassView ... ^ self newNavigationView treeStructure: { Class -> #prepareProjectItemsQueryFrom:in: } ... And... nothing. When #prepareClassItemsQueryFrom:in: didn't exist, I got no debugger. When I created it, placing a halt in it never got triggered. Besides my immediate experiment of making the class pane a tree, my more fundamental questions are: 1. What is the best heuristic to explore the system? This would be great to put somewhere publicly. Especially, but as we can see from this post not exclusively, for new users. 2. Do we value discoverability? 3. If so, are we designing our system with this value in mind? ----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
Cheers,
Sean |
Hi Sean. пт, 5 июн. 2020 г. в 16:15, Sean P. DeNigris <[hidden email]>: I had a "simple" goal: to change Calypso's class pane to a tree. After an I implemented it in very early stages. But I did have time to implement it in a better way. The old code is still there. But I did not expose it to the browser widgets API. Try to replace following line in ClyFullBrowser>>switchToFlatClasses
with:
The trick is to use ClyExpandedDataSource instead of ClyCollapsedDataSource. The former is responsible to provide expansion to predefined internal tree structure (which you see in default browser). I wanted to merge them but I had no time for that. I thought to myself, You were in the right direction. But there is a little detail here. By default your code would work for domain objects in the list (not a class view). But the problem with classes and methods lists is to support the Ring model where classes are not instances of Class and methods are not instances of CompiledMethod. My solution was to have a data type for query items. By default it is an actual class of objects. But for classes and methods I introduced ClyClass and ClyMethod to address the Ring case. So try following in your experiment ClyClass -> #prepareProjectItemsQueryFrom:in: And you should have a debugger. I wonder, did you try a halt in #treeStructure users . I think it would help to discover this logic. Denis ... |
Administrator
|
Denis Kudriashov wrote
> Try to replace... with... Thanks!! That added tree node arrows to the class tree :) but the icons and arrows themselves are not properly indented (they are all in one vertical line regardless of depth in tree) :/ BTW am I alone in thinking that the class list should be treated as a tree by default? It basically is a tree *already*, but without the ability to collapse/expand which limits understanding a large tree where siblings may be far apart when it's fully expanded. Also, I can't imagine ever coming up with all that on my own, so I'm glad I asked, but I'm worried about the future extensibility/maintenance if original authors aren't available :/ Denis Kudriashov wrote > You were in the right direction. But there is a little detail here. > By default your code would work for domain objects in the list (not a > class > view). > But the problem with classes and methods lists is to support the Ring > model > where classes are not instances of Class and methods are not instances of > CompiledMethod. > My solution was to have a data type for query items. By default it is an > actual class of objects. But for classes and methods I introduced > ClyClass and ClyMethod to address the Ring case. > > So try following in your experiment > ClyClass -> #prepareProjectItemsQueryFrom:in: > And you should have a debugger. > > I wonder, did you try a halt in #treeStructure users . I think it would > help to discover this logic. I checked for senders of #treeStructure (there were none) and then references to the underlying inst var, but for some reason my eyes glossed over `queryToExpand:ifAbsent:` and I only ran across it much later in a debugger, but I don't remember from what route. Although, given your solution above, is this even necessary? ----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
Cheers,
Sean |
Administrator
|
Sean P. DeNigris wrote
> the icons and arrows themselves are not properly indented (they are all in > one vertical > line regardless of depth in tree) :/ Fixed: `displayMainColumnBy: [ :cell :item | cell useFullIndentation... ]` ----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
Cheers,
Sean |
Administrator
|
Sean P. DeNigris wrote
> Fixed https://github.com/pharo-project/pharo/pull/6493 ----- Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html
Cheers,
Sean |
In reply to this post by Sean P. DeNigris
Hi Sean. пт, 5 июн. 2020 г. в 21:16, Sean P. DeNigris <[hidden email]>: BTW am I alone in thinking that the class list should be treated as a tree I think collapsing buttons add "extra icons noise". I also thought to enable it by default but I did not like how it visually looks. Maybe I just need to get used to it. I will comment your PR. It requires more work I think |
Free forum by Nabble | Edit this page |