fix(editor): restore horizontal scrolling in kanban board full-width layout#14665
fix(editor): restore horizontal scrolling in kanban board full-width layout#14665CTDave001 wants to merge 2 commits intotoeverything:canaryfrom
Conversation
…layout The kanban view element expanded to fit its children instead of constraining them, making scrollWidth equal clientWidth and preventing horizontal scroll. Adding CSS containment (contain: inline-size) forces the element width to derive from its parent. Replaced inline padding with spacer divs so that content width exceeds the container, enabling proper overflow and a functional scrollbar. Closes toeverything#14531
Verify that KanbanViewUI sets contain: inline-size on connectedCallback, which is required for horizontal scrolling to work in full-width layout.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThis PR fixes the broken Kanban board by adding CSS containment ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip CodeRabbit can approve the review once all CodeRabbit's comments are resolved.Enable the |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## canary #14665 +/- ##
==========================================
+ Coverage 58.55% 58.68% +0.12%
==========================================
Files 2909 2910 +1
Lines 159987 160102 +115
Branches 23202 23252 +50
==========================================
+ Hits 93687 93953 +266
+ Misses 63548 63396 -152
- Partials 2752 2753 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
the change broke some kanban tests |
Summary
Fixes the horizontal scrolling issue in the kanban board when using full-width page layout. The scrollbar wasn't showing up because the kanban container was expanding to match its content width instead of staying constrained to the viewport.
Closes #14531
Problem
In full-width mode,
virtualPaddingis0, which meant the negative-margin/padding technique used for scroll alignment was essentially a no-op. Without any width constraint, theKanbanViewUIelement would grow to fit all its child groups, soscrollWidth === clientWidthand no scrollbar appeared.Fix
contain: inline-sizeto the kanban view element so its width comes from the parent, not its childrenclientWidthwhile spacer divs only add toscrollWidthFiles changed
blocksuite/affine/data-view/src/view-presets/kanban/pc/kanban-view-ui-logic.ts— the actual fixblocksuite/affine/data-view/src/core/group-by/trait.ts— removed stray commentblocksuite/affine/data-view/src/__tests__/kanban.unit.spec.ts— added test for scroll containmentTesting
KanbanViewUIappliescontain: inline-sizeon connectTo verify manually:
Summary by CodeRabbit
Tests
Style
Chores