-
Notifications
You must be signed in to change notification settings - Fork 5
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
Improve app responsiveness on mobile screen #1382
Conversation
WalkthroughThis pull request introduces several changes across multiple components. The Changes
Suggested labels
Suggested reviewers
Poem
Tip 🌐 Web search-backed reviews and chat
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (3)
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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
🧹 Nitpick comments (1)
services/cms/src/components/blocks/BackgroundAndColorCustomizer.tsx (1)
23-27
: LGTM! Consider expanding the font color palette.The new font color options using theme colors ensure consistency. Consider adding more color options to provide greater flexibility for different use cases.
const DEFAULT_FONT_COLORS = [ { color: baseTheme.colors.gray[700], name: "gray-1" }, { color: baseTheme.colors.gray[600], name: "gray-2" }, { color: baseTheme.colors.gray[500], name: "gray-3" }, + { color: baseTheme.colors.blue[700], name: "blue" }, + { color: baseTheme.colors.green[700], name: "green" }, ]
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
services/cms/src/blocks/HeroSection/HeroSectionEditor.tsx
(3 hunks)services/cms/src/components/blocks/BackgroundAndColorCustomizer.tsx
(2 hunks)services/course-material/src/components/HeroSection.tsx
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: build-and-deploy
- GitHub Check: build
- GitHub Check: headless_lms
🔇 Additional comments (4)
services/cms/src/components/blocks/BackgroundAndColorCustomizer.tsx (2)
30-30
: LGTM! Consistent use of theme colors.Using baseTheme.colors.gray[700] for the GRAY constant ensures consistency with the font color palette.
118-121
: LGTM! Improved color palette separation.Good separation of concerns by using distinct color palettes for font and background colors.
services/cms/src/blocks/HeroSection/HeroSectionEditor.tsx (2)
38-42
: LGTM! Proper initialization of default colors.The useEffect hook ensures that both backgroundColor and fontColor have default values when not set.
63-63
: LGTM! Simplified background color usage.Direct use of backgroundColor property without fallback aligns with the new default color handling in useEffect.
There was a problem hiding this 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 (1)
services/cms/src/blocks/HeroSection/HeroSectionEditor.tsx (1)
36-37
: Consider moving the WHITE constant to a shared location.For better reusability and consistency, consider moving the
WHITE
constant to the theme configuration or a shared constants file.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
services/cms/src/blocks/HeroSection/HeroSectionEditor.tsx
(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: build
- GitHub Check: build-and-deploy
- GitHub Check: headless_lms
🔇 Additional comments (3)
services/cms/src/blocks/HeroSection/HeroSectionEditor.tsx (3)
5-5
: LGTM!The addition of
useEffect
import is appropriate for the new default color initialization logic.
38-45
: LGTM!The useEffect hook correctly initializes default colors with proper dependency tracking.
66-66
: LGTM!The direct application of backgroundColor is safe due to the default initialization in useEffect, making the code cleaner and more maintainable.
There was a problem hiding this 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)
services/course-material/src/components/ContentRenderer/core/common/Quote/QuoteBlock.tsx (1)
21-27
:🧩 Analysis chain
Consider maintaining consistent padding across quote styles.
The padding in
styleLeftDefault
has been reduced to0.4rem 1rem
while other quote styles (styleRightDefault
andstyleCenterDefault
) maintain0.5rem 2rem
. This inconsistency might affect the visual harmony of quotes across the application.Would you like to:
- Keep the reduced padding and update other styles for consistency
- Revert to the original padding to maintain consistency with other styles
If the padding reduction is intentional for responsive design, consider using the imported
respondToOrLarger
function to handle different screen sizes:const styleLeftDefault = css` - padding: 0.4rem 1rem; + padding: 0.4rem 1rem; + ${respondToOrLarger("tablet")} { + padding: 0.5rem 2rem; + } margin: 2.5rem 0; max-width: 100%; border-left: 7px solid #bdc7d1; background: #f6f8fa; `
Error: No shell scripts or web queries found
🏁 Script executed:
#!/bin/bash # List all quote style definitions in QuoteBlock.tsx to verify the padding values rg "const style" -n services/course-material/src/components/ContentRenderer/core/common/Quote/QuoteBlock.tsxLength of output: 218
🏁 Script executed:
#!/bin/bash # Print relevant lines (from 20 to 40) of QuoteBlock.tsx to inspect quote style definitions and their padding values sed -n '20,40p' services/course-material/src/components/ContentRenderer/core/common/Quote/QuoteBlock.tsxLength of output: 539
Action: Address Inconsistent Quote Padding
- The
styleLeftDefault
usespadding: 0.4rem 1rem
, whilestyleRightDefault
usespadding: 0.5rem 2rem
andstyleCenterDefault
does not define padding.- This discrepancy could cause visual inconsistencies in the quote components.
- Consider either:
- Updating the left quote style to match the right (and possibly center) quote padding, or
- Adopting a responsive approach (e.g., using the imported
respondToOrLarger
function) so that padding variations are intentional and scale appropriately with screen size.
🧹 Nitpick comments (3)
services/course-material/src/components/ContentRenderer/moocfi/InfoBox.tsx (1)
24-29
: LGTM with a minor nitpick!The responsive padding implementation looks good:
- Improves mobile experience with
1rem 0
padding- Maintains desktop experience with
3rem
padding- Correctly uses the
noPadding
propConsider fixing the template literal indentation:
- ${!props.data.attributes.noPadding && ` padding: 3rem;`} + ${!props.data.attributes.noPadding && `padding: 3rem;`}shared-module/packages/common/src/components/TopLevelPage.tsx (1)
6-6
: Remove unused import.The
baseTheme
import is not used in this file.-import { baseTheme, primaryFont } from "../styles" +import { primaryFont } from "../styles"shared-module/packages/common/src/components/Card/SimpleCard.tsx (1)
49-54
: Adjust font size values to ensure consistent scaling.The current implementation might cause the font size to decrease when switching from mobile to desktop view:
- Mobile: 1.875rem (30px)
- Desktop minimum: 28px (from clamp)
Consider adjusting the clamp values to maintain a smooth size transition:
line-height: 110%; font-size: 1.875rem; ${respondToOrLarger.lg} { - font-size: clamp(28px, 2.7rem, 46px); + font-size: clamp(30px, 2.7rem, 46px); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
services/course-material/src/components/ContentRenderer/core/common/Quote/QuoteBlock.tsx
(2 hunks)services/course-material/src/components/ContentRenderer/moocfi/AsideBlock.tsx
(2 hunks)services/course-material/src/components/ContentRenderer/moocfi/HighglightBox.tsx
(1 hunks)services/course-material/src/components/ContentRenderer/moocfi/InfoBox.tsx
(2 hunks)services/course-material/src/components/ContentRenderer/moocfi/InstructionBox.tsx
(1 hunks)services/course-material/src/components/ContentRenderer/moocfi/LearningObjectiveBlock.tsx
(1 hunks)shared-module/packages/common/src/components/Breadcrumbs.tsx
(2 hunks)shared-module/packages/common/src/components/Card/SimpleCard.tsx
(1 hunks)shared-module/packages/common/src/components/TopLevelPage.tsx
(3 hunks)
✅ Files skipped from review due to trivial changes (1)
- services/course-material/src/components/ContentRenderer/moocfi/LearningObjectiveBlock.tsx
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: build
- GitHub Check: headless_lms
- GitHub Check: build-and-deploy
🔇 Additional comments (11)
services/course-material/src/components/ContentRenderer/moocfi/InstructionBox.tsx (2)
22-22
: LGTM! Good implementation of responsive padding.The mobile-first approach with reduced horizontal padding on smaller screens and proper spacing on larger screens aligns well with responsive design best practices.
Also applies to: 26-28
36-36
: LGTM! Well-coordinated responsive padding.The inner div's padding adjustments complement the outer div's responsive behavior, ensuring optimal content spacing across different screen sizes.
Also applies to: 38-40
shared-module/packages/common/src/components/Breadcrumbs.tsx (2)
6-7
: LGTM!The import of
respondToOrLarger
is properly placed and utilized for responsive design implementation.
19-23
: LGTM! Well-implemented responsive design.The mobile-first approach with zero padding by default and increased padding for medium and larger screens is a good implementation of responsive design.
services/course-material/src/components/ContentRenderer/moocfi/InfoBox.tsx (1)
9-9
: LGTM!The import statement follows the project's conventions and is appropriately placed with other shared module imports.
services/course-material/src/components/ContentRenderer/moocfi/AsideBlock.tsx (2)
7-7
: LGTM!The import for
respondToOrLarger
is correctly placed and follows the project's import conventions.
21-21
: LGTM! Responsive padding implementation looks good.The padding adjustments improve mobile responsiveness while maintaining appropriate spacing on larger screens. The implementation aligns well with similar changes across other components in the codebase.
Also applies to: 26-28
shared-module/packages/common/src/components/TopLevelPage.tsx (2)
13-13
: LGTM! Color updates improve consistency.The color changes align well with the PR objective of syncing colors and maintain good contrast for accessibility.
Also applies to: 28-28, 35-35
83-83
: LGTM! SVG color matches text color.The SVG fill color change maintains visual consistency with the text color.
services/course-material/src/components/ContentRenderer/moocfi/HighglightBox.tsx (2)
28-32
: LGTM! Responsive padding implementation looks good.The padding adjustment improves the mobile experience while maintaining the original spacing on larger screens. The implementation follows the project's responsive design patterns.
28-32
: Verify alignment with PR objectives.These padding changes appear unrelated to the PR's stated objective of "Sync fontColor and backgroundColor of HeroSectionEditor with defaults". Please clarify if these changes should be in a separate PR focused on responsive design improvements.
services/course-material/src/components/ContentRenderer/core/common/Quote/QuoteBlock.tsx
Outdated
Show resolved
Hide resolved
…ade of the its bgColor
There was a problem hiding this 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 (2)
services/course-material/src/components/ContentRenderer/moocfi/CourseProgressBlock/CompletionRequirementsTabulation/HilightItem.tsx (1)
19-19
: Consider using a theme constant or color utility instead of a hardcoded hex value.While the color change works, hardcoding hex values reduces maintainability and makes it harder to maintain consistent styling across the application. Consider:
- Using a theme constant
- Moving the color to a shared color utility
- Creating a dedicated constants file for such values
This will make future updates easier and maintain consistency across the application.
Example approach:
// In a colors utility file (e.g., shared-module/common/styles/colors.ts) export const borderColors = { light: '#e4eaee', // ... other variations } as const; // Then in this file: import { borderColors } from '@/shared-module/common/styles/colors'; // ... border-left: 2px solid ${borderColors.light};shared-module/packages/common/src/components/NextSectionLink.tsx (1)
277-286
: Consider keeping visual feedback for inaccessible sections.Removing the lock icon reduces the UI's clarity about why a section is inaccessible. While the cursor and color changes provide some feedback, a visual indicator (like a lock icon) makes the state more immediately apparent to users.
Consider keeping the lock icon to maintain clear visual feedback:
- {url && ( - <ArrowSVGIcon - id="right-svg-icon" - role="presentation" - alt="" - width="30" - height="30" - viewBox="0 0 39 39" - /> - )} + {url ? ( + <ArrowSVGIcon + id="right-svg-icon" + role="presentation" + alt="" + width="30" + height="30" + viewBox="0 0 39 39" + /> + ) : ( + <LockIcon + id="lock-icon" + role="presentation" + alt="" + width="30" + height="30" + viewBox="0 0 39 39" + /> + )}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
services/course-material/src/components/ContentRenderer/moocfi/CourseProgressBlock/CompletionRequirementsTabulation/HilightItem.tsx
(2 hunks)services/course-material/src/components/ContentRenderer/moocfi/CourseProgressBlock/CompletionRequirementsTabulation/index.tsx
(1 hunks)services/course-material/src/components/ContentRenderer/moocfi/NavigationContainer/NextPage.tsx
(1 hunks)services/course-material/src/components/ContentRenderer/moocfi/PagesInChapterBlock/PagesInChapter.tsx
(2 hunks)shared-module/packages/common/src/components/NextSectionLink.tsx
(2 hunks)
✅ Files skipped from review due to trivial changes (1)
- services/course-material/src/components/ContentRenderer/moocfi/CourseProgressBlock/CompletionRequirementsTabulation/index.tsx
⏰ Context from checks skipped due to timeout of 90000ms (3)
- GitHub Check: build
- GitHub Check: build-and-deploy
- GitHub Check: headless_lms
🔇 Additional comments (6)
services/course-material/src/components/ContentRenderer/moocfi/PagesInChapterBlock/PagesInChapter.tsx (2)
12-12
: LGTM!The import of
respondToOrLarger
utility is correctly placed and follows the established import organization pattern.
44-52
: LGTM! Well-implemented responsive design pattern.The font size adjustments follow mobile-first design principles:
- Base size of 1.5rem for mobile
- Scales up to 1.875rem for medium and larger screens using the shared responsive utility
services/course-material/src/components/ContentRenderer/moocfi/NavigationContainer/NextPage.tsx (2)
65-65
: LGTM: Spacing adjustment improves visual hierarchy.The increased margin provides better visual separation between the metrics.
71-76
: LGTM: Enhanced mobile responsiveness.The alignment changes improve readability on mobile while maintaining the original design on larger screens.
services/course-material/src/components/ContentRenderer/moocfi/CourseProgressBlock/CompletionRequirementsTabulation/HilightItem.tsx (1)
3-3
: LGTM!The import of
headingFont
from the shared module is correctly implemented and follows the project's conventions.shared-module/packages/common/src/components/NextSectionLink.tsx (1)
216-216
: Verify layout after addingdisplay: inline-grid
.The addition of
display: inline-grid
to a div that's already using overflow, white-space, and text-overflow properties might cause layout issues, especially since it's nested within a flex container.Please verify that:
- The title and subtitle remain properly aligned
- The text truncation (ellipsis) still works as expected
- The layout remains consistent across different viewport sizes
Summary by CodeRabbit
New Features
Style