Skip to content

fix: home page custom content card overflows on narrow viewports - #42084

Open
byteayan wants to merge 2 commits into
RocketChat:developfrom
byteayan:fix/home-card-controls-mobile-overflow
Open

byteayan wants to merge 2 commits into
RocketChat:developfrom
byteayan:fix/home-card-controls-mobile-overflow

Conversation

@byteayan

@byteayan byteayan commented Sep 9, 2026 •

Copy link
Copy Markdown

Proposed changes (including videos or screenshots)

The custom content card on the home page renders three action buttons inside CardControls. That container is a flex row without flex-wrap, so on narrow viewports the buttons stay on one line, the card stretches past the edge of the screen, and the third button is cut off.

Before After
Third button clipped at the right edge of the viewport All three buttons wrapped inside the card

Both captured on the admin home page at 414 x 896, the iPhone X viewport. Measured from the rendered page:

  • Before: the card is 524px wide inside a 414px viewport, the controls sit on one 32px row, and the last button's right edge lands at 504px.
  • After: the card is 366px wide, the controls wrap onto two rows totalling 72px, and the last button's right edge lands at 343px.

This change wraps the three buttons in a ButtonGroup with the wrap prop. Fuselage already styles .rcx-button-group--wrap with flex-wrap: wrap, so the buttons move onto a second line when the card is too narrow to fit them on one.

ButtonGroup is what fuselage documents for "grouping buttons that semantically share a common action context", which describes these three. It also renders role="group", so the grouping is exposed to assistive technology. TagList.tsx and MarketplaceHeader.tsx already use the same prop.

I fixed this on the app side because the root cause is in fuselage and has not been released. RocketChat/fuselage#1440 tracks the missing flex-wrap on .rcx-card__controls and RocketChat/fuselage#2074 proposes adding it. Both are open, and 0.88.0, the version this repository depends on, does not contain the fix. If that PR lands, the ButtonGroup here remains correct and can be simplified later if maintainers prefer.

Issue(s)

Closes #42083

Steps to test or reproduce

  1. Sign in as a user with the admin role.
  2. Open the home page.
  3. Open browser devtools and switch to a mobile viewport, for example iPhone X at 414 x 896.
  4. Scroll to the custom content card at the end of the card group.

Before this change the third button is clipped at the edge of the screen. After it the buttons wrap onto a second line and stay inside the card.

Further comments

Only the admin branch of CustomContentCard changes. The other branches render no controls, so they are unaffected. No unit or e2e test covers this component today.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Fixed horizontal overflow of custom content cards on narrow screens.
    • Custom content action buttons now wrap onto multiple lines when needed, keeping the controls within the card’s available width on smaller viewports. The controls retain their existing labels and behavior while adapting their layout to fit. This improves the card’s presentation across screen sizes without changing its available actions.

The custom content card renders three action buttons inside CardControls,
which is a flex container without flex-wrap in fuselage 0.88.0. On narrow
viewports the buttons stay on one line and overflow the card.

Group the buttons in a ButtonGroup with the wrap prop, which fuselage
already styles with flex-wrap: wrap, so they wrap inside the card.
@byteayan
byteayan requested a review from a team as a code owner September 9, 2026 18:02
@dionisio-bot

dionisio-bot Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot

changeset-bot Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9ad0248

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@CLAassistant

CLAassistant commented Sep 9, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@coderabbitai

coderabbitai Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The custom content card now places its three admin controls in a wrapping button group. A changeset records a patch release for @rocket.chat/meteor.

Changes

Custom content card controls

Layer / File(s) Summary
Wrap custom content card actions
apps/meteor/client/views/home/cards/CustomContentCard.tsx, .changeset/home-custom-content-card-controls-wrap.md
The three admin controls now use a wrapping ButtonGroup; their conditions, labels, titles, and handlers remain unchanged. The changeset records a patch release and describes the overflow fix.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested labels: type: bug

Suggested reviewers: dougfabris, tassoevan

Merge Risk: Minimal · up to 9ad02

The change enables wrapping for the admin controls without changing their behavior. No actionable merge-blocking risk remains; narrow-viewport rendering was not tested.

Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the bug (home page custom content card overflowing on narrow viewports), and the changeset targets that exact bug. The raw summary says the change wraps the three admin controls in a B…
Linked Issues check Passed Issue #42083 requires the three action buttons in the home page custom content card to wrap onto multiple lines and stay inside the card on narrow viewports, without clipping or horizontal page scroll…
Out of Scope Changes check Passed The whole-PR diff against the merge base touches two files. CustomContentCard.tsx changes only the admin branch: it adds the ButtonGroup import, wraps the existing three Button elements in ButtonGroup…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Title check

Explanation

The title names the bug (home page custom content card overflowing on narrow viewports), and the changeset targets that exact bug. The raw summary says the change wraps the three admin controls in a ButtonGroup so they stay inside the card on narrow screens, and the linked issue #42083 asks for the same fix. The title names the main change and the affected component area, so it passes.

Full details: Linked Issues check

Explanation

Issue #42083 requires the three action buttons in the home page custom content card to wrap onto multiple lines and stay inside the card on narrow viewports, without clipping or horizontal page scroll. At the reviewed head, apps/meteor/client/views/home/cards/CustomContentCard.tsx wraps the three admin buttons (Customize_Content, Show/Hide On Workspace, Show Only This Content) in <ButtonGroup wrap>, imported from @rocket.chat/fuselage. The issue states that fuselage styles the wrap variant with flex-wrap: wrap, so the buttons can move to a second line inside the CardControls flex container. Button labels, conditions, titles, and handlers are unchanged. The issue does not request automated tests, and the only coding requirement is the wrapping behavior. The author's before and after measurements (card width 524px to 366px; last button right edge 504px to 343px) are reported in the PR description. I did not reproduce these measurements, and the fuselage stylesheet was not inspected directly. The layout outcome rests on the issue's stylesheet evidence and the author's measurements.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff against the merge base touches two files. CustomContentCard.tsx changes only the admin branch: it adds the ButtonGroup import, wraps the existing three Button elements in ButtonGroup wrap, and re-indents them. The non-admin branches are unchanged. The second file is .changeset/home-custom-content-card-controls-wrap.md, a patch changeset describing this fix. This is a standard repository convention and is connected to the change. No unrelated behavior, refactoring, or other components are modified.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Errors were encountered while retrieving linked issues.

Errors: 1

  • JIRA integration encountered authorization issues. Please disconnect and reconnect the integration in the CodeRabbit UI.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f2d1eaf2-2308-41cc-9093-81078f85cf15
Commits

Reviewing files that changed from the base of the PR and between e82540c and 9ad0248.

Files selected for processing: 1

  • apps/meteor/client/views/home/cards/CustomContentCard.tsx
Files skipped from review as they are similar to previous changes: 1

  • apps/meteor/client/views/home/cards/CustomContentCard.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 2 files

Re-trigger cubic

@byteayan

Copy link
Copy Markdown
Author

Hi! I've signed the CLA, and the code changes are ready. Could someone approve the pending CI workflows and assign the appropriate milestone? Happy to make any changes if needed during review. Thanks!

develop renamed the buttons' medium prop to size='medium' and moved
useIsEnterprise into @rocket.chat/ui-client, so CardControls was rewritten
around those. Kept develop's version and reapplied the ButtonGroup wrapper
that lets the three actions wrap instead of overflowing.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Home page custom content card overflows horizontally on narrow viewports

2 participants