Implement progress bar with custom goal#87
Conversation
1.1) Add some checks in the widget to disable it.
d13fad0 to
3a316a9
Compare
|
@Quorafind If my code needs adjustments to better fit your coding style, I can make the changes. |
| if (!taskText) return null; | ||
|
|
||
| // Match only the patterns g::number or goal::number | ||
| const goalMatch = taskText.match(/\b(g|goal)::(\d+)\b/i); |
There was a problem hiding this comment.
Is it better to use \b(g|goal)::\s*(\d+)\b? Sometimes people want to add a space between :: and digital.
There was a problem hiding this comment.
Good tip. I'll adjust it to just one space or no space. What do you think? \b(g|goal)::(\s|\d+)\b
There was a problem hiding this comment.
Using \b(g|goal)::\s*?(\d+)\b would be better in your case. https://regex101.com/r/GViCZt/2
Otherwise, the match would not work: https://regex101.com/r/GViCZt/1
There was a problem hiding this comment.
The first version allows multiple spaces. What do you think about limiting it to a single space instead?
\b(g|goal)::\s{0,1}(\d+)\b
https://regex101.com/r/aYBif2/2
Implement progress bar with custom goal
Feature Description:
Bug 1 Description:
Situation 1 (Bug occurs):
Situation 2 (Works as expected):
Currently, as long as at least one child task includes the goal pattern, progress is calculated correctly.
PR Roadmap: