Open
Conversation
Author
|
I'm not super happy with the fact that we calculate and set the progress into frontmatter, but couldn't find a better way to make it compatible with standard base views. However for TaskNotes views it works with a calculated property very well. Standard Bases views (table etc) gave me lot of headache while trying to get it running as a calculated property, but that's currently simply not possible the way obsidian bases work. If anyone has an idea, feel free to fork this branch and try it and get the same headache 😄 |
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.
Progress Bar Feature: Task Completion Tracking
Adds a progress bar that displays task completion status based on first-level checkboxes in the task body. With focus on performance, customization, and full Bases integration. This is inspired by Trello.
(Screenshot from a task card from the TaskNotes KanBan Base View)
Features
task.progressin all Bases views (including standard Table view) and selectable in property pickerupdateTask()Technical Details
Architecture
ProgressServicefor centralized progress calculation with cachingtask_progress(percentage number 0-100) for Bases compatibilityProperty Name Mapping
The progress property uses a three-tier naming system:
Frontmatter Field: Configurable field name (default:
task_progress, stored in YAML frontmatter as a number 0-100)task_progress, but users can change it toprogressor any other name)Bases Property:
task.progress(used in Bases views)task.progressregardless of the frontmatter field nameBasesDataAdapterBasesViewBase.registerComputedProperties()Internal Property:
progress(used in TaskInfo and TaskCard)ProgressInfoobject withcompleted,total, andpercentagePropertyMappingServicefor display in TaskCardWhy Three Names?
task.progress(consistent Bases API, regardless of frontmatter name)progress(standardized name for consistent code usage)Note: The default frontmatter field name is
task_progress, but users can configure it to beprogressor any other name via FieldMapper settings. The Bases property nametask.progressand internal nameprogressremain constant.Implementation Flow
ProgressService.calculateProgress()analyzes task body for checkboxesFieldMapper.mapToFrontmatter()BasesDataAdaptermapstask_progress→task.progressTaskCardrenders progress bar usingtask.progresspropertyBreaking Changes
None. The feature is enabled by default but can be disabled in settings.
Migration Notes
task_progressin frontmatter, it will be recalculated on next file changeKnown Issues and Future Improvements
Disclaimer
I'm not an experienced Obsidian Plugin Dev, but tried to align with all guidelines and be consistent with existent code. Feedback is very welcome! :)