[Report] Navigation triggered from within a modal always opens tiddlers at the top of the story river
Problem Description
I have a modal that is a form that lets me create a new tiddlers.
I have it set up so it opens the tiddler afterwards, but it always opens at the top of the story river, not respecting $:/config/Navigation/openLinkFromOutsideRiver being set to bottom:
To Reproduce
Steps to reproduce the behaviour:
- At https://tiddlywiki.com
- Set
$:/config/Navigation/openLinkFromOutsideRivertobottom - Open tiddler
SampleModaland add this text:<$button><$action-navigate $to="Learning"/>Open "Learning"</$button> - Open tiddler
WidgetMessage: tm-modal - Scroll down and click the Click me! button
- Click the button on the modal labelled Open "Learning"
Expected behaviour
As a user,
I would expect the "Learning" tiddler to open at the bottom, due to my preference to open links at the bottom of the story river.
Actual behaviour
The "Learning" tiddler always opens at the top, regardless of my preference.
TiddlyWiki Configuration
- Version: 5.4.1
- Saving mechanism: Node.js
- Plugins installed: Not relevant
Desktop
- OS: Fedora Linux 44 KDE Edition
- Browser: Ungoogled Chromium 151.0.7922.173
Additional context
I have an alternative where I open a modal from a panel (so from within the story river in a sense) and again, it always opens on top, not respecting $:/config/Navigation/openLinkFromInsideRiver. I would say this is out of scope as that would require a whole mechanism, to know where the modal has been opened from. This is something more appropriately hacked together by me.
After some frustrating experiments, I checked with an LLM and it confirmed it is currently hardcoded as follows:
LLM analysis of current state (provided by GLM 5.3 Max)core/modules/utils/dom/modal.js renders every modal inside its own $navigator widget, and that navigator receives only the story and history attributes (Modal.prototype.display → navigatorTree). The two navigation settings are never passed.
When a widget inside the modal dispatches tm-navigate (for example a button containing <$action-navigate $to="..."/>), the event reaches this modal navigator first, and NavigatorWidget.handleNavigateEvent returns false, so the page-level <$navigator> in core/ui/PageTemplate.tid — the one wired to {{$:/config/Navigation/openLinkFromInsideRiver}} and {{$:/config/Navigation/openLinkFromOutsideRiver}} — never sees it.
NavigatorWidget.addToStory then reads its own attributes for the insertion position (getAttribute("openLinkFromInsideRiver","top") / getAttribute("openLinkFromOutsideRiver","top")), both unset on the modal navigator, so the hardcoded default "top" applies. The modal context also has no storyTiddler variable, so navigateFromTitle is empty and the "outside the river" branch is taken — $:/config/Navigation/openLinkFromOutsideRiver should govern here, but is never consulted.
Source: TiddlyWiki/TiddlyWiki5