Skip to content

Commit 768f43e

Browse files
authored
Merge pull request #692 from objectstack-ai/copilot/fix-console-layout-issues
2 parents fd054a9 + a3d4e20 commit 768f43e

11 files changed

Lines changed: 38 additions & 19 deletions

File tree

ROADMAP.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,18 @@ ObjectUI is a universal Server-Driven UI (SDUI) engine built on React + Tailwind
132132
- [x] i18n for all 11 locales (en, zh, ja, de, fr, es, ar, ru, pt, ko)
133133
- [ ] Conditional formatting rules
134134

135+
### P1.9 Console — Content Area Layout & Responsiveness
136+
137+
- [x] Add `min-w-0` / `overflow-hidden` to flex layout chain (SidebarInset → AppShell → ObjectView → PluginObjectView) to prevent content overflow
138+
- [x] Fix Gantt task list width — responsive sizing (120px mobile, 200px tablet, 300px desktop) instead of hardcoded 300px
139+
- [x] Fix Kanban board overflow containment (`min-w-0` on swimlane and flat containers)
140+
- [x] Fix Calendar header responsive wrapping and date label sizing
141+
- [x] Fix Map container overflow containment via `cn()` merge
142+
- [x] Fix Timeline container `min-w-0` to prevent overflow
143+
- [x] Fix ListView container `min-w-0 overflow-hidden` to prevent overflow
144+
- [ ] Mobile/tablet end-to-end testing for all view types
145+
- [ ] Dynamic width calculation for Gantt task list and Kanban columns based on container width
146+
135147
---
136148

137149
## 🧩 P2 — Polish & Advanced Features

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: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ function getResponsiveColumnWidth() {
3939
return 60;
4040
}
4141

42+
function getResponsiveTaskListWidth() {
43+
const w = typeof window !== 'undefined' ? window.innerWidth : 1024;
44+
if (w < 640) return 120;
45+
if (w < 1024) return 200;
46+
return 300;
47+
}
48+
4249
export interface GanttTask {
4350
id: string | number
4451
title: string
@@ -138,7 +145,7 @@ export function GanttView({
138145
return cols;
139146
}, [timelineRange]);
140147

141-
const taskListWidth = 300;
148+
const taskListWidth = getResponsiveTaskListWidth();
142149

143150
const headerRef = React.useRef<HTMLDivElement>(null);
144151
const listRef = React.useRef<HTMLDivElement>(null);
@@ -170,7 +177,7 @@ export function GanttView({
170177
};
171178

172179
return (
173-
<div className={cn("flex flex-col h-full bg-background border rounded-lg overflow-hidden", className)}>
180+
<div className={cn("flex flex-col h-full bg-background border rounded-lg overflow-hidden min-w-0", className)}>
174181
{/* Toolbar */}
175182
<div className="flex flex-col sm:flex-row items-start sm:items-center justify-between gap-2 p-2 border-b bg-card">
176183
<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"

0 commit comments

Comments
 (0)