Skip to content

Extend table component#1

Open
adrianSepiol wants to merge 3 commits intomainfrom
extend-table-component
Open

Extend table component#1
adrianSepiol wants to merge 3 commits intomainfrom
extend-table-component

Conversation

@adrianSepiol
Copy link
Copy Markdown
Owner

Description

Screenshots

Checklist

  • Pull request has a descriptive title and context useful to a reviewer.
  • Pull request title follows the [<catalog_entry>] <commit message> naming convention using one of the
    following catalog_entry values: FEATURE, ENHANCEMENT, BUGFIX, BREAKINGCHANGE, DOC,IGNORE.
  • All commits have DCO signoffs.

UI Changes

  • Changes that impact the UI include screenshots and/or screencasts of the relevant changes.
  • Code follows the UI guidelines.
  • E2E tests are stable and unlikely to be flaky.
    See e2e docs for more details. Common issues include:
    • Is the data inconsistent? You need to mock API requests.
    • Does the time change? You need to use consistent time values or mock time utilities.
    • Does it have loading states? You need to wait for loading to complete.

…e component

Signed-off-by: Adrian Sepiół <adisepko@gmail.com>
Signed-off-by: Adrian Sepiół <adisepko@gmail.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the components/src/Table component to support additional UX/features (fuzzy global search, column visibility toggling, and support for sub-rows/expansion) and broadens some table API types.

Changes:

  • Add fuzzy global search support via a new useFuzzySearch hook and a toolbar search input.
  • Add a column-visibility UI (“Columns” menu) and initial hidden-columns support.
  • Extend table API/types (e.g., width accepts string, getSubRows, and export TanStack pagination/sorting types).

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
package-lock.json Adds lockfile entries for @tanstack/match-sorter-utils and remove-accents.
components/package.json Adds @tanstack/match-sorter-utils dependency.
components/src/Table/model/table-model.ts Extends TableProps/TableColumnConfig for new features and types.
components/src/Table/index.ts Re-exports TanStack sorting/pagination state types.
components/src/Table/hooks/useFuzzySearch.ts Introduces fuzzy global filter hook/options for TanStack table.
components/src/Table/TableToolbar.tsx Adds toolbar UI for search + column visibility toggling.
components/src/Table/VirtualizedTable.tsx Renders the new toolbar and switches to visible columns for rendering.
components/src/Table/Table.tsx Wires up global filter + column visibility state into TanStack table instance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +84 to +89
aria-haspopup="listbox"
aria-expanded={colMenuOpen}
>
Columns
</Button>
<Menu
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

The button is wired to open a MUI Menu, but aria-haspopup is set to listbox. For accessibility semantics this should be menu/true and ideally include aria-controls pointing at the menu id so assistive tech can associate the trigger with the popup.

Suggested change
aria-haspopup="listbox"
aria-expanded={colMenuOpen}
>
Columns
</Button>
<Menu
aria-haspopup="menu"
aria-expanded={colMenuOpen}
aria-controls={colMenuOpen ? 'table-toolbar-columns-menu' : undefined}
>
Columns
</Button>
<Menu
id="table-toolbar-columns-menu"

Copilot uses AI. Check for mistakes.
Comment on lines +78 to +82
const { globalFilter, setGlobalFilter, fuzzySearchOptions } = useFuzzySearch<TableData>(showSearch);

const [columnVisibility, setColumnVisibility] = useState<VisibilityState>(
hiddenColumns?.reduce((acc, columnId) => ({ ...acc, [columnId]: false }), {}) ?? {}
);
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

New behavior is introduced for global fuzzy search (showSearch/globalFilter) and column visibility (showColumnFilter/hiddenColumns), but there are no corresponding tests in Table.test.tsx. Please add coverage to verify: (1) enabling showSearch filters rows based on the query, (2) enabling showColumnFilter can hide/show a column and affects rendered headers/cells, and (3) hiddenColumns hides the expected columns on initial render.

Copilot uses AI. Check for mistakes.
Comment on lines +24 to +27
export interface UseFuzzySearchResult<TableData> {
globalFilter: string;
setGlobalFilter: (value: string) => void;
fuzzySearchOptions: Pick<
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

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

UseFuzzySearchResult.setGlobalFilter is typed as (value: string) => void, but the actual setter returned by useState also supports functional updates ((prev) => next). Exposing the narrower type can unnecessarily restrict callers and is inconsistent with TanStack’s onGlobalFilterChange updater signature. Consider typing it as React.Dispatch<React.SetStateAction<string>> (or OnChangeFn<string> from TanStack) instead.

Copilot uses AI. Check for mistakes.
Signed-off-by: Adrian Sepiół <adisepko@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants