TiddlyWiki5 icon indicating copy to clipboard operation
TiddlyWiki5 copied to clipboard

[IDEA] Proposal to format tag pill text in italic if tiddler is missing

Open pmario opened this issue 2 years ago • 5 comments

At: https://talk.tiddlywiki.org/t/italicize-tag-iff-theres-no-tiddler-there-tag-itself-is-missing/8972 it's proposed to format tag-pills in italic if the tag tiddler is missing.

It would be so straightforward and consistent if the tag pill would display in italics for tags whose home-tiddler does not exist, as in this graphic:

bdc0e8efd24079860582fad4f990df6277080aeb_2_517x94

Quick demo of this tiny tweak: https://quick-demo.tiddlyhost.com/#tag-pill%20italics%20iff%20missing

While using "off-the-shelf" TiddlyWiki, one has to click on the tag pill, and look at the drop-down, in order to see whether the tag's governing tiddler appears in italics or not.

I realize that some TiddlyWiki users don't tend to put actual content into the tiddlers that serve as tags. Perhaps those folks would not care about this behavior, but would anyone specifically prefer not to incorporate this info? (Even if you don't usually interact directly with these tag-governing tiddlers, the italics could confirm at a glance that there's no info there, including in its list field.)

What do you think, @TW_Tones? This strikes me as a natural mini-feature of reimagine-tags (or is it reimagin-tags?)...

In 5.3.2+, the tweak is super-easy, thanks to conditional shortcut syntax:

In $:/core/macros/tag the string <$view tiddler=<<__tag__>> field="title" format="text" /> is replaced by:

<%if [<__tag__>!is[missing]] %>	<$view tiddler=<<__tag__>> field="title" format="text" />
<% else %>
//<$view tiddler=<<__tag__>> field="title" format="text" />//
<% endif %>

@Jermolene -- What do you think?

pmario avatar Jan 28 '24 11:01 pmario

Hi @pmario I think it's a good idea.

Hover, I think it would be more consistent with the way that we style links if we conditionally assigned a new tc-tag-missing class, and then used CSS to make it appear in italics.

Jermolene avatar Jan 28 '24 11:01 Jermolene

conditionally assigned a new tc-tag-missing class, and then used CSS to make it appear in italics.

Something like this in $:/core/macros/tag:

<span class={{{ [<__tag__>is[missing]then[tc-tag-missing]] }}}>
<$view tiddler=<<__tag__>> field="title" format="text" />
</span>

and then in $:/themes/tiddlywiki/vanilla/base add:

.tc-tag-missing { font-style:italics; }

ericshulman avatar Jan 28 '24 12:01 ericshulman

Good idea to have an option to show missing tags like missing tiddlers. I propose to add a config to be able to show missing tag as missing link! Many users, most of time don't create the tag itself but they used them as meta data, so for most users the default scenario is: tag is missing.

  1. Having too many missing tags, makes the tag row ugly if they are shown as italic
  2. In the current TW implementation missing tags are not listed under Sidebar -> More -> Missing, if you add above option they shall be listed there. This is not a good idea

kookma avatar Jan 28 '24 12:01 kookma

I propose to add a config to be able to show missing tag as missing link!

Links in the ViewTemplate tag area are not detected as missing links. Only the text area detects missing tiddler if used as links.

pmario avatar Jan 28 '24 12:01 pmario

Good idea to have an option to show missing tags like missing tiddlers.

I'm against an option. If a user really does not want to see missing-tag tiddlers as italic, they should create a new stylesheet-tiddler and remove the format. We may add this info to the documentation, so they know how to do other things too. eg:

title: initial-tag-format
tags: $:/tags/Stylesheet

.tc-tag-missing {
	font-style: initial;
}

pmario avatar Jan 28 '24 13:01 pmario

Good idea to have an option to show missing tags like missing tiddlers. I propose to add a config to be able to show missing tag as missing link!

I agree.

Having it without an option to turn it OFF for many (most?) users just adds unneeded visual clutter?

TiddlyTweeter avatar Apr 18 '24 11:04 TiddlyTweeter

If a user really does not want to see missing-tag tiddlers as italic, they should create a new stylesheet-tiddler and remove the format.

@pmario I DO like the proposal as an option to show tags in italic when a tag's tiddler is not yet created

BUT I do not see the benefit of it being the default. Why? ...

  • you can already see that at the top of any single tag drop-down;
  • it may make the interface more visually "noisy" than most users need;
  • I think this would be a good addition for some users ...
  • ... but very unlikely to be of any relevance to most.

Just comments, TT

TiddlyTweeter avatar Apr 18 '24 11:04 TiddlyTweeter

@TiddlyTweeter - Please check the new docs. https://tiddlywiki.com/prerelease/#tag%20Macro:%5B%5Btag%20Macro%5D%5D%20%5B%5Btag%20Macro%20(Examples)%5D%5D -- The default has been removed.

pmario avatar Apr 18 '24 12:04 pmario

@TiddlyTweeter - Please check the new docs. https://tiddlywiki.com/prerelease/#tag%20Macro:%5B%5Btag%20Macro%5D%5D%20%5B%5Btag%20Macro%20(Examples)%5D%5D -- The default has been removed.

Thanks! That looks fine. First you need add the style. And it would be easy to remove.

TiddlyTweeter avatar Apr 18 '24 14:04 TiddlyTweeter