fix: clean up renderer errors - #8337
Conversation
|
Assigned |
There was a problem hiding this comment.
Pull request overview
This PR targets cleanup of renderer-side React/Emotion warnings in Compass by preventing invalid prop leakage to DOM nodes, ensuring stable React keys, and avoiding state updates after unmount.
Changes:
- Prevent React state updates on unmounted components in the collections/databases tables by disabling
react-table’s automatic page-index reset. - Remove invalid/non-DOM props from tab title rendering and ensure tab drawer rendering uses stable keys to eliminate React warnings.
- Guard the Firefox-only range-thumb CSS rule to avoid Emotion
insertRulefailures in non-Firefox engines.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/databases-collections-list/src/items-table.tsx | Disables autoResetPageIndex to avoid post-unmount state updates from table internals. |
| packages/compass-crud/src/stores/crud-store.ts | Renames internal collection field to collectionModel and updates usage site. |
| packages/compass-components/src/components/resize-handle.tsx | Wraps Firefox-specific slider thumb styling in a feature query to reduce insertRule errors. |
| packages/compass-collection/src/plugin-tab-title.tsx | Prevents tabId/subTab (and dispatch) from being forwarded via prop spreads to the tab element. |
| packages/compass-collection/src/components/collection-tab.tsx | Adds stable keys when rendering tab drawers to eliminate React list key warnings. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| // The workspace props below are not valid DOM attributes and would end up | ||
| // on the tab element through the spread of the remaining props. | ||
| tabId: _tabId, | ||
| subTab: _subTab, |
There was a problem hiding this comment.
Why do we allow to pass them to the component if they are not valid dom attributes and not used by anything else?
There was a problem hiding this comment.
workspace-tab-context-provider.tsx#L115 is where we wrap this component and pass these props to this component. I am not sure why we are doing that though.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Description
When running Compass, there's lot of errors from react/emotion. I fed all of that to Claude and it came up with these fixes.
Warning: Each child in a list should have a unique "key" prop.Warning: React does not recognize the 'tabId' prop on a DOM element.There was a problem inserting the following rule: ".leafygreen-ui-b4u0dq::-moz-range-thumb{width:0;height:0;}" SyntaxError: Failed to execute 'insertRule' on 'CSSStyleSheet'Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.Not attaching event collection; key already exists console.<computed>Checklist
Motivation and Context
Open Questions
Dependents
Types of changes