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

chore: fix chat ui bugs #38100

Closed
wants to merge 1 commit into from
Closed

chore: fix chat ui bugs #38100

wants to merge 1 commit into from

Conversation

jsartisan
Copy link
Contributor

@jsartisan jsartisan commented Dec 11, 2024

/ok-to-test tags="@tag.Anvil"

CE PR for fixing chat UI bugs

Summary by CodeRabbit

  • New Features

    • Added a button to toggle the sidebar's state between "full-width" and "expanded" on mobile devices.
  • Style

    • Updated sidebar styles for improved layout, including a minimum height for the header and new rules for empty header visibility.
    • Introduced a new class for the expand button to enhance alignment.

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/12275050510
Commit: 558f468
Cypress dashboard.
Tags: @tag.Anvil
Spec:


Wed, 11 Dec 2024 11:28:30 UTC

Copy link
Contributor

coderabbitai bot commented Dec 11, 2024

Walkthrough

The changes in this pull request involve modifications to the _SidebarContent component in SidebarContent.tsx and updates to the CSS styles in styles.module.css. A new button for toggling the sidebar's state has been added, which is conditionally rendered based on the mobile state. Additionally, several CSS updates enhance the layout and visibility of the sidebar, including new styles for the header and button, as well as adjustments to existing properties.

Changes

File Change Summary
app/client/packages/design-system/widgets/src/components/Sidebar/src/SidebarContent.tsx Added a new class name styles.sidebarHeaderExpandButton to the Button component for toggling sidebar state.
app/client/packages/design-system/widgets/src/components/Sidebar/src/styles.module.css - Added min-height to .sidebarHeader.
- Introduced .sidebarHeader:empty to hide empty headers.
- Added .sidebarHeaderExpandButton with margin-inline-start: auto;.
- Removed overflow-x from .sidebarContentInner.

Possibly related PRs

Suggested labels

Bug, Design System Product, IDE Product, IDE Pod, ADS Components, ADS Visual Styles, ok-to-test

Suggested reviewers

  • KelvinOm
  • znamenskii-ilia

🎉 In the sidebar, a button does gleam,
To toggle the state, it’s quite the dream!
With styles that align, and heights that are set,
The layout now shines, you’ll never forget!
So here’s to the changes, bright and bold,
In our design system, new stories unfold! 🌟


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 61c90ce and 558f468.

📒 Files selected for processing (2)
  • app/client/packages/design-system/widgets/src/components/Sidebar/src/SidebarContent.tsx (1 hunks)
  • app/client/packages/design-system/widgets/src/components/Sidebar/src/styles.module.css (1 hunks)
🔇 Additional comments (4)
app/client/packages/design-system/widgets/src/components/Sidebar/src/SidebarContent.tsx (1)

Line range hint 49-61: LGTM! Consider verifying mobile view behavior

The expand button implementation looks good with proper conditional rendering and state management.

Let's verify there are no unintended mobile view side effects:

✅ Verification successful

Mobile view behavior verified - implementation is solid

The mobile handling in the sidebar is well-implemented with proper separation of concerns:

  • useIsMobile hook manages mobile state detection
  • SidebarProvider properly integrates mobile state into sidebar context
  • SidebarContent correctly uses isMobile flag to conditionally render the expand button
  • No unintended side effects found in mobile view handling
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other mobile-specific sidebar handling
rg "isMobile.*sidebar" --type typescript

Length of output: 77


Script:

#!/bin/bash
# Search for mobile-specific sidebar handling with correct file type
rg "isMobile.*sidebar" -t ts -t tsx

# Search for isMobile usage in the sidebar component
rg "isMobile" app/client/packages/design-system/widgets/src/components/Sidebar -t ts -t tsx

# Look for other mobile-related code in sidebar components
ast-grep --pattern 'isMobile = $$$'

Length of output: 76785


Script:

#!/bin/bash
# Search for isMobile usage in the Sidebar component with correct file extension
rg "isMobile" "app/client/packages/design-system/widgets/src/components/Sidebar" -g "*.{ts,tsx,js,jsx}"

# Look for mobile-related state handling in the sidebar
rg "mobile.*sidebar|sidebar.*mobile" "app/client/packages/design-system/widgets/src/components/Sidebar" -g "*.{ts,tsx,js,jsx}"

# Find the useSidebar hook implementation
ast-grep --pattern 'export function useSidebar() {
  $$$
}'

Length of output: 2488

app/client/packages/design-system/widgets/src/components/Sidebar/src/styles.module.css (3)

165-165: Good addition for consistent header height

Adding min-height ensures the header maintains its size even when content is dynamically changed.


170-172: Nice UX improvement for empty headers

Hiding empty headers prevents unnecessary whitespace and improves the overall layout.


181-183: Consider RTL support verification

The margin-inline-start usage is good for RTL support. However, let's verify other RTL-related styles.

✅ Verification successful

RTL support is properly implemented

The Sidebar component consistently uses logical properties (inline-start/inline-end) instead of physical properties (left/right) throughout its styles, which ensures proper RTL support. All directional properties use the modern logical property syntax.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for RTL-related properties and potential inconsistencies
rg "margin-(left|right)|float:|text-align:" --type css app/client/packages/design-system/widgets/src/components/Sidebar/

Length of output: 122


Script:

#!/bin/bash
# Let's check for any directional CSS properties in the Sidebar component
rg "(margin|padding|border)-(left|right|inline-start|inline-end|block-start|block-end)|\bfloat:\s|text-align:" app/client/packages/design-system/widgets/src/components/Sidebar/src/styles.module.css

Length of output: 594


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 generate docstrings to generate docstrings for this PR. (Experiment)
  • @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.

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.

@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Dec 11, 2024
@jsartisan
Copy link
Contributor Author

@KelvinOm @znamenskii-ilia This is the CE PR for chat ui bug fixes.

@jsartisan jsartisan added the ok-to-test Required label for CI label Dec 11, 2024
@jsartisan jsartisan closed this Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Required label for CI skip-changelog Adding this label to a PR prevents it from being listed in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants