Navigating to a missing tiddler with the Command Palette?

Hello all,

I’ve been using the Command Palette plugin for several months now, and am generally very happy with it. However, I also make frequent use of “ghost” tiddlers - that is, missing tiddlers that use view templates to display content based on their name scheme or their relationships to other existing tiddlers. I’m thus hoping to modify the Command Palette to let me navigate to missing tiddlers as well (including missing tiddlers that may not be referenced by any hardlinks).

I’m envisioning either…

  • an additional “exact” category displayed at the top of the results, where the title is just the unformatted text I’ve typed in the search box, or
  • no additional “results” displayed; instead, hitting Enter while in the Command Palette simply takes me to the tiddler with the current input text as its title, whether or not this tiddler actually exists. This would be in contrast to the current behavior, where hitting Enter takes you to the top search result unless another result has been manually selected.

I did a little fruitless experimentation with $:/plugins/souk21/commandpalette/CommandPaletteSearchSteps, which looked like it might govern the search results displayed, but I don’t know Javascript and don’t entirely understand the plugin’s internal function. Would I have to edit $:/core/modules/widgets/commandpalettewidget.js to add this functuality?

Thanks in advance for any pointers!

(P.S. It was unclear to me whether this post would be more appropriately filed under the Plugins category, or whether that’s intended solely for developers. If I’ve misjudged, feel free to move it!)

  • Including softlinks

Unfortunately softlinks can take on many forms and most if not all only after rendering.

  • Sadly triddlywiki.com has no useful search results for “missing tiddlers”

Yes if the Command Palette has an entry there as this related directly to that plugin, otherwise in Discussion is most appropriate.

Back to the actual problem,

  • I am not that familiar with the Command Palette but I think you need to address the fundamental issues with softlinks first.
  • My own strategy is to turn a missing softlink tiddler into a hardlink or actual tiddlers when ever I see them, then they are available by normal means.
  • I do think there are ways to address searching for softlinks but they are complex and most likely very inefficient.

Sorry, I think I may have introduced an unintended complication! I don’t actually care about link handling for this purpose; I mentioned hardlinks only as an afterthought, intending to emphasize the distinction between “missing” tiddlers that belong to the “linked-but-not-yet-created” set and those that simply… don’t exist.

To put it another way, I’d like to be able to navigate to tiddlers that would fall under the is[missing] header, not just those found by all[missing]. A solution that meets my needs wouldn’t need to distinguish hardlinked or softlinked tiddlers at all, it would simply provide a link (in the Command Palette results) that I could click to reach a non-existent title.

  • My point is your code will need to if you want softlinks included.

To use is[missing] you must first provide the title to test if it is[missing], this is similar to has[title] it always needs to be [[something]has[title]]

  • If you have access to the “soft titles” you can do this test, if not you can’t search/find where they are displayed, because they are only exist/displayed at render time.

I hope thisd helps

Perhaps I’m misunderstanding your proposed approach? My understanding is as follows:

  • I open the Command Palette and type directly into the search field. My input is presumably saved (temporarily) in a $:/state or $:/temp tiddler, which will be deleted when the Command Palette popup closes.
  • I want to be able to navigate directly to the title stored in that $:/state tiddler, whether or not it exists.
  • This should be pretty simple: it’s already possible to navigate to a spontaneously generated title if, for instance you type [[Missing]] into the Filter tab of $:/AdvancedSearch. It doesn’t matter whether there are any preexisting references to the “Missing” tiddler on tiddlywiki.com.
  • I just don’t know where and how to modify the plugin to add this functionality, and I’d hoped that someone who was more familiar with it might be able to help.

Please remember;

  • See my edit [the title in the state tiddler]

If you can find the state tiddler or the macro that generates its name you could then provide a link to it, missing or otherwise.

<$link to={{{ [<statetiddlermacro prefix>get[text]] }}}/>
<$link to={{state tiddler macro}}/>

To find the state tiddler it will be in the command pallet code or install this edit-recent-sidebars.json (2.8 KB) and you can see any temp, state or system tiddlers that change as you use command pallet.

Hi Tony,

I’m familiar with the $link widget and its usefulness in building dynamic links. Unfortunately I’m not familiar with Javascript, which is what I imagine I’d need to edit, as the plugin doesn’t use wikitext templates to render results.

From my scanning of the Javascript tiddler, it uses the tm-navigate to handle navigation to a selection, so my problem isn’t with linking, it’s just with adding an additional option to the dropdown list. I’d initially hoped I might be able to do this by adding an extra filter step to $:/plugins/souk21/commandpalette/CommandPaletteSearchSteps, but since I also noticed this.tiddlerOrShadowExists in the Javascript, I suspect it won’t return a nonexistent title.

Still, thank you for your effort. I think we can probably let this one lie until someone comfortable with Javascript and/or this particular plugin comes along.

I managed to achieve what I was looking for by adopting @cdaven’s as-yet-uncommitted PR #20, which made it trivial to add another filter using the <query> variable. Many thanks to both @cdaven for the code and @Maurycy for the idea that inspired it!

Here’s what the modified behavior looks like:
Screenshot 2023-01-27 114331

And here are the edited tiddlers, in case they can be useful to anyone else. I may repackage the plugin for my own use at some future point.
command-palette-missing-tiddlers-tweak.json (49.0 KB)

2 Likes