Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue: #963 UI Overflow on Mobile for Home page #1030

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

KaranNegi20Feb
Copy link
Contributor

Describe the bug:
The page width and the container width do not match properly, causing horizontal overflow on mobile devices.

Fix results:
Screenshot 2025-03-07 at 12 17 35 AM

Fix_mobile.mov

Copy link
Contributor

coderabbitai bot commented Mar 6, 2025

Summary by CodeRabbit

  • Refactor

    • Overhauled the Home page structure to streamline the layout and improve content organization, including revised sections for events, chapters, projects, and contributor displays.
    • Updated rendering logic for issues and releases to enhance how comments and details are presented.
  • Style

    • Applied improved spacing and dark mode adjustments for a cleaner, more consistent visual presentation.

Walkthrough

This pull request applies significant layout and component restructuring in the Home page. The outer container now features updated styling, including new margin, padding, and dark mode adjustments. The internal composition is reorganized with new wrappers and conditional rendering enhancements for event details, contributor counts, and comments. Specific sections like "Upcoming Events", "New Chapters", and "New Projects" have been restructured and merged accordingly, while the display of logos has been repositioned. No changes were made to any exported or public declarations.

Changes

File(s) Summary of Changes
frontend/src/pages/Home.tsx - Updated outer <div> styling (margin, padding, dark mode background)
- Reorganized main content structure with new wrapper maintaining max width
- Revised layout for "Upcoming Events" via SecondaryCard with conditional date rendering
- Merged and restructured "New Chapters" and "New Projects" sections
- Updated formatting in mapping over recent chapters and projects by removing the capitalization function
- Reduced TopContributors initial display from 9 to 6
- Enhanced conditional rendering in ItemCardList for comments count
- Repositioned MovingLogos within a new layout

Suggested reviewers

  • kasya
  • arkid15r
  • aramattamara

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7020e31 and ab7f5b9.

📒 Files selected for processing (1)
  • frontend/src/pages/Home.tsx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: Run frontend unit tests
  • GitHub Check: CodeQL (python)
  • GitHub Check: Run frontend e2e tests
  • GitHub Check: Run backend tests
  • GitHub Check: CodeQL (javascript-typescript)
🔇 Additional comments (7)
frontend/src/pages/Home.tsx (7)

113-114: Great improvement to the main container.

The addition of padding, maximum width constraint, and proper dark mode styling will help prevent the horizontal overflow issue on mobile devices. The max-w-6xl with mx-auto properly centers and constrains the content.


115-115: Fix duplicate padding-top property.

There are two padding-top (pt-) classes. Only the last one applied (pt-5) will take effect, making pt-20 redundant.

- <div className="pt-20 pt-5 text-center sm:mb-20">
+ <div className="pt-5 md:pt-20 text-center sm:mb-20">

133-154: Good responsive grid implementation for events.

The 3-column grid layout for events using md:grid-cols-3 appropriately stacks on mobile and expands on larger screens, which helps address the overflow issue.


156-208: Well-structured two-column layout for chapters and projects.

This responsive layout with md:grid-cols-2 is a good approach that resolves the mobile overflow issue while maintaining a clean, organized display on larger screens.


217-217: Improve grid responsiveness setup.

The current implementation uses grid-cols-2 but only applies the grid layout on large screens with lg:grid. This could cause layout inconsistencies. For better responsiveness, explicitly define the grid and its column behavior.

- <div className="grid-cols-2 gap-4 lg:grid">
+ <div className="grid grid-cols-1 gap-4 lg:grid-cols-2">

247-256: Good responsive grid for statistics counters.

The 4-column grid with md:grid-cols-4 properly stacks on mobile devices and expands on medium screens and above, providing a clean display that prevents overflow issues.


258-276: Effective CTA and logo section layout.

The call-to-action and logo sections have proper margin and padding, and each is contained within a SecondaryCard component which helps maintain consistent styling and prevents overflow issues.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🔭 Outside diff range comments (1)
frontend/src/pages/Home.tsx (1)

10-19: ⚠️ Potential issue

Remove unused import EventType.

The EventType import on line 18 is declared but never used in this file, as flagged by ESLint in the pipeline failure.

- import { EventType } from 'types/event'
🧰 Tools
🪛 GitHub Actions: Run CI/CD

[error] 10-10: 'EventType' is defined but never used @typescript-eslint/no-unused-vars

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0033a44 and 418b1d3.

📒 Files selected for processing (1)
  • frontend/src/pages/Home.tsx (1 hunks)
🧰 Additional context used
🪛 GitHub Actions: Run CI/CD
frontend/src/pages/Home.tsx

[error] 10-10: 'EventType' is defined but never used @typescript-eslint/no-unused-vars

🔇 Additional comments (5)
frontend/src/pages/Home.tsx (5)

111-113: Good container restructuring to fix mobile overflow.

The changes to the container structure address the mobile overflow issue effectively. Moving from a fixed-width outer container to a padded container with a max-width inner wrapper is a good responsive design approach.


131-183: Good restructuring of chapter and project cards.

The implementation of separate cards for new chapters and projects with appropriate formatting and consistent styling improves the layout organization and readability on mobile devices.


184-184: Appropriate reduction in displayed contributors.

Reducing the maxInitialDisplay from 9 to 6 for TopContributors is a good adjustment that will help prevent overcrowding on mobile screens.


192-221: Good enhancement with conditional comment count display.

The added conditional rendering for comment counts in the ItemCardList components is a nice improvement that prevents displaying empty or zero counts.


223-249: Good responsive grid layout for statistics.

Using a responsive grid that switches from 1 column on mobile to 4 columns on medium screens ensures the statistics display properly on all device sizes.

@KaranNegi20Feb KaranNegi20Feb force-pushed the fixing-home-overflow branch 2 times, most recently from 88066b1 to 2a34af3 Compare March 6, 2025 19:52
@KaranNegi20Feb KaranNegi20Feb marked this pull request as draft March 6, 2025 19:58
@KaranNegi20Feb KaranNegi20Feb marked this pull request as ready for review March 6, 2025 20:33
@KaranNegi20Feb
Copy link
Contributor Author

Hey @arkid15r and @kasya can you please review the PR. Thank you.

Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

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

What issue is this PR related to?

@KaranNegi20Feb
Copy link
Contributor Author

What issue is this PR related to?
#963

@arkid15r arkid15r linked an issue Mar 7, 2025 that may be closed by this pull request
@KaranNegi20Feb
Copy link
Contributor Author

Hey @arkid15r all the merge conflicts are resolved, you can now proceed with your review. Thank you.

@KaranNegi20Feb KaranNegi20Feb requested a review from arkid15r March 7, 2025 03:55
Copy link
Collaborator

@kasya kasya left a comment

Choose a reason for hiding this comment

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

Thanks for updating mobile view! I like that!

But I noticed a few issues that need to be addressed ⬇️

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
frontend/src/pages/Home.tsx (1)

113-113: Consider more responsive padding for the main container.

The padding of p-8 (32px) might be excessive on very small mobile screens. Using responsive padding would provide better spacing across different device sizes.

- <div className="mt-16 min-h-screen p-8 text-gray-600 dark:bg-[#212529] dark:text-gray-300">
+ <div className="mt-16 min-h-screen p-4 md:p-8 text-gray-600 dark:bg-[#212529] dark:text-gray-300">
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 886e785 and 9d5f492.

📒 Files selected for processing (2)
  • frontend/__tests__/e2e/pages/Contribute.spec.ts (1 hunks)
  • frontend/src/pages/Home.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/tests/e2e/pages/Contribute.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: CodeQL (python)
  • GitHub Check: Run frontend unit tests
  • GitHub Check: CodeQL (javascript-typescript)
  • GitHub Check: Run backend tests
  • GitHub Check: Run frontend e2e tests
🔇 Additional comments (5)
frontend/src/pages/Home.tsx (5)

114-114: LGTM! Great solution for preventing overflow.

Adding a centered, max-width container is an excellent approach to address the mobile overflow issue. This ensures content is properly constrained across all device sizes.


160-212: Good implementation of responsive grid.

The two-column layout with md:grid-cols-2 properly collapses to a single column on mobile screens, preventing horizontal overflow. The consistent use of this pattern throughout the page is excellent for maintaining responsive behavior.


213-213: Reduced the initial contributors display count.

The maxInitialDisplay prop for TopContributors has been reduced from 9 to 6, which should help with mobile display by showing fewer items initially.


251-260: Good responsive implementation for counter stats.

The grid layout with md:grid-cols-4 ensures the counter stats are stacked vertically on mobile screens and displayed in a row on larger screens, which is appropriate for mobile viewing.


277-279: Moving logos implementation preserved as requested.

As noted in the past review comments, the MovingLogos component has been correctly preserved and properly integrated into the new layout structure.

@KaranNegi20Feb
Copy link
Contributor Author

Hey @kasya and @arkid15r i have made the required changes, you may go through those and review it. Thank you 😁.

@KaranNegi20Feb
Copy link
Contributor Author

Hey @kasya and @arkid15r i have made the required changes, you may go through those and review it. Thank you 😁.

Hey @arkid15r and @kasya could you please review the pr. Thank you ☺️.

aramattamara
aramattamara previously approved these changes Mar 9, 2025
Copy link
Collaborator

@aramattamara aramattamara left a comment

Choose a reason for hiding this comment

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

Tested on local envirnment, looks good! Thanks for this PR!

@KaranNegi20Feb
Copy link
Contributor Author

Tested on local envirnment, looks good! Thanks for this PR!

welcome @aramattamara 😄.

Copy link
Collaborator

@kasya kasya left a comment

Choose a reason for hiding this comment

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

It seems that there are still some changes to the home page that are not rellevant to this task.

  • We used to have 3 columns for Upcoming events, now it shows two:
    Screenshot 2025-03-08 at 6 08 38 PM

  • Recent issues and releases are still showing up in rows instead of having two columns side by side:
    Screenshot 2025-03-08 at 6 09 54 PM
    Screenshot 2025-03-08 at 6 12 39 PM

@KaranNegi20Feb
Copy link
Contributor Author

KaranNegi20Feb commented Mar 9, 2025

Fixed for 3 columns instead of 2
Screenshot 2025-03-09 at 10 01 40 AM
Final outcome of changes:

Screen.Recording.2025-03-09.at.10.14.48.AM.mov
newone.mov

@KaranNegi20Feb
Copy link
Contributor Author

Hey @aramattamara, @arkid15r and @kasya, I have tried to mitigate as may ui flaws in this pr as many as possible. Thankyou for your continuous guidance and support throughout this PR reviews. I also have mentioned the final outcomes above with the help of a video and screenshots, do go through those.

Link below:
#1030 (comment)

Copy link
Collaborator

@kasya kasya left a comment

Choose a reason for hiding this comment

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

@KaranNegi20Feb I don't see those changes being applied🤔 Home page still looks the same for me.
Are you sure you pushed everything?

@KaranNegi20Feb
Copy link
Contributor Author

@KaranNegi20Feb I don't see those changes being applied🤔 Home page still looks the same for me. Are you sure you pushed everything?

Yes the branch is updated, could you share your side of the view since i pushed all the changes

@KaranNegi20Feb
Copy link
Contributor Author

Hey @kasya I checked the code push, everything seems fine here, the branch runs fine on my device as well, if you could show me what's that you saw that does not match the right version. Thank you.

@KaranNegi20Feb KaranNegi20Feb requested a review from kasya March 10, 2025 04:38
@KaranNegi20Feb
Copy link
Contributor Author

KaranNegi20Feb commented Mar 10, 2025

This is how it looks on my local machine.

Screen.Recording.2025-03-10.at.10.24.35.AM.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI Overflow on Mobile (Chrome)
4 participants