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

product dropdown improvements #122

Merged
merged 2 commits into from
Nov 21, 2024
Merged

Conversation

jsladerman
Copy link
Contributor

@jsladerman jsladerman commented Nov 20, 2024

per designs
also shrinks the cookiebot dialog a bit on smaller screens since it was too intrusive (closes PROD-2909)

@jsladerman jsladerman added the enhancement New feature or request label Nov 20, 2024
@jsladerman jsladerman requested a review from a team as a code owner November 20, 2024 19:11
Copy link

linear bot commented Nov 20, 2024

Copy link

coderabbitai bot commented Nov 20, 2024

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough
📝 Walkthrough
📝 Walkthrough
📝 Walkthrough

Walkthrough

The changes in this pull request involve modifications to the Navigation.tsx and Menu.tsx components. In Navigation.tsx, adjustments include new CSS properties for width and updated text styles for various link components. In Menu.tsx, the dropdown menus have been enhanced with responsive design updates, including changes to class names and properties that improve layout and spacing. Overall, these changes focus on refining the styling and responsiveness of navigation and menu components.

Changes

File Change Summary
src/components/Navigation.tsx - Added css={{ width: 440 }} to MainLinkBase in ProductLink.
- Updated textStyles in ResponsiveText components.
- Modified padding in MainLinkBase.
src/components/menu/Menu.tsx - Updated DropdownCard class for responsive design.
- Changed PlatformOverviewLinkSC class for max height and min width.
- Added gap-x-medium class to ul in MenuDropdown.
- Set width: 'max-content' in DropdownCardSC.

Poem

🐰 In the land of links so bright,
Our navigation shines with delight.
With styles anew and spacing just right,
The menus dance in responsive light.
Hooray for changes, let’s take flight! 🌟


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.

Copy link

netlify bot commented Nov 20, 2024

Deploy Preview for plural-marketing ready!

Name Link
🔨 Latest commit f78596b
🔍 Latest deploy log https://app.netlify.com/sites/plural-marketing/deploys/673f8547aa8e8d00083d414a
😎 Deploy Preview https://deploy-preview-122--plural-marketing.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

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

🧹 Outside diff range and nitpick comments (1)
src/components/menu/Menu.tsx (1)

308-308: Consider adding max-width constraint

While width: 'max-content' ensures the dropdown fits its content, consider adding a max-width constraint to prevent potential layout issues with very wide content.

 const DropdownCardSC = styled.div<{ $kind: string }>(({ theme, $kind }) => ({
   overflowX: 'hidden',
   overflowY: 'auto',
-  width: 'max-content',
+  width: 'max-content',
+  maxWidth: '90vw', // Prevent extremely wide dropdowns
   padding:
     $kind === 'product' ? theme.spacing.xlarge : `${theme.spacing.xsmall}px 0`,
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between f51c438 and e8a9989.

⛔ Files ignored due to path filters (1)
  • src/generated/graphqlDirectus.ts is excluded by !**/generated/**
📒 Files selected for processing (2)
  • src/components/Navigation.tsx (3 hunks)
  • src/components/menu/Menu.tsx (3 hunks)
🔇 Additional comments (5)
src/components/Navigation.tsx (3)

167-167: LGTM: Padding adjustment aligns with design changes

The reduction in horizontal padding complements the width constraints and appears to be part of the intended design improvements.


46-46: Verify responsive behavior with fixed width

The fixed width of 440px might cause layout issues on smaller screens. Consider using responsive width or max-width constraints.

✅ Verification successful

Fixed width is appropriate for this design

The width of 440px is intentionally used for the product dropdown menu and appears to be part of a responsive design system. The codebase shows:

  • A well-defined breakpoints system (src/breakpoints.ts) with multiple responsive breakpoints
  • Media queries handling different screen sizes throughout the codebase
  • The width is used in a dropdown menu context, which commonly has fixed widths for consistent layout

The fixed width is appropriate here as:

  1. It's used in a dropdown menu where consistent width improves usability
  2. The parent component can handle overflow appropriately
  3. The codebase has proper responsive design patterns in place
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for responsive handling or media queries for this width
rg -A 3 "440" --type css --type typescript
rg -A 3 "width" --type css --type typescript

Length of output: 157


Script:

#!/bin/bash
# Check for responsive handling or media queries for this width
rg -A 3 "440"
rg -A 3 "@media.*width"

Length of output: 36730


57-65: Verify new text style definitions

The text styles have been updated to use mComponentLink and mComponentText. These appear to be design system changes.

src/components/menu/Menu.tsx (2)

224-228: LGTM! Clean implementation of conditional grid layout

The grid layout for product features with appropriate spacing improves the organization and readability of the menu items.


211-211: Consider content overflow handling with max-height constraint

The addition of max-h-[120px] might truncate content on smaller screens. Consider adding overflow handling or ensuring the content always fits within this constraint.

Comment on lines +205 to 207
? 'flex flex-col items-center gap-large min-[1352px]:flex-row'
: ''
}
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Custom breakpoint min-[1352px] deviates from the design system

The codebase has a well-defined breakpoint system in src/breakpoints.ts with standardized values:

  • lg: 1000px
  • xl: 1280px
  • xxl: 1440px

The custom breakpoint min-[1352px] falls between xl and xxl breakpoints and doesn't align with the design system. Consider using either xl (1280px) or xxl (1440px) for better consistency.

🔗 Analysis chain

Verify the custom breakpoint value consistency

The change from lg:flex-row to min-[1352px]:flex-row introduces a specific pixel breakpoint. Ensure this breakpoint (1352px) aligns with the design system's breakpoint standards.


Let me gather more specific information about the breakpoints defined in the system.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other instances of this breakpoint to verify consistency
rg --type tsx --type ts "1352px|min-\[1352px\]"

# Look for any breakpoint definitions in theme files
fd -e ts -e tsx -e js theme | xargs rg "breakpoint"

Length of output: 5144


Script:

#!/bin/bash
# Check the breakpoints.ts file content to understand the defined breakpoints
cat src/breakpoints.ts

# Check the theme configuration
cat tailwind.config.ts

Length of output: 3548

Copy link
Contributor

@nickcernera nickcernera left a comment

Choose a reason for hiding this comment

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

Looks perfect!

Copy link

linear bot commented Nov 21, 2024

@jsladerman jsladerman force-pushed the jake/prod-2898-dropdown-improvements branch from 3e5bf88 to 3e053b5 Compare November 21, 2024 19:02
@jsladerman jsladerman force-pushed the jake/prod-2898-dropdown-improvements branch from 3e053b5 to f78596b Compare November 21, 2024 19:08
@jsladerman jsladerman merged commit 06d0418 into main Nov 21, 2024
10 checks passed
@jsladerman jsladerman deleted the jake/prod-2898-dropdown-improvements branch November 21, 2024 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants