Skip to content

Commit 19634b0

Browse files
Copilothotlong
andcommitted
fix: add min-w-0 and overflow-hidden to layout containers to prevent 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>
1 parent 5fc10e6 commit 19634b0

10 files changed

Lines changed: 20 additions & 19 deletions

File tree

apps/console/src/components/ObjectView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ export function ObjectView({ dataSource, objects, onEdit, onRowClick }: any) {
388388
}), [objectDef.name, onEdit, activeView?.showSearch, activeView?.showFilters]);
389389

390390
return (
391-
<div className="h-full flex flex-col bg-background">
391+
<div className="h-full flex flex-col bg-background min-w-0 overflow-hidden">
392392
{/* 1. Header with breadcrumb + description */}
393393
<div className="flex justify-between items-center py-2.5 sm:py-3 px-3 sm:px-4 border-b shrink-0 bg-background z-10">
394394
<div className="flex items-center gap-2 sm:gap-3 min-w-0 flex-1">
@@ -517,7 +517,7 @@ export function ObjectView({ dataSource, objects, onEdit, onRowClick }: any) {
517517

518518
{/* 2. Content — Plugin ObjectView with ViewSwitcher + Filter + Sort */}
519519
<div className="flex-1 overflow-hidden relative flex flex-row">
520-
<div className="flex-1 relative h-full flex flex-col">
520+
<div className="flex-1 min-w-0 relative h-full flex flex-col">
521521
<div className="flex-1 relative overflow-auto p-3 sm:p-4">
522522
<PluginObjectView
523523
key={refreshKey}

packages/components/src/ui/sidebar.tsx

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/layout/src/AppShell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export function AppShell({
140140
<div className="w-px h-4 bg-border mx-1 sm:mx-2" />
141141
{navbar}
142142
</header>
143-
<main className={cn("flex-1 overflow-auto p-3 sm:p-4 md:p-6", className)}>
143+
<main className={cn("flex-1 min-w-0 overflow-auto p-3 sm:p-4 md:p-6", className)}>
144144
{children}
145145
</main>
146146
</SidebarInset>

packages/plugin-calendar/src/CalendarView.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,9 @@ function CalendarView({
237237
}
238238

239239
return (
240-
<div role="region" aria-label="Calendar" className={cn("flex flex-col h-full bg-background", className)}>
240+
<div role="region" aria-label="Calendar" className={cn("flex flex-col h-full bg-background min-w-0 overflow-hidden", className)}>
241241
{/* Header */}
242-
<div className="flex items-center justify-between p-4 border-b">
242+
<div className="flex flex-wrap items-center justify-between gap-2 p-2 sm:p-4 border-b min-w-0">
243243
<div className="flex items-center gap-4">
244244
<div className="flex items-center bg-muted/50 rounded-lg p-1 gap-1">
245245
<Button variant="ghost" size="sm" onClick={handleToday} className="h-8" aria-label="Go to today">
@@ -272,7 +272,7 @@ function CalendarView({
272272
variant="ghost"
273273
aria-label={`Current date: ${getDateLabel()}`}
274274
className={cn(
275-
"text-xl font-semibold h-auto px-3 py-1 hover:bg-muted/50 transition-colors",
275+
"text-base sm:text-xl font-semibold h-auto px-2 sm:px-3 py-1 hover:bg-muted/50 transition-colors",
276276
"flex items-center gap-2"
277277
)}
278278
>

packages/plugin-gantt/src/GanttView.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ export function GanttView({
138138
return cols;
139139
}, [timelineRange]);
140140

141-
const taskListWidth = 300;
141+
// Responsive task list width — narrower on small screens
142+
const taskListWidth = typeof window !== 'undefined' && window.innerWidth < 640 ? 120 : typeof window !== 'undefined' && window.innerWidth < 1024 ? 200 : 300;
142143

143144
const headerRef = React.useRef<HTMLDivElement>(null);
144145
const listRef = React.useRef<HTMLDivElement>(null);
@@ -170,7 +171,7 @@ export function GanttView({
170171
};
171172

172173
return (
173-
<div className={cn("flex flex-col h-full bg-background border rounded-lg overflow-hidden", className)}>
174+
<div className={cn("flex flex-col h-full bg-background border rounded-lg overflow-hidden min-w-0", className)}>
174175
{/* Toolbar */}
175176
<div className="flex flex-col sm:flex-row items-start sm:items-center justify-between gap-2 p-2 border-b bg-card">
176177
<div className="flex items-center gap-2">

packages/plugin-kanban/src/KanbanImpl.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ function KanbanBoardInner({ columns, onCardMove, onCardClick, className, dnd, qu
515515

516516
{swimlanes ? (
517517
/* Swimlane (2D) layout */
518-
<div className={cn("flex flex-col gap-1 p-2 sm:p-4", className)} role="region" aria-label="Kanban board with swimlanes">
518+
<div className={cn("flex flex-col gap-1 p-2 sm:p-4 min-w-0 overflow-hidden", className)} role="region" aria-label="Kanban board with swimlanes">
519519
{/* Column headers */}
520520
<div className="flex gap-3 sm:gap-4 pl-36 sm:pl-44 overflow-x-auto">
521521
{boardColumns.map(col => (
@@ -572,7 +572,7 @@ function KanbanBoardInner({ columns, onCardMove, onCardClick, className, dnd, qu
572572
</div>
573573
) : (
574574
/* Standard flat layout */
575-
<div className={cn("flex gap-3 sm:gap-4 overflow-x-auto snap-x snap-mandatory p-2 sm:p-4 bg-muted/10 rounded-lg [-webkit-overflow-scrolling:touch]", className)} role="region" aria-label="Kanban board">
575+
<div className={cn("flex gap-3 sm:gap-4 overflow-x-auto snap-x snap-mandatory p-2 sm:p-4 bg-muted/10 rounded-lg [-webkit-overflow-scrolling:touch] min-w-0", className)} role="region" aria-label="Kanban board">
576576
{boardColumns.map((column) => (
577577
<KanbanColumnView
578578
key={column.id}

packages/plugin-list/src/ListView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ export const ListView: React.FC<ListViewProps> = ({
785785
return (
786786
<div
787787
ref={pullRef}
788-
className={cn('flex flex-col h-full bg-background relative', className)}
788+
className={cn('flex flex-col h-full bg-background relative min-w-0 overflow-hidden', className)}
789789
{...(schema.aria?.label ? { 'aria-label': schema.aria.label } : {})}
790790
{...(schema.aria?.describedBy ? { 'aria-describedby': schema.aria.describedBy } : {})}
791791
{...(schema.aria?.live ? { 'aria-live': schema.aria.live } : {})}

packages/plugin-map/src/ObjectMap.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import React, { useEffect, useState, useMemo } from 'react';
2424
import type { ObjectGridSchema, DataSource, ViewData } from '@object-ui/types';
2525
import { useNavigationOverlay } from '@object-ui/react';
26-
import { NavigationOverlay } from '@object-ui/components';
26+
import { NavigationOverlay, cn } from '@object-ui/components';
2727
import { z } from 'zod';
2828
import MapGL, { NavigationControl, Marker, Popup } from 'react-map-gl/maplibre';
2929
import maplibregl from 'maplibre-gl';
@@ -501,7 +501,7 @@ export const ObjectMap: React.FC<ObjectMapProps> = ({
501501

502502
if (loading) {
503503
return (
504-
<div className={className}>
504+
<div className={cn("min-w-0 overflow-hidden", className)}>
505505
<div className="flex items-center justify-center h-96 bg-muted rounded-lg border">
506506
<div className="text-muted-foreground">Loading map...</div>
507507
</div>
@@ -511,7 +511,7 @@ export const ObjectMap: React.FC<ObjectMapProps> = ({
511511

512512
if (error) {
513513
return (
514-
<div className={className}>
514+
<div className={cn("min-w-0 overflow-hidden", className)}>
515515
<div className="flex items-center justify-center h-96 bg-muted rounded-lg border">
516516
<div className="text-destructive">Error: {error.message}</div>
517517
</div>
@@ -520,7 +520,7 @@ export const ObjectMap: React.FC<ObjectMapProps> = ({
520520
}
521521

522522
return (
523-
<div className={className}>
523+
<div className={cn("min-w-0 overflow-hidden", className)}>
524524
{invalidCount > 0 && (
525525
<div className="mb-2 p-2 text-sm text-yellow-800 bg-yellow-50 border border-yellow-200 rounded">
526526
{`${invalidCount} record${invalidCount !== 1 ? 's' : ''} with missing or invalid coordinates excluded from the map.`}

packages/plugin-timeline/src/ObjectTimeline.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ export const ObjectTimeline: React.FC<ObjectTimelineProps> = ({
185185
}
186186

187187
return (
188-
<div ref={pullRef} className="relative overflow-auto h-full">
188+
<div ref={pullRef} className="relative overflow-auto h-full min-w-0">
189189
{pullDistance > 0 && (
190190
<div
191191
className="flex items-center justify-center text-xs text-muted-foreground"

packages/plugin-view/src/ObjectView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ export const ObjectView: React.FC<ObjectViewProps> = ({
914914
: layout;
915915

916916
return (
917-
<div className={cn('flex flex-col h-full', className)}>
917+
<div className={cn('flex flex-col h-full min-w-0 overflow-hidden', className)}>
918918
{/* Title and description */}
919919
{(schema.title || schema.description) && (
920920
<div className="mb-4 shrink-0">
@@ -933,7 +933,7 @@ export const ObjectView: React.FC<ObjectViewProps> = ({
933933
</div>
934934

935935
{/* Content */}
936-
<div className="flex-1 min-h-0">
936+
<div className="flex-1 min-h-0 min-w-0 overflow-hidden">
937937
{renderContent()}
938938
</div>
939939

0 commit comments

Comments
 (0)