Subtle but noticeable mark in sidebar tab title

Is there a way to add some dynamic markup for a sidebar tab header? What I’d like to do is to keep track of the count of open work-items for myself, things that will change on the fly as I work on my wiki. I haven’t figured out any details of how I’d collect the information yet, but I won’t bother if I can’t report it in a simple manner. I was thinking of something like this:

image

Which represents my having four open items to deal with. I see this sort of UI in many places online, and it strikes me as useful, a compelling combination of subtlety and obviousness.

Has anyone done something like this? Is there a simple technique?

1 Like

It’s remarkably simple! Just create a tiddler (e.g., “TasksTab”), tagged with $:/tags/SideBar, containing something like:

<$list filter="[tag[task]]">

</$list>

This will display a list of all tiddlers tagged with task.

Then, give your “TasksTab” tiddler a caption field containing:

Tasks @@color:red;^^<$text text={{{ [tag[task]count[]] }}}/>^^@@

Of course, you could use a more sophisticated filter to select only “open work-items”, or a custom macro/procedure to display any other task-specific content you want.

enjoy,
-e

5 Likes

The only thing I can add to Eric’s solution is that, depending on the complexity of your wikitext, it may be easier to stick it in a global macro/procedure so that you don’t have to do all your editing in the caption field. :slight_smile:

Ahh, I had never realized that caption could include markup. Thank you!

– Scott

Definitely. What I end up with will be complicated, so a proc makes sense. The biggest stumbling block was that I simply didn’t realize that the caption could include wikitext. This will make it so much easier.

In addition to Eric’s suggestion perhaps consider adding a limit - perhaps hardcoded limit[50] to avoid long lists in a sidebar tab?

I will definitely consider it if I ever try to expand this for others’ usage. For my case, that shouldn’t ever be a problem.

I’m collecting a lot of information to later organize and analyze. I want to capture things like this:

[tag[Doc Link]] :map:flat[get[authors]enlist-input[]] +[unique[]] :filter[!is[tiddler]]

As I enter a new document link, I try also to list its authors using OokTech’s GenTags plugin. This would allow me to add authors who themselves don’t have a dedicated tiddler. I want to be able to come back soon and add those. I have three or four other sorts of open items I may collect, and I simply want a reminder to myself to come back and fix these soon. I don’t expect more than a dozen or so to ever be open at once.

If I do want to share, then I will make that limit available, as well as a limit to the count in the notification, perhaps 99+ would be reasonable text if there end up being many of these notifications.

Very nice, thanks! I’ve been wanting a little more constant visibility on my tiddlers tagged “todo” and since I rarely need to see what’s open I removed the $:/tags/SideBar from it and added a ToDos sidebar tab with this subtle – in my face – reminder.

From past advice, this is what is in the caption field of one of my sidebar tabs:

Railroads Open <$text text={{{ [listtag[Railroads]count[]] }}}/>

Here’s the stylesheet:

.rropen {
font-variant-position: super;
}

.rropen .section.open .label {
color: #e9e0c7;
}

And here’s what it looks like:
image

Edit: I was just reviewing my post and found an error. The caption actually has this as its contents:

Railroads Open <span class="rropen"> <$text text={{{ [list<tv-story-list>tag[Railroads]count[]] }}}/> </span>

The block quote messed up what was shown.

1 Like

Methinks Scott will be looking at fields a little differently from now on.