Mobile: Add Commands/Support for Navigating Suggestion Modals

Use case or problem

I have a vault that has some overlap in file names like planner and devotions files (for example both have YYYYMMDD as the file name format). The devotions are broken up into sections which are delineated by a header. I do not always do all of the devotions for that day in one sitting. I do not use actual wiki links in my vault since I want the links to work whether or not I am using Obsidian. However I do use the wiki link format to initially search for the file to link to since the process is less manual and it automatically converts to markdown since I have Use [Wikilinks] set to false.

When I do part or all of my devotions, I go to my planner folder for the day to link to the devotions I have already completed. However since both files have the same name, when I type in 20240514, for example, the wiki link file suggester is suggesting the current file be used. However I want to select the file in my devotions folder. If I were just linking to the file, this would not be an issue, I could just tap on the file I wanted and be done with it. However when you want to link to a header or paragraph in the file, then things get tricky. I may just be unaware of how to do this, but I have yet to find a command or other option to change the selected file in the suggester on mobile. On desktop, I can use the up and down arrow keys in order to navigate through the list of suggested file links and have it highlight the one I want. This is important when it comes to selecting a header from the file because when I type # on desktop this tries to get the list of headers in the first matching file in the wiki suggester if it exists or the file you have highlighted/navigated to in the suggestion modal. Mobile seems to lack an ability to do the later which means you either need to have unique names or type out a longer path rather than just the file name or alias that you are looking for.

What I would like if possible, is the ability to have a command or some kind of comparable functionality for moving up and down in a suggestion list on mobile.

Proposed solution

I would suggest creating a command for moving up and down in the suggestion modal results. This would allow the user to highlight which file is being referenced instead of always assuming it is the currently typed text and nothing more. Some caveats may be that on mobile it will now need to assume that the file referenced is the one highlighted in the suggestion modal if present (hopefully that would not be too bad, but you never know).

Current workaround (optional)

I have currently written a plugin that kind of does this, but it has had limited success: https://github.com/pjkaufman/obsidian-mobile-suggester-helper

The main problems I have encountered with the approach listed above are as follows:

  • For some reason it did not respect the link format being relative to other files
  • I had to copy the text from the suggestion modal based on several conditions to grab the right text so when I typed # it would pull up the proper file’s headers
  • Only works for the wiki link suggester at this time
    • The up and down commands may work for all suggesters, but the selecting of the currently highlighted value only works for wiki links at this time because I added logic to get it to create relative links since Obsidian was not doing that for me
  • It seems there may be a bug where linking to headers on mobile does now work correctly when it converts from wiki link to markdown link

Related feature requests (optional)

N/A