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

Consider cancelled tasks as checked #191

Merged

Conversation

julianmateu
Copy link
Contributor

@julianmateu julianmateu commented Jul 10, 2024

Fixes #84 (partially, only adds cancelled tasks and it is not customizable).

I tried making it customizable via settings, but I think I'm not following the convention on the different classes, so I think it's better to just ship this PR first and address customisation separately.

@Moyf
Copy link

Moyf commented Jul 28, 2024

Also hope for this feature!

@julianmateu julianmateu marked this pull request as ready for review October 23, 2024 12:32
@@ -10,6 +10,7 @@ export class Todo {
// suffix: '] '
// body: hello
private static readonly regexp = /^(?<prefix>((> ?)*)?\s*[\-\*][ ]+\[)(?<check>.)(?<suffix>\]\s+)(?<body>.*)$/;
private static readonly checkedStatuses = ['x', '-'];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To make it customisable as it is, this would have to either

  1. be passed from the controller somehow, this will cause the setting to be passed around through every function call.
  2. it should access the global settings from the model. This won't work, as the model does not depend on Obsidian, and when importing { SETTINGS } from 'settings' tests will fail

None of these is an acceptable solution, so I decided to leave this as a hardcoded list.

Copy link

Choose a reason for hiding this comment

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

I think that's good enough! Thank you!

@julianmateu
Copy link
Contributor Author

@uphy any thoughts?

@uphy
Copy link
Owner

uphy commented Dec 24, 2024

I'm sorry for the delay in reviewing.

I think this is a very good implementation that is both necessary and sufficient.
Please let me test this more later.

related: #208

@8bitbuddhist Though this implementation will not ignore the IN_PROGRESS status (- [/] in-progress task), but canceled task will be ignored.

Copy link
Owner

@uphy uphy left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks!!

@uphy uphy merged commit 394d3a3 into uphy:master Dec 24, 2024
@uphy uphy mentioned this pull request Dec 24, 2024
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.

[Feature]: Recognise extended checkbox values. Ideally customisable
3 participants