Open
Conversation
liskin
reviewed
Nov 4, 2020
Collaborator
liskin
left a comment
There was a problem hiding this comment.
Just had a quick look and added a couple comments/suggestions...
| @@ -171,6 +171,8 @@ def get_complement_tag(tag): | |||
| for token in taskfilter_args: | |||
| if token == '-VISIBLE': | |||
| meta['visible'] = False | |||
Collaborator
There was a problem hiding this comment.
Suggested change
| meta['visible'] = False | |
| if token == '-VISIBLE' or token == '+VISIBLE': | |
| meta['visible'] = token[0] == '+' |
| return set( | ||
| task for task in self.tw.tasks.filter(*args) | ||
| if task in tasks_outside_viewport | ||
| ) |
Collaborator
There was a problem hiding this comment.
return set(
task for task in self.tw.tasks.filter(*args)
if (task in tasks_outside_viewport) == self.meta['visible']
)
| class TestViewportsVisibleMetaTag(MultiSyntaxIntegrationTest): | ||
|
|
||
| viminput = """ | ||
| HEADER2(Home tasks | project:Home +VISIBLE) |
Collaborator
There was a problem hiding this comment.
Drop the project:Home, as otherwise this isn't testing the +VISIBLE meta tag at all, the chore task would be there anyway.
| Matching taskwarrior tasks: 0 | ||
| Displayed tasks: 1 | ||
| Tasks to be added: | ||
| Tasks to be deleted: tag work task |
Collaborator
There was a problem hiding this comment.
Is this intended?
I'd appreciate a comment explaining what this test really tests, as I don't think it's obvious. :-/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a +VISIBLE metatag to display tasks already displayed in the file. This is useful to have different or aggregate sortings of tasks. For instance, you can have 2 projects that track your work under two different viewports. These 2 projects are equally important. On the top of the file, you just use a
<name> | +VISIBLEviewport and you get all the tasks from both projects ordered by priority, so that you know which one you should work on first.