A linkcatcher widget question. The widget makes an $action-navigate with $scroll="no" scroll anyway

From a previous topic we saw how to insert a search box in the tag-pill dropdown: Search box in tag dropdown - A question
I had also seen the interesting changes to the standard tag system made by @TW_Tones: reimagin-tags.json (16.6 KB)

I’ve tried combining the two solutions, and almost everything works fine, except for the $:/PSaT/open-all-tagged button, this button opens all tiddlers with a given tag without scrolling.

But by combining the two solutions, the scroll becomes active again. I investigated and I also understood why.
In the solution proposed by @pmario: $ _core_ui_TagTemplate-tag-dropdown-search-input-OK.json (2.6 KB) a link catcher widget is used. This link catcher somehow interferes with $scroll="no" of the open all tagged button.
I think this is a normal operation of the widget, but is there a way for the two things to coexist?


How can I resolve this conflict? (I’ve never had to deal with the linkcathcer widget and I don’t know how to do it)

1 Like

This is behavior you don’t want, right?

The linkcatcher code you attached has this:

	<$linkcatcher actions=<<clearTemp>>  >

which will execute this action code when a link click is caught:

\procedure clearTemp()
	<% if [<navigateTo>prefix[$:/state/popup/tag]] %>
		<$action-deletetiddler $tiddler=<<tempTiddler>>/>
	<% else %> 
		<$action-deletetiddler $tiddler=<<tempTiddler>>/>
		<$action-deletetiddler $tiddler=<<popupState>>/>
		<$action-navigate $to=<<navigateTo>>/>
	<% endif %>
\end

Notice the above is explicitly calling $action-navigate. Maybe you should remove that line.

@SteeringWheels I have being planning to integrate a search into reimagin tags, perhaps even publish it as a plugin, but I can see that it contains the tiddler $:/PSaT/open-all-tagged which is a stand alone tiddler, I have since packaged it under the name space $:/PSaT/reimagine-tags.

  • Today I will look at the search box here and look at integrating them
  • However here is the latest open all open-all-tagged.json (1.5 KB)
  • Here is the current full reimagin-tags-2.json (20.1 KB) but I expect it to change soon. If you use this first delete the tiddlers that came with the old package. Use the package-filter “in the advanced search filter tab” and delete.

Unfortunately I’m not there yet.
The advice is valid and I thank you @btheado, it helped me understand the situation better, but the problem is that simply removing the line that contains <$action-navigate $to=<<navigateTo>>/> makes all navigation stop working. I want to stop only the navigation of the “open-all-tagged” button.


Thank you!

@TW_Tones I saw your latest edit, nothing important, it’s just a curiosity to better understand your creation, what is the purpose of the filter you added in the code of the $:/PSaT/open-all-tagged tiddler?

<$list filter="[tag<currentTiddler>limit[1]]" variable=~><!-- only allow open it is is a tag -->

Possible solutions to the problem: (at least theoretically, I haven’t been able to get them to work yet)

I combined only the relevant parts into a single tiddler → $ _core_ui_TagTemplate(10).json (3.3 KB)

I added to the “open all tagged” button the possibility of opening all tiddlers that respond to the search parameter making a small change to the filter.
It is also possible to do the same with the “close all below button” by using this filter: <$list filter="[tag<currentTiddler>search:title,caption:<searchString>] -[<storyTiddler>]">
-Remember that the searchString variable must be defined, like it is with the “open all tagged” button.

  • Possible solution 1: I interrupt the range of action of the $linkcatcher widget at the “open all below” button. But something is wrong with the syntax I think, maybe I also need to interrupt the $qualify? In the code below look at the comment ((1)) to better understand the idea.

  • Possible solution 2: Alternatively, I insert a ((2)) elseif condition that would activate only when the “open all below” button is being used. But maybe this is doable with a $messagecatcher and not with a $linkcathcer… Honestly, I share this second idea because maybe it is the right one and someone knows how to apply it easily.


    But I have no idea. I think the best solution is the first one.

I am making other attempts, but in the meantime I leave you these considerations.

\whitespace trim

\procedure tempTiddler() $:/temp/tag-filter
 
\procedure clearTemp()
	<% if [<navigateTo>prefix[$:/state/popup/tag]] %>
		<$action-deletetiddler $tiddler=<<tempTiddler>>/>
<!-- ((2)) HERE in place of "???" something that something that uniquely points to the $action-navigate of the button "Open all below" 
	<% elseif ??? %>
		<$action-deletetiddler $tiddler=<<tempTiddler>>/>
		<$action-deletetiddler $tiddler=<<popupState>>/>
-->
	<% else %> 
		<$action-deletetiddler $tiddler=<<tempTiddler>>/>
		<$action-deletetiddler $tiddler=<<popupState>>/>
		<$action-navigate $to=<<navigateTo>>/>
	<% endif %>
\end


<style>
.tc-drop-down-input input {
	width: 90%;
	margin-bottom: 4px;
}
.tc-drop-down-input {
	padding: 0 14px 0 14px;
}
</style>

<$qualify 
	name=popupState
	title="$:/state/popup/tag/"
>
	<$linkcatcher actions=<<clearTemp>>  >
		<span class="tc-tag-list-item" data-tag-title=<<currentTiddler>>>
		<$set name="transclusion" value=<<currentTiddler>>>
			<$macrocall $name="tag-pill-body"
				tag=<<currentTiddler>>
				icon={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerIconFilter]!is[draft]get[text]] }}}
				colour={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/TiddlerColourFilter]!is[draft]get[text]] }}}
				palette={{$:/palette}}
				element-tag="$button"
				element-attributes="""popup=<<popupState>> dragFilter="[all[current]tagging[]]" tag='span'"""
			/>
			<$reveal state=<<popupState>> type="popup" position="below" animate="yes" class="tc-drop-down tc-popup-keep">
				<$set name="tv-show-missing-links" value="yes">
					<$transclude tiddler="$:/core/ui/ListItemTemplate"/>
				</$set>
				<$list filter="[all[shadows+tiddlers]tag[$:/tags/TagDropdown]!has[draft.of]]" variable="listItem"> 
					<$transclude tiddler=<<listItem>>/> 
				</$list>
<hr>		
<div class="tc-drop-down-input">
	<$edit tiddler=<<tempTiddler>> placeholder="Search" tag=input/>
	<$link tag="span" class="tc-small-gap-left" to=<<popupState>> >{{$:/core/images/close-button}}</$link>
</div>

<!-- ((1)) CLOSE $qualify CLOSE $linkcatcher ? ∼ </$linkcatcher> -->
<$let searchString=`${ [<tempTiddler>get[text]] }$`>
<$list filter="[tag<currentTiddler>limit[1]]" variable=~><!-- only allow open it is is a tag -->
<$button tooltip="Open all tiddlers with this tag" class="tc-btn-invisible">
	<$list filter="[tag<currentTiddler>search:title,caption:<searchString>]">
		<$action-navigate $to=<<currentTiddler>> $scroll="no"/>
	</$list>
{{$:/core/images/unfold-all-button}}&nbsp;Open all below
</$button>
</$list>
</$let>
<!-- ((1)) NEW $qualify and NEW $linkcatcher ? ∼ <$linkcatcher actions=<<clearTemp>>  >-->

<hr>				
				
<$let searchString=`${ [<tempTiddler>get[text]] }$`>
	<$macrocall $name="list-tagged-draggable" tag=<<currentTiddler>> subFilter="search:title,caption:<searchString>"/>
</$let>
			</$reveal>
		</$set>
		</span>
	</$linkcatcher>
</$qualify>

I think the filter [tag<currentTiddler>limit[1]] was to display only if the tag, is tagging one or more titles. You can’t open all if there is none.

However I now have focused on a new release of reimagine tags and develop it separately.

  • There is a way to introduce a tag pill on tiddlers not having that tag. I call them virtual tags.
1 Like

Thank you, it makes sense

:eyes: