Repository navigation
Conversation
IzumiSy
marked this pull request as ready for review
October 29, 2026 05:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
DataTable combines rendering, filtering, cell editing, browser measurement, and table-level state in a few oversized files. This makes individual features difficult to navigate and changes harder to review without reading unrelated behavior.
The largest test suites also mix unrelated feature contracts. Aligning test ownership with the implementation boundaries makes the relevant assertions easier to find for both human and AI-assisted changes, without reducing integration coverage.
Split these responsibilities into cohesive internal modules while keeping the existing public API, rendered output, persistence, and interaction behavior unchanged.
Design Decision
Keep feature ownership explicit
Group filtering and editing in feature-local directories with short filenames. Keep shared cell-value helpers outside editing because read-only renderers use them too, and keep the sticky column footer separate from the public pagination/bulk-action footer.
Nest the cell dispatcher, shared UI, editor branches, and related tests under
editing/cell/. Useroot.tsx,typing.tsx,choice.tsx, anddate.tsxwithout repeating the directory's cell context in filenames. Navigation and edit-session hooks remain directly underediting/.Extract existing state and measurement logic rather than introducing a generic state framework or additional providers. The public DataTable namespace and useDataTable return shape remain unchanged.
Match tests to behavior, not arbitrary file size
Retain public-composition harnesses and organize suites around meaningful features: menus, headers, column layout, cell rendering, row expansion, filter surfaces, and editor input modes. Reuse the existing selection, styling, choice, and date suites instead of introducing parallel destinations for the same concern.
Keep table-level state and composition checks in
data-table.test.tsx, cross-surface filter IME behavior infilters/filters.test.tsx, and cross-editor interactions inediting/cell/root.test.tsx. Share only repeated fixtures and interaction helpers; test lifecycle cleanup stays explicit in each suite.Preserve existing cases and assertions rather than replacing integration coverage with isolated unit tests. Leave the snapshot-bearing footer test at the family root so its snapshot path and contents remain unchanged.
Summary
filters/and cell UI with matching tests intoediting/cell/, while keeping navigation and edit-session hooks atediting/.