Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 39 additions & 22 deletions packages/@react-spectrum/s2/src/TableView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ import {Key} from '@react-types/shared';
import {LayoutInfo, Rect, TableLayout, Virtualizer} from 'react-aria-components/Virtualizer';
import {LayoutNode} from 'react-stately/useVirtualizerState';
import {Menu, MenuItem, MenuSection, MenuTrigger} from './Menu';
import MoreVertical from '../s2wf-icons/S2_Icon_MoreVertical_20_N.svg';
import Nubbin from '../ui-icons/S2_MoveHorizontalTableWidget.svg';
import {OverlayTriggerStateContext} from 'react-aria-components/Dialog';
import {ProgressCircle} from './ProgressCircle';
Expand Down Expand Up @@ -897,9 +898,7 @@ const resizableMenuButtonWrapper = style({
paddingX: 16,
backgroundColor: 'transparent',
borderStyle: 'none',
fontSize: controlFont(),
fontFamily: 'sans',
fontWeight: 'bold'
font: 'title-sm'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fontSize was originally using ui which has a line height of 16px but the column title needs a line height of 18px so that the column menu icon uses the appropriate line height. not sure if this was updated at some point and we just never got to it

});

const resizerHandleContainer = style({
Expand Down Expand Up @@ -949,20 +948,24 @@ const resizerHandle = style<{isFocusVisible: boolean; isResizing: boolean}>({
const columnHeaderText = style({
truncate: true,
// Make it so the text doesn't completely disappear when column is resized to smallest width + both sort and chevron icon is rendered
minWidth: fontRelative(16),
minWidth: fontRelative(18),
flexGrow: 0,
flexShrink: 1,
flexBasis: 'auto'
});

const chevronIcon = style({
rotate: 90,
const moreVerticalIcon = style({
size: '1lh',
marginStart: 'text-to-visual',
minWidth: fontRelative(16),
flexShrink: 0,
'--iconPrimary': {
type: 'fill',
value: 'currentColor'
value: {
default: 'gray-700',
isHovered: 'gray-800',
isFocusVisible: 'gray-800'

@yihuiliao yihuiliao Sep 9, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no design for when it is focused so i just assume it's the same as hovered, we can clarify with design tho

}
}
});

Expand Down Expand Up @@ -1064,22 +1067,36 @@ function ColumnWithMenu(props: ColumnWithMenuProps) {
className={renderProps =>
resizableMenuButtonWrapper({...renderProps, align: buttonAlignment})
}>
{allowsSorting && (
<Provider
values={[
[
IconContext,
{
styles: sortIcon({isButton: true})
}
]
]}>
{sortDirection != null &&
(sortDirection === 'ascending' ? <SortUpArrow /> : <SortDownArrow />)}
</Provider>
{({isHovered, isFocusVisible}) => (
<>
{allowsSorting && (
<Provider
values={[
[
IconContext,
{
styles: sortIcon({isButton: true})
}
]
]}>
{sortDirection != null &&
(sortDirection === 'ascending' ? <SortUpArrow /> : <SortDownArrow />)}
</Provider>
)}
<div className={columnHeaderText}>{children}</div>
<Provider
values={[
[
IconContext,
{
styles: moreVerticalIcon({isHovered, isFocusVisible})
}
]
]}>
<MoreVertical />
</Provider>
</>
)}
<div className={columnHeaderText}>{children}</div>
<Chevron size="M" className={chevronIcon} />
</Button>
<Menu onAction={onMenuSelect} styles={style({minWidth: 128})}>
{items.length > 0 && (
Expand Down