Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
1d4f20c
Table frame refactor: closed border on overflow, native scrollbar
benjaminleonard Nov 24, 2026
e82e207
Tune overscroll behavior to feel more native
benjaminleonard Nov 24, 2026
716c438
Trim comments
benjaminleonard Nov 24, 2026
f28dc53
Remove selection css
benjaminleonard Nov 24, 2026
691ed3b
Fixed table column widths and column resizing
benjaminleonard Nov 24, 2026
ed3b2a0
Per-table resize keys, drag limits, convert remaining tables
benjaminleonard Nov 24, 2026
d568efb
Move license headers back to the top of two files
benjaminleonard Nov 24, 2026
32a1389
Merge main
david-crespo Dec 1, 2026
2ac8514
Truncate badges inside table cells, even cell padding
benjaminleonard Nov 30, 2026
3094cec
Merge branch 'main' into fixed-column-widths
benjaminleonard Dec 1, 2026
a379e4f
Cap flexible table columns, fill leftover width with a spacer before …
benjaminleonard Dec 1, 2026
41f9b14
Cap content width at 1600px and center it on wide screens
benjaminleonard Dec 1, 2026
cb3ab19
Increase column handle hit area
benjaminleonard Dec 1, 2026
acd883b
Move content width cap to its own branch
benjaminleonard Dec 1, 2026
385a03c
Avoid spacer cell slither
benjaminleonard Dec 1, 2026
1d23d82
Adjust max col width
benjaminleonard Dec 1, 2026
bad3162
Give name and description columns flexible minimums
benjaminleonard Dec 1, 2026
6e28748
Address review: stable default column, link cell tooltips, resize fixes
benjaminleonard Dec 1, 2026
486c27c
Memoize table body so resizing doesn't re-render every row
benjaminleonard Dec 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@
"error",
{
"paths": [
{
"name": "@tanstack/react-table",
"importNames": ["createColumnHelper"],
"message": "Use createColumnHelper from ~/table/column-helper, which requires every column to set meta.width."
},
{
"name": ".",
"message": "Import from the file directly to avoid confusion due to auto-imports and barrel files."
Expand Down
10 changes: 5 additions & 5 deletions app/components/StateBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const InstanceStateBadge = (props: { state: InstanceState; className?: st
{instanceTransitioning(props.state) && (
<Spinner size="sm" variant={INSTANCE_COLORS[props.state]} />
)}
{props.state}
<span className="truncate">{props.state}</span>
</Badge>
)

Expand All @@ -68,7 +68,7 @@ export const DiskStateBadge = (props: { state: DiskStateStr; className?: string
{diskTransitioning(props.state) && (
<Spinner size="sm" variant={DISK_COLORS[props.state]} />
)}
{props.state.replace(/_/g, ' ')}
<span className="truncate">{props.state.replace(/_/g, ' ')}</span>
</Badge>
)

Expand All @@ -84,7 +84,7 @@ export const SnapshotStateBadge = (props: { state: SnapshotState; className?: st
{snapshotTransitioning(props.state) && (
<Spinner size="sm" variant={SNAPSHOT_COLORS[props.state]} />
)}
{props.state}
<span className="truncate">{props.state}</span>
</Badge>
)

Expand All @@ -106,7 +106,7 @@ export const SupportBundleStateBadge = (props: {
{supportBundleTransitioning(props.state) && (
<Spinner size="sm" variant={SUPPORT_BUNDLE_COLORS[props.state]} />
)}
{props.state}
<span className="truncate">{props.state}</span>
</Badge>
)

Expand All @@ -118,7 +118,7 @@ export const DiskTypeBadge = (props: { diskType: DiskType; className?: string })

// span is here to prevent it getting underlined in the LinkCell
export const ReadOnlyBadge = () => (
<span>
<span className="trailing-badge" title="Read only">
<Badge color="neutral" className="relative">
Read only
</Badge>
Expand Down
6 changes: 4 additions & 2 deletions app/pages/ProjectsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* Copyright Oxide Computer Company
*/
import { useQuery } from '@tanstack/react-query'
import { createColumnHelper } from '@tanstack/react-table'
import { useCallback } from 'react'
import { Outlet, useNavigate } from 'react-router'

Expand All @@ -18,8 +17,9 @@ import { makeCrumb } from '~/hooks/use-crumbs'
import { useQuickActions } from '~/hooks/use-quick-actions'
import { confirmDelete } from '~/stores/confirm-delete'
import { makeLinkCell } from '~/table/cells/LinkCell'
import { createColumnHelper } from '~/table/column-helper'
import { useColsWithActions, type MenuAction } from '~/table/columns/action-col'
import { Columns } from '~/table/columns/common'
import { ColWidth, Columns } from '~/table/columns/common'
import { useQueryTable } from '~/table/QueryTable'
import { CreateLink } from '~/ui/lib/CreateButton'
import { EmptyMessage } from '~/ui/lib/EmptyMessage'
Expand Down Expand Up @@ -55,6 +55,7 @@ export const handle = makeCrumb('Projects', pb.projects())
const colHelper = createColumnHelper<Project>()
const staticCols = [
colHelper.accessor('name', {
meta: { width: ColWidth.name },
cell: makeLinkCell((project) => pb.project({ project })),
}),
colHelper.accessor('description', Columns.description),
Expand Down Expand Up @@ -98,6 +99,7 @@ export default function ProjectsPage() {

const columns = useColsWithActions(staticCols, makeActions)
const { table } = useQueryTable({
id: 'projects',
query: projectList,
columns,
emptyState: <EmptyState />,
Expand Down
18 changes: 10 additions & 8 deletions app/pages/SiloAccessPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*
* Copyright Oxide Computer Company
*/
import { createColumnHelper, getCoreRowModel, useReactTable } from '@tanstack/react-table'
import { getCoreRowModel } from '@tanstack/react-table'
import { useMemo, useState } from 'react'

import {
Expand Down Expand Up @@ -33,13 +33,16 @@ import { useCurrentUser } from '~/hooks/use-current-user'
import { useQuickActions } from '~/hooks/use-quick-actions'
import { confirmDelete } from '~/stores/confirm-delete'
import { addToast } from '~/stores/toast'
import { createColumnHelper } from '~/table/column-helper'
import { getActionsCol } from '~/table/columns/action-col'
import { ColWidth, Columns } from '~/table/columns/common'
import { Table } from '~/table/Table'
import { useTable } from '~/table/use-table'
import { CreateButton } from '~/ui/lib/CreateButton'
import { EmptyMessage } from '~/ui/lib/EmptyMessage'
import { PageHeader, PageTitle } from '~/ui/lib/PageHeader'
import { TableActions, TableEmptyBox } from '~/ui/lib/Table'
import { identityTypeLabel, roleColor } from '~/util/access'
import { roleColor } from '~/util/access'
import { groupBy } from '~/util/array'
import { ALL_ISH } from '~/util/consts'
import { docLinks } from '~/util/links'
Expand Down Expand Up @@ -121,13 +124,11 @@ export default function SiloAccessPage() {

const columns = useMemo(
() => [
colHelper.accessor('name', { header: 'Name' }),
colHelper.accessor('identityType', {
header: 'Type',
cell: (info) => identityTypeLabel[info.getValue()],
}),
colHelper.accessor('name', { meta: { width: ColWidth.name }, header: 'Name' }),
colHelper.accessor('identityType', Columns.identityType),
colHelper.accessor('siloRole', {
header: 'Role',
meta: { width: ColWidth.xl },
cell: (info) => {
const role = info.getValue()
return role ? <Badge color={roleColor[role]}>silo.{role}</Badge> : null
Expand Down Expand Up @@ -161,7 +162,8 @@ export default function SiloAccessPage() {
[siloPolicy, updatePolicy, me]
)

const tableInstance = useReactTable({
const tableInstance = useTable({
id: 'silo-access',
columns,
data: rows,
getCoreRowModel: getCoreRowModel(),
Expand Down
22 changes: 11 additions & 11 deletions app/pages/SiloImagesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* Copyright Oxide Computer Company
*/
import { useQuery } from '@tanstack/react-query'
import { createColumnHelper } from '@tanstack/react-table'
import { useCallback, useMemo, useState } from 'react'
import { useForm } from 'react-hook-form'
import { Outlet } from 'react-router'
Expand All @@ -23,10 +22,10 @@ import { HL } from '~/components/HL'
import { useQuickActions } from '~/hooks/use-quick-actions'
import { confirmDelete } from '~/stores/confirm-delete'
import { addToast } from '~/stores/toast'
import { EmptyCell } from '~/table/cells/EmptyCell'
import { makeLinkCell } from '~/table/cells/LinkCell'
import { createColumnHelper } from '~/table/column-helper'
import { useColsWithActions, type MenuAction } from '~/table/columns/action-col'
import { Columns } from '~/table/columns/common'
import { ColWidth, Columns } from '~/table/columns/common'
import { useQueryTable } from '~/table/QueryTable'
import { Button } from '~/ui/lib/Button'
import { toComboboxItems } from '~/ui/lib/Combobox'
Expand Down Expand Up @@ -58,16 +57,12 @@ export const handle = { crumb: 'Images' }
const colHelper = createColumnHelper<Image>()
const staticCols = [
colHelper.accessor('name', {
meta: { width: ColWidth.name },
cell: makeLinkCell((image) => pb.siloImage({ image })),
}),
colHelper.accessor('description', Columns.description),
colHelper.accessor('os', {
header: 'OS',
cell: (info) => info.getValue() || <EmptyCell />,
}),
colHelper.accessor('version', {
cell: (info) => info.getValue() || <EmptyCell />,
}),
colHelper.accessor('os', Columns.imageOs),
colHelper.accessor('version', Columns.imageVersion),
colHelper.accessor('size', Columns.size),
colHelper.accessor('timeCreated', Columns.timeCreated),
]
Expand Down Expand Up @@ -104,7 +99,12 @@ export default function SiloImagesPage() {
)

const columns = useColsWithActions(staticCols, makeActions)
const { table } = useQueryTable({ query: imageList, columns, emptyState: <EmptyState /> })
const { table } = useQueryTable({
id: 'silo-images',
query: imageList,
columns,
emptyState: <EmptyState />,
})

const { data: allImages } = useQuery(q(api.imageList, { query: { limit: ALL_ISH } }))

Expand Down
18 changes: 10 additions & 8 deletions app/pages/project/access/ProjectAccessPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Copyright Oxide Computer Company
*/

import { createColumnHelper, getCoreRowModel, useReactTable } from '@tanstack/react-table'
import { getCoreRowModel } from '@tanstack/react-table'
import { useMemo, useState } from 'react'
import * as R from 'remeda'

Expand Down Expand Up @@ -37,14 +37,17 @@ import { useProjectSelector } from '~/hooks/use-params'
import { useQuickActions } from '~/hooks/use-quick-actions'
import { confirmDelete } from '~/stores/confirm-delete'
import { addToast } from '~/stores/toast'
import { createColumnHelper } from '~/table/column-helper'
import { getActionsCol } from '~/table/columns/action-col'
import { ColWidth, Columns } from '~/table/columns/common'
import { Table } from '~/table/Table'
import { useTable } from '~/table/use-table'
import { CreateButton } from '~/ui/lib/CreateButton'
import { EmptyMessage } from '~/ui/lib/EmptyMessage'
import { PageHeader, PageTitle } from '~/ui/lib/PageHeader'
import { TableActions, TableEmptyBox } from '~/ui/lib/Table'
import { TipIcon } from '~/ui/lib/TipIcon'
import { identityTypeLabel, roleColor } from '~/util/access'
import { roleColor } from '~/util/access'
import { groupBy } from '~/util/array'
import { ALL_ISH } from '~/util/consts'
import { docLinks } from '~/util/links'
Expand Down Expand Up @@ -142,12 +145,10 @@ export default function ProjectAccessPage() {

const columns = useMemo(
() => [
colHelper.accessor('name', { header: 'Name' }),
colHelper.accessor('identityType', {
header: 'Type',
cell: (info) => identityTypeLabel[info.getValue()],
}),
colHelper.accessor('name', { meta: { width: ColWidth.name }, header: 'Name' }),
colHelper.accessor('identityType', Columns.identityType),
colHelper.accessor('roleBadges', {
meta: { width: 'flex' },
header: () => (
<span className="inline-flex items-center">
Role
Expand Down Expand Up @@ -203,7 +204,8 @@ export default function ProjectAccessPage() {
[projectPolicy, projectSelector.project, updatePolicy]
)

const tableInstance = useReactTable<UserRow>({
const tableInstance = useTable<UserRow>({
id: 'project-access',
columns,
data: rows,
getCoreRowModel: getCoreRowModel(),
Expand Down
36 changes: 23 additions & 13 deletions app/pages/project/affinity/AffinityPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*/

import { useQuery } from '@tanstack/react-query'
import { createColumnHelper, getCoreRowModel, useReactTable } from '@tanstack/react-table'
import { useCallback } from 'react'
import { getCoreRowModel } from '@tanstack/react-table'
import { useCallback, useMemo } from 'react'
import { Outlet } from 'react-router'

import {
Expand All @@ -31,9 +31,11 @@ import { confirmDelete } from '~/stores/confirm-delete'
import { addToast } from '~/stores/toast'
import { EmptyCell, SkeletonCell } from '~/table/cells/EmptyCell'
import { makeLinkCell } from '~/table/cells/LinkCell'
import { createColumnHelper } from '~/table/column-helper'
import { useColsWithActions, type MenuAction } from '~/table/columns/action-col'
import { Columns } from '~/table/columns/common'
import { ColWidth, Columns } from '~/table/columns/common'
import { Table } from '~/table/Table'
import { useTable } from '~/table/use-table'
import { CreateLink } from '~/ui/lib/CreateButton'
import { EmptyMessage } from '~/ui/lib/EmptyMessage'
import { PageHeader, PageTitle } from '~/ui/lib/PageHeader'
Expand Down Expand Up @@ -68,13 +70,16 @@ export const AffinityGroupPolicyBadge = ({ policy }: { policy: AffinityPolicy })
const staticCols = [
colHelper.display({
header: 'type',
meta: { width: ColWidth.lg },
cell: () => <Badge>anti-affinity</Badge>,
}),
colHelper.accessor('name', {
header: 'instances',
meta: { width: ColWidth.sm },
cell: (info) => <AffinityGroupMembersCell antiAffinityGroup={info.getValue()} />,
}),
colHelper.accessor('policy', {
meta: { width: ColWidth.sm },
header: AffinityPolicyHeader,
cell: (info) => <AffinityGroupPolicyBadge policy={info.getValue()} />,
}),
Expand Down Expand Up @@ -124,19 +129,24 @@ export default function AffinityPage() {
)

const columns = useColsWithActions(
[
colHelper.accessor('name', {
cell: makeLinkCell((antiAffinityGroup) =>
pb.antiAffinityGroup({ project, antiAffinityGroup })
),
id: 'members',
}),
...staticCols,
],
useMemo(
() => [
colHelper.accessor('name', {
meta: { width: ColWidth.name },
cell: makeLinkCell((antiAffinityGroup) =>
pb.antiAffinityGroup({ project, antiAffinityGroup })
),
id: 'members',
}),
...staticCols,
],
[project]
),
makeActions
)

const table = useReactTable({
const table = useTable({
id: 'anti-affinity-groups',
columns,
data: antiAffinityGroups,
getCoreRowModel: getCoreRowModel(),
Expand Down
31 changes: 19 additions & 12 deletions app/pages/project/affinity/AntiAffinityGroupPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* Copyright Oxide Computer Company
*/

import { createColumnHelper, getCoreRowModel, useReactTable } from '@tanstack/react-table'
import { useCallback, useState } from 'react'
import { getCoreRowModel } from '@tanstack/react-table'
import { useCallback, useMemo, useState } from 'react'
import { Outlet, useNavigate } from 'react-router'

import { Affinity24Icon } from '@oxide/design-system/icons/react'
Expand Down Expand Up @@ -39,9 +39,11 @@ import { confirmAction } from '~/stores/confirm-action'
import { confirmDelete } from '~/stores/confirm-delete'
import { addToast } from '~/stores/toast'
import { makeLinkCell } from '~/table/cells/LinkCell'
import { createColumnHelper } from '~/table/column-helper'
import { useColsWithActions, type MenuAction } from '~/table/columns/action-col'
import { Columns } from '~/table/columns/common'
import { ColWidth, Columns } from '~/table/columns/common'
import { Table } from '~/table/Table'
import { useTable } from '~/table/use-table'
import { Button } from '~/ui/lib/Button'
import { CardBlock } from '~/ui/lib/CardBlock'
import { Divider } from '~/ui/lib/Divider'
Expand Down Expand Up @@ -156,18 +158,23 @@ export default function AntiAffinityPage() {
)

const columns = useColsWithActions(
[
colHelper.accessor('value.name', {
header: 'name',
cell: makeLinkCell((instance) => pb.instanceSettings({ project, instance })),
}),
colHelper.accessor('value.runState', Columns.instanceState),
colHelper.accessor('value.id', Columns.id),
],
useMemo(
() => [
colHelper.accessor('value.name', {
meta: { width: ColWidth.name },
header: 'name',
cell: makeLinkCell((instance) => pb.instanceSettings({ project, instance })),
}),
colHelper.accessor('value.runState', Columns.instanceState),
colHelper.accessor('value.id', Columns.id),
],
[project]
),
makeActions
)

const table = useReactTable({
const table = useTable({
id: 'anti-affinity-group-members',
columns,
data: members.items,
getCoreRowModel: getCoreRowModel(),
Expand Down
Loading
Loading