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 scrolling issues on list/details pages #2310

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

mohitb35
Copy link
Collaborator

Resolve scrolling issues that affected the user experience on list and details pages, particularly on iOS. Adjustments to layout and padding improve overall scrolling behavior.

- scrolling issues were visible on iOS, but could affect any OS
Copy link

vercel bot commented Nov 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
planet-webapp-multi-tenancy-setup ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 19, 2024 9:33am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
planet-webapp ⬜️ Ignored (Inspect) Nov 19, 2024 9:33am
planet-webapp-temp ⬜️ Ignored (Inspect) Nov 19, 2024 9:33am

Copy link
Contributor

coderabbitai bot commented Nov 19, 2024

Walkthrough

The pull request introduces several changes to the SCSS files focused on enhancing mobile responsiveness across various components. New SCSS variables for mobile layout spacing are added, and existing classes are modified to improve layout and spacing for small screens. Key adjustments include changes to padding, height, and positioning properties in multiple files, ensuring a more streamlined and user-friendly mobile experience.

Changes

File Path Change Summary
src/features/common/Layout/ProjectsLayout/ProjectsLayout.module.scss Added variables $topMobileNavigationSpace and $bottomMobileFooterSpace. Modified .mobileProjectsLayout for positioning and display. Adjusted .viewButton and .mobileContentContainer for improved layout.
src/features/projectsV2/ProjectDetails/ProjectDetails.module.scss Updated .projectDetailsContainer padding and height for small phone views.
src/features/projectsV2/ProjectDetails/styles/ProjectInfo.module.scss Adjusted padding of .projectInfoSection for extra small phone screens.
src/features/projectsV2/ProjectsMap/ProjectsMap.module.scss Modified top positioning for .projectListControlsContainer and .projectDetailsControlsContainer. Corrected z-index for .projectDetailsControlsContainer.
src/features/projectsV2/ProjectsSection.module.scss Introduced $bottomFooterSpace variable and updated .projectList height and padding for responsiveness.

Poem

In the meadow where rabbits play,
New styles bloom, brightening the day.
With padding light and heights refined,
Mobile views now perfectly aligned.
Hops of joy as we adjust and sway,
A responsive dance in a stylish way! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.

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

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: 0

🧹 Outside diff range and nitpick comments (4)
src/features/common/Layout/ProjectsLayout/ProjectsLayout.module.scss (1)

7-8: LGTM! Consider documenting the spacing values.

The new variables improve maintainability. Consider adding comments to explain what these specific pixel values represent (e.g., mobile navigation height, footer height).

+// Height of the mobile navigation bar
 $topMobileNavigationSpace: 77px;
+// Height of the mobile footer
 $bottomMobileFooterSpace: 49px;
src/features/projectsV2/ProjectDetails/styles/ProjectInfo.module.scss (3)

16-16: Consider adding bottom padding for better content separation

The removal of bottom padding (15px 24px 0) might cause content to stick too close to subsequent elements on iOS devices. Consider maintaining some bottom padding for better visual separation and to prevent any touch target issues.

-    padding: 15px 24px 0;
+    padding: 15px 24px 12px;

Line range hint 89-103: Review iOS scrolling behavior for horizontal label container

The horizontal scrolling implementation for .siteOwnershipLabelContainer uses CSS to hide scrollbars. While this works, iOS devices might benefit from additional properties to ensure smooth momentum-based scrolling:

  .siteOwnershipLabelContainer {
    display: flex;
    gap: 5px;
    margin-bottom: 4px;
    overflow-x: scroll;
    -ms-overflow-style: none;
    scrollbar-width: none;
    width: 100%;
    max-width: 258px;
+   -webkit-overflow-scrolling: touch;
    span {
      padding: 2px 6px;
      background-color: rgba(var(--more-info-background-color-new), 0.2);
      border-radius: 4px;
      font-weight: 400;
      font-size: $fontXXSmall;
      white-space: nowrap;
    }
  }

Line range hint 171-189: Optimize mobile layout for expense details

The mobile view changes for .expenseDetails enforce full width and increase the gap, which could contribute to excessive vertical scrolling:

  .expenseDetails {
    width: 100%;
-   gap: 32px;
+   gap: 16px;
+   justify-content: space-between;
  }

This would maintain the spacing while potentially reducing overall scroll length on mobile devices.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 6fe12be and 727455e.

📒 Files selected for processing (5)
  • src/features/common/Layout/ProjectsLayout/ProjectsLayout.module.scss (2 hunks)
  • src/features/projectsV2/ProjectDetails/ProjectDetails.module.scss (1 hunks)
  • src/features/projectsV2/ProjectDetails/styles/ProjectInfo.module.scss (1 hunks)
  • src/features/projectsV2/ProjectsMap/ProjectsMap.module.scss (2 hunks)
  • src/features/projectsV2/ProjectsSection.module.scss (2 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/features/projectsV2/ProjectsMap/ProjectsMap.module.scss
🔇 Additional comments (8)
src/features/projectsV2/ProjectDetails/ProjectDetails.module.scss (2)

24-24: LGTM: Height adjustment improves scrolling behavior

Setting height: 100% instead of calc(100% + 30px) provides more natural scrolling boundaries on iOS, preventing potential overscroll issues while maintaining proper content containment.


23-23: LGTM: Padding reduction enhances mobile layout

Reducing bottom padding to 20px creates a more compact and mobile-friendly layout while maintaining sufficient spacing. This should eliminate excessive scrolling space that could affect the iOS scrolling experience.

src/features/projectsV2/ProjectsSection.module.scss (2)

3-3: LGTM: Good variable extraction

The introduction of $bottomFooterSpace variable improves maintainability by centralizing the footer spacing value.


27-28: Improved mobile layout calculations

The changes address iOS scrolling issues by:

  1. Using precise height calculation with $bottomFooterSpace
  2. Optimizing padding for better space utilization

Let's verify if similar adjustments are needed in related layout files:

✅ Verification successful

Height calculation change is consistent with existing patterns

The verification shows that:

  1. The new calc(100% - $bottomFooterSpace) height calculation follows the same pattern used across the codebase in similar layout components (UserLayout, ShareModal, Navbar)
  2. The variable $bottomFooterSpace is only used in this specific component, indicating it's a local optimization
  3. No other mobile view padding patterns were found that would require similar adjustments
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for similar padding/height patterns that might need adjustment

# Search for related layout calculations
rg -t scss "calc\(100%.*\)" --no-heading

# Look for potential inconsistent padding in mobile views
rg -t scss "@include \w*PhoneView.*padding-bottom:" --no-heading

Length of output: 167


Script:

#!/bin/bash
# Search for related layout calculations without file type restriction
rg "calc\(100%.*\)" --type-add 'styles:*.{scss,css,sass,less}' -t styles

# Look for potential inconsistent padding in mobile views
rg "@include \w*PhoneView.*padding" --type-add 'styles:*.{scss,css,sass,less}' -t styles

# Find other occurrences of bottomFooterSpace variable
rg "\$bottomFooterSpace" --type-add 'styles:*.{scss,css,sass,less}' -t styles

Length of output: 992

src/features/common/Layout/ProjectsLayout/ProjectsLayout.module.scss (4)

62-71: Excellent fix for iOS scrolling issues!

The changes effectively address the scrolling problems by:

  • Using fixed positioning with proper spacing to prevent content from scrolling under navigation/footer
  • Implementing flex column layout for proper content flow
  • Setting explicit boundaries with top/bottom spacing variables

73-75: LGTM! Proper handling of map mode layout.

The adjustments correctly remove top spacing when in map mode, allowing for full-screen map display.


80-85: Great improvements to iOS scrolling behavior!

The changes implement essential iOS-specific scroll optimizations:

  • Proper space utilization with flex: 1
  • Smooth iOS scrolling with -webkit-overflow-scrolling: touch
  • Native scroll feel with overscroll-behavior: auto

62-85: Verify scroll behavior across different iOS devices and scenarios.

While the changes look comprehensive, please verify:

  1. Smooth scrolling on different iOS devices and versions
  2. No content overlap with navigation/footer
  3. Proper scroll behavior in both list and map modes
✅ Verification successful

Scroll behavior implementation is consistent across the codebase

The comprehensive analysis of scroll-related styles shows that:

  1. The implemented scroll fixes in ProjectsLayout.module.scss align with global scroll patterns
  2. iOS-specific optimizations (-webkit-overflow-scrolling: touch) are uniquely applied where needed
  3. Mobile-specific media queries and scroll behaviors are properly handled across components

Key findings that support this:

  • Global scroll settings in global.scss provide base consistency
  • Other mobile containers use similar overflow handling patterns
  • No conflicting scroll behaviors found in related components
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any other scroll-related styles that might need similar fixes

# Look for other scroll-related properties
rg -g '*.scss' -g '*.css' 'overflow|scroll|touch|overscroll'

# Look for other mobile-specific styles that might need adjustment
rg -g '*.scss' -g '*.css' '@media.*\(.*max-width'

Length of output: 17767

@mohitb35 mohitb35 mentioned this pull request Nov 20, 2024
@mohitb35 mohitb35 merged commit 943499f into develop Nov 20, 2024
9 checks passed
@mohitb35 mohitb35 deleted the hotfix/scrolling-issue-for-projects branch November 20, 2024 07:04
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