roma0104/gsd5

Action not shown in context

Opened this issue · 1 comments

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

Please see attached example: tiddlywiki.zip

Analysis:

  • when changing the project of "Action2" to "--" the item will show up
  • changing the state of the action to "waiting" or "future" will show the item in the context correctly
  • adding Action1 to the same context as Action2 will show both actions in the context correctly
  • removing Action2 from the context will still show Action1 in the context correctly

-> 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.

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.