roma0104 / gsd5

A Getting-Things-Done tools for the TiddlyWiki5 environment.
MIT License
59 stars 22 forks source link

Action not shown in context #85

Open gordin123 opened 7 years ago

gordin123 commented 7 years ago

When several actions exist, sometimes action items will not be shown in the context.

Please see attached example: tiddlywiki.zip

Analysis:

-> items will not show up in the context if another action (that is older by creation date or alphabetically ordered before that action?) is not also connected to the context.

The issue also arises when both actions are put into "waiting" or "future" state.

gordin123 commented 7 years ago

I was able to track the issue down to the filter expression created in $:/plugins/gsd5/core/macro/list-composer.js for $:/plugins/gsd5/core/macro/gsd5-list:41

<$list filter=<<list-composer gsd_type:$gsd_type$ gsd_status:$gsd_status$ gsd_complete:$gsd_complete$ realmAware:"true" sort:$sort$ order:$order$ groupBy:$groupBy$ groupTail:"false" groupTailHeader:"false" groupHeader:"true" customFilter:$customFilter$ ownerField:$ownerField$>>>

The filter created will be

[field:gsd_type[action]field:gsd_complete[false]field:gsd_status[next]nsort[title]has[gsd_project]each[gsd_project]tag<caller>_fieldvalue[gsd_project]]

The "each" expression will select one action item for each gsd_project. As the "tag" expression comes after the "each" expression the filter will only work as expected if the item selected by "each" also contains the context tag.

A possible solution would be to move the "group" property in filter.strings behind the "owner" property to move the "tag" expression before the "each" expression in the filter string.

$:/plugins/gsd5/core/macro/list-composer.js:178ff

    // String are used to created the final filter statement.
    filter.strings = {
        type: "",
        complete: "",
        status: "",
        realm: "",
        sort: "",
        customFilter: "",
        owner: "",
        group: "",
        fieldValue: ""
    };

I tested this and it indeed solves this particular problem but i fear that this may break other filter strings.