fix(smi-table): optimize row rendering with memoized rows#7618
fix(smi-table): optimize row rendering with memoized rows#7618Manishnemade12 wants to merge 7 commits intolayer5io:masterfrom
Conversation
Signed-off-by: Manishnemade12 <mnemade140@gmail.com>
|
@rishiraj38 Can you please review this pr |
rishiraj38
left a comment
There was a problem hiding this comment.
Good catch on extracting TableRow to fix the state mutation!
One issue though: dynamically generating the tooltip IDs (react-tooltip-${rowIndex}) broke the tooltips on the checkmarks/crosses since those are still hardcoded to look for react-tooltip. Also, rendering a <Tooltip> component per row can causes severe DOM bloat.
|
@rishiraj38 following changes i did as per your suggestion
|
Signed-off-by: Manishnemade12 <mnemade140@gmail.com>
rishiraj38
left a comment
There was a problem hiding this comment.
Nice work! 👍 This makes a lot of sense — moving the collapse state into each row instead of keeping it all at the parent level should fix that laggy feeling when clicking through large tables.
|
@Manishnemade12 did you get any input from today meeting? |
|
@saurabhraghuvanshii i addressed your all comments , please take review once |
Signed-off-by: Manishnemade12 <mnemade140@gmail.com>
|
Preview deployment for PR #7618 removed. This PR preview was automatically pruned because we keep only the 6 most recently updated previews on GitHub Pages to stay within deployment size limits. If needed, push a new commit to this PR to generate a fresh preview. |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR targets the SMI table’s interaction performance by extracting row rendering into a memoized component and moving collapse state from the table-level into each row.
Changes:
- Introduced a
TableRowcomponent (wrapped withReact.memo) to isolate row rendering. - Moved collapse state to per-row local state (
useState) to prevent whole-table re-renders on toggle. - Centralized the tooltip instance via a shared
TOOLTIP_ID.
|
@Manishnemade12 Please address all comments. |
Signed-off-by: Manishnemade12 <mnemade140@gmail.com>
|
@saurabhraghuvanshii i addressed all comments . can you please review it now |
Signed-off-by: Manishnemade12 <mnemade140@gmail.com>
|
@Manishnemade12 LGTM. Could you please verify that your changes are working as expected? if possible attach a video |
Summary
This PR resolves the SMI table rendering performance issue by isolating row rendering and collapse state per row.
Closes : #7613
What changed
TableRowcomponent insrc/components/SMI-Table/index.js.TableRowwithReact.memo()to reduce unnecessary row re-renders.useState(false)) insideTableRow.Why this improves performance
Scope
src/components/SMI-Table/index.jsValidation