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

Add a task progress indicator to notes in board view #897

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

H3mul
Copy link
Contributor

@H3mul H3mul commented Jun 4, 2024

Quick implementation of a feature I've been missing from projects - a Trello-style checkbox task progress indicator in Board view

A note with something like this:

- [ ] Task 1
- [x] Task 2
- [ ] Task 3

automatically gains this indicator:

image

Let me know if this is something that will benefit projects, and if you'd like anything more fleshed out (eg, a plugin setting to enable this functionality, etc), I'd be happy to work on this further.

Perhaps this should be a custom field/record value, so it can be used for filtering/sorting/coloring.

@Acylation Acylation added the kind/feature New feature request label Jun 4, 2024
@Acylation
Copy link
Collaborator

Instead of going through note content to get the tasks, if we only want to get the progress, we can read it directly from metadata cache if I remembered correctly. Will commit.

@H3mul
Copy link
Contributor Author

H3mul commented Jun 13, 2024

I experimented with some other task indicators, eg a task weight field that allows a task to contribute more to the board column total (useful for something like sprint planning):

image

If interested I can add to this PR, or a new one if you prefer

@Acylation
Copy link
Collaborator

Yeah directly commit on this is fine! I'm rewriting getTaskProgress using metadataCache, changes other than this won't cause conflicts.

const completedTasks = taskLines.map(l => COMPLETED_ITEM_REGEX.test(l)).filter(Boolean).length;
const totalTasks = app.metadataCache
.getFileCache(file)
?.listItems?.filter((item) => item.task !== undefined);

if (totalTasks) {
Copy link
Contributor Author

@H3mul H3mul Jun 13, 2024

Choose a reason for hiding this comment

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

totalTasks is an empty array in the present cache but no tasks case; empty arrays are true in js. Fixed

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks!

@Acylation
Copy link
Collaborator

Acylation commented Jun 14, 2024

We're now handling "tasks" in multiple levels. The existing "total" was introduced to show the progress of the whole column, working alongwith a checkField. In this way, each card (aka record, note) is considered a task. While this PR will give users chances to view or manage the tasks within a note. Using the Indicator to visualize the progress of each note is pretty fine.

However, when talking about "weight", it becomes a little bit confusing. Projects once used the term priority in board view to store the dnd sorting sequence back to notes. Though priority was deprecated (see #584 and #586), now we still provide a similar order sync field binding, so we need to help users clearly distinguish them, stating that the new weight field has nothing to do with card order.

Then, regarding the idea of "allow a task contribute more to the total", I suggest that we directly adapt terms from scrum / sprint, like story point or pts, rather than tasks / task weight. We can provide a board option to display column progress based on note-level check status (current version), in-note tasks count (need to implement), or the story points (proposal on task weight).

@H3mul
Copy link
Contributor Author

H3mul commented Jun 14, 2024

Hmm, I see the confusion.

I didn't intend for task progress icons to have anything to do with actual task completion or task closing - perhaps "task progress" is a misnomer, "step completion" or simply "checklist items" (this is what Trello uses) might be a better choice. This is semantic since we never actually use the title of this feature anywhere. But the point is, I agree that the task in the board is atomic, but I also allow that it may be composed of several discrete steps to complete - and this icon tracks that progress. I'm also against multiple leves of task handling - the task structure should be as flat as possible.

I'm also not against renaming "task weight" to "task/story point value", in my experience the two are equally established agile terms

I suggest:

  • Adding a tooltip on hover over indicators with the proper feature name (whichever we choose), eg:
    • "Checklist Items" for the original step completion feature of this pr
    • "Weigh" or "Story Points" and a corresponding icon for the task weight feature
  • Leave the current board total consistently tracking the tasks checked/total as is currently
  • Add an additional total for the Weight/Points completion (sum of those in checked tasks / sum of all task contributions). This total ONLY appears if the task weight feature is used (the feature field setting is populated), and also has the same feature icon + tooltip for clarity
    • here is a rough example (from Gitlab Issue Boards): they use the weight icon for sum of task weights in the board column and a cup (or card?) icon for the task count
    • Perhaps our weight total can also only be the total sum of task points like this example and not a ratio - that also makes sense to me. Tasks are atomic regardless of their weight, but a "sprint total" is useful to know.

@Acylation Acylation added the area/view/board Issues related to the Board view label Jun 20, 2024
@H3mul
Copy link
Contributor Author

H3mul commented Jul 6, 2024

Sorry for the radio silence)

Implemented the proposal, still struggling to find an icon for "points" :)
But IMO the terminology of "point" together with a weight icon sort of brings the agile concept across as is

image

H3mul added 2 commits July 7, 2024 16:27
also show all point values instead of only >1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/view/board Issues related to the Board view kind/feature New feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants