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(Picker): fix group headers' height and equalise padding #1453

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

ashbork
Copy link
Contributor

@ashbork ashbork commented Dec 10, 2024

Group headers can now stretch vertically, allowing for more than one line to be displayed in a clear way without overflowing the background

Description

Group headers now don't have a limited height, allowing them to stretch to fit the passed name.

Adds a longer group header to the Picker story, makes the group headers' padding equal on top and bottom.

Storybook

https://feature-picker-responsive-group-headers--613a8e945a5665003a05113b.chromatic.com

Checklist

Obligatory:

  • Self review (use this as your final check for proposed changes before requesting the review)
  • Add correct label
  • Assign pull request with the correct issue

Summary by CodeRabbit

  • New Features

    • Updated the display text for the group header in the picker component.
  • Style

    • Adjusted the padding and height of header elements in the picker list item for improved visual layout.

Group headers can now stretch vertically, allowing for more than

one line to be displayed in a clear way without overflowing the background
@ashbork ashbork added the bug Something isn't working label Dec 10, 2024
Copy link
Contributor

coderabbitai bot commented Dec 10, 2024

Walkthrough

The pull request includes styling updates to the PickerListItem.module.scss file, specifically adjusting the padding and height of the &__header class to refine its appearance. Additionally, the DEFAULT_EXTENDED_OPTIONS array in the constants.tsx file has been modified to change the display text of the groupB header. These changes focus on visual adjustments without altering functionality or exported entities.

Changes

File Change Summary
packages/react-components/src/components/Picker/components/PickerListItem.module.scss Adjusted padding for &__header and modified height of ::after pseudo-element.
packages/react-components/src/components/Picker/constants.tsx Updated name property of groupB in DEFAULT_EXTENDED_OPTIONS from 'Group B title header' to 'Group B title header, longer than one line'.

Possibly related PRs

Suggested reviewers

  • marcinsawicki
  • vladko-uxds
  • EmWa94

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 7ed07d2 and 6912434.

📒 Files selected for processing (2)
  • packages/react-components/src/components/Picker/components/PickerListItem.module.scss (1 hunks)
  • packages/react-components/src/components/Picker/constants.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/react-components/src/components/Picker/constants.tsx
🔇 Additional comments (2)
packages/react-components/src/components/Picker/components/PickerListItem.module.scss (2)

93-93: LGTM: Padding equalization improves visual consistency

The change from uneven padding (12px 12px 4px) to equal padding (8px 12px) creates better visual balance in group headers.


101-101: LGTM: Responsive height enables multi-line headers

Changing from fixed height to 100% allows headers to expand naturally with content, preventing text overflow issues.

Let's verify the visual impact:

✅ Verification successful

Let me check the specific context of the PickerListItem height change by looking at related files.


Height change is safe and improves flexibility

The change from fixed height to 100% in PickerListItem is correct and won't conflict with other components. The parent PickerList only enforces height on the "no-results" state (36px), while list items are designed to be flexible with padding and content.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for any hardcoded heights that might conflict
rg -g '*.scss' -g '*.css' --no-heading "height:\s*36px" 

Length of output: 1924


Script:

#!/bin/bash
# Check PickerList and PickerListItem files for height-related styles
cat packages/react-components/src/components/Picker/components/PickerList.module.scss
cat packages/react-components/src/components/Picker/components/PickerListItem.module.scss

Length of output: 4097


🪧 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.

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.

@ashbork ashbork requested review from marcinsawicki and a team December 10, 2024 12:03
@ashbork ashbork merged commit 4d456e0 into main Dec 10, 2024
7 checks passed
@ashbork ashbork deleted the feature/picker-responsive-group-headers branch December 10, 2024 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants