TiddlyWiki / TiddlyWiki5

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

Proposal: High level UI for add/remove sidebar tabs #4323

Open twMat opened 4 years ago

twMat commented 4 years ago

Proposing a high level UI for the sidebar tabs in the ctrlpanel. It is currently iffy to modify this main UI thingy. Here's a sketch... but the tab should probably be named "Sidebar tabs". (Possibly it should all be in a more general "Sidebar" setting.) Anyway, for the sketch:

Reorder via DnD.

The most interesting thing is probably the "add tiddler title" which is similar to the tag picker and which adds a sidebar tag to any tiddler. After created, it can be DnD into the More to instead add the tag for that. I've shortened the More listing (...) for the illustration.

sidebarui

twMat commented 4 years ago

add: As indicated by the unticked Contents tab, I feel this could make us afford more (inactive) default sidebar tabs. #4319 is another idea for a potential tab.

AnthonyMuscio commented 4 years ago

Mat,

Could I suggest extending this a little further if change is to be made anyway?

Various elements including the content in existing sidebar tabs can currently appear in more than one place already with the following tags;

$:/tags/SideBarSegment $:/tags/SideBar $:/tags/MoreSideBar

I would like to see a more general tag say $:/tags/displayTiddler that is applied to any tiddler, and typically retains that tag indefinitely. However if so tagged it will be listed (using its Caption} in a control panel tab where it can be placed in one or more of the possible locations by toggling the various tags.

I also use $:/plugins/wikilabs/link-to-tabs set to Show internal tab link for selected tabs so I can open any of these as a full tiddler. Perhaps when in full tiddler mode the options allowing where it displayed could be selected.

If this interests you I can build this solution for evaluation. However if it is good enough it would be nice to add it to the standard distribution so others plugins and solutions can participate.

AnthonyMuscio commented 4 years ago

Here is an initial example of some code to support an extended selector.

\define display-tags-filter() [is[tiddler]tag[$:/tags/displayTiddler]] [is[tiddler]tag[$:/tags/SideBar]] [is[tiddler]tag[$:/tags/SideBarSegment]] [is[tiddler]tag[$:/tags/MoreSideBar]] [is[tiddler]tag[$:/tags/TiddlerInfo]] [is[tiddler]tag[$:/tags/ControlPanel]] [tag[$:/tags/ControlPanel/Info]] +[sort[]]
;Chose where any tiddler tagged with $:/tags/displayTiddler will apear
:What if we assume all tags are position locations?

<table>
<tr><th>Display Tiddler</th><th>Caption</th><th>SideBar</th><th>[[SideBar Tabs|$:/core/ui/SideBarSegments/tabs]]</th><th>[[Sidebar > More|$:/core/ui/SideBar/More]]</th><th>[[Info Panel|$:/core/ui/TiddlerInfo]]</th><th>[[Control Panel|$:/ControlPanel]]</th><th>[[Control Panel Info|$:/core/ui/ControlPanel/Info]]</th></tr>
<$list filter="[subfilter<display-tags-filter>]">
  <tr>
    <td><<currentTiddler>></td><td>{{!!caption}}</td>
    <td><$checkbox tag="$:/tags/SideBarSegment"></$checkbox></td>
    <td><$checkbox tag="$:/tags/SideBar"></$checkbox></td>
    <td><$checkbox tag="$:/tags/MoreSideBar"></$checkbox></td>
    <td><$checkbox tag="$:/tags/TiddlerInfo"></$checkbox></td>
    <td><$checkbox tag="$:/tags/ControlPanel"></$checkbox></td>
    <td><$checkbox tag="$:/tags/ControlPanel/Info"></$checkbox></td>
    </tr>
</$list>
</table>
pmario commented 4 years ago
  • I would like to avoid making shadow tiddlers overwritten

hmmm, I think a mechanism like this should work for every tiddler.

The proposed mechanism doesn't work for shadows, because changing a tag will overwrite them, creating a "normal" tiddler.


We do have a built-in "visibility" mechanism, that works with every tiddler. see: page controls

It uses an independent $:/config/xxx tiddler, that is responsible to define visibility. So there is no need to create a new system tag: $:/tags/displayTiddler

pmario commented 4 years ago

I'm thinking about a config dialog similar to this one, which would also let you create new elements.

controlpanel-appearence-toolbar

twMat commented 4 years ago

Thanks for input guys. I posted a more generic concept for discussion.

Jermolene commented 4 years ago

Hi @twMat I would like to see something along the lines you suggest; as @pmario notes there is already a precedent for how we'd implement it.

Note also for interest that it is already possible to drag tiddlers into the toolbar editors in the control panel. The result won't be useful unless the added tiddler has the right fields.

AnthonyMuscio commented 4 years ago

Perhaps when a tiddler is dragged to such a list and does not have required fields we can click a button that opens that tiddler with the fields added, and containing default values that suggest what values are required.

twMat commented 4 years ago

bump! ref