TiddlyWiki / TiddlyWiki5

A self-contained JavaScript wiki for the browser, Node.js, AWS Lambda etc.
https://tiddlywiki.com/
Other
8.07k stars 1.19k forks source link

[BUG] Some list-*-draggable should not accept everything dragged #8598

Open Leilei332 opened 2 months ago

Leilei332 commented 2 months ago

Describe the bug

Create a tiddler with the following content:

<$button dragFilter="one [[two three]] four"/>

Open the Control panel and navigate to Appearance, Toolbars, View Toolbar. Drag the button to it, three items appear with checkbox checked. The tiddler one, two three and four is created and tagged $:/tags/ViewToolbar.

Expected behavior

Although it may be convenitent to create customed toolbar buttons, I think some draggable list is used only to adjust the order of the items. IMO the draggable list should only accept tiddlers limited to a second filter (like the View Toolbar page with [tag[$:/tags/ViewToolbar]] so that only tiddlers tagged the tag can be accepted) to prevent dangerous usage (like dragging TableOfContents tag to the View Toolbar page in tiddlywiki.com).

To Reproduce

No response

Screenshots

No response

TiddlyWiki Configuration

5.3.6-prerelease

Additional context

No response

pmario commented 2 months ago

So you are talking about a new parameter eg: accept, which expects a filter that is evaluated with every incoming tiddler. If it returns a "non empty" value the tiddler is accepted.

@Jermolene -- what do you think?