Skip to content

feat(data-weaver): Import/export menus are made responsive on narrow screens. - #456

Merged
pablonoel merged 6 commits into
datacommonsorg:mainfrom
pablonoel:ui-export_import
Sep 1, 2026
Merged

feat(data-weaver): Import/export menus are made responsive on narrow screens.#456
pablonoel merged 6 commits into
datacommonsorg:mainfrom
pablonoel:ui-export_import

Conversation

@pablonoel

@pablonoel pablonoel commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Overview

Import/export menus are made responsive on narrow screens.

Changes Made

export_responsive

Scrolling now happens in a dedicated inner container so rounded menus keep their scrollbar clipped inside the container as per other components do.

Keeps floating menus inside the viewport by clamping their horizontal position and max-height based on the trigger and window bounds.

Testing Done

Describe the steps you took to test these changes (please also list commands ran if possible).

  • Unit tests passed
  • Integration tests passed
  • Manual verification

Checklist

  • I have followed the style guidelines of this project.
  • I have commented my code, particularly in hard-to-understand areas.
  • My changes generate no new warnings.

Note: Only Maintainers can approve and merge PRs. Expected initial review time: 3 business days.

Import/export menus are made responsive on narrow screens.

Keeps floating menus inside the viewport by clamping their horizontal position and max-height based on the trigger and window bounds.

Scrolling now happens in a dedicated inner container so rounded menus keep their scrollbar clipped inside the container as per other componetns do.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request improves the responsiveness and positioning of the menu component on narrow screens by dynamically clamping its position and height using a useLayoutEffect hook, wrapping its children in a scrollable container, and updating the export and import menu styles to use responsive widths. Feedback on these changes suggests optimizing the resize event handler in the useLayoutEffect hook with requestAnimationFrame to avoid layout thrashing, and removing redundant flex-shrink: 0 properties from the header and content containers of the export and import menus since their parent is no longer a flex container.

Comment thread dataweaver/apps/web/src/components/elements/menu.tsx
Use requestAnimationFrame to debounce the menu resize handler in MenuWithPrefersMotion and cancel the pending frame on cleanup to prevent layout thrash and stale callbacks. Remove redundant `flex-shrink: 0` rules from export/import menu styles so header and content containers can shrink correctly.
@pablonoel pablonoel changed the title Import/export menus are made responsive on narrow screens. feat(Data-Weaver): Import/export menus are made responsive on narrow screens. Aug 31, 2026
@pablonoel pablonoel changed the title feat(Data-Weaver): Import/export menus are made responsive on narrow screens. feat(data-weaver): Import/export menus are made responsive on narrow screens. Aug 31, 2026
Import ReactNode and reformat React imports; cast children as ReactNode in Menu to satisfy TypeScript typing. This adjusts the import block and adds an explicit children cast in dataweaver/apps/web/src/components/elements/menu.tsx to prevent type errors during compilation.
@pablonoel
pablonoel merged commit bcd26fd into datacommonsorg:main Sep 1, 2026
11 checks passed
@pablonoel
pablonoel deleted the ui-export_import branch September 1, 2026 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants