From 556d36e3f47eab8a03afd6d8f464bb1f76a58561 Mon Sep 17 00:00:00 2001 From: Talisson Costa Date: Tue, 17 Nov 2026 11:37:22 -0300 Subject: [PATCH 01/11] feat(Tables): Open table filters as a popover, a bottom sheet on phones TableFilter is built on Popover instead of InlineModal, so the feature list filters (Tags, Value, Users, Groups, View, Sort) open anchored on desktop and as a bottom sheet on phones, instead of a blank full-screen panel. - TableFilterOptions reuses TableFilter rather than duplicating the trigger and InlineModal. - Filters whose title carries a count take a label, so the sheet and the trigger's popup have a name. - Title, search and list share the same 16px indent. Co-Authored-By: Claude Opus 5.5 --- .../web/components/tables/TableFilter.tsx | 69 ++++---- .../components/tables/TableFilterOptions.tsx | 150 ++++++++---------- .../components/tables/TableGroupsFilter.tsx | 1 + .../components/tables/TableOwnerFilter.tsx | 1 + .../web/components/tables/TableTagFilter.tsx | 3 +- .../components/tables/TableValueFilter.tsx | 3 +- 6 files changed, 103 insertions(+), 124 deletions(-) diff --git a/frontend/web/components/tables/TableFilter.tsx b/frontend/web/components/tables/TableFilter.tsx index d22809f0abb1..f87dd6efae99 100644 --- a/frontend/web/components/tables/TableFilter.tsx +++ b/frontend/web/components/tables/TableFilter.tsx @@ -1,15 +1,19 @@ -import React, { FC, ReactNode, useState } from 'react' -import InlineModal from 'components/InlineModal' +import React, { FC, ReactNode } from 'react' import { IonIcon } from '@ionic/react' import { caretDown } from 'ionicons/icons' import classNames from 'classnames' +import Popover from 'components/base/Popover' +import BareButton from 'components/base/forms/BareButton' type TableFilterType = { title: string | ReactNode + // Names the filter when the title isn't plain text (it has a count) + label?: string hideTitle?: boolean dropdownTitle?: ReactNode | string className?: string - children: ReactNode + size?: 'sm' | 'lg' + children: ReactNode | ((close: () => void) => ReactNode) 'data-test'?: string } @@ -19,26 +23,26 @@ const TableFilter: FC = ({ 'data-test': dataTest, dropdownTitle, hideTitle, + label, + size = 'sm', title, -}) => { - const [open, setOpen] = useState(false) - const toggle = function () { - if (!open) { - setOpen(true) - } - } - return ( - <> - ( + ( + @@ -51,25 +55,20 @@ const TableFilter: FC = ({ }} icon={caretDown} /> - - {open && ( - { - setTimeout(() => { - setOpen(false) - }, 10) - }} - containerClassName='px-0' - className='inline-modal table-filter inline-modal--sm right' - > - {children} - - )} - - ) -} + + )} + > + {(close) => ( + <> + {!hideTitle && ( +
+ {dropdownTitle || title} +
+ )} + {typeof children === 'function' ? children(close) : children} + + )} + +) export default TableFilter diff --git a/frontend/web/components/tables/TableFilterOptions.tsx b/frontend/web/components/tables/TableFilterOptions.tsx index 86aa64310584..09684239d0a8 100644 --- a/frontend/web/components/tables/TableFilterOptions.tsx +++ b/frontend/web/components/tables/TableFilterOptions.tsx @@ -1,14 +1,13 @@ import React, { FC, ReactNode, useMemo, useState } from 'react' -import InlineModal from 'components/InlineModal' -import { IonIcon } from '@ionic/react' -import { caretDown } from 'ionicons/icons' import classNames from 'classnames' +import TableFilter from './TableFilter' import TableFilterItem from './TableFilterItem' import Input from 'components/base/forms/Input' import Utils from 'common/utils/utils' -type TableFilterType = { +type TableFilterOptionsType = { title: ReactNode + label?: string dropdownTitle?: ReactNode | string className?: string size?: 'sm' | 'lg' @@ -20,9 +19,10 @@ type TableFilterType = { showSearch?: boolean } -const TableFilter: FC = ({ +const TableFilterOptions: FC = ({ className, isLoading, + label, multiple, onChange, options, @@ -33,13 +33,6 @@ const TableFilter: FC = ({ }) => { const [filter, setFilter] = useState('') - const [open, setOpen] = useState(false) - const toggle = function () { - if (!open) { - setOpen(true) - } - } - const filteredOptions = useMemo(() => { const lowerSearch = filter?.toLowerCase() return filter @@ -51,86 +44,69 @@ const TableFilter: FC = ({ return (
- - {title} - - - {open && ( - { - setTimeout(() => { - setOpen(false) - }, 10) - }} - containerClassName='px-0' - className={`inline-modal table-filter inline-modal--${size} right`} - > - {!!showSearch && ( -
- { - setFilter(Utils.safeParseEventValue(e)) - }} - className='full-width' - value={filter} - type='text' - size='xSmall' - placeholder='Search' - search - /> - {!filteredOptions?.length && ( -
No results
- )} -
- )} -
- {filteredOptions.map((v) => ( - { - if (!multiple) { - setOpen(false) - } - if (multiple) { - if ((value || []).includes(v.value)) { - onChange( - ((value as string[]) || []).filter( - (item) => item !== v.value, - ), - ) + {(close) => ( + <> + {!!showSearch && ( +
+ { + setFilter(Utils.safeParseEventValue(e)) + }} + className='full-width' + value={filter} + type='text' + size='xSmall' + placeholder='Search' + search + /> + {!filteredOptions?.length && ( +
No results
+ )} +
+ )} +
+ {filteredOptions.map((v) => ( + { + if (!multiple) { + close() + } + if (multiple) { + if ((value || []).includes(v.value)) { + onChange( + ((value as string[]) || []).filter( + (item) => item !== v.value, + ), + ) + } else { + onChange(((value as string[]) || []).concat([v.value])) + } } else { - onChange(((value as string[]) || []).concat([v.value])) + onChange(v.value) } - } else { - onChange(v.value) + }} + isActive={ + multiple ? value?.includes(v.value) : value === v.value } - }} - isActive={ - multiple ? value?.includes(v.value) : value === v.value - } - /> - ))} -
- - )} + /> + ))} +
+ + )} +
) } -export default TableFilter +export default TableFilterOptions diff --git a/frontend/web/components/tables/TableGroupsFilter.tsx b/frontend/web/components/tables/TableGroupsFilter.tsx index b0c6f40dc57e..a98f73e25ef6 100644 --- a/frontend/web/components/tables/TableGroupsFilter.tsx +++ b/frontend/web/components/tables/TableGroupsFilter.tsx @@ -34,6 +34,7 @@ const TableGroupsFilter: FC = ({ return ( diff --git a/frontend/web/components/tables/TableOwnerFilter.tsx b/frontend/web/components/tables/TableOwnerFilter.tsx index 61fa869d0c6b..2d9ec64a5d57 100644 --- a/frontend/web/components/tables/TableOwnerFilter.tsx +++ b/frontend/web/components/tables/TableOwnerFilter.tsx @@ -27,6 +27,7 @@ const TableOwnerFilter: FC = ({ return ( = ({
@@ -101,7 +102,7 @@ const TableTagFilter: FC = ({ } >
-
+
{ diff --git a/frontend/web/components/tables/TableValueFilter.tsx b/frontend/web/components/tables/TableValueFilter.tsx index 8c0c277c9a91..f5456b5a8269 100644 --- a/frontend/web/components/tables/TableValueFilter.tsx +++ b/frontend/web/components/tables/TableValueFilter.tsx @@ -49,6 +49,7 @@ const TableTagFilter: FC = ({ return (
= ({ } >
-
+
Date: Tue, 17 Nov 2026 11:41:10 -0300 Subject: [PATCH 02/11] refactor(Tables): Drop the table filter size prop Only the Users filter passed size='lg' (a fixed 355px). The default already grows with its content up to 355px, and the phone sheet is full width. Co-Authored-By: Claude Opus 5.5 --- frontend/web/components/tables/TableFilter.tsx | 4 +--- frontend/web/components/tables/TableFilterOptions.tsx | 3 --- frontend/web/components/tables/TableOwnerFilter.tsx | 1 - frontend/web/styles/project/_modals.scss | 10 ---------- 4 files changed, 1 insertion(+), 17 deletions(-) diff --git a/frontend/web/components/tables/TableFilter.tsx b/frontend/web/components/tables/TableFilter.tsx index f87dd6efae99..cd39d5bfeb23 100644 --- a/frontend/web/components/tables/TableFilter.tsx +++ b/frontend/web/components/tables/TableFilter.tsx @@ -12,7 +12,6 @@ type TableFilterType = { hideTitle?: boolean dropdownTitle?: ReactNode | string className?: string - size?: 'sm' | 'lg' children: ReactNode | ((close: () => void) => ReactNode) 'data-test'?: string } @@ -24,14 +23,13 @@ const TableFilter: FC = ({ dropdownTitle, hideTitle, label, - size = 'sm', title, }) => ( ( void | Promise @@ -27,7 +26,6 @@ const TableFilterOptions: FC = ({ onChange, options, showSearch, - size = 'sm', title, value, }) => { @@ -48,7 +46,6 @@ const TableFilterOptions: FC = ({ title={title} label={label} hideTitle - size={size} className={classNames('user-select-none', className)} > {(close) => ( diff --git a/frontend/web/components/tables/TableOwnerFilter.tsx b/frontend/web/components/tables/TableOwnerFilter.tsx index 2d9ec64a5d57..a7567c0e1e02 100644 --- a/frontend/web/components/tables/TableOwnerFilter.tsx +++ b/frontend/web/components/tables/TableOwnerFilter.tsx @@ -28,7 +28,6 @@ const TableOwnerFilter: FC = ({ return ( Date: Wed, 25 Nov 2026 23:29:50 -0300 Subject: [PATCH 03/11] feat(Tables): Use larger rows when a table filter opens as a bottom sheet 16px labels and 48px rows on phones, matching DropdownMenu sheets. Co-Authored-By: Claude Opus 5.5 --- .../web/components/tables/TableFilter.tsx | 97 ++++++++++--------- frontend/web/styles/project/_modals.scss | 17 +++- 2 files changed, 69 insertions(+), 45 deletions(-) diff --git a/frontend/web/components/tables/TableFilter.tsx b/frontend/web/components/tables/TableFilter.tsx index cd39d5bfeb23..f8dfb7d6fcc1 100644 --- a/frontend/web/components/tables/TableFilter.tsx +++ b/frontend/web/components/tables/TableFilter.tsx @@ -4,6 +4,7 @@ import { caretDown } from 'ionicons/icons' import classNames from 'classnames' import Popover from 'components/base/Popover' import BareButton from 'components/base/forms/BareButton' +import { useBreakpoint } from 'common/hooks/useBreakpoint' type TableFilterType = { title: string | ReactNode @@ -24,49 +25,57 @@ const TableFilter: FC = ({ hideTitle, label, title, -}) => ( - ( - - {title} - - - )} - > - {(close) => ( - <> - {!hideTitle && ( -
- {dropdownTitle || title} -
- )} - {typeof children === 'function' ? children(close) : children} - - )} -
-) +}) => { + // Popover opens as a sheet on the same breakpoint, where rows get larger + const asSheet = useBreakpoint('isPhone') + return ( + ( + + {title} + + + )} + > + {(close) => ( +
+ {!hideTitle && ( +
+ {dropdownTitle || title} +
+ )} + {typeof children === 'function' ? children(close) : children} +
+ )} +
+ ) +} export default TableFilter diff --git a/frontend/web/styles/project/_modals.scss b/frontend/web/styles/project/_modals.scss index 8512b90f2ffe..d359e869b033 100644 --- a/frontend/web/styles/project/_modals.scss +++ b/frontend/web/styles/project/_modals.scss @@ -319,8 +319,23 @@ $side-width: 800px; text-overflow: ellipsis; overflow-x: hidden; } +// The sheet sets these; the rows read them +.table-filter { + --table-filter-row: 0; + --table-filter-font: var(--font-size-body-md); + + // In a bottom sheet rows are larger, like native action sheets. There is no + // 16px body token, so the size is set here + &--sheet { + --table-filter-row: 48px; + --table-filter-font: 16px; + } +} .table-filter-item { - display: block; + display: grid; + align-items: center; + min-height: var(--table-filter-row); + font-size: var(--table-filter-font); border-bottom: 1px solid $input-border-color; &:last-of-type { border-bottom: none; From aa3ac9dd9b1d3b01f570abc7450b82ceb3531d32 Mon Sep 17 00:00:00 2001 From: Talisson Costa Date: Thu, 26 Nov 2026 08:26:57 -0300 Subject: [PATCH 04/11] refactor(Tables): Keep the table filter styles with their components TableFilter and TableFilterItem get their own stylesheets instead of rules in the global _modals.scss. The row border uses a token, so it no longer needs a .dark rule. PanelSearch and TableSortFilter, which borrow the row class for their sort rows, import its stylesheet until they move to DropdownMenu. Co-Authored-By: Claude Opus 5.5 --- frontend/web/components/PanelSearch.tsx | 2 + .../tables/TableFilter/TableFilter.scss | 28 +++++++++++++ .../tables/{ => TableFilter}/TableFilter.tsx | 5 ++- .../components/tables/TableFilter/index.ts | 1 + .../TableFilterItem/TableFilterItem.scss | 11 ++++++ .../{ => TableFilterItem}/TableFilterItem.tsx | 1 + .../tables/TableFilterItem/index.ts | 1 + .../web/components/tables/TableSortFilter.tsx | 2 + frontend/web/styles/project/_modals.scss | 39 ------------------- 9 files changed, 49 insertions(+), 41 deletions(-) create mode 100644 frontend/web/components/tables/TableFilter/TableFilter.scss rename frontend/web/components/tables/{ => TableFilter}/TableFilter.tsx (93%) create mode 100644 frontend/web/components/tables/TableFilter/index.ts create mode 100644 frontend/web/components/tables/TableFilterItem/TableFilterItem.scss rename frontend/web/components/tables/{ => TableFilterItem}/TableFilterItem.tsx (96%) create mode 100644 frontend/web/components/tables/TableFilterItem/index.ts diff --git a/frontend/web/components/PanelSearch.tsx b/frontend/web/components/PanelSearch.tsx index 7e2a6fbf0f4a..f8d401c1ccf5 100644 --- a/frontend/web/components/PanelSearch.tsx +++ b/frontend/web/components/PanelSearch.tsx @@ -25,6 +25,8 @@ import Panel from './base/grid/Panel' import Utils from 'common/utils/utils' import { colorIconAction, colorIconSecondary } from 'common/theme/tokens' import { SortOrder } from 'common/types/requests' +// Its sort rows reuse the filter row look until they move to DropdownMenu +import './tables/TableFilterItem/TableFilterItem.scss' export type SortOption = { value: string diff --git a/frontend/web/components/tables/TableFilter/TableFilter.scss b/frontend/web/components/tables/TableFilter/TableFilter.scss new file mode 100644 index 000000000000..deec79847da3 --- /dev/null +++ b/frontend/web/components/tables/TableFilter/TableFilter.scss @@ -0,0 +1,28 @@ +@import '../../../styles/variables'; +@import '../../../styles/mixins/custom-scrollbar'; + +// The sheet sets these; the rows read them +.table-filter__content { + --table-filter-row: 0; + --table-filter-font: var(--font-size-body-md); + + // In a bottom sheet rows are larger, like native action sheets. There is no + // 16px body token, so the size is set here + &--sheet { + --table-filter-row: 48px; + --table-filter-font: 16px; + + // The sheet scrolls itself + .table-filter-list { + max-height: none; + } + } +} + +.table-filter-list { + overflow-y: auto; + max-height: 350px; + @include customScroll(); + text-overflow: ellipsis; + overflow-x: hidden; +} diff --git a/frontend/web/components/tables/TableFilter.tsx b/frontend/web/components/tables/TableFilter/TableFilter.tsx similarity index 93% rename from frontend/web/components/tables/TableFilter.tsx rename to frontend/web/components/tables/TableFilter/TableFilter.tsx index f8dfb7d6fcc1..ddae477c2811 100644 --- a/frontend/web/components/tables/TableFilter.tsx +++ b/frontend/web/components/tables/TableFilter/TableFilter.tsx @@ -5,6 +5,7 @@ import classNames from 'classnames' import Popover from 'components/base/Popover' import BareButton from 'components/base/forms/BareButton' import { useBreakpoint } from 'common/hooks/useBreakpoint' +import './TableFilter.scss' type TableFilterType = { title: string | ReactNode @@ -62,8 +63,8 @@ const TableFilter: FC = ({ > {(close) => (
{!hideTitle && ( diff --git a/frontend/web/components/tables/TableFilter/index.ts b/frontend/web/components/tables/TableFilter/index.ts new file mode 100644 index 000000000000..34524e043763 --- /dev/null +++ b/frontend/web/components/tables/TableFilter/index.ts @@ -0,0 +1 @@ +export { default } from './TableFilter' diff --git a/frontend/web/components/tables/TableFilterItem/TableFilterItem.scss b/frontend/web/components/tables/TableFilterItem/TableFilterItem.scss new file mode 100644 index 000000000000..e0853fa087c7 --- /dev/null +++ b/frontend/web/components/tables/TableFilterItem/TableFilterItem.scss @@ -0,0 +1,11 @@ +.table-filter-item { + display: grid; + align-items: center; + min-height: var(--table-filter-row); + font-size: var(--table-filter-font); + border-bottom: 1px solid var(--color-border-default); + + &:last-of-type { + border-bottom: none; + } +} diff --git a/frontend/web/components/tables/TableFilterItem.tsx b/frontend/web/components/tables/TableFilterItem/TableFilterItem.tsx similarity index 96% rename from frontend/web/components/tables/TableFilterItem.tsx rename to frontend/web/components/tables/TableFilterItem/TableFilterItem.tsx index 8dfd4bb3fdcf..a4bc387ed68e 100644 --- a/frontend/web/components/tables/TableFilterItem.tsx +++ b/frontend/web/components/tables/TableFilterItem/TableFilterItem.tsx @@ -1,6 +1,7 @@ import React, { FC, ReactNode } from 'react' import Icon from 'components/icons/Icon' import classNames from 'classnames' +import './TableFilterItem.scss' type TableFilterItemType = { isActive?: boolean diff --git a/frontend/web/components/tables/TableFilterItem/index.ts b/frontend/web/components/tables/TableFilterItem/index.ts new file mode 100644 index 000000000000..0c64d5326eee --- /dev/null +++ b/frontend/web/components/tables/TableFilterItem/index.ts @@ -0,0 +1 @@ +export { default } from './TableFilterItem' diff --git a/frontend/web/components/tables/TableSortFilter.tsx b/frontend/web/components/tables/TableSortFilter.tsx index b3c0774c5273..d2431b96d3d2 100644 --- a/frontend/web/components/tables/TableSortFilter.tsx +++ b/frontend/web/components/tables/TableSortFilter.tsx @@ -3,6 +3,8 @@ import TableFilter from './TableFilter' import Icon from 'components/icons/Icon' import classNames from 'classnames' import { SortOrder } from 'common/types/requests' +// Its sort rows reuse the filter row look until they move to DropdownMenu +import './TableFilterItem/TableFilterItem.scss' type SortType = { value: string diff --git a/frontend/web/styles/project/_modals.scss b/frontend/web/styles/project/_modals.scss index d359e869b033..5f9226b82955 100644 --- a/frontend/web/styles/project/_modals.scss +++ b/frontend/web/styles/project/_modals.scss @@ -220,9 +220,6 @@ $side-width: 800px; height: 100vh; max-height: 100vh; } - .table-filter-list { - max-height: none !important; - } } .modal-back-btn { margin-right: 12px; @@ -312,42 +309,6 @@ $side-width: 800px; } } -.table-filter-list { - overflow-y: auto; - max-height: 350px; - @include customScroll(); - text-overflow: ellipsis; - overflow-x: hidden; -} -// The sheet sets these; the rows read them -.table-filter { - --table-filter-row: 0; - --table-filter-font: var(--font-size-body-md); - - // In a bottom sheet rows are larger, like native action sheets. There is no - // 16px body token, so the size is set here - &--sheet { - --table-filter-row: 48px; - --table-filter-font: 16px; - } -} -.table-filter-item { - display: grid; - align-items: center; - min-height: var(--table-filter-row); - font-size: var(--table-filter-font); - border-bottom: 1px solid $input-border-color; - &:last-of-type { - border-bottom: none; - } -} -.dark { - - .table-filter-item { - border-color: $white-alpha-8; - } -} - // Lets a long drawer title truncate instead of pushing its buttons out .side-modal .modal-title { min-width: 0; From d20d3d622f3a501df01126ce970ef96a0cabfa5e Mon Sep 17 00:00:00 2001 From: Talisson Costa Date: Thu, 26 Nov 2026 08:27:47 -0300 Subject: [PATCH 05/11] refactor(Tables): Use the project's chevron on table filter triggers Drops the ionicon caret and its inline styles. Co-Authored-By: Claude Opus 5.5 --- .../components/tables/TableFilter/TableFilter.tsx | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/frontend/web/components/tables/TableFilter/TableFilter.tsx b/frontend/web/components/tables/TableFilter/TableFilter.tsx index ddae477c2811..8ee8e8cb4e6f 100644 --- a/frontend/web/components/tables/TableFilter/TableFilter.tsx +++ b/frontend/web/components/tables/TableFilter/TableFilter.tsx @@ -1,9 +1,8 @@ import React, { FC, ReactNode } from 'react' -import { IonIcon } from '@ionic/react' -import { caretDown } from 'ionicons/icons' import classNames from 'classnames' import Popover from 'components/base/Popover' import BareButton from 'components/base/forms/BareButton' +import Icon from 'components/icons/Icon' import { useBreakpoint } from 'common/hooks/useBreakpoint' import './TableFilter.scss' @@ -50,14 +49,7 @@ const TableFilter: FC = ({ )} > {title} - + )} > From cbb8c13341069816aa69f92edc710652bded9c42 Mon Sep 17 00:00:00 2001 From: Talisson Costa Date: Thu, 26 Nov 2026 08:33:16 -0300 Subject: [PATCH 06/11] refactor(Tables): Render sort options with TableFilterItem TableSortFilter and PanelSearch built their own rows with the table-filter-item class. They now use TableFilterItem, which shows the sort direction on the active option through a sortOrder prop. PanelSearch also drops its ionicons. Co-Authored-By: Claude Opus 5.5 --- frontend/web/components/PanelSearch.tsx | 34 +++++----------- .../TableFilterItem/TableFilterItem.tsx | 11 ++++- .../web/components/tables/TableSortFilter.tsx | 40 +++++-------------- 3 files changed, 30 insertions(+), 55 deletions(-) diff --git a/frontend/web/components/PanelSearch.tsx b/frontend/web/components/PanelSearch.tsx index f8d401c1ccf5..715dba09dfde 100644 --- a/frontend/web/components/PanelSearch.tsx +++ b/frontend/web/components/PanelSearch.tsx @@ -11,11 +11,10 @@ import React, { import { AutoSizer, List } from 'react-virtualized' import classNames from 'classnames' import Popover from './base/Popover' +import TableFilterItem from './tables/TableFilterItem' import BareButton from './base/forms/BareButton' import Input from './base/forms/Input' import Icon from './icons/Icon' -import { IonIcon } from '@ionic/react' -import { chevronDown, chevronUp } from 'ionicons/icons' import Button from './base/forms/Button' import Paging from './Paging' import lodashFilter from 'lodash/filter' @@ -25,8 +24,6 @@ import Panel from './base/grid/Panel' import Utils from 'common/utils/utils' import { colorIconAction, colorIconSecondary } from 'common/theme/tokens' import { SortOrder } from 'common/types/requests' -// Its sort rows reuse the filter row look until they move to DropdownMenu -import './tables/TableFilterItem/TableFilterItem.scss' export type SortOption = { value: string @@ -133,8 +130,7 @@ const PanelSearch = (props: PanelSearchProps): ReactElement => { }, [propSearch, internalSearch, exact, filter, filterRow, items, sortItems]) const handleSort = useCallback( - (e: React.MouseEvent, sortOption: SortOption) => { - e.preventDefault() + (sortOption: SortOption) => { if (sortOption.value === sortBy) { const newSortOrder = sortOrder === SortOrder.ASC ? SortOrder.DESC : SortOrder.ASC @@ -298,28 +294,16 @@ const PanelSearch = (props: PanelSearchProps): ReactElement => { {(close) => ( )} diff --git a/frontend/web/components/tables/TableFilterItem/TableFilterItem.tsx b/frontend/web/components/tables/TableFilterItem/TableFilterItem.tsx index a4bc387ed68e..48d2d8e39f2e 100644 --- a/frontend/web/components/tables/TableFilterItem/TableFilterItem.tsx +++ b/frontend/web/components/tables/TableFilterItem/TableFilterItem.tsx @@ -1,19 +1,28 @@ import React, { FC, ReactNode } from 'react' import Icon from 'components/icons/Icon' import classNames from 'classnames' +import { SortOrder } from 'common/types/requests' import './TableFilterItem.scss' type TableFilterItemType = { isActive?: boolean + // For sort options: the active one shows its direction instead of a tick + sortOrder?: SortOrder subtitle?: string title: string | ReactNode onClick: () => void 'data-test'?: string } +const markerIcon = (sortOrder?: SortOrder) => { + if (!sortOrder) return 'checkmark' + return sortOrder === SortOrder.ASC ? 'chevron-up' : 'chevron-down' +} + const TableFilterItem: FC = ({ isActive, onClick, + sortOrder, subtitle, title, ...rest @@ -36,7 +45,7 @@ const TableFilterItem: FC = ({
diff --git a/frontend/web/components/tables/TableSortFilter.tsx b/frontend/web/components/tables/TableSortFilter.tsx index d2431b96d3d2..e553fdf55b6b 100644 --- a/frontend/web/components/tables/TableSortFilter.tsx +++ b/frontend/web/components/tables/TableSortFilter.tsx @@ -1,10 +1,7 @@ import React, { FC } from 'react' +import TableFilterItem from './TableFilterItem' import TableFilter from './TableFilter' -import Icon from 'components/icons/Icon' -import classNames from 'classnames' import { SortOrder } from 'common/types/requests' -// Its sort rows reuse the filter row look until they move to DropdownMenu -import './TableFilterItem/TableFilterItem.scss' type SortType = { value: string @@ -22,6 +19,9 @@ type TableFilterType = { onChange: (v: SortValue) => void } +const oppositeOrder = (order: SortOrder) => + order === SortOrder.ASC ? SortOrder.DESC : SortOrder.ASC + const TableSortFilter: FC = ({ isLoading, onChange, @@ -39,40 +39,22 @@ const TableSortFilter: FC = ({ {options.map((sortOption, i) => { const isActive = sortOption?.value === value?.sortBy return ( - { - e.preventDefault() + title={sortOption.label} + isActive={isActive} + sortOrder={value.sortOrder} + onClick={() => { if (isLoading) return onChange({ label: sortOption.label, sortBy: sortOption.value, sortOrder: isActive - ? value.sortOrder === SortOrder.ASC - ? SortOrder.DESC - : SortOrder.ASC + ? oppositeOrder(value.sortOrder) : SortOrder.ASC, }) }} - > - -
{sortOption.label}
-
- -
-
-
+ /> ) })} From b8250a91cf1dcfcb926940960657b52262d49d0e Mon Sep 17 00:00:00 2001 From: Talisson Costa Date: Thu, 26 Nov 2026 08:38:10 -0300 Subject: [PATCH 07/11] refactor(Tables): Make filter options buttons and find them by role in E2E TableFilterItem was a link to '#' that only ran an action; it is now a BareButton with aria-pressed for the selected option. E2E finds the archived tag option and the history compare options by role and name, so the table-filter and history compare test ids are removed. Co-Authored-By: Claude Opus 5.5 --- .../e2e/helpers/e2e-helpers.playwright.ts | 7 ++-- frontend/e2e/tests/flag-tests.pw.ts | 13 +++---- frontend/web/components/FeatureHistory.tsx | 2 - .../tables/TableFilter/TableFilter.tsx | 8 ---- .../TableFilterItem/TableFilterItem.scss | 2 + .../TableFilterItem/TableFilterItem.tsx | 38 +++++++++---------- .../web/components/tables/TableTagFilter.tsx | 1 - 7 files changed, 29 insertions(+), 42 deletions(-) diff --git a/frontend/e2e/helpers/e2e-helpers.playwright.ts b/frontend/e2e/helpers/e2e-helpers.playwright.ts index 3bf344b6eab9..6b5e9b006cd4 100644 --- a/frontend/e2e/helpers/e2e-helpers.playwright.ts +++ b/frontend/e2e/helpers/e2e-helpers.playwright.ts @@ -832,10 +832,9 @@ export class E2EHelpers { ) { await this.goToFeatureVersions(featureName); await this.click(byId(`history-item-${versionIndex}-compare`)); - if (compareOption === 'LIVE') { - await this.click(byId(`history-item-${versionIndex}-compare-live`)); - } else if (compareOption === 'PREVIOUS') { - await this.click(byId(`history-item-${versionIndex}-compare-previous`)); + if (compareOption) { + const name = compareOption === 'LIVE' ? 'Live Version' : 'Previous Version'; + await this.page.getByRole('button', { exact: true, name }).filter({ visible: true }).click(); } // Wait for comparison modal to fully load data diff --git a/frontend/e2e/tests/flag-tests.pw.ts b/frontend/e2e/tests/flag-tests.pw.ts index 349fc63bd239..345bfdbe17f3 100644 --- a/frontend/e2e/tests/flag-tests.pw.ts +++ b/frontend/e2e/tests/flag-tests.pw.ts @@ -221,14 +221,11 @@ test.describe('Flag Tests', () => { })).toHaveCount(0, { timeout: LONG_TIMEOUT }) log('Enable archived filter') - // Click on Tags filter button - await click(byId('table-filter-tags')) - - // Click on archived filter option - await clickByText(/^archived/, '.table-filter-item') - - // Close the filter dropdown - await click(byId('table-filter-tags')) + // The trigger's name includes the count of selected tags + const tagsFilter = page.getByRole('button', { name: /^Tags/ }) + await tagsFilter.click() + await page.getByRole('dialog', { name: 'Tags' }).getByRole('button', { name: 'archived' }).click() + await tagsFilter.click() log('Verify archived feature is now visible') // Wait for the features list to update and verify archived feature appears diff --git a/frontend/web/components/FeatureHistory.tsx b/frontend/web/components/FeatureHistory.tsx index d174bab8b70d..1544dadf3c21 100644 --- a/frontend/web/components/FeatureHistory.tsx +++ b/frontend/web/components/FeatureHistory.tsx @@ -174,7 +174,6 @@ const FeatureHistory: FC = ({ className='inline-modal table-filter inline-modal--sm right' > { setCompareToLive(true) @@ -187,7 +186,6 @@ const FeatureHistory: FC = ({ }} /> { setCompareToLive(false) diff --git a/frontend/web/components/tables/TableFilter/TableFilter.tsx b/frontend/web/components/tables/TableFilter/TableFilter.tsx index 8ee8e8cb4e6f..fc8c4fd02632 100644 --- a/frontend/web/components/tables/TableFilter/TableFilter.tsx +++ b/frontend/web/components/tables/TableFilter/TableFilter.tsx @@ -14,13 +14,11 @@ type TableFilterType = { dropdownTitle?: ReactNode | string className?: string children: ReactNode | ((close: () => void) => ReactNode) - 'data-test'?: string } const TableFilter: FC = ({ children, className, - 'data-test': dataTest, dropdownTitle, hideTitle, label, @@ -37,12 +35,6 @@ const TableFilter: FC = ({ renderTrigger={(props) => ( void - 'data-test'?: string } const markerIcon = (sortOrder?: SortOrder) => { @@ -28,28 +28,28 @@ const TableFilterItem: FC = ({ ...rest }) => { return ( - { - e.preventDefault() - onClick() - }} + // Toggled filter or the active sort option + aria-pressed={!!isActive} + onClick={onClick} className='table-filter-item' > - -
+ + {title} - {subtitle &&
{subtitle}
} -
-
- -
-
-
+ {subtitle && ( + {subtitle} + )} + + + +
) } diff --git a/frontend/web/components/tables/TableTagFilter.tsx b/frontend/web/components/tables/TableTagFilter.tsx index d11a9b676704..345b26eeae0c 100644 --- a/frontend/web/components/tables/TableTagFilter.tsx +++ b/frontend/web/components/tables/TableTagFilter.tsx @@ -58,7 +58,6 @@ const TableTagFilter: FC = ({ return (
Date: Thu, 26 Nov 2026 08:42:01 -0300 Subject: [PATCH 08/11] refactor(Tables): Size the filter panel and title in TableFilter's own styles Stops borrowing InlineModal's inline-modal--sm, inline-modal__title and inline-modal__list classes. Co-Authored-By: Claude Opus 5.5 --- .../web/components/tables/TableFilter/TableFilter.scss | 10 ++++++++++ .../web/components/tables/TableFilter/TableFilter.tsx | 4 ++-- frontend/web/components/tables/TableTagFilter.tsx | 2 +- frontend/web/components/tables/TableValueFilter.tsx | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/frontend/web/components/tables/TableFilter/TableFilter.scss b/frontend/web/components/tables/TableFilter/TableFilter.scss index deec79847da3..9fd886c4f74f 100644 --- a/frontend/web/components/tables/TableFilter/TableFilter.scss +++ b/frontend/web/components/tables/TableFilter/TableFilter.scss @@ -1,6 +1,16 @@ @import '../../../styles/variables'; @import '../../../styles/mixins/custom-scrollbar'; +// The anchored panel; the phone sheet sizes itself +.table-filter__panel { + min-width: 200px; + max-width: 355px; +} + +.table-filter__title { + font-size: var(--font-size-body-sm); +} + // The sheet sets these; the rows read them .table-filter__content { --table-filter-row: 0; diff --git a/frontend/web/components/tables/TableFilter/TableFilter.tsx b/frontend/web/components/tables/TableFilter/TableFilter.tsx index fc8c4fd02632..171296b7d3e9 100644 --- a/frontend/web/components/tables/TableFilter/TableFilter.tsx +++ b/frontend/web/components/tables/TableFilter/TableFilter.tsx @@ -31,7 +31,7 @@ const TableFilter: FC = ({ aria-label={label ?? (typeof title === 'string' ? title : 'Filter')} placement='bottom-end' // Width for the anchored panel; the phone sheet is full width - className='inline-modal--sm' + className='table-filter__panel' renderTrigger={(props) => ( = ({ })} > {!hideTitle && ( -
+
{dropdownTitle || title}
)} diff --git a/frontend/web/components/tables/TableTagFilter.tsx b/frontend/web/components/tables/TableTagFilter.tsx index 345b26eeae0c..9398df088819 100644 --- a/frontend/web/components/tables/TableTagFilter.tsx +++ b/frontend/web/components/tables/TableTagFilter.tsx @@ -100,7 +100,7 @@ const TableTagFilter: FC = ({ } > -
+
= ({ } > -
+
Date: Thu, 26 Nov 2026 08:44:13 -0300 Subject: [PATCH 09/11] refactor(Tables): Use BodyText for filter subtitles and empty messages Co-Authored-By: Claude Opus 5.5 --- .../components/tables/TableFilterItem/TableFilterItem.tsx | 5 ++++- frontend/web/components/tables/TableFilterOptions.tsx | 5 ++++- frontend/web/components/tables/TableTagFilter.tsx | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/frontend/web/components/tables/TableFilterItem/TableFilterItem.tsx b/frontend/web/components/tables/TableFilterItem/TableFilterItem.tsx index 7381bbe8bb54..db1104759438 100644 --- a/frontend/web/components/tables/TableFilterItem/TableFilterItem.tsx +++ b/frontend/web/components/tables/TableFilterItem/TableFilterItem.tsx @@ -4,6 +4,7 @@ import BareButton from 'components/base/forms/BareButton' import classNames from 'classnames' import { SortOrder } from 'common/types/requests' import './TableFilterItem.scss' +import { BodyText } from 'components/base/typography' type TableFilterItemType = { isActive?: boolean @@ -39,7 +40,9 @@ const TableFilterItem: FC = ({ {title} {subtitle && ( - {subtitle} + + {subtitle} + )} = ({ search /> {!filteredOptions?.length && ( -
No results
+ + No results + )}
)} diff --git a/frontend/web/components/tables/TableTagFilter.tsx b/frontend/web/components/tables/TableTagFilter.tsx index 9398df088819..afcc88de23c1 100644 --- a/frontend/web/components/tables/TableTagFilter.tsx +++ b/frontend/web/components/tables/TableTagFilter.tsx @@ -8,6 +8,7 @@ import TableFilterItem from './TableFilterItem' import Constants from 'common/constants' import { TagStrategy } from 'common/types/responses' import TagContent from 'components/tags/TagContent' +import { BodyText } from 'components/base/typography' type TableFilterType = { projectId: number @@ -116,7 +117,9 @@ const TableTagFilter: FC = ({ />
{filteredTags?.length === 0 && ( -
No tags
+ + No tags + )}
Date: Thu, 26 Nov 2026 08:59:00 -0300 Subject: [PATCH 10/11] test(E2E): Find the Value tab inside the feature drawer The features list's Value filter is now also a button named exactly Value. Co-Authored-By: Claude Opus 5.5 --- frontend/e2e/tests/flag-dependencies-test.pw.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/e2e/tests/flag-dependencies-test.pw.ts b/frontend/e2e/tests/flag-dependencies-test.pw.ts index 48f3ce1dfa2e..be24f3b5ea5f 100644 --- a/frontend/e2e/tests/flag-dependencies-test.pw.ts +++ b/frontend/e2e/tests/flag-dependencies-test.pw.ts @@ -79,7 +79,11 @@ test.describe('Flag Dependencies', () => { await expect( page.getByRole('button', { name: /0 of 1 prerequisites met/ }), ).toBeVisible() - await page.getByRole('button', { exact: true, name: 'Value' }).click() + // The features list behind the drawer has a Value filter too + await page + .locator('#create-feature-modal') + .getByRole('button', { exact: true, name: 'Value' }) + .click() await expect(servingOff).toBeVisible() await visualSnapshot(page, 'dependencies-blocked-value', testInfo) await page From 4a868645b6b7edc0f3706b8beaff4a9aa86aa0d8 Mon Sep 17 00:00:00 2001 From: Talisson Costa Date: Thu, 26 Nov 2026 09:03:51 -0300 Subject: [PATCH 11/11] refactor(Tables): Drop TableFilter's title slot Every filter but Tags hid it, and Tags used it for its strategy select, not a title. Tags now renders the select in its own content, so hideTitle and dropdownTitle go. Co-Authored-By: Claude Opus 5.5 --- .../tables/TableFilter/TableFilter.scss | 4 -- .../tables/TableFilter/TableFilter.tsx | 9 --- .../components/tables/TableFilterOptions.tsx | 2 - .../web/components/tables/TableSortFilter.tsx | 2 +- .../web/components/tables/TableTagFilter.tsx | 61 +++++++++---------- .../components/tables/TableValueFilter.tsx | 1 - 6 files changed, 29 insertions(+), 50 deletions(-) diff --git a/frontend/web/components/tables/TableFilter/TableFilter.scss b/frontend/web/components/tables/TableFilter/TableFilter.scss index 9fd886c4f74f..cd8a3e1cf843 100644 --- a/frontend/web/components/tables/TableFilter/TableFilter.scss +++ b/frontend/web/components/tables/TableFilter/TableFilter.scss @@ -7,10 +7,6 @@ max-width: 355px; } -.table-filter__title { - font-size: var(--font-size-body-sm); -} - // The sheet sets these; the rows read them .table-filter__content { --table-filter-row: 0; diff --git a/frontend/web/components/tables/TableFilter/TableFilter.tsx b/frontend/web/components/tables/TableFilter/TableFilter.tsx index 171296b7d3e9..be1a9b0a7fd3 100644 --- a/frontend/web/components/tables/TableFilter/TableFilter.tsx +++ b/frontend/web/components/tables/TableFilter/TableFilter.tsx @@ -10,8 +10,6 @@ type TableFilterType = { title: string | ReactNode // Names the filter when the title isn't plain text (it has a count) label?: string - hideTitle?: boolean - dropdownTitle?: ReactNode | string className?: string children: ReactNode | ((close: () => void) => ReactNode) } @@ -19,8 +17,6 @@ type TableFilterType = { const TableFilter: FC = ({ children, className, - dropdownTitle, - hideTitle, label, title, }) => { @@ -51,11 +47,6 @@ const TableFilter: FC = ({ 'table-filter__content--sheet': asSheet, })} > - {!hideTitle && ( -
- {dropdownTitle || title} -
- )} {typeof children === 'function' ? children(close) : children}
)} diff --git a/frontend/web/components/tables/TableFilterOptions.tsx b/frontend/web/components/tables/TableFilterOptions.tsx index 63100183c8d1..ed9a985bf3a7 100644 --- a/frontend/web/components/tables/TableFilterOptions.tsx +++ b/frontend/web/components/tables/TableFilterOptions.tsx @@ -9,7 +9,6 @@ import { BodyText } from 'components/base/typography' type TableFilterOptionsType = { title: ReactNode label?: string - dropdownTitle?: ReactNode | string className?: string isLoading?: boolean options: { label: string; value: string | number; subtitle?: string }[] @@ -46,7 +45,6 @@ const TableFilterOptions: FC = ({ {(close) => ( diff --git a/frontend/web/components/tables/TableSortFilter.tsx b/frontend/web/components/tables/TableSortFilter.tsx index e553fdf55b6b..b932c95bb022 100644 --- a/frontend/web/components/tables/TableSortFilter.tsx +++ b/frontend/web/components/tables/TableSortFilter.tsx @@ -35,7 +35,7 @@ const TableSortFilter: FC = ({ } return (
- + {options.map((sortOption, i) => { const isActive = sortOption?.value === value?.sortBy return ( diff --git a/frontend/web/components/tables/TableTagFilter.tsx b/frontend/web/components/tables/TableTagFilter.tsx index afcc88de23c1..68c170f63f40 100644 --- a/frontend/web/components/tables/TableTagFilter.tsx +++ b/frontend/web/components/tables/TableTagFilter.tsx @@ -61,39 +61,6 @@ const TableTagFilter: FC = ({ -
- ({ + ...base, + height: 18, + }), + }} + onChange={(v) => { + if (v) onChangeStrategy(v.value) + }} + value={{ + label: tagStrategy === 'INTERSECTION' ? 'Has all' : 'Has some', + value: tagStrategy, + }} + options={[ + { + label: 'Has all', + value: 'INTERSECTION', + }, + { + label: 'Has some', + value: 'UNION', + }, + ]} + /> +
= ({ Value{' '}