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

Fix: Scrollability issue of users list for discord users #934

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

shantanu-02
Copy link
Contributor

@shantanu-02 shantanu-02 commented Jan 5, 2025

Date: 05/01/2025

Developer Name: Shantanu Pawar


Issue Ticket Number

Description

Made a separate container for the list of users so that the scrollability of the list doesn't affect the whole page.

Documentation Updated?

  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Screenshots

Screenshot recording 1
Screen.Recording.2025-01-05.142752.mp4

Test Coverage

Screenshot 1 dashboard_ss

Additional Notes

Summary by CodeRabbit

  • Refactor

    • Reorganized the layout to clearly separate the user list from the user details.
  • Style

    • Enhanced the appearance and behavior of the user list with vertical scrolling and height limits.
    • Updated the presentation of the user details section for consistent visibility and positioning.

Copy link
Member

@Achintya-Chatterjee Achintya-Chatterjee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test screenshot is missing

@shantanu-02
Copy link
Contributor Author

test screenshot is missing

It was just the UX issue...so didn't update/write any tests.

@Achintya-Chatterjee
Copy link
Member

Achintya-Chatterjee commented Jan 10, 2025

test screenshot is missing

It was just the UX issue...so didn't update/write any tests.

@shantanu-02 you have to update the test screenshot, it's mandatory

@AnujChhikara
Copy link
Member

Hello @shantanu-02 can you please attach the test coverage screenshot

Comment on lines +59 to +70

createElement('div', { class: 'users_section' }, [
UsersSection({
users,
showUser,
handleUserSelected,
}),
]),

createElement('div', { class: 'user_details_section' }, [
UserDetailsSection({ user: users[showUser] ?? {} }),
]),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to create the div here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Copy link

coderabbitai bot commented Feb 24, 2025

Walkthrough

The changes update the component structure and styling in the Discord-related user interface. In the App component, the UsersSection and UserDetailsSection are now each wrapped in a <div> with specific class names. In the UserDetailsSection component, a redundant class attribute has been removed from the <section> element. The CSS has been modified: the .users_section gains scrollability and a maximum height, while the .user_details_section loses grid positioning in favor of sticky positioning and full height, with an update to the main element to occupy 100% height. No control flow or data handling changes were introduced.

Changes

File(s) Affected Summary of Changes
users/discord/App.js Wrapped UsersSection and UserDetailsSection in separate <div> elements with classes users_section and user_details_section respectively.
users/discord/components/UserDetailsSection.js Removed the class attribute from the <section> element, altering its styling or identification.
users/discord/style.css Redefined .users_section with overflow-y: auto and max-height: 20rem; updated .user_details_section by removing grid-area and margin, and adding position: sticky and height: 100%; also set the main element’s height to 100%.

Sequence Diagram(s)

Poem

I’m a hopper in the code, a rabbit full of glee,
New wrappers dance neatly, as plain as can be.
CSS tweaks and styling hops along the way,
Each line of change makes my burrow bright as day.
Through shifting divs and styles, I bound with delight—
Celebrating code changes under the starry night!
🐰✨


🪧 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. (Beta)
  • @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.

Copy link

@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

🧹 Nitpick comments (2)
users/discord/style.css (2)

66-71: User Details Section Sticky Positioning

Switching the .user_details_section to use position: sticky and setting its height to 100% helps maintain its visibility during scroll. To ensure consistent sticky behavior across all browsers, please consider adding an explicit top: 0; property. For example:

.user_details_section {
   padding: 1rem;
   background-color: var(--light-gray);
+  top: 0;
   position: sticky;
   height: 100%;
}

73-76: Minor Formatting Consistency

The annotation on the closing block of .user_details_field (line 76, marked with "~") may indicate a minor formatting change. Please double-check that this change is intentional and consistent with the rest of the file’s formatting.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ce6be97 and 946e6e9.

📒 Files selected for processing (3)
  • users/discord/App.js (1 hunks)
  • users/discord/components/UserDetailsSection.js (0 hunks)
  • users/discord/style.css (3 hunks)
💤 Files with no reviewable changes (1)
  • users/discord/components/UserDetailsSection.js
✅ Files skipped from review due to trivial changes (1)
  • users/discord/App.js
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: test
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (2)
users/discord/style.css (2)

12-20: Main Element Height Configuration

The addition of height: 100% to the main element ensures that it stretches to fill its container, which is important for the proper layout of internal grid areas. Make sure that its parent containers (e.g., html and body) are also set to height: 100% to avoid potential layout issues.


41-47: Users Section Scrollability Enhancement

The .users_section now includes overflow-y: auto and max-height: 20rem, which localizes scrolling to the users list. This change should effectively resolve the scrollability issue for Discord users. Consider verifying that the fixed max-height is appropriate across different screen sizes or if responsiveness adjustments are needed in the future.

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.

Fix: User information container on /users/discord page of the dashboard.
6 participants