Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
Building an outline via containers in map vie (Read 2293 times)
Pat Maddox
Full Member
*
Offline



Posts: 66

Building an outline via containers in map vie
Dec 06th, 2015, 3:51am
 
I have a note with five lines in it - 1, 2, 3, 4 5. I've exploded the note so each line becomes its own note. Now I want to build an outline by dragging the notes into a container in map view. So I create my container note called outline, and drag the notes into it in my new order - 5, 3, 1, 4, 2.

When I view the note in outline view, it's almost exactly what I want - the problem is, it's in reverse order. The outline shows 2, 4, 1, 3, 5.

How do I either a) reverse the order that the container note lists its children in outline view (there is no sort on, so checking "reverse" does nothing) or b) get the container note to add new children to the bottom of the list instead of the top?

My use case is that I have a bunch of notes, I organize them into groups in map view, and then I build up my new outline by dragging them into a container. But whoops... my outline is the reverse of what I want.
Back to top
 
 
  IP Logged
Pat Maddox
Full Member
*
Offline



Posts: 66

Re: Building an outline via containers in map vie
Reply #1 - Dec 6th, 2015, 4:02am
 
Of course I found something that works immediately after posting Smiley

1. Sort by (General) "Outline order"
2. Check reverse

You can uncheck reverse, and the order will be maintained. Each time you enable reverse, the outline order will flip.
Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Building an outline via containers in map vie
Reply #2 - Dec 6th, 2015, 10:22am
 
More generally, you could sort the container by $Name.  Or, to sort by the order in which notes were created, sort by $Created.
Back to top
 
 
WWW   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Building an outline via containers in map vie
Reply #3 - Dec 6th, 2015, 10:57am
 
Quote:
So I create my container note called outline, and drag the notes into it in my new order - 5, 3, 1, 4, 2.

When I view the note in outline view, it's almost exactly what I want - the problem is, it's in reverse order. The outline shows 2, 4, 1, 3, 5.

Maps don't have an order - in terms of where on the map they appear. Outline order ($OutlineOrder) is reflected in a map by the z-order (the on-screen vertical stacing order), which is only evident when notes overlap. That is explained in more detail here.

The reason you're inital checking of the 'reverse' box on the sort sub-tab of the Action inspector is becasue you likely din't have any osrt order set. IOW, Tinderbox had no already-set sort order order - as opposed to the existing order as initally added - to which a reverse sort can be applied.

Notes in maps stack so the most recent (and highest sibling $OutlineOrder number) items stacks in front of - on top of - any other overlapping items.  The oldest - first added - time (and with the lowest sibling $OutlineOrder) stacks behind all other notes on that map. A sidenote re maps: all notes stack in front of all adornments with each having its own outline-order-based stack.

The stack order on a map is basically intended so newer maps don't get added obsured by existing items. Hover, it seems drag-dropping a selection of note(s) in map view onto a child container adds them s oldest rather than newest, which breaks such a pattern. I'm unaware of any shortcurt workaround for that.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Pat Maddox
Full Member
*
Offline



Posts: 66

Re: Building an outline via containers in map vie
Reply #4 - Jan 6th, 2016, 8:05pm
 
I guess I didn't explain myself very well. But I think this should be pretty simple.

When I add a note to a container in map view, I want it to go to the END of the outline view list, rather than the beginning, like it currently does.

Is that making more sense?

I guess what I want to do is set up an OnAdd to modify the OutlineOrder and move the note to the end of the list. But OutlineOrder is read-only.
Back to top
 
« Last Edit: Jan 6th, 2016, 8:11pm by Pat Maddox »  
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Building an outline via containers in map vie
Reply #5 - Jan 7th, 2016, 4:12am
 
To add a new note to a container as the first child, use Shift+Return; to add it a new note to a container as last child (i.e. last sibling(, use Ctrl+Shift+Return.

If you want to add an existing note to the container via drag-drop or via an action, you'd need to use some code in the $OnAdd of the container. Ideally, were $SiblingOrder not read-only, something like $SiblingOrder = $SiblingOrder(lastChild)+1; would suffice. However, if you use the setting of a $Container value to move an item to a new location, it is added to the new container as the last sibling by outline order (tested in v6.4.0).

Let's assume we have a Container "Things" (whose title, i.e.  $Name, is unique). Now make an stamp whose action is:

$Container="Things";

Save the stamp and use it on the item you wish to move. Note that if the target $Name is not unique you should cite the whole path in the stamp action. For instance:

$Container="/These/Things";

Ensuring the note isn't moved to a same named container at path /Those/things.

But, this doesn't scale as the target container is hard-coded in the action. I've tested and this works:

$Container=$MyString;

whereby the stamped item's $MyString sets where the stamp moves the item. Of course that now depend on setting a variable in each note you want to move. Better perhaps to make a note just to hold that value and always change just that one note. Let's assume will make a note Container-Move-Target (e.g. a name we'll not likely use for actual content notes). Now the stamp is:

$Container=$MyString("Container-Move-Target");

Now you set/change $MyString in 'Container-Move-Target' as often as you need and that target container is used for all stamped note(s) be it one or a whole group of them. Effectively you've made a stamp that's (re-)configured by a single note value. Arguably editing that note's $MyString is no less effort than editing the actual stamp code. Take your pick as to which suits your work style.

~~~~~~~~~

Part of the background here is $OutlineOrder does different tasks in different views.  In the Outline, it stores/reflects the order as in the fully expanded outline. In map view (another of TB's earliest view types), the Z order - i.e. vertical stacking of overlapping items) is reverse OutlineOrder. Thus the first child by outline order is the frontmost item in a map. Ergo, when dragging items to a container it makes sense they get added in a manner so they aren't lost on the map by being behind and existing item. To someone only using outline, you'd never see this issue but Tinderbox has to cater for all sorts of use! Hopefully this at least explains how the status quo came to exist, in terms of sibling order of newly added notes.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Pat Maddox
Full Member
*
Offline



Posts: 66

Re: Building an outline via containers in map vie
Reply #6 - Jan 7th, 2016, 10:58am
 
My workflow for this is dragging and dropping onto another note.

The closest I've gotten so far is:

Code:
$OnAdd: $Container = $Path(parent) + "/outline" 



(is there a way to refer to the container note in OnAdd, or do I need to use parent like I'm doing here?)

The problem is this inserts this "outline" container note in between the actual container.

Here's what I'm trying to accomplish:

When I drag an existing note onto a container note, I want the child note to appear at the end of the list in outline view.

That's it, really Smiley
Back to top
 
« Last Edit: Jan 7th, 2016, 11:04am by Pat Maddox »  
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Building an outline via containers in map vie
Reply #7 - Jan 7th, 2016, 11:04am
 
...which, as explained in my last post, you can't do via drag/drop, unless you expand the (outline) container and choose a drop position 'by eye'.

But, if you use the method described in my last post (setting container) - which doesn't use OnAdd [sic] - then you can achieve your desired outcome.

Have you tried the stamp method I describe? I'd suggest at least trying it before discarding it as a solution given that you can't god what you want via the method you want. The stamp approach seems the best alternate.

I'm definitely not suggesting your desired task is not a reasonable thing to want. However, at present it's just not a supported feature. You might want to email in to suggest such a feature, although there aren't many keystroke shortcuts/modifiers that aren't already used for other tasks.
Back to top
 
« Last Edit: Jan 7th, 2016, 11:05am by Mark Anderson »  

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Pat Maddox
Full Member
*
Offline



Posts: 66

Re: Building an outline via containers in map vie
Reply #8 - Jan 7th, 2016, 11:24am
 
Thanks for taking the time to provide alternatives. It wasn't clear to me from your post that you absolutely cannot do this via drag/drop which is why I clarified that drag/drop is my desired workflow here.

I tried the stamp thing and ruled it out. Here's why:

1. With a working drag/drop workflow, it's drag / drop / DONE Smiley

vs

1. Open "Inspect stamps window"
2. Create a new stamp
3. Name the stamp
4. Set stamp action
5. Click target note
6. Click "apply"
7. Refocus the map on my notes (since the map has now shifted to some other position)
8. Go to 5 for each note in the group
9. Go to 2 for each container note (or modify the stamp action)

I think the best approach then is to cluster my notes, drag them all into a container in one shot, and then sort them manually in outline view.
Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Building an outline via containers in map vie
Reply #9 - Jan 7th, 2016, 11:35am
 
Wouldn't it be truly unsatisfactory to open a tab for the outline view of the container in question and, after adding notes in map view, switch briefly to outline view to adjust their order?

In principle, we might use some modified drag -- perhaps ⌘-^-drag -- to add notes to the end rather than the beginning of the containerís children.  But does this make Tinderbox easier, or harder?
Back to top
 
 
WWW   IP Logged
Pat Maddox
Full Member
*
Offline



Posts: 66

Re: Building an outline via containers in map vie
Reply #10 - Jan 7th, 2016, 11:51am
 
Quote:
Wouldn't it be truly unsatisfactory to open a tab for the outline view of the container in question and, after adding notes in map view, switch briefly to outline view to adjust their order?


It's not what I want to do. But it seems like the best option given TB's present functionality. Keep in mind I've changed one part of my workflow here: rather than drag notes onto the container one-by-one (the order I want them in), I just select the whole cluster and drag them in at once. Then re-order in outline.

At least this way, I spend my time & energy thinking about my notes. With the stamp method, I spend more of my time and energy thinking about the tool.

But yes, I'd love for it to work my way. Because when I arrange my clusters, I arrange them in a rough order. Then I drag them onto the container in the order I want, just as if I were stacking up some physical note cards.

Quote:
In principle, we might use some modified drag -- perhaps ⌘-^-drag -- to add notes to the end rather than the beginning of the containerís children.  But does this make Tinderbox easier, or harder?


It makes it easier... for me Smiley
Back to top
 
 
  IP Logged
Derek Van Ittersum
Full Member
*
Offline



Posts: 168

Re: Building an outline via containers in map vie
Reply #11 - Jan 7th, 2016, 12:15pm
 
Wouldn't there be some way to have the Container increment a user attribute (say, $SortOrder) for each note by 1 so that the first note dropped on the container was 1, the second was 2, etc. Then the Container could be sorted by $SortOrder.

I'm not sure how to create the right $OnAdd code though. Maybe MarkA or MarkB might have a suggestion along those lines.

If I had to guess on the approach, maybe I would have a two step:

$OnAdd="$SortOrder=$SortOrder(parent)+1;$SortOrder(parent)=$SortOrder(parent)+1

Which, I'm thinking, would set each added note's $SortOrder to 1 more than the Container's $SortOrder, then add 1 to the Container's $SortOrder. But I think there's probably a less roundabout way to make this happen--maybe with a "sequential" number attribute of some kind.


--------

Note. Just tested the code above and it seems to work. Give it a try.
Back to top
 
« Last Edit: Jan 7th, 2016, 12:31pm by Derek Van Ittersum »  
  IP Logged
Pat Maddox
Full Member
*
Offline



Posts: 66

Re: Building an outline via containers in map vie
Reply #12 - Jan 7th, 2016, 12:58pm
 
Quote:
Wouldn't there be some way to have the Container increment a user attribute (say, $SortOrder) for each note by 1 so that the first note dropped on the container was 1, the second was 2, etc. Then the Container could be sorted by $SortOrder.


Yeah I tried something like that. Custom attribute $MyOrder (number)

Code:
OnAdd: $MyOrder = $MyOrder(lastSibling) + 1 



and set the container to sort by $MyOrder.

This is another option that kinda works. But then you can't rearrange the notes in outline view, because the sorting is fixed.

Another close option is setting up a container called "move: things" with:

Code:
OnAdd: $Container = $Name(parent).substr(6) 



So dragging onto "move: things" will move it into a container called "things".

I also tried that with adornments, but it crashed (using adornment instead of parent designator).

The extra "move" note seems the closest to what I want. I can set the OnAdd rule automatically with a prototype. I haven't experimented with it in multiple levels let (probably need to do something with the path).
Back to top
 
 
  IP Logged
Pat Maddox
Full Member
*
Offline



Posts: 66

Re: Building an outline via containers in map vie
Reply #13 - Jan 7th, 2016, 1:15pm
 
Here's an agent that does the job...

Code:
// Query
$Name.substr(0, 6) == "MOVE: "

// AgentAction:
$OnAdd = '$Container = $Path(grandparent) + "/" + $Name(parent).substr(6)';
$HTMLDontExport = true;
 



Create a note title "MOVE: things" and it'll automatically move it into a container called "things". This appears to work at all levels in a document...

And of course it could set a prototype instead of the OnAdd action...

Anyway, I think this is good for now. It's a bit of setup, and extra notes, but I can live with it.
Back to top
 
« Last Edit: Jan 7th, 2016, 1:25pm by Pat Maddox »  
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Building an outline via containers in map vie
Reply #14 - Jan 7th, 2016, 6:17pm
 
@Pat - apologies.  I didn't test my $Container-based ideas in an adornment context. Age-nerfed memory means I forgot earllier discussion of your work context. I should have remembered.

My gut feeling is the soltion would be a (keystroke) modified drop action but I'm not a code and have no idea to practical that would be.  I can see that simply changing the status quo (first vs last child) would be an ugly hack and break work patterns for others.

Glad you've found a code solution. The upside of Tinderbox is that in most cases there is an alternative approach, even if not the desired ideal.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Pages: 1
Send Topic Print