Skip to content

fix: prevent content area overflow across all view types - #692

Merged
hotlong merged 3 commits into
mainfrom
copilot/fix-console-layout-issues
Feb 21, 2026
Merged

fix: prevent content area overflow across all view types#692
hotlong merged 3 commits into
mainfrom
copilot/fix-console-layout-issues

Conversation

CopilotAI commented Feb 21, 2026

Copy link
Copy Markdown
Contributor

Console content area views (Grid, Kanban, Gantt, Calendar, Map, Timeline) overflow their containers on narrow viewports, obscuring the sidebar and breaking layout. Root cause: the flex chain from SidebarInset → AppShell → ObjectView → PluginObjectView lacks min-w-0, so flex children expand to intrinsic content width rather than respecting parent bounds.

Container chain fixes

  • SidebarInset — add min-w-0 overflow-hidden to the flex child wrapping all main content
  • AppShell main — add min-w-0
  • Console ObjectView — add min-w-0 overflow-hidden to outer and inner content divs
  • PluginObjectView — add min-w-0 overflow-hidden to root and content wrapper

View-specific fixes

  • GanttView — replace hardcoded taskListWidth = 300 with getResponsiveTaskListWidth() (120/200/300px at sm/md/lg breakpoints), matching the existing getResponsiveColumnWidth() pattern
  • KanbanImpl — add min-w-0 to both swimlane and flat board containers
  • CalendarView — add min-w-0 overflow-hidden, make header flex-wrap with responsive padding
  • ObjectMap — wrap all three render paths with cn("min-w-0 overflow-hidden", className)
  • ObjectTimeline — add min-w-0
  • ListView — add min-w-0 overflow-hidden

Why min-w-0

Flex items default to min-width: auto, which prevents them from shrinking below content size. Adding min-w-0 allows the flex item to shrink into overflow-hidden / overflow-auto containers, keeping scroll regions scoped to each view rather than blowing out the layout.

/* Before: content pushes sidebar off-screen */
.flex-1 { /* implicit min-width: auto */ }
/* After: content respects parent bounds */
.flex-1.min-w-0.overflow-hidden { }
Original prompt

This section details on the original issue you should resolve

<issue_title>Console内容区布局溢出与视图宽度响应性系统改进</issue_title>
<issue_description>## 背景与问题
当前 Console 内容区的多视图类型(Grid、Kanban、Gantt、Calendar、Map等)在宽屏/窄屏,特别是手机端经常出现横向/纵向溢出、撑破容器、侧边栏被遮挡、标题区混乱等问题。根因是主内容区域缺少 min-w-0overflow-hidden 等响应布局处理,同时各视图内部控件宽度硬编码,未考虑容器宽度或可自适应。

甘特图溢出截图

主要场景与问题列表

  1. Gantt(甘特图):任务列表固定宽度 + 时间轴横向无限延伸,导致内容溢出、侧边栏被遮挡
  2. Kanban(看板):多列横排,每列 min-width,列数多时横向超出父容器
  3. Calendar(日历):周视图宽度大于容器,手机端横向滚动不友好
  4. Map(地图):容器宽高未响应父层,导致地图视图被布局挤压
  5. Timeline:同甘特图,横向延展溢出
  6. List/Grid:大量列时横向超出,手机端无法滚动

影响与表现

  • 侧边栏与内容区重叠或被挤出屏幕
  • 标题、面包屑、工具栏布局混乱
  • 内容区无法滚动,或者需要全局滚动导致体验差
  • 手机端/Pad端溢出更严重,无法正常查看/编辑

解决方案建议

  • 内容区容器 (ObjectView.tsx/PluginObjectView) 增加 min-w-0overflow-hidden,保证flex子元素不会撑破父容器
  • 子视���组件(GanttView、KanbanView、CalendarView、MapView、TimelineView)统一采用响应式宽度,任务区、时间区、列区等都应基于父容器宽度/屏幕尺寸自适应
  • 任务列表宽度固定改为比例/最大值自适应
  • 横向滚动容器增加 overscroll-x-autotouch 支持,优化移动端体验
  • 针对所有视图类型,明确容器布局模式(flex、grid、overflow等),不可使用硬编码宽度
  • ToolBar与面包屑、标题等上方区域分隔,避免重叠
  • 视图切换/响应式布局时自动调整各区域宽度,保证侧边栏与主视图区不互相遮挡
  • 移动端特殊适配,横向滚动区域可自适应,重要操作按钮避免被遮挡

子任务拆分建议

  • 检查所有 ObjectView 内容区涉及的布局层级,梳理 min-w-0、overflow-hidden、overflow-x/y 的使用
  • 各视图插件内部宽度、横向滚动策略统一整理为响应式逻辑
  • 手机端/Pad端测试所有主要视图类型,收集典型溢出、遮挡、滚动不便场景
  • 针对卡片、甘特、日历等组件,增加宽度动态计算/横向滚动体验优化
  • 优化面包屑/工具栏布局分隔,防止跨区域遮挡

如需具体代码方案或视觉设计稿请补充需求。</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel

vercelBot commented Feb 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentActionsUpdated (UTC)
objectuiReadyReadyPreview, CommentFeb 21, 2026 8:22am
objectui-demoReadyReadyPreview, CommentFeb 21, 2026 8:22am
objectui-storybookReadyReadyPreview, CommentFeb 21, 2026 8:22am

Request Review

CopilotAIand others added 2 commits February 21, 2026 08:12
…content overflow
- SidebarInset: add min-w-0 overflow-hidden to prevent flex children from pushing beyond parent width
- AppShell main: add min-w-0 to prevent flex child overflow
- Console ObjectView: add min-w-0 overflow-hidden to outer and inner content divs
- PluginObjectView: add min-w-0 overflow-hidden to root and content wrapper
- GanttView: make taskListWidth responsive (120px mobile, 200px tablet, 300px desktop)
- KanbanImpl: add min-w-0 to swimlane and flat board containers
- CalendarView: add min-w-0 overflow-hidden to root, responsive header padding/wrapping
- ObjectMap: add min-w-0 overflow-hidden using cn() to all container states
- ObjectTimeline: add min-w-0 to root container
- ListView: add min-w-0 overflow-hidden to root container
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…k list width
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
CopilotAI changed the title [WIP] Fix console layout overflow and responsiveness issuesfix: prevent content area overflow across all view typesFeb 21, 2026
CopilotAI requested a review from hotlongFebruary 21, 2026 08:18
@hotlong
hotlong marked this pull request as ready for review February 21, 2026 08:23
CopilotAI review requested due to automatic review settings February 21, 2026 08:23
@hotlong
hotlong merged commit 768f43e into mainFeb 21, 2026
6 checks passed

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Addresses layout overflow in the Console’s main content area by tightening the flex container chain and adding view-level overflow containment so narrow viewports don’t push the sidebar off-screen.

Changes:

  • Add min-w-0 / overflow-hidden in key flex containers (AppShell, Console ObjectView wrapper, plugin-view ObjectView, and multiple view plugins) to prevent intrinsic-width overflow.
  • Improve responsiveness in view plugins (notably Gantt task list width and Calendar header wrapping).
  • Update ROADMAP.md with a dedicated Console layout/responsiveness milestone and checklist.

Reviewed changes

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

Show a summary per file
FileDescription
packages/plugin-view/src/ObjectView.tsxAdds min-w-0 overflow-hidden to the root/content containers to prevent flex overflow in plugin ObjectView.
packages/plugin-timeline/src/ObjectTimeline.tsxAdds min-w-0 to the scroll container to allow shrinking within flex parents.
packages/plugin-map/src/ObjectMap.tsxWraps root/loading/error containers with cn('min-w-0 overflow-hidden', className) for consistent overflow containment.
packages/plugin-list/src/ListView.tsxAdds min-w-0 overflow-hidden to the ListView root container.
packages/plugin-kanban/src/KanbanImpl.tsxAdds min-w-0 (and overflow-hidden for swimlanes) to better contain horizontal overflow.
packages/plugin-gantt/src/GanttView.tsxIntroduces responsive task list width helper and adds min-w-0 to the root container.
packages/plugin-calendar/src/CalendarView.tsxAdds min-w-0 overflow-hidden, wraps header, and adjusts responsive spacing/typography.
packages/layout/src/AppShell.tsxAdds min-w-0 to <main> to prevent the content area from forcing layout overflow.
packages/components/src/ui/sidebar.tsxModifies SidebarInset classes (note: this is a Shadcn-synced path).
apps/console/src/components/ObjectView.tsxAdds min-w-0 overflow-hidden in Console’s ObjectView wrapper chain around PluginObjectView.
ROADMAP.mdAdds a P1.9 section tracking the layout/responsiveness work and follow-ups.

ref={ref}
className={cn(
"relative flex w-full flex-1 flex-col bg-background",
"relative flex min-w-0 w-full flex-1 flex-col bg-background overflow-hidden",

CopilotAIFeb 21, 2026

Copy link

Choose a reason for hiding this comment

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

packages/components/src/ui/* is Shadcn-synced and treated as a no-touch zone in this repo (changes can be overwritten by sync scripts). Please revert this modification and instead apply min-w-0 overflow-hidden via a wrapper in packages/components/src/custom/ or by passing className from the consuming layout(s) (e.g., AppShell, navigation sidebar renderer, CLI generator).

Suggested change
"relative flex min-w-0 w-full flex-1 flex-col bg-background overflow-hidden",
"relative flex w-full flex-1 flex-col bg-background",

Copilot uses AI. Check for mistakes.
os-zhuang pushed a commit that referenced this pull request Aug 23, 2026
…e the pin (#5442)
⛔ Comments only. This commit is a NO-OP to the workflow's execution: the
pinned version, every input, every `if:` and every step body are byte-identical,
and `yaml.safe_load` of the file before and after parses to structurally
identical objects. Verified mechanically, not by eye.
Dependabot proposed changesets/action v1 -> v2 in both repositories and it was
declined in both — objectstack#9208 (closed unmerged 2026-08-19) and
objectui#4945 (closed unmerged 2026-08-23). objectstack recorded the reasoning
in its own repo (objectstack#9916); objectui had no equivalent, and #5442 makes
that urgent: before it the pin rested on one v1 property, after it on two.
The block states why v1 is pinned (safety properties asserted against v1's
source, not a version preference), the two properties an upgrade must
re-verify — the `!hasChangesets && hasPublishScript -> runPublish` dispatch
table, and that `runPublish` never commits and never pushes a branch — and the
five v2 changes readable from its CHANGELOG that would break this file.
The second property is the sharp one: it is what makes the clear step's
runner-local deletion safe, and v2's #692 moves pushes to the GitHub API by
default, which is a different code path than the one that verification covers.
It also records the plausible wrong answer explicitly: the Changesets CLI
generation is NOT what pins us. v2's #699 directs CLI v2 users to @v1, and this
repository is on CLI v3 (`^3.0.0`, lockfile 3.0.1).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0124Qg8rLvpXnQDwCmpKUmaJ
Sign up for freeto 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.

Console内容区布局溢出与视图宽度响应性系统改进

3 participants

@hotlong