Skip to content

feat: show the code snippet count on the column header - #549

Open
Mario-Mohar wants to merge 1 commit into
anoopcodehack:mainfrom
Mario-Mohar:feature/column-snippet-count
Open

Mario-Mohar wants to merge 1 commit into
anoopcodehack:mainfrom
Mario-Mohar:feature/column-snippet-count

Conversation

@Mario-Mohar

Copy link
Copy Markdown
Contributor

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 in Column.jsx that is not the column, it is the current view. KanbanBoard passes getTasksByStatus(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 real allTasks.

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 build in devboard/client.

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.
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.

Show total snippet count per column in header 💻

1 participant