Skip to content

Conversation

@nkakouros
Copy link
Contributor

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> | +VISIBLE viewport and you get all the tasks from both projects ordered by priority, so that you know which one you should work on first.

Copy link
Collaborator

@liskin liskin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just had a quick look and added a couple comments/suggestions...


for token in taskfilter_args:
if token == '-VISIBLE':
meta['visible'] = False
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

            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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intended?

I'd appreciate a comment explaining what this test really tests, as I don't think it's obvious. :-/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants