Skip to content

fix: corrected scroll of main component at client mods; feat: improoved ux #341

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

Merged
merged 5 commits into from
May 2, 2025

Conversation

mgDentist
Copy link

@mgDentist mgDentist commented May 2, 2025

PR Type

Bug fix, Enhancement


Description

  • Fixed scroll behavior in main and sidebar components for better UX.

    • Changed .screen-content overflow to hidden to resolve scroll issues.
    • Adjusted sidebar and mod list min-heights for improved layout.
    • Enabled sidebar scrolling with overflow: auto.
  • Cleaned up inline styles and comments for clarity.


Changes walkthrough 📝

Relevant files
Enhancement
mods.module.css
Adjust sidebar and mod list heights, enable sidebar scrolling

src/react/mods.module.css

  • Reduced .modList min-height for vertical layouts.
  • Set .sidebar min-height and enabled scrolling with overflow: auto.
  • +3/-1     
    Bug fix
    screens.css
    Update screen-content overflow to fix scrolling                   

    src/screens.css

  • Changed .screen-content overflow from auto to hidden.
  • Commented out height: fit-content for testing scroll fix.
  • +3/-2     
    Screen.tsx
    Remove overflow style from fullscreen container                   

    src/react/Screen.tsx

    • Removed inline overflow: auto from fullscreen container.
    +1/-1     
    Formatting
    ModsPage.tsx
    Minor formatting fix in onButtonClick method                         

    src/react/ModsPage.tsx

    • Minor formatting fix: removed space in onButtonClick method.
    +1/-1     

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • Summary by CodeRabbit

    • Style
      • Improved layout and scrolling behavior for main containers and sidebar sections, resulting in more flexible sizing and better overflow handling.
      • Updated styles to use grid layouts and vertical scrolling where appropriate.
      • Adjusted overflow settings to address previous scrolling issues in main content areas.

    Copy link

    codesandbox bot commented May 2, 2025

    Review or Edit in CodeSandbox

    Open the branch in Web EditorVS CodeInsiders

    Open Preview

    Copy link

    coderabbitai bot commented May 2, 2025

    Walkthrough

    The changes adjust the scrolling and layout behavior across several React components and CSS modules. Inline style enforcement of overflow: auto is removed from a fullscreen container in the React code, allowing overflow to be controlled externally. In the CSS modules, the layout of a vertical content area is shifted from flexbox to a grid, with scrolling now managed via overflow-y: auto on key sections. Additionally, the main screen content's overflow is switched from auto to hidden, with comments indicating this is a temporary fix for scrolling issues.

    Changes

    File(s) Summary
    src/react/Screen.tsx Removed forced overflow: auto from the fullscreen container's inline styles; now only applies the passed style.
    src/react/mods.module.css Changed .verticalContent from flex to grid layout, added overflow: hidden, updated .modList and .sidebar for scrollability and sizing using grid and overflow-y: auto. Also added min-height: 0 and adjusted widths and heights for consistent layout.
    src/screens.css Changed .screen-content overflow from auto to hidden, commented out height: fit-content, and added explanatory comment.

    Sequence Diagram(s)

    Loading
    sequenceDiagram
        participant User
        participant FullscreenDiv
        participant CSS
        User->>FullscreenDiv: Render with optional style prop
        FullscreenDiv->>CSS: Apply only passed styles (no forced overflow)
        User->>CSS: CSS modules control scrolling and layout for mod list and sidebar
        User->>CSS: Main screen content overflow managed by CSS (.screen-content)
    

    Suggested reviewers

    • zardoy

    Poem

    A tweak to the scroll, a shift to the grid,
    Overflow’s now hidden, the old rules we rid.
    No more forced auto, let the styles decide,
    With mod lists and sidebars, let content reside.
    The rabbit hops on, with layouts anew—
    May your screens scroll smooth, and your bugs be few!
    🐇✨


    📜 Recent review details

    Configuration used: CodeRabbit UI
    Review profile: CHILL
    Plan: Pro

    📥 Commits

    Reviewing files that changed from the base of the PR and between 9baa0ae and 42ef6a2.

    📒 Files selected for processing (1)
    • src/react/mods.module.css (3 hunks)
    🚧 Files skipped from review as they are similar to previous changes (1)
    • src/react/mods.module.css
    ⏰ Context from checks skipped due to timeout of 90000ms (1)
    • GitHub Check: build-and-deploy

    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
    🪧 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.

    Support

    Need help? Create a ticket on our support page for assistance with any issues or questions.

    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 generate sequence diagram to generate a sequence diagram of the changes in 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.

    CodeRabbit Configuration File (.coderabbit.yaml)

    • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
    • Please see the configuration documentation for more information.
    • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

    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.

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Commented Code

    The PR contains commented code and TODO comments that should be cleaned up before merging. The developer should decide whether to remove the commented height property and clean up the testing comments.

    /* todo remove it but without it in chrome android the screen is not scrollable */
    /*! upd: changed from "overflow: auto" to "overflow: hidden" to fix main component scroll - delete this comment after testing */
    overflow: hidden;
    /* height: fit-content; */ /*! delete this line after testing previous line */
    Min-height Reduction

    The min-height for modList was reduced from 200px to 100px. Verify this doesn't cause layout issues on smaller screens or with limited content.

    height: 50%;
    min-height: 100px;

    Copy link

    qodo-merge-pro-for-open-source bot commented May 2, 2025

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    @zardoy
    Copy link
    Owner

    zardoy commented May 2, 2025

    /deploy

    Copy link

    github-actions bot commented May 2, 2025

    Deployed to Vercel Preview: https://prismarine-67krg79kp-zaro.vercel.app
    Playground
    Storybook

    @zardoy
    Copy link
    Owner

    zardoy commented May 2, 2025

    /deploy

    Copy link

    github-actions bot commented May 2, 2025

    Deployed to Vercel Preview: https://prismarine-8psio64f7-zaro.vercel.app
    Playground
    Storybook

    @zardoy zardoy merged commit c5f72f2 into zardoy:next May 2, 2025
    3 checks passed
    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.

    3 participants