Skip to content

fix(kanban): respect configured columnWidth across flat and swimlane views - #2755

Merged
callumalpass merged 1 commit into
mainfrom
fix/2754-kanban-column-width
Nov 30, 2026
Merged

callumalpass merged 1 commit into
mainfrom
fix/2754-kanban-column-width

Conversation

@callumalpass

Copy link
Copy Markdown
Owner

Fixes #2754

Root cause

  1. KanbanView.getRenderedColumnWidth() read back the existing --kanban-column-width inline CSS variable from boardEl before falling back to this.columnWidth, and renderFlat() / renderSwimLaneTable() wrote that stale value back to --kanban-column-width. Once set, subsequent columnWidth updates never replaced it during rendering.
  2. KanbanView.updateBoardLayout() computed desktop widths as Math.max(320, Math.min(this.columnWidth, available / Math.max(1, openCount))). That forced a 320px floor (ignoring slider values below 320) while capping widths to fit all open columns inside the viewport, pinning most multi-column desktop boards to 320px across the entire 200–500px slider range. When board.clientWidth === 0 (detached/hidden), the < 480 branch also collapsed the width to 0px.
  3. buildRenderSignature() did not include this.columnWidth directly.

Fix

  • Drive --kanban-column-width directly from this.columnWidth on desktop (and unmeasured boards), while keeping narrow-pane clamping (0 < clientWidth < 480) so a single column still fits inside mobile/narrow panes.
  • Reference var(--kanban-column-width, ...) on open flat columns and swimlane grid tracks (and var(--kanban-swimlane-label-width, ...) on swimlane label tracks) so responsive/user CSS variable overrides continue to work while collapsed columns keep --tn-kanban-collapsed-column-width.
  • Include columnWidth in buildRenderSignature() and validate parsed columnWidth values in readViewOptions().
  • Add unit and Obsidian E2E regression tests covering flat and swimlane layouts, live updates, reload persistence, narrow panes, and CSS variable overrides.

Verification

  • npm test (863 suites / 6,740 tests passed)
  • npm run typecheck, npm run lint, npm run build:test
  • Isolated Obsidian Playwright E2E (e2e/issues/issue-2754-kanban-column-width.spec.ts, e2e/issues/issue-2531-kanban-horizontal-scroll.spec.ts, e2e/issues/issue-2382-kanban-nested-settings.spec.ts — 11 passed)

@callumalpass
callumalpass merged commit c4d29f9 into main Nov 30, 2026
3 checks passed
@callumalpass
callumalpass deleted the fix/2754-kanban-column-width branch November 30, 2026 19:03
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.

[Bug]: kanban view column width not responding

1 participant