Skip to content

fix(channels): prevent ChannelsTypeTabs from wrapping on small screens#1206

Merged
looplj merged 1 commit intolooplj:release/v0.9.xfrom
nb5p:release/v0.9.x
Mar 28, 2026
Merged

fix(channels): prevent ChannelsTypeTabs from wrapping on small screens#1206
looplj merged 1 commit intolooplj:release/v0.9.xfrom
nb5p:release/v0.9.x

Conversation

@nb5p
Copy link
Copy Markdown
Contributor

@nb5p nb5p commented Mar 28, 2026

Prevent ChannelsTypeTabs from wrapping on small screens. Switch to a single-row horizontal scroll layout with mouse wheel support.
CleanShot 2026-03-28 at 16 33 21

On small screens with many channel types, the type filter tabs wrapped
into multiple rows, consuming excessive vertical space. Switch to a
single-row horizontal scroll layout with mouse wheel support.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Copy link
Copy Markdown
Contributor

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

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 updates the ChannelsTypeTabs component to enable horizontal scrolling across all screen sizes by replacing the responsive wrapping behavior with a non-wrapping flex container. It also introduces a wheel event handler to allow horizontal scrolling via the mouse wheel. A review comment suggests refining this handler to prevent simultaneous vertical page scrolling and to ensure it only intercepts events when horizontal overflow is actually present.

<div className='mb-6 w-full overflow-hidden'>
<div
className='hide-scroll flex flex-nowrap items-center gap-2 overflow-x-auto scroll-smooth'
onWheel={(e) => { e.currentTarget.scrollLeft += e.deltaY; }}
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.

medium

The current onWheel implementation can lead to a confusing user experience. It causes the page to scroll vertically at the same time as the tabs scroll horizontally. It also intercepts mouse wheel events even when there's no horizontal overflow, preventing normal page scroll.

To improve this, you should prevent the default scroll behavior and only apply the horizontal scroll when the content is actually scrollable.

Suggested change
onWheel={(e) => { e.currentTarget.scrollLeft += e.deltaY; }}
onWheel={(e) => { if (e.currentTarget.scrollWidth > e.currentTarget.clientWidth) { e.preventDefault(); e.currentTarget.scrollLeft += e.deltaY; } }}

@looplj looplj merged commit 8c2ebc7 into looplj:release/v0.9.x Mar 28, 2026
2 checks passed
NekoNuo pushed a commit to NekoNuo/axonhub that referenced this pull request Mar 28, 2026
looplj#1206)

On small screens with many channel types, the type filter tabs wrapped
into multiple rows, consuming excessive vertical space. Switch to a
single-row horizontal scroll layout with mouse wheel support.

Co-authored-by: nb5p <[email protected]>
Co-authored-by: Claude Sonnet 4.6 <[email protected]>
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