Skip to content

style(modal): Update modal styles for better positioning on small screens - #21289

Merged
ramonlsouza merged 1 commit into
bigbluebutton:v3.0.x-releasefrom
Scroody:fix-layout-modal-style-mobile
Oct 1, 2024
Merged

ramonlsouza merged 1 commit into
bigbluebutton:v3.0.x-releasefrom
Scroody:fix-layout-modal-style-mobile

Conversation

@Scroody

@Scroody Scroody commented Sep 30, 2024

Copy link
Copy Markdown
Contributor

What does this PR do?

This PR fixes the layout modal style so it looks visually better.

Before Fix

image

After Fix

image

@Scroody Scroody added this to the Release 3.0 milestone Sep 30, 2024
@Scroody
Scroody requested a review from gabriellpr September 30, 2024 23:15
@sonarqubecloud

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Sep 30, 2024 •

Copy link
Copy Markdown
Contributor

Walkthrough

The changes in the pull request involve updates to the styles in the bigbluebutton-html5/imports/ui/components/layout/modal/styles.js file. These updates include the addition of new CSS properties and modifications to existing styled components, enhancing responsiveness and visual presentation. Adjustments were made to several components, including margins, paddings, and specific styles for different screen sizes, while maintaining the overall structure and functionality of the components.

Changes

File Change Summary
bigbluebutton-html5/imports/ui/components/layout/modal/styles.js Added new styles and modified existing styles for ButtonBottomContainer, ToggleStatusWrapper, and LayoutBtn. Adjusted margins, paddings, and flexbox behavior for better responsiveness.

Possibly related PRs

Suggested reviewers

  • ramonlsouza
  • gabriellpr

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.

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (2)
bigbluebutton-html5/imports/ui/components/layout/modal/styles.js (2)

156-160: Consider a more flexible positioning approach for small screens

The addition of position: relative and right: 1rem for small screens improves the layout, but using a fixed offset might not be ideal for all screen sizes within the small screen range.

Consider using a percentage-based or calc() approach for the right offset to ensure better adaptability across different small screen sizes. For example:

 @media ${smallOnly} {
   align-self: center;
   padding-right: unset;
   position: relative;
-  right: 1rem;
+  right: calc(5% + 0.5rem);
 }

This approach combines a percentage with a fixed value, providing more flexibility while maintaining the desired positioning.


Line range hint 1-214: Overall improvements with suggestions for further refinement

The changes in this file significantly improve the modal layout for small screens, enhancing the visual presentation and responsiveness. The new styles for active states and the addition of icons provide better user feedback.

However, there are a few areas where the positioning approach could be more flexible to accommodate a wider range of screen sizes within the small screen category. I've suggested some adjustments in the previous comments.

To ensure these changes work well across different devices:

  1. Test the modal on various small screen sizes, paying special attention to the positioning of elements with newly added relative positioning.
  2. Verify that the icon positioning in the LayoutBtn component works correctly across different screen sizes.
  3. Consider using a more consistent and flexible approach for positioning elements on small screens, possibly using a combination of percentage-based and fixed values.

As a final step, it would be beneficial to conduct a comprehensive cross-device testing to ensure that these style changes enhance the user experience across all targeted screen sizes without introducing any unintended layout issues.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 87964ca and 6d18057.

📒 Files selected for processing (1)
  • bigbluebutton-html5/imports/ui/components/layout/modal/styles.js (2 hunks)
🔇 Additional comments (2)
bigbluebutton-html5/imports/ui/components/layout/modal/styles.js (2)

179-183: Ensure consistent positioning approach and test on various screen sizes

The addition of relative positioning for small screens is good, but the fixed right: 2rem offset might not be ideal for all small screen sizes, similar to the issue in ButtonBottomContainer.

  1. Consider using a consistent approach with the ButtonBottomContainer component, such as a combination of percentage and fixed values:
 @media ${smallOnly} {
   position: relative;
-  right: 2rem;
+  right: calc(10% + 1rem);
 }
  1. To ensure these layout changes work well across different screen sizes, please test the modal on various devices and screen resolutions within the small screen range.

You can use the following script to list all the media query breakpoints in the project, which will help in identifying the range of screen sizes to test:

#!/bin/bash
# Description: List all media query breakpoints in the project

# Test: Search for media query breakpoints
rg --type js 'media.*\$\{.*Only\}' bigbluebutton-html5/imports/ui/

Review the output and ensure that the layout works well for all listed breakpoints.


Line range hint 39-86: Improved visual feedback for active state

The changes to the LayoutBtn component enhance the user experience by providing clear visual feedback for the active state. The addition of the icon using the :before pseudo-element is a nice touch. The responsive adjustments for small screens are also well-considered.

To ensure the icon positioning works correctly across different screen sizes, please run the following verification script:

If the script returns any results, consider using relative units (like rem or em) instead of pixels for better responsiveness.

✅ Verification successful

Verified: No hardcoded 'px' values found in LayoutBtn component.

The LayoutBtn component does not contain any hardcoded px units, ensuring better responsiveness and adherence to scalable design practices.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any hardcoded pixel values in the LayoutBtn styles

# Test: Search for px units in the LayoutBtn component
rg --type js 'LayoutBtn.*px' bigbluebutton-html5/imports/ui/components/layout/modal/styles.js

Length of output: 6220


Script:

#!/bin/bash
# Description: Check for any hardcoded pixel values in the LayoutBtn component styles

# Test: Search for 'px' units in the LayoutBtn component
rg --type js 'LayoutBtn.*px' bigbluebutton-html5/imports/ui/components/layout/modal/styles.js

Length of output: 95


Script:

#!/bin/bash
# Description: Verify the absence of hardcoded 'px' units in the LayoutBtn component styles

# Test: Search for 'px' units within the LayoutBtn styled component
rg --type js 'const\s+LayoutBtn\s+=\s+styled\(Button\)`[^`]*px[^`]*`' bigbluebutton-html5/imports/ui/components/layout/modal/styles.js

Length of output: 136

@github-actions

Copy link
Copy Markdown

Automated tests Summary

✅ All the CI tests have passed!

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