Skip to content

feat(kanban): add per-view pinnedColumns option (#1784)#1833

Open
loukandr wants to merge 2 commits intocallumalpass:mainfrom
loukandr:feat/kanban-pinned-columns
Open

feat(kanban): add per-view pinnedColumns option (#1784)#1833
loukandr wants to merge 2 commits intocallumalpass:mainfrom
loukandr:feat/kanban-pinned-columns

Conversation

@loukandr
Copy link
Copy Markdown

Description

Adds an optional pinnedColumns view config to tasknotesKanban. Listed column values always render, even when empty, and stay valid drop targets regardless of hideEmptyColumns. When unset, behavior is unchanged.

Use case

A vault with a shared global status set (Backlog, To Do, In Progress, In Review, Done) where individual boards want different always-visible subsets. Without pinnedColumns, the choice was either show every status everywhere via hideEmptyColumns: false, or hide every empty column and lose the drag target. pinnedColumns adds the middle option.

Behavior

  • Pinned values are inserted as empty groups regardless of the groupBy property.
  • Pinned columns are exempt from the hideEmptyColumns skip in renderFlat.
  • When no saved drag order exists, pinned columns appear first in the configured array order. Non-pinned columns sort alphabetically after.
  • When a saved drag order exists, it continues to take precedence (existing behavior preserved).
  • Property-agnostic: works with status, priority, tags, or any custom groupBy.

Screenshots

The three boards below render the same dataset (three tasks: one in to-do, two in in-progress). All three views have hideEmptyColumns: true.

Without pinnedColumns

Without pinnedColumns

hideEmptyColumns: true
# pinnedColumns: not set

Only columns with tasks render. Backlog, In Review, and Done are hidden.

With pinnedColumns: to-do, in-progress, done

With pinned subset

hideEmptyColumns: true
pinnedColumns: to-do, in-progress, done

The pinned subset renders in array order. Done stays visible despite being empty. Backlog and In Review remain hidden.

With pinnedColumns: backlog, to-do, in-progress, in-review, done

With all pinned

hideEmptyColumns: true
pinnedColumns: backlog, to-do, in-progress, in-review, done

The full status set always renders. Empty pinned columns stay visible as drop targets.

Screenshots taken in a vault with custom CSS theming. Default Obsidian appearance differs cosmetically. The behavior is unchanged.

Implementation

  • src/bases/registration.ts: registers a new text Bases option for pinnedColumns, mirroring the columnOrder precedent.
  • src/bases/KanbanView.ts:
    • readViewOptions parses the value as a comma-separated string or YAML array, trims, drops empty entries, and dedupes preserving first-seen order.
    • augmentWithPinnedColumns inserts empty groups for missing pinned keys, called from groupTasks after the existing status and priority augmenters.
    • applyColumnOrder no-saved-order branch puts pinned keys first in array order. Remaining keys keep alphabetical fallback. Saved drag order branch untouched.
    • renderFlat filter exempts pinned keys from the empty-column skip.
  • docs/views/kanban-view.md: option documented under "Kanban-Specific Options" and added to the example config.
  • tests/unit/issues/issue-1784-kanban-pinned-columns.test.ts: 23 pure-logic tests covering parser, augmenter, ordering with and without saved order, visibility filter, and integration for status, priority, and tags grouping.

Out of scope

  • Swimlane mode does not currently honor hideEmptyColumns, so the pinned-exempt rule is a no-op there. Pinned values still render in swimlane mode through the augmenter, without the filter interaction.
  • customStatuses / customPriorities settings order is not used as a fallback when no saved drag order exists. Existing behavior, not changed here.

Closes #1784. Addresses #1446.

Copilot AI review requested due to automatic review settings April 26, 2026 13:06
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a per-view pinnedColumns configuration to the TaskNotes Kanban Bases view so specified columns always render (even when empty) and remain valid drop targets while still allowing hideEmptyColumns: true for non-pinned columns.

Changes:

  • Register new Kanban view option pinnedColumns in Bases view option registration.
  • Implement parsing, group augmentation, ordering behavior, and hide-empty exemption for pinned columns in KanbanView.
  • Document the option and add regression/unit coverage for Issue #1784.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/bases/registration.ts Registers pinnedColumns as a Kanban view option in the Bases options UI.
src/bases/KanbanView.ts Adds pinned column parsing + group augmentation + ordering/visibility behavior updates.
docs/views/kanban-view.md Documents pinnedColumns and updates the example configuration.
tests/unit/issues/issue-1784-kanban-pinned-columns.test.ts Adds regression tests for parsing/augmentation/ordering/visibility logic.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/bases/KanbanView.ts Outdated
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.

[FR]: Per-view pinned columns in Kanban

2 participants