Help with modal editing of a tiddler fields

236 views
Skip to first unread message

peuhpeuh singe

unread,
Sep 15, 2017, 5:11:56 AM9/15/17
to tiddl...@googlegroups.com
Hi twexpert !

I use tiddly wiki to deal with a set of scripts that allow me to reproduce some results I need to be able to reproduce (go go science !).
Each of these scripts is contained in a tiddler that is tagged with the name of the article it is related.

Each of these scripts has three main fields:
*summary, that is a description of what it is computed,
*todo, you know what it is,
*results, which is a list of path to files than are the e.g. files, tables ... generated by the script.

Then, these three fields are used to present a complete summary of code/result and current issues of a given article.

But what I need for more convenience is a kind of interface to be able to edit these 3 fields for a given script.

This is what I did:

1) List all tiddlers associated to a given article ($root$) and if the user clicks on the ✎ it opens the generic tiddler "$:/_JM/project/MyEditField" in a modal for the tiddler of interest


\define setList(root)
<$button message="tm-edit-tiddler" tooltip={{!!summary}} aria-label="tag" class=<<tv-config-toolbar-class>>> <$view field="title"/> </$button></td>
<$list filter="[!has[draft.of]tag[$root$]field:status[ok]]">
<$button class=tc-btn-invisible>
<$action-sendmessage $message="tm-modal" $param="$:/_JM/project/MyEditField" TidName={{!!title}} />

</$button>
</
$list>
\end







2) Then this is "$:/_JM/project/MyEditField"

\define listElt()
<$edit-text tiddler="$:/_JM/fooEditField"  field="$(nameOut)$" default="$(nameOut)$" />
\end

!!<<TidName>>

* Summary:

<$edit tiddler=<<TidName>> field="summary"/>

* Todo:

<$edit tiddler=<<TidName>> field="todo"/>




* Outputs:

<$edit tiddler=<<TidName>> field="outputs"/>

<!-- The following is just because the field outputs contains a list of string (separate by a newline) that I want to display more properly-->
<$set name="currentTiddler" value=<<TidName>>>
<$list filter="[list[!!outputs]]">
<$set name="nameOut" value=<<currentTiddler>>>

<$macrocall $name="listElt"/>

</$set>
</
$list>
</$set>

Which essentially works fine. But has the following strange behaviour: when the modal opens all widget edit-tiddler are empty (while the fields are not empty) until I edit one of them (arbitrarly) .  Once the first  character typed in the widget, all widgets are filled with the correct value...

Moreover, it appears that I can only edit a widget that is empty (for the first necessary edit) all others are "locked" until I manage to type a character in a given widget (so if all fields are full I can do nothing).

I am a bit lost with this issue and any help would be appreciate !

Thanks for your expertise.
P.

PMario

unread,
Sep 15, 2017, 10:34:24 AM9/15/17
to TiddlyWiki
Hi,
Only had a look at your description. ... IMO there's a conceptual problem. ... at least for me.
But the concept is interesting. I'll probably think about it a little bit more.
-m


On Friday, September 15, 2017 at 11:11:56 AM UTC+2, peuhpeuh singe wrote:
I use tiddly wiki to deal with a set of scripts that allow me to reproduce some results I need to be able to reproduce (go go science !).
Each of these scripts is contained in a tiddler that is tagged with the name of the article it is related.

OK
 
Each of these scripts has three main fields:
 
*summary, that is a description of what it is computed,

OK
 
*todo, you know what it is,

Is there only one ToDo? ... Fiels are not good at storing several things.
 
*results, which is a list of path to files than are the e.g. files, tables ... generated by the script.

Same as todo. IMO both should be lists themselfs.
 
Then, these three fields are used to present a complete summary of code/result and current issues of a given article.

OK. .. So the "article" should present a dynamic summary.

I'll play a bit with that idea.

have fun!
mario
 

peuhpeuh singe

unread,
Sep 15, 2017, 11:24:23 AM9/15/17
to tiddl...@googlegroups.com
Considering your suggestions : I considered only one todo but why not many... and there are indeed several output (so this is stored in the field as a set of \n-separated values) My main point is not about the "present a dynamic summary" but about displaying a proper form in a modal : as for now the solution I wrote in my post does not work... and I do not understand why. By the way, good to know you are on the pb : I can't wait to see your proposal ! (and also those of others !)

PMario

unread,
Oct 25, 2017, 7:27:35 AM10/25/17
to TiddlyWiki
On Friday, September 15, 2017 at 5:24:23 PM UTC+2, peuhpeuh singe wrote:
Considering your suggestions : I considered only one todo but why not many... and there are indeed several output (so this is stored in the field as a set of \n-separated values) My main point is not about the "present a dynamic summary" but about displaying a proper form in a modal : as for now the solution I wrote in my post does not work... and I do not understand why. By the way, good to know you are on the pb : I can't wait to see your proposal ! (and also those of others !)

Hi puehpeuh,

Sorry for the long, delay! ...

I did several hacks, to implement a workflow, as you described in the OP. But the rusulting code was super ugly (and complicated), so I did throw the stuff away and started over from scratch. ...

First I wanted to have table based overviews, using the html <table> element. But I ended up with a CSS grid based approach, that is new for me and that's why.. interesting :)

I did include a "script-manager.bundle" file to this post, that you can download and drag and drop import to an eg: empty.html TW.
Before you use any of this stuff with your own TW, please BACKUP FIRST!

Since the bundle contains a whole workflow, some explanation is needed.
I did create a short intro video that may help you, if you want to use the stuff.

The bundle basically contains 3 visible tiddlers.

 - Overview Scripts
 - Overview ToDo's
 - ---

and a bunch of system tiddlers, that actually contain the code. ... wich I may describe in detail in other videos.

As the first step, I wanted to explore the UI possibilities with a grid based layout. ... done (see the attachment)

As a second step, I wanted to have a closer look about the code patterns, that I needed to implement the workflow.

I did already see several possibilities to standardize stuff. ... BUT it will need some more time, till I can come up with a generic implementation, which I really want to have. Since requests as yours come up quite often. ....

Feedback is very welcome!

have fun!
mario

script-manager.bundle.0.0.1.json
Reply all
Reply to author
Forward
0 new messages