Skip to content

Commit 3b9a504

Browse files
make repository column width fixed
1 parent 9faaf8d commit 3b9a504

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

packages/web/src/app/[domain]/repos/columns.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ export const columns = (domain: string): ColumnDef<RepositoryColumnInfo>[] => [
7373
{
7474
accessorKey: "repoDisplayName",
7575
header: 'Repository',
76+
size: 500,
7677
cell: ({ row: { original: { repoId, repoName, repoDisplayName, imageUrl } } }) => {
7778
return (
7879
<div className="flex flex-row items-center gap-3 py-2">
@@ -110,6 +111,7 @@ export const columns = (domain: string): ColumnDef<RepositoryColumnInfo>[] => [
110111
},
111112
{
112113
accessorKey: "status",
114+
size: 150,
113115
header: ({ column }) => {
114116
const uniqueLabels = Object.values(statusLabels);
115117
const currentFilter = column.getFilterValue() as string | undefined;
@@ -163,6 +165,7 @@ export const columns = (domain: string): ColumnDef<RepositoryColumnInfo>[] => [
163165
},
164166
{
165167
accessorKey: "lastIndexed",
168+
size: 150,
166169
header: ({ column }) => (
167170
<div className="w-[150px]">
168171
<Button

packages/web/src/components/ui/data-table.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ export function DataTable<TData, TValue>({
8585
<TableRow key={headerGroup.id}>
8686
{headerGroup.headers.map((header) => {
8787
return (
88-
<TableHead key={header.id}>
88+
<TableHead
89+
key={header.id}
90+
style={{ width: `${header.getSize()}px` }}
91+
>
8992
{header.isPlaceholder
9093
? null
9194
: flexRender(
@@ -106,7 +109,10 @@ export function DataTable<TData, TValue>({
106109
data-state={row.getIsSelected() && "selected"}
107110
>
108111
{row.getVisibleCells().map((cell) => (
109-
<TableCell key={cell.id}>
112+
<TableCell
113+
key={cell.id}
114+
style={{ width: `${cell.column.getSize()}px` }}
115+
>
110116
{flexRender(cell.column.columnDef.cell, cell.getContext())}
111117
</TableCell>
112118
))}

0 commit comments

Comments
 (0)