Skip to content

fix: Table editor no longer rebuilds all rows and the search index on every change - #2625

Draft
bprusinowski wants to merge 1 commit into
feat/table-abbreviationsfrom
fix/table-editor-performance
Draft

bprusinowski wants to merge 1 commit into
feat/table-abbreviationsfrom
fix/table-editor-performance

Conversation

@bprusinowski

Copy link
Copy Markdown
Member

Not tied to a GitLab issue: large tables (e.g. "Popular initiatives", ~10k rows × 24 columns) froze the editor for over a second after every change.

This PR:

  • keeps the same chartData array in useChartData when no interactive filter applies, so config changes that don't touch the data (e.g. opening column options) no longer copy every row and rebuild everything downstream; combo charts now sort a copy instead of sorting chartData in place
  • memoizes the column types in table-state.tsx, which were rebuilt on every render and forced react-table to regroup and re-sort all rows
  • builds the table search index on the first search instead of with the table (search results unchanged, still tokenize: "full")
  • measures column widths once per distinct value, and no longer on every width or option change

Editor long tasks on "Popular initiatives" (dev build, Chromium):

Action Before After
Open column options 1,471 ms 601 ms
Tick "Hide column" 1,484 ms 747 ms
Close column options 1,282 ms 598 ms
First search 235 ms 804 ms

Most of what remains in dev (~450 ms) is @urql/devtools, which isn't in production builds. The first search now pays for building the index.

How to test

  1. Create a table chart from "Popular initiatives".
  2. Open and close a column's options, tick "Hide column", or scroll the table: the editor no longer freezes.
  3. Turn on search and search for "initiative": rows with "Volksinitiative" still match.

  • I added a CHANGELOG entry
  • I made a self-review of my own code
  • I wrote tests for the changes (if applicable)
  • I wrote configurator and chart config migrations (if applicable)

@vercel

vercel Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
visualization-tool Error Error Nov 27, 2026 12:37pm UTC

Request Review

This branch had an error being deployed

1 failed deployment
Preview — 5b4538a7 Deployed Nov 27, 2026 by vercel[bot]
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.

1 participant