Add native queries and remove react-container-query#1504
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Replaces the react-container-query dependency with an internal ResizeObserver-based hook to detect the editor container’s “desktop” breakpoint (720px) while keeping the existing CSS container-query layout behavior and editor/output resizing UX.
Changes:
- Removed
react-container-query(and related transitive packages) and deleted the now-unusedcontainerQueries.jshelper. - Added
useContainerMinWidthhook to detect whether a container meets a minimum width threshold. - Updated
Projectto use the new hook and extended unit tests to cover the desktop vs stacked resize-handle behavior.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| package.json | Removes react-container-query dependency. |
| yarn.lock | Drops react-container-query and now-unused transitive dependencies. |
| src/utils/containerQueries.js | Removes obsolete container-query config helper. |
| src/hooks/useContainerMinWidth.js | Introduces internal container min-width detection hook using ResizeObserver. |
| src/hooks/useContainerMinWidth.test.js | Adds unit tests for the new hook behavior and cleanup. |
| src/components/Editor/Project/Project.jsx | Switches breakpoint logic from useContainerQuery to useContainerMinWidth(720). |
| src/components/Editor/Project/Project.test.js | Mocks the new hook and adds assertions for the desktop resize handle/style behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
DNR500
approved these changes
Jun 19, 2026
DNR500
left a comment
Contributor
There was a problem hiding this comment.
Nice thanks for doing this!
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.
Summary
react-container-querywith a small internalResizeObserverhook for the editor container breakpoint.50%width /100%height100%width /50%heightcontainerQueries.jshelper and thereact-container-querydependency.