[UI] Table field refactor#12274
Merged
SchrodingersGat merged 47 commits intoJun 30, 2026
Merged
Conversation
- preventing shallow comparison from working
✅ Deploy Preview for inventree-web-pui-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
1 task
matmair
approved these changes
Jun 29, 2026
matmair
left a comment
Member
There was a problem hiding this comment.
LGTM; this will require change on any plugins that use tables; right?
Comment on lines
+5
to
+9
| /** | ||
| * A custom hook that logs the previous and current props of a component whenever it updates. | ||
| */ | ||
| export function useWhyDidYouUpdate(name: string, props: any) { | ||
| const previousProps = useRef({}); |
Member
There was a problem hiding this comment.
Maybe this should be mentioned in the docs?
|
|
||
| return { | ||
| items: stockItems, | ||
| model: ModelType.stockitem, |
Member
There was a problem hiding this comment.
imo this could be helpful info in the future for plugins / customisation and should not cause re-renders
Member
Author
Yes, marked as breaking now. And I'll update the CHANGELOG |
martonmiklos
pushed a commit
to martonmiklos/InvenTree
that referenced
this pull request
Jun 30, 2026
* Use callback funcs * Don't use idx to identify rows * Add debug function for finding why a component re-rendered * Do not pass 'control' through to each row * Prevent unnecessary re-rendering of table rows * Adjust order of operations for hooks * Keep props hidden * Use lightweight NumberInput * Use NumberInput elsewhere * Add comment * use rowId instead of idx * Generic row memos * Compare errors too * Fix for BomItemSubstituteRow * Adjust more forms * memoize quantity * Memoize build lines * Fix re-rendering issues for build allocation * Fix for useConsumeBuildLinesForm * Fix for transfer order table * Fix useReceiveLineItems * Remove memoized pattern * Fix row keys * Cleanup * Create useStockItems hook for memoizing items * Refactoring * More refactoring * Remove obj reference - preventing shallow comparison from working * Add error message to useWhyDidYouUpdate * Cleanup * Cleanup dead code * Adjust modal width * Change attr name * Remove autoFillFilters prop * Adjustments for serialized stock * Fix typing * Bump frontend version * Adjustments for playwright testing * Fix ref issue * Remove debug entry * Update CHANGELOG.md * Reintroduce index to table header * Refactor common component
martonmiklos
pushed a commit
to martonmiklos/InvenTree
that referenced
this pull request
Jun 30, 2026
* Use callback funcs * Don't use idx to identify rows * Add debug function for finding why a component re-rendered * Do not pass 'control' through to each row * Prevent unnecessary re-rendering of table rows * Adjust order of operations for hooks * Keep props hidden * Use lightweight NumberInput * Use NumberInput elsewhere * Add comment * use rowId instead of idx * Generic row memos * Compare errors too * Fix for BomItemSubstituteRow * Adjust more forms * memoize quantity * Memoize build lines * Fix re-rendering issues for build allocation * Fix for useConsumeBuildLinesForm * Fix for transfer order table * Fix useReceiveLineItems * Remove memoized pattern * Fix row keys * Cleanup * Create useStockItems hook for memoizing items * Refactoring * More refactoring * Remove obj reference - preventing shallow comparison from working * Add error message to useWhyDidYouUpdate * Cleanup * Cleanup dead code * Adjust modal width * Change attr name * Remove autoFillFilters prop * Adjustments for serialized stock * Fix typing * Bump frontend version * Adjustments for playwright testing * Fix ref issue * Remove debug entry * Update CHANGELOG.md * Reintroduce index to table header * Refactor common component
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.

Closes #11425
Breaking Change
Any custom plugins which use "table" field types in UI forms will need to adjust to match the new configuration. A unique ID value is required for each row.
Description
This PR addresses a major design inefficiency in the way that "table fields" are rendered in the user interface. It fixes a number of structural problems:
These issues were largely caused by:
Performance Comparison
Before Refactor
before.mp4
After Refactor
after.mp4