Identifying the Parent Note in an Agent

In my main TB file I have a prototype called “Notes Prototype” which I use all the time to record notes during meetings, thoughts, records of telephone calls etc… It has a number of Key Attributes (KAs) that help me identify the note context, the satellite missions involved and other meta data that makes sense to me. If the note is long or it makes sense to split into different sections I usually add subnotes to the main note with the same prototype.

These notes and their use in TB has proven very useful especially in combination with Agents and Dashboards (hopefully in the future cross-tabs :slight_smile:). For instance I have Agent called “This Week” which retrieves all notes from this week using the following code:

Action:

($Created.week==today.week) & ($Created.year==today.year) & ($Prototype==“Notes Prototype” | $Prototype==“Task”)

which I view in Outline mode. One challenge I still face is how to recognise the Sub Notes within the view. As the Agent flattens the hierarchy and the prototype of a sub note is the same as the container it is difficult to recognise the relationship/hierarchy at a glance. This being TB there are many options that I know of to address this including inter alia:

  • Create a new prototype for sub notes derived from the main note prototype and use OnAdd action. The disadvantage of this is that you create a new prototype for what is essentially the same thing (a proper note on its own)
  • Link the sub note to the containing note. I already do this via an OnAdd action so that I can always find the container note using BrowseLinks. However, visually there is no connection in Outline View so it requires some extra steps e.g. BrowseLinks pop-up or similar to establish this connection.
  • Add a KA with $Container attribute to sub notes. Probably one of the better solutions (although this requires the text pane to be open). I’m not so keen on using up even more real-estate on my text panes. I usually only need this info inside Agents in any case, so not more than 1 or 2 times a day at most.
  • Use the excellent $HoverExpression connected to some action code along the lines of

if($Prototype(parent)==“Notes Prototype”){$HoverExpression=$Name(parent);};
which also works well once you know that the note is a sub note.

I guess what I miss most is a visual way of saying that this is a subnote within the outline view. Visual clues in outline are much less than you have in say Map (flags, different edges) in indicate that - while this is a note - it is a child to another note.

Any thoughts or suggestions ?

There’s nothing to fault in your first idea; a second prototype that belongs to the “sub notes”. The second prototype can be the one with the badge or other indicator.

Or just use a stamp to apply a badge to the sub notes when you create them.

Further to the last, the two main affordances you have for your use are $Color and $Badge. Also, sorting your agent on $OutlineOrder and original note data, should order the results within the agent’s list of aliases such that the aliases of child notes always follow the alias of the child’s parent note note.

To make colour more usable in Outline, I usually turn of the document setting to darken colours in outlines as it makes them grey and muddy. However, if doing so, avoid very bright colours like yellow or white (use darker shades of these colours instead).

For instance, if your note prototype uses an OnAdd to set a second prototype, the latter could use a different (or no) colour for $Color and have a different badge or no $Badge.

Here is a file showing this idea: childof.tbx (102.6 KB)

It looks like this:

I was unclear whether the “sub notes” are children of main notes, or at the same level of the outline hierarchy.

If they are children then you could have a second agent (or edict) that queries for

$Prototype(this) == $Prototype(parent)

and adds the badge for you – or whatever other indicator you settle on. The second agent would prepare the notes for viewing in your main agent.

I’ve updated my post above with a demo TBX, which shows the ideas and to act as a context for question/discussion. I’ve also added a screengrab of the outline.

Thanks for the wonderful feedback and illustrative example. Just to clarify my initial post, Sub Notes are indeed children of Notes.

Reading through your inputs, I had overseen two additional possibilities:

  1. To sort the Agent results in $OutlineOrder so that the Sub Notes always follow the (containing) Note.

  2. The use of $Badges in the Outline View. Unless I’m mistaken the option of using $Badges does not appear in the actual discussion of outline view in Atbref ? If I look at the bottom of the page I see discussions on checkboxes and other styling options such as colours. I’m wondering if worth mentioning there the use of Badges ?

Thanks to your help I now have enough information to manage my notes/subnotes in Agents.

Badges work in most views, except treemap and hyperbolic views, so the question is moot (This is mentioned in the main article on Badges). The easiest way to test if a visual feature you want works in a different view is to set that feature and then change the current view to the new view type: the result will be self-eviden in the new view. In my articles about views like Outline and Timeline, I’m primarily describing features that only work in that view or work differently in that view. Generic visual issues tend to have a main article under ‘Misc. User Interface Aspects’, though with some 2k articles to keep on top of I’m sure the odd thing gets missed!

It is the case that badges are drawn at a smaller size (16x16px?), however they may get bigger if you zoom the view. It’s actually quite complex now with OS dark/light mode, 4k displays, etc. as resolution/size are less cdertain values than of old.

Glad the TBX helped. It’s only a sketch. Names, colours, code etc can all be altered. For instance, personally I use terser prototype names but here I followed your style to better tie in with your questions. I did mean to note that don’t be tempted to nest the prototypes just because thats how they are ‘used’ in the outline: see the article on prototypes, specifically about 'bequeathing notes/prototypes. Also in the TBX doc uploaded, the default darker colours† in Outlines option has been disabled.

† Just spotted the page has the wrong image. i’ll fix later today.

I realised too late that in my haste, I made the two prototype a lack of contrast which is inconsiderate of a wider audience, so I’ve tweaked it to look like so:

Grr. ‘Modern’ lacks contrast and ‘normal’ is invisible in outline unless you use the ‘darker colours’ option. Sigh. All other features are the same:

childof.tbx (103.3 KB)

1 Like

I like the clever use of $Prototype.beginsWith("Notes ") in the query to capture both note prototypes with a single query.

1 Like