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

[WEB-2765] fix: issue detail page unnecessary scroll #6068

Merged
merged 2 commits into from
Nov 21, 2024

Conversation

anmolsinghbhatia
Copy link
Collaborator

@anmolsinghbhatia anmolsinghbhatia commented Nov 18, 2024

Summary:

This PR addresses following:

  • Resolves the unnecessary scrolling issue on the issue detail page.
  • Fix issue detail sidebar padding.

Reference:

[WEB-2765]

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Enhanced ContentWrapper component to accept an optional className property for improved styling flexibility.
    • Updated ProjectIssueDetailsLayout to utilize the new className feature, enabling better control over overflow behavior.
    • Modified IssueDetailRoot component to improve visual spacing by adjusting padding in the sidebar.
  • Bug Fixes

    • Adjusted styling to prevent overflow issues in the ContentWrapper.

Copy link
Contributor

coderabbitai bot commented Nov 18, 2024

Walkthrough

The changes in this pull request involve modifications to the ContentWrapper component and its usage within the ProjectIssueDetailsLayout. The ContentWrapper now accepts an optional className property, allowing for additional CSS classes to be applied. This update enhances the component's styling flexibility. The ProjectIssueDetailsLayout has been updated to include the overflow-hidden class on the ContentWrapper, affecting its overflow behavior.

Changes

File Path Change Summary
web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/issues/(detail)/layout.tsx Updated ProjectIssueDetailsLayout to include className="overflow-hidden" in ContentWrapper.
web/core/components/core/content-wrapper.tsx Added optional className property to ContentWrapperProps and updated component to use it.
web/core/components/issues/issue-detail/root.tsx Adjusted className for IssueDetailsSidebar to include py-5 instead of pb-5.

Suggested labels

🎨UI / UX

Suggested reviewers

  • sriramveeraghanta
  • SatishGandham

🐇 In the layout where issues reside,
A class was added, oh what a ride!
Overflow hidden, neat and tight,
Content wrapped up, a lovely sight!
With styles that dance and play,
Our UI shines in a brand new way! 🌟


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 1ba70e4 and 3cb4dd1.

📒 Files selected for processing (1)
  • web/core/components/issues/issue-detail/root.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • web/core/components/issues/issue-detail/root.tsx

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.

@anmolsinghbhatia anmolsinghbhatia added this to the v0.24.0 milestone Nov 18, 2024
@anmolsinghbhatia anmolsinghbhatia marked this pull request as ready for review November 18, 2024 11:14
Copy link
Contributor

@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

🧹 Outside diff range and nitpick comments (1)
web/core/components/core/content-wrapper.tsx (1)

12-14: Consider a more flexible overflow control approach

While the implementation is technically correct, the double-layered overflow control might be overly complex:

  • Outer div has hard-coded overflow-hidden
  • Inner div has configurable overflow through className

Consider simplifying by:

  1. Making the outer div's overflow behavior configurable
  2. Using a single layer of overflow control where possible
  3. Adding props specifically for overflow behavior instead of relying on className

Example refactor:

interface ContentWrapperProps {
  className?: string;
  preventOverflow?: boolean;
  children: ReactNode;
}

export const ContentWrapper = ({ 
  className, 
  preventOverflow = false,
  children 
}: ContentWrapperProps) => (
  <div className={cn(
    "h-full w-full",
    preventOverflow && "overflow-hidden"
  )}>
    <div className={cn(
      "relative h-full w-full",
      !preventOverflow && "overflow-x-hidden overflow-y-scroll",
      className
    )}>
      {children}
    </div>
  </div>
);

This approach would:

  • Make the overflow behavior more explicit and configurable
  • Maintain backward compatibility
  • Better separate concerns between structural and visual styling
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between c1ac6e4 and 1ba70e4.

📒 Files selected for processing (2)
  • web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/issues/(detail)/layout.tsx (1 hunks)
  • web/core/components/core/content-wrapper.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • web/app/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/issues/(detail)/layout.tsx
🔇 Additional comments (3)
web/core/components/core/content-wrapper.tsx (3)

4-5: LGTM! Clean import organization

The addition of the cn helper import follows proper import organization patterns.


8-8: LGTM! Well-typed interface extension

The optional className prop is properly typed and maintains backward compatibility.


12-14: Verify the scroll behavior in issue detail page

Let's ensure this change properly fixes the unnecessary scroll issue without causing other scroll-related problems.

✅ Verification successful

Based on the search results, I can now provide a conclusive response about the scroll behavior changes in the ContentWrapper component.

Scroll behavior changes are safe and consistent with app's design

The changes to ContentWrapper are appropriate as:

  • The component is used across many layouts where controlled scrolling is needed
  • The new scroll configuration (overflow-x-hidden overflow-y-scroll) matches the app's scroll pattern used in other major containers
  • Other layout components like issue lists, settings pages, and sidebars follow similar overflow patterns with explicit x/y scroll control
  • The change helps standardize scroll behavior across the application
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for ContentWrapper usage in issue detail related files
echo "Searching for ContentWrapper usage in issue detail layouts..."
rg -l "ContentWrapper" web/app/.*issues.*layout.tsx

# Check for other scroll-related classes near ContentWrapper usage
echo "Checking for scroll-related classes in layouts..."
rg -B 2 -A 2 "overflow-.*scroll" web/app/.*issues.*layout.tsx

Length of output: 499


Script:

#!/bin/bash
# First, let's find the correct path for issue-related files
echo "Finding issue-related files..."
fd "issues.*layout" web/

# Now let's search for ContentWrapper usage in the entire web directory
echo "Searching for ContentWrapper usage..."
rg -l "ContentWrapper" web/

# Check for scroll-related classes near ContentWrapper usage
echo "Checking for scroll-related classes..."
rg -B 2 -A 2 "overflow-.*scroll" web/

Length of output: 29808

@anmolsinghbhatia anmolsinghbhatia marked this pull request as draft November 18, 2024 11:46
@anmolsinghbhatia anmolsinghbhatia marked this pull request as ready for review November 19, 2024 11:11
@pushya22 pushya22 merged commit a446bc0 into preview Nov 21, 2024
22 of 23 checks passed
@pushya22 pushya22 deleted the fix-issue-detail-unnecessary-scroll branch November 21, 2024 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants