Skip to content

Commit d6999c1

Browse files
committed
Fix table layout and make action column sticky
Adjust layout and table behavior to prevent overflow and keep the action menu visible. In App.tsx added min-w-0 to the main container and overflow-hidden to the content wrapper so flex children can shrink and avoid layout breaks. In ObjectDataTable.tsx changed overflow-auto to overflow-x-auto, added whitespace-nowrap to table headers to prevent label wrapping, and made the actions column sticky (right-0) with a matching bg-background so the dropdown stays visible during horizontal scrolling. Also updated the actions column width class.
1 parent 4ac213d commit d6999c1

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

apps/console/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@ export default function App() {
171171
selectedApp={selectedApp}
172172
onSelectApp={handleSelectApp}
173173
/>
174-
<main className="flex flex-1 flex-col bg-background">
174+
<main className="flex min-w-0 flex-1 flex-col bg-background">
175175
<SiteHeader selectedObject={selectedObject} appLabel={selectedApp?.label} />
176-
<div className="flex flex-1 flex-col">
176+
<div className="flex flex-1 flex-col overflow-hidden">
177177
{selectedObject ? (
178178
<div className="flex flex-1 flex-col gap-4 p-4">
179179
{client && (

apps/console/src/components/ObjectDataTable.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,12 +261,12 @@ export function ObjectDataTable({ client, objectApiName, onEdit }: ObjectDataTab
261261
</CardHeader>
262262

263263
<CardContent className="p-0">
264-
<div className="overflow-auto">
264+
<div className="overflow-x-auto">
265265
<Table>
266266
<TableHeader>
267267
<TableRow className="hover:bg-transparent">
268268
{columns.map(col => (
269-
<TableHead key={col.name} className="font-medium">
269+
<TableHead key={col.name} className="font-medium whitespace-nowrap">
270270
<div className="flex items-center gap-1.5">
271271
{col.label}
272272
<Badge variant="outline" className="text-[10px] px-1 py-0 font-normal opacity-50 hidden lg:inline-flex">
@@ -275,7 +275,7 @@ export function ObjectDataTable({ client, objectApiName, onEdit }: ObjectDataTab
275275
</div>
276276
</TableHead>
277277
))}
278-
<TableHead className="w-[60px]"></TableHead>
278+
<TableHead className="w-15 sticky right-0 bg-background"></TableHead>
279279
</TableRow>
280280
</TableHeader>
281281
<TableBody>
@@ -288,7 +288,7 @@ export function ObjectDataTable({ client, objectApiName, onEdit }: ObjectDataTab
288288
<CellValue value={record[col.name]} type={col.type} />
289289
</TableCell>
290290
))}
291-
<TableCell className="py-2.5">
291+
<TableCell className="py-2.5 sticky right-0 bg-background">
292292
<DropdownMenu>
293293
<DropdownMenuTrigger asChild>
294294
<Button

0 commit comments

Comments
 (0)