chore: fix sidebar mobile responsiveness.#38159
Conversation
WalkthroughThe changes in this pull request primarily involve modifications to the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
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
Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (3)
app/client/packages/design-system/widgets/src/components/Sidebar/src/Sidebar.tsx (1)
87-87: LGTM: Clean data attribute implementation.Good use of undefined for falsy state to keep the DOM clean. Consider using a boolean attribute pattern for consistency with other data attributes in the component.
-data-is-mobile={isMobile ? "" : undefined} +data-is-mobile={isMobile || undefined}app/client/packages/design-system/widgets/src/components/Sidebar/src/styles.module.css (2)
25-30: LGTM: Clean responsive design approach.Good use of attribute selectors and container queries. The removal of media queries in favor of attribute-based selectors improves maintainability.
Consider adding
will-change: widthto optimize animations if performance profiling shows benefits.
111-118: LGTM: Clean border handling for mobile/full-width states.Good use of :is() for combining conditions. However, complex selectors might impact performance.
Consider splitting the selector for better performance:
.mainSidebar[data-is-mobile] .sidebar, .mainSidebar[data-state="full-width"][data-side="start"] .sidebar { border-inline-end: none; }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
app/client/packages/design-system/widgets/src/components/Sidebar/src/Sidebar.tsx(2 hunks)app/client/packages/design-system/widgets/src/components/Sidebar/src/styles.module.css(2 hunks)
🔇 Additional comments (3)
app/client/packages/design-system/widgets/src/components/Sidebar/src/Sidebar.tsx (1)
26-26: LGTM: Clean hook usage for mobile state.
The addition of isMobile state follows React best practices for responsive design.
app/client/packages/design-system/widgets/src/components/Sidebar/src/styles.module.css (2)
103-105: LGTM: Good RTL support.
Proper use of logical properties for RTL compatibility.
107-109: LGTM: Consistent border handling.
Maintains symmetry with start position styling.
https://github.com/user-attachments/assets/6eadc643-da55-4b9c-9aae-f07e09bd34cd /ok-to-test tags="@tag.Anvil" <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Enhanced mobile responsiveness for the sidebar component with the addition of a new data attribute. - **Bug Fixes** - Improved styling conditions for the sidebar in various states, ensuring better visual consistency across mobile and full-width displays. - **Style** - Updated CSS selectors for more precise styling of the sidebar, enhancing its responsive behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/12314321713> > Commit: 3ee6c76 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12314321713&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Anvil` > Spec: > <hr>Fri, 13 Dec 2024 11:17:26 UTC <!-- end of auto-generated comment: Cypress test results -->
CleanShot.2024-12-13.at.16.22.10.mp4
/ok-to-test tags="@tag.Anvil"
Summary by CodeRabbit
New Features
Bug Fixes
Style
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/12314321713
Commit: 3ee6c76
Cypress dashboard.
Tags:
@tag.AnvilSpec:
Fri, 13 Dec 2024 11:17:26 UTC