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: dynamically adjust dropdown width to prevent text wrapping #504

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

DevanjoyDas
Copy link
Contributor

Description

This PR addresses the issue where the dropdown menu in the navigation bar had a fixed width, causing text wrapping for longer items and excessive space for shorter items. The dropdown width now adjusts dynamically based on the length of the longest link, ensuring a more consistent and responsive UI.

Screenshot
DropDownIssueSolved

Fixes #503

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

Copy link

netlify bot commented Jan 2, 2025

Deploy Preview for peaceful-ramanujan-288045 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit c8bb3a0
🔍 Latest deploy log https://app.netlify.com/sites/peaceful-ramanujan-288045/deploys/677693ddca061e0008718346
😎 Deploy Preview https://deploy-preview-504--peaceful-ramanujan-288045.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
Collaborator

@ashmit-coder ashmit-coder left a comment

Choose a reason for hiding this comment

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

LGTM! the workflow seems to be failing due to the year changing from 2024 to 2025.

@ashmit-coder
Copy link
Collaborator

hey @thulieblack should we change the year on the main page to 2025 or merge the pr's if only this test is failing?

@DevanjoyDas
Copy link
Contributor Author

DevanjoyDas commented Jan 2, 2025

LGTM! the workflow seems to be failing due to the year changing from 2024 to 2025.

Yes @ashmit-coder , The error is occurring because the test "Contains correct heading" for the landing page heading is expecting the text:
AsyncAPI Conf On Tour 2025

I have created PR #506 implementing the second solution.

Root Cause of the Error:

In the file https://github.com/asyncapi/conference-website/blob/master/cypress/e2e/Landing.cy.js

const Year = new Date().getFullYear();
cy.getTestData("landing-heading").contains(`AsyncAPI Conf On Tour ${Year}`);

Possible Solutions

  1. Short term solution only for this Year 2025
    We can change the Heading Directly to 2025 in the file https://github.com/asyncapi/conference-website/blob/master/components/Header/header.js

Current Code

<Heading className='text-6xl sm:text-4xl leading-normal sm:leading-38px tracking-[-3px] sm:tracking-[-0.02em] font-extrabold text-gradient' level='h1' typeStyle='heading'>
			AsyncAPI Conf On Tour 2024
</Heading>

Proposed New Code

<Heading className='text-6xl sm:text-4xl leading-normal sm:leading-38px tracking-[-3px] sm:tracking-[-0.02em] font-extrabold text-gradient' level='h1' typeStyle='heading'>
			AsyncAPI Conf On Tour 2025
</Heading>
  1. Another Short term solution for this year 2025
    We can temporarily modify the code until the official dates for the 2025 Conferences are announced
    In file https://github.com/asyncapi/conference-website/blob/master/cypress/e2e/Landing.cy.js

Current Code

const Year = new Date().getFullYear();
    cy.getTestData("landing-heading").contains(`AsyncAPI Conf On Tour ${Year}`);

Proposed New Code

const Year = new Date().getFullYear();
cy.getTestData("landing-heading").contains(new RegExp(`AsyncAPI Conf On Tour (${Year}|${Year-1})`));
  1. Long term solution for every upcoming Year
    If the heading is supposed to change dynamically each year, we can update the logic in the application to reflect the current year

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.

[BUG] Navigation Dropdown UI issue – text wrapping due to fixed width
2 participants