Skip to content

[WEB-2282] fix: date picker and member picker dropdown z-index for list, kanban and spreadsheet views#5555

Merged
pushya22 merged 4 commits intopreviewfrom
fix/date-picker-and-assignees
Sep 12, 2024
Merged

[WEB-2282] fix: date picker and member picker dropdown z-index for list, kanban and spreadsheet views#5555
pushya22 merged 4 commits intopreviewfrom
fix/date-picker-and-assignees

Conversation

@sharma01ketan
Copy link
Contributor

@sharma01ketan sharma01ketan commented Sep 9, 2024

[WEB-2282]

Notes:

  • z-10 is chosen for list and gantt view: It was the value prior to the commit which introduced this bug.

  • z-9 for spreadsheet: because value of z-10 solved the issue for vertical scrolling only but not for horizontal scrolling, So the value had to be reduced further.

  • Day Picker refers to both start and end/due date here.

Changes:

List View:

  • Date picker does not overlap the header now.
Screenshot 2024-09-09 at 3 23 22 PM
  • Assignees Dropdown does not overlap the header now
Screenshot 2024-09-09 at 3 24 46 PM

Kanban View:

  • No overlapping with sidebar
Screenshot 2024-09-09 at 3 25 03 PM Screenshot 2024-09-09 at 3 25 35 PM

Spreadsheet View:

  • Same for Spreadsheet View.
Screenshot 2024-09-09 at 3 27 59 PM Screenshot 2024-09-09 at 3 28 33 PM

Previous State:

  • List View
Screenshot 2024-09-09 at 3 34 08 PM
  • Kanban View
Screenshot 2024-09-09 at 3 34 20 PM
  • Spreadsheet
Screenshot 2024-09-09 at 3 34 30 PM

Reference: [WEB-2282]

Summary by CodeRabbit

  • New Features

    • Enhanced DateDropdown and MemberDropdown components to accept a customizable className prop for improved styling flexibility.
    • Introduced a dynamic class name assignment for better reusability and customization options.
  • Bug Fixes

    • No specific bug fixes were included in this release.
  • Documentation

    • Updated component documentation to reflect the addition of the className prop and its usage.

@sharma01ketan sharma01ketan added 🐛bug Something isn't working 🌐frontend labels Sep 9, 2024
@sharma01ketan sharma01ketan added this to the v0.23-dev milestone Sep 9, 2024
@sharma01ketan sharma01ketan self-assigned this Sep 9, 2024
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 9, 2024

Walkthrough

The pull request introduces modifications to several dropdown components within the codebase. Key changes include the addition of a className prop in the DateDropdown, MemberDropdown, and MemberOptions components, enhancing styling flexibility. Additionally, z-index classes have been added to various spreadsheet column components to adjust their stacking order. These updates improve the adaptability and visual layering of the components without altering their core functionality.

Changes

File Path Change Summary
web/core/components/dropdowns/date.tsx Modified DateDropdown to use dynamic class names via className prop for enhanced styling flexibility.
web/core/components/dropdowns/member/index.tsx Added className prop to MemberOptions component within MemberDropdown for improved styling options.
web/core/components/dropdowns/member/member-options.tsx Added optional className to Props interface in MemberOptions, allowing for custom class name usage.
web/core/components/issues/issue-layouts/properties/all-properties.tsx Updated button elements to include additional class "z-10" for visual layering.
web/core/components/issues/issue-layouts/spreadsheet/columns/assignee-column.tsx Added className="z-9" to SpreadsheetAssigneeColumn for stacking order adjustment.
web/core/components/issues/issue-layouts/spreadsheet/columns/due-date-column.tsx Added className="z-9" to SpreadsheetDueDateColumn for stacking order adjustment.
web/core/components/issues/issue-layouts/spreadsheet/columns/start-date-column.tsx Added className="z-9" to SpreadsheetStartDateColumn for stacking order adjustment.

Possibly related PRs

  • [WEB-2201] fix: clear email button on login screen #5546: The changes in the DateDropdown component regarding dynamic class name assignment are related to the addition of the className prop in the MemberDropdown and MemberOptions components, which similarly enhance styling flexibility.

Suggested labels

🌟improvement

Poem

🐇 In the meadow where the dropdowns play,
A sprinkle of class names brightens the day.
With z-index magic, they leap and they bound,
Enhancing the layers, all snug and sound.
Hooray for the changes, let’s hop and rejoice,
For every new feature, we cheer and we voice! 🎉

Tip

New features

Walkthrough comment now includes:

  • Possibly related PRs: A list of potentially related PRs to help you recall past context.
  • Suggested labels: CodeRabbit can now suggest labels by learning from your past PRs. You can also provide custom labeling instructions in the UI or configuration file.

Notes:

  • Please share any feedback in the discussion post on our Discord.
  • Possibly related PRs, automatic label suggestions based on past PRs, learnings, and possibly related issues require data opt-in (enabled by default).

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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.

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: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ad5c6ee and 68f3445.

Files selected for processing (7)
  • web/core/components/dropdowns/date.tsx (1 hunks)
  • web/core/components/dropdowns/member/index.tsx (1 hunks)
  • web/core/components/dropdowns/member/member-options.tsx (2 hunks)
  • web/core/components/issues/issue-layouts/properties/all-properties.tsx (3 hunks)
  • web/core/components/issues/issue-layouts/spreadsheet/columns/assignee-column.tsx (1 hunks)
  • web/core/components/issues/issue-layouts/spreadsheet/columns/due-date-column.tsx (1 hunks)
  • web/core/components/issues/issue-layouts/spreadsheet/columns/start-date-column.tsx (1 hunks)
Files skipped from review due to trivial changes (3)
  • web/core/components/issues/issue-layouts/properties/all-properties.tsx
  • web/core/components/issues/issue-layouts/spreadsheet/columns/assignee-column.tsx
  • web/core/components/issues/issue-layouts/spreadsheet/columns/due-date-column.tsx
Additional comments not posted (3)
web/core/components/issues/issue-layouts/spreadsheet/columns/start-date-column.tsx (1)

43-43: Approve the addition of z-index, but verify against other UI elements.

The addition of className="z-9" to the DateDropdown component is a straightforward fix to control the stacking order. This change should help prevent the date picker from overlapping with the header as intended.

However, it's important to verify that the z-index value of 9 does not conflict with other UI elements in the application. This can be done by checking the z-index values used in other components, especially those that might appear in the same context.

Verification successful

No conflicts found with z-index value of 9.

The z-index value of 9 added to the DateDropdown component does not conflict with other z-index values found in the codebase. The closest value is 10, which is slightly higher, but without specific overlapping contexts, it does not indicate a conflict. If there are known overlapping elements, further manual verification might be needed.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify z-index values across components to ensure no conflicts.

# Test: Search for z-index usage in component styles. Expect: No higher values in overlapping contexts.
rg --type css 'z-index' | grep -v 'z-9'

Length of output: 647

web/core/components/dropdowns/member/index.tsx (1)

156-156: Approve the addition of className prop, but verify its integration.

The addition of the className prop to the MemberOptions component allows for more flexible styling, which is crucial for adjusting UI elements like the assignees dropdown to prevent overlap with other UI components.

It's recommended to verify how this className is being used in different contexts to ensure that it integrates well with the rest of the UI and does not introduce any styling conflicts.

web/core/components/dropdowns/member/member-options.tsx (1)

18-18: Approve the addition and integration of className prop, but verify default behavior.

The addition of the className prop to the MemberOptions component and its integration into the component's main div enhances the flexibility for custom styling, which is crucial for adjusting the UI to prevent overlap and improve usability.

It's recommended to verify the default behavior when the className is not provided to ensure that it does not negatively impact the existing styles or introduce any unexpected issues.

Also applies to: 26-26, 93-94

Comment on lines +159 to +162
className={cn(
"my-1 bg-custom-background-100 shadow-custom-shadow-rg rounded-md overflow-hidden p-3 z-20",
className
)}
Copy link
Contributor

Choose a reason for hiding this comment

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

Refactor suggestion: Simplify dynamic class name assignment.

The dynamic class name assignment using the cn function is correctly implemented to allow for external styling through the className prop. However, the className is being applied twice (lines 160 and 162), which might be redundant or cause confusion.

Consider simplifying the class name assignment to ensure that className is only included once in the final class string. This will make the code cleaner and prevent potential styling conflicts or duplications.

Here's a proposed change to ensure className is applied only once:

              className={cn(
                "my-1 bg-custom-background-100 shadow-custom-shadow-rg rounded-md overflow-hidden p-3 z-20",
-               className
              )}

Committable suggestion was skipped due to low confidence.

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 68f3445 and 962dec4.

Files selected for processing (3)
  • web/core/components/dropdowns/date.tsx (1 hunks)
  • web/core/components/dropdowns/member/index.tsx (1 hunks)
  • web/core/components/dropdowns/member/member-options.tsx (2 hunks)
Files skipped from review as they are similar to previous changes (3)
  • web/core/components/dropdowns/date.tsx
  • web/core/components/dropdowns/member/index.tsx
  • web/core/components/dropdowns/member/member-options.tsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛bug Something isn't working 🌐frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants