Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix check for empty excerpts in popups #1086

Merged
merged 3 commits into from
Apr 26, 2024

Conversation

diegogangl
Copy link
Contributor

If the content had some whitespace the if-guard would fail, creating a tooltip with just "...".
It would also fail because it would include tags and subtasks. So now we first process the content properly and then check.

Also fixes the regex to remove tags in a comma list properly from the excerpt

fixes #1010

If the content had some whitespace the if-guard would fail, creating a
tooltip with just "...".

It would also fail because it would include tags and subtasks.
So now we first process the content properly and then check.

fixes getting-things-gnome#1010
Copy link
Contributor

@SqAtx SqAtx left a comment

Choose a reason for hiding this comment

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

The change itself looks good to me.

If the content had some whitespace the if-guard would fail, creating a tooltip with just "...".
It would also fail because it would include tags and subtasks. So now we first process the content properly and then check.

Also fixes the regex to remove tags in a comma list properly from the excerpt

Could we add tests for these cases? Ideally break the existing test_excerpt() into one test for each case (empty task, task with only whitespace, test that tags are ignored, etc)

This type of functionality is just perfect for unit tests: it's just text in / text out.

@diegogangl
Copy link
Contributor Author

Good idea, thanks!
Added the tests

@diegogangl diegogangl requested a review from SqAtx April 25, 2024 23:04
Copy link
Contributor

@SqAtx SqAtx left a comment

Choose a reason for hiding this comment

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

Nice!

@diegogangl diegogangl merged commit 8c0045a into getting-things-gnome:master Apr 26, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When a task in the Task Browser has no description to show, it shows "…" in the tooltip
2 participants