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 #1660 [Mobile Frontend Issue] : Section-Dialog Overflow In Mobile Device Along With Some Changes In Spacing And Font Size Of Sidebar #2114

Merged
merged 2 commits into from
Jan 12, 2025

Conversation

Karanrajsinh
Copy link
Contributor

@Karanrajsinh Karanrajsinh commented Dec 1, 2024

This Is The Fix For #1660

Issue : Form Prompt For Details Overflowing The Screen Without Scrollable Area With Fixed Height [Unresponsive In Mobile]

Fix : Added Max Height To The Section-Dialog.tsx For Mobile Device 60vh and Desktop Fit Content , Wrapping The Form Element With Scroll Area Allowing User To Scroll The Details Form When Exceeding The Height Of 60vh and Preventing The Overflow

Other Fix : Changes In Font Size For Mobile Devices And Some Layout Spacing Between The Section Of Left And Right Sidebar For All Devices

LEFT SIDEBAR:-

Before

rxresu.mp4

After

rxresu-1.mp4

RIGHT SIDEBAR:-

Before

rxresu-2.mp4

After

rxresu-3.mp4

Summary by CodeRabbit

  • Style

    • Adjusted font sizes to be responsive across different screen sizes, changing from text-3xl to text-2xl for smaller screens while maintaining text-3xl for larger screens
    • Increased vertical spacing in various sections by modifying gap classes
    • Added margin-right to dropdown menu content
    • Introduced scrollable areas for better usability on smaller screens
  • UI/UX Improvements

    • Enhanced layout responsiveness across multiple sections
    • Improved spacing and readability of section headers and components

@Karanrajsinh Karanrajsinh changed the title Issue#1049[Mobile Responsive] : Section-Dialog Overflow In Mobile Device Along With Some Changes In Spacing And Font Size Of Sidebar Issue#1663[Mobile Frontend Issue] : Section-Dialog Overflow In Mobile Device Along With Some Changes In Spacing And Font Size Of Sidebar Dec 2, 2024
@Karanrajsinh Karanrajsinh changed the title Issue#1663[Mobile Frontend Issue] : Section-Dialog Overflow In Mobile Device Along With Some Changes In Spacing And Font Size Of Sidebar Issue#1660 [Mobile Frontend Issue] : Section-Dialog Overflow In Mobile Device Along With Some Changes In Spacing And Font Size Of Sidebar Dec 2, 2024
@Karanrajsinh Karanrajsinh changed the title Issue#1660 [Mobile Frontend Issue] : Section-Dialog Overflow In Mobile Device Along With Some Changes In Spacing And Font Size Of Sidebar Fix #1660 [Mobile Frontend Issue] : Section-Dialog Overflow In Mobile Device Along With Some Changes In Spacing And Font Size Of Sidebar Dec 4, 2024
Copy link
Contributor

@DemaPy DemaPy left a comment

Choose a reason for hiding this comment

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

  • Headings size reduced for mobile device
  • Added ScrollContainer

Copy link

coderabbitai bot commented Jan 12, 2025

📝 Walkthrough

Walkthrough

The pull request introduces a series of consistent styling and layout modifications across multiple sidebar components in the builder interface. The changes primarily focus on responsive design, adjusting font sizes and vertical spacing for better visual hierarchy and adaptability across different screen sizes. The modifications include reducing the default heading size from text-3xl to text-2xl on smaller screens while maintaining text-3xl on larger screens, and adjusting vertical spacing (gap) in various sections to improve visual layout and readability.

Changes

File Path Change Summary
apps/client/src/pages/builder/sidebars/left/index.tsx Increased vertical spacing (gap-y) from 6 to 10
apps/client/src/pages/builder/sidebars/left/sections/basics.tsx Adjusted header font size, increased spacing for "Full Name" input section
apps/client/src/pages/builder/sidebars/left/sections/shared/section-base.tsx Modified title and button text sizes for responsive design
apps/client/src/pages/builder/sidebars/left/sections/shared/section-dialog.tsx Added ScrollArea component, updated form height classes
apps/client/src/pages/builder/sidebars/left/sections/shared/section-options.tsx Added right margin (mr-4) to dropdown menu
apps/client/src/pages/builder/sidebars/... Consistent font size changes from text-3xl to text-2xl lg:text-3xl across multiple right sidebar sections

Possibly related PRs

  • release: v4.3.1 #2140: Accessibility improvements related to converting "ContextMenu" to "DropdownMenu" for better user interaction

Poem

🐰 Responsive Rabbit's Design Dance 🎨

Pixels shift and margins sway,
From large to small, we find our way
Gaps expand with gentle care,
Typography leaps without a snare!
A sidebar's rhythm, clean and bright ✨


🪧 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. (Beta)
  • @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

@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

🧹 Nitpick comments (6)
apps/client/src/pages/builder/sidebars/left/sections/shared/section-dialog.tsx (1)

152-152: Consider additional mobile UX improvements.

While the current implementation addresses the overflow issue, consider these enhancements for better mobile experience:

  1. The space-y-6 spacing might be tight on mobile. Consider using responsive spacing like space-y-4 lg:space-y-6.
  2. Add a visual indicator when content is scrollable (e.g., fade effect or scroll indicator).
-              className=" max-h-[60vh] space-y-6 lg:max-h-fit"
+              className="max-h-[60vh] space-y-4 lg:space-y-6 lg:max-h-fit relative"
apps/client/src/pages/builder/sidebars/right/sections/typography.tsx (1)

78-80: Consider enhancing focus visibility for accessibility

The responsive text sizing (text-xs/lg:text-sm) improves mobile usability while maintaining desktop readability. The transition and focus states are well implemented.

Consider adding a slightly more prominent focus indicator for better accessibility, such as a higher contrast ring color or larger ring-offset.

- "flex h-12 items-center justify-center overflow-hidden rounded border text-center text-xs ring-primary transition-colors hover:bg-secondary-accent focus:outline-none focus:ring-1 disabled:opacity-100 lg:text-sm",
+ "flex h-12 items-center justify-center overflow-hidden rounded border text-center text-xs ring-primary transition-colors hover:bg-secondary-accent focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-100 lg:text-sm",
apps/client/src/pages/builder/sidebars/right/sections/statistics.tsx (1)

23-23: LGTM! Consider removing extra space in className.

The responsive font sizing is consistent with other sections, but there's an extra space in the className string.

-          <h2 className="line-clamp-1 text-2xl  font-bold lg:text-3xl">{t`Statistics`}</h2>
+          <h2 className="line-clamp-1 text-2xl font-bold lg:text-3xl">{t`Statistics`}</h2>
apps/client/src/pages/builder/sidebars/right/sections/page.tsx (1)

26-26: LGTM! Consider removing extra spaces in className.

The responsive font sizing is consistent with other sections, but there are extra spaces in the className string.

-          <h2 className="line-clamp-1  text-2xl  font-bold lg:text-3xl">{t`Page`}</h2>
+          <h2 className="line-clamp-1 text-2xl font-bold lg:text-3xl">{t`Page`}</h2>
apps/client/src/pages/builder/sidebars/left/sections/basics.tsx (1)

30-30: Consider maintaining consistent spacing across form fields.

The full name field uses space-y-4 while other fields use space-y-1.5. This inconsistency might affect the visual rhythm of the form.

-        <div className="space-y-4 sm:col-span-2">
+        <div className="space-y-1.5 sm:col-span-2">
apps/client/src/pages/builder/sidebars/right/sections/notes.tsx (1)

17-17: LGTM! Minor formatting suggestion.

The responsive heading size adjustment aligns well with the PR objectives and maintains consistency across sidebar sections.

Consider removing the extra space in text-2xl font-bold for better code formatting:

-          <h2 className="line-clamp-1 text-2xl  font-bold lg:text-3xl">{t`Notes`}</h2>
+          <h2 className="line-clamp-1 text-2xl font-bold lg:text-3xl">{t`Notes`}</h2>
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 89a44cc and 9d0a0bb.

📒 Files selected for processing (16)
  • apps/client/src/pages/builder/sidebars/left/index.tsx (1 hunks)
  • apps/client/src/pages/builder/sidebars/left/sections/basics.tsx (2 hunks)
  • apps/client/src/pages/builder/sidebars/left/sections/shared/section-base.tsx (2 hunks)
  • apps/client/src/pages/builder/sidebars/left/sections/shared/section-dialog.tsx (2 hunks)
  • apps/client/src/pages/builder/sidebars/left/sections/shared/section-options.tsx (1 hunks)
  • apps/client/src/pages/builder/sidebars/left/sections/summary.tsx (1 hunks)
  • apps/client/src/pages/builder/sidebars/right/sections/export.tsx (1 hunks)
  • apps/client/src/pages/builder/sidebars/right/sections/information.tsx (1 hunks)
  • apps/client/src/pages/builder/sidebars/right/sections/layout.tsx (2 hunks)
  • apps/client/src/pages/builder/sidebars/right/sections/notes.tsx (1 hunks)
  • apps/client/src/pages/builder/sidebars/right/sections/page.tsx (1 hunks)
  • apps/client/src/pages/builder/sidebars/right/sections/sharing.tsx (1 hunks)
  • apps/client/src/pages/builder/sidebars/right/sections/statistics.tsx (1 hunks)
  • apps/client/src/pages/builder/sidebars/right/sections/template.tsx (1 hunks)
  • apps/client/src/pages/builder/sidebars/right/sections/theme.tsx (1 hunks)
  • apps/client/src/pages/builder/sidebars/right/sections/typography.tsx (2 hunks)
✅ Files skipped from review due to trivial changes (5)
  • apps/client/src/pages/builder/sidebars/right/sections/sharing.tsx
  • apps/client/src/pages/builder/sidebars/right/sections/export.tsx
  • apps/client/src/pages/builder/sidebars/left/sections/shared/section-options.tsx
  • apps/client/src/pages/builder/sidebars/left/index.tsx
  • apps/client/src/pages/builder/sidebars/right/sections/layout.tsx
🔇 Additional comments (14)
apps/client/src/pages/builder/sidebars/left/sections/shared/section-dialog.tsx (2)

23-23: LGTM! ScrollArea import added correctly.

The ScrollArea component import is properly added from the UI library, which will enable the scrolling functionality needed for mobile responsiveness.


150-154: LGTM! ScrollArea implementation addresses the overflow issue.

The ScrollArea wrapper with responsive height constraints (60vh for mobile, fit-content for desktop) effectively addresses the mobile overflow issue while maintaining desktop functionality.

apps/client/src/pages/builder/sidebars/right/sections/typography.tsx (2)

61-61: LGTM: Consistent spacing adjustment

The increased vertical gap improves the visual hierarchy and matches the spacing adjustments across other sidebar components.


65-65: LGTM: Proper responsive typography implementation

Good use of Tailwind's responsive design patterns to adjust heading size based on viewport. The text-2xl on mobile and lg:text-3xl on desktop provides better readability across devices.

apps/client/src/pages/builder/sidebars/left/sections/summary.tsx (1)

23-23: LGTM! Responsive font sizing improvement.

The change from text-3xl to text-2xl lg:text-3xl improves mobile responsiveness while maintaining desktop visual hierarchy.

Let's verify consistent application across other section headers:

✅ Verification successful

Font sizing is consistently implemented across all section headers

The responsive font sizing pattern (text-2xl lg:text-3xl) is uniformly applied across all 13 section headers in both left and right sidebars, maintaining a consistent heading hierarchy throughout the application.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for consistent responsive font sizing across section headers
# Expect: All section headers should use text-2xl lg:text-3xl pattern

rg -U 'className="[^"]*h2[^"]*"' apps/client/src/pages/builder/sidebars

Length of output: 73


Script:

#!/bin/bash
# First, let's verify the file structure
fd . apps/client/src/pages/builder/sidebars

# Then search for any heading elements and font size classes
rg -U '<h[1-6].*class.*text-[2-3]xl' apps/client/src/pages/builder/sidebars

Length of output: 5163

apps/client/src/pages/builder/sidebars/right/sections/template.tsx (2)

19-19: LGTM! Consistent responsive typography.

The font size adjustment maintains consistency with other sidebar sections.


23-23: LGTM! Improved template grid spacing.

The increased gap and responsive grid layout enhance the visual spacing between templates, particularly beneficial for mobile devices.

apps/client/src/pages/builder/sidebars/right/sections/page.tsx (1)

30-30: LGTM! Improved vertical spacing.

The increased gap enhances readability and spacing between form elements.

apps/client/src/pages/builder/sidebars/left/sections/basics.tsx (1)

21-21: LGTM! Responsive typography implementation.

The mobile-first approach with text-2xl lg:text-3xl improves readability on smaller screens while maintaining the visual hierarchy on larger displays.

apps/client/src/pages/builder/sidebars/right/sections/information.tsx (1)

117-117: LGTM! Consistent responsive design implementation.

The heading's font size adjustment matches the mobile-first approach implemented across other sections, maintaining a consistent visual hierarchy.

apps/client/src/pages/builder/sidebars/right/sections/theme.tsx (2)

20-20: LGTM! Consistent typography implementation.

The heading's responsive font size adjustment maintains consistency with other sections.


24-24: LGTM! Improved spacing for better mobile interaction.

The increased gap (gap-y-6) provides better touch target spacing and visual separation between theme controls, enhancing mobile usability.

apps/client/src/pages/builder/sidebars/left/sections/shared/section-base.tsx (2)

103-103: LGTM! Consistent responsive typography.

The heading's font size implementation maintains consistency with other sections, following the mobile-first approach.


164-168: LGTM! Enhanced button readability for mobile.

The button's text size adjustment (text-xs lg:text-sm) improves readability on mobile devices while maintaining appropriate sizing on larger screens.

@AmruthPillai
Copy link
Owner

Thank you for this contribution! :) Will make sure it gets to production ASAP!

@AmruthPillai AmruthPillai merged commit 007243f into AmruthPillai:main Jan 12, 2025
1 check passed
@Karanrajsinh
Copy link
Contributor Author

@AmruthPillai Thanks for considering my contribution

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.

3 participants