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: Prevent dropdown width from shrinking in container picker (#12642) #12745

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

L-Abraham
Copy link

@L-Abraham L-Abraham commented Dec 2, 2024

Summary

Fixes #12642
This PR resolves an issue in the log viewer where the width of the container dropdown fluctuates during expand/collapse, causing misalignment with adjacent buttons.

Occurred changes and/or fixed issues

Modified the .containerPicker CSS class to:

  • Set a min-width of 200px and max-width of 300px to stabilize the dropdown width.
  • Maintain consistent height (height: 30px) with adjacent buttons.
  • Ensured the dropdown no longer resizes or misaligns the buttons when expanded or collapsed

Technical notes summary

  • The CSS update applies only to the containerPicker class within the log viewer context.
  • The fix ensures consistent behaviour across all states (expanded, collapsed) of the dropdown.

Areas or cases that should be tested

  1. Deploy a pod with multiple containers
  2. Open View Logs: Expand and collapse the dropdown multiple times. Verify that the dropdown width does not fluctuate.
  3. Check alignment and responsiveness of buttons next to the dropdown
  4. Test in different browsers (e.g., Chrome, Firefox, Safari) - It was tested in Chrome & Safari

Areas which could experience regressions

  • Ensure no regressions in other components using containerPicker

Screenshots

Before Fix:
before1

before2

After Fix:
Screenshot 2024-12-02 at 5 32 45 PM
Screenshot 2024-12-02 at 5 32 55 PM

NOTE: there was a max-width set, this can be changed or based on your design requirement. Here is what a long container name would look like with the width requirement in place:
Screenshot 2024-12-02 at 5 33 02 PM
Screenshot 2024-12-02 at 5 33 08 PM

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes

@rancher-ui-project-bot rancher-ui-project-bot bot added this to the v2.12.0 milestone Dec 2, 2024
@L-Abraham L-Abraham removed their assignment Dec 2, 2024
@richard-cox richard-cox self-requested a review December 3, 2024 08:33
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.

Width of select container drop down in log viewer bobbles on expand/collapse
1 participant