feat: show the code snippet count on the column header - #549
Open
Mario-Mohar wants to merge 1 commit into
Open
Mario-Mohar wants to merge 1 commit into
Mario-Mohar wants to merge 1 commit into
Conversation
Closes anoopcodehack#514. The header carried the task count but nothing about the snippets saved underneath it, so there was no way to see at a glance which column holds the code. Counted over the unfiltered task set rather than over the list the column receives. `KanbanBoard` passes `getTasksByStatus(col)`, which has already applied the search term and the priority filter, so counting there would have made the number drop while typing in the search box. A count that changes with the view is not a property of the column. The badge carries a `</>` marker and a title, because the header already shows a bare number for the task count and two bare numbers side by side are easy to confuse.
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.
Closes #514.
The column header carried the task count but nothing about the snippets saved underneath it, so there was no way to see at a glance which column holds the code.
One thing about the snippet in the issue: it counts over
tasks, and inColumn.jsxthat is not the column, it is the current view.KanbanBoardpassesgetTasksByStatus(col)in, and that has already applied the search term and the priority filter. Counting there makes the number drop while you type in the search box, and a count that changes with the view is not a property of the column.So this counts over the unfiltered set from the context instead. Worth knowing for anyone touching the file later: the local
const { tasks: allTasks } = useBoard()at the top is itself the filtered list despite the name, while the context also offers a realallTasks.The badge carries a
</>marker and a title text, because the header already shows a bare number for the task count and two bare numbers next to each other are easy to mix up. It stays hidden when the column has no snippets.Checked with
npm run buildindevboard/client.