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(filter): Set max height for the log-level listbox and refine styling (fixes #150). #155

Merged
merged 2 commits into from
Jan 6, 2025

Conversation

junhaoliao
Copy link
Member

@junhaoliao junhaoliao commented Dec 19, 2024

Description

  1. Set max height for log-level listbox.
  2. Disable "equalWidth" modifier to prevent width auto-resizing with the Select button.
  3. Disable "offset" modifier to remove gap between the listbox and the button.

Validation performed

  1. Repeated the reproduction steps in The log level filter list box does not fully expand to utilize the available height #150 and observe the log-level listbox fully expanded when the viewport is of size 650x330.
  2. Further shrank the height of the window to make it 650x300 and observed the listbox expanded but did not cover the menu bar.
    image

Summary by CodeRabbit

  • Bug Fixes

    • Adjusted styles in the LogLevelSelect component to resolve a rounding issue with the listbox positioning.
    • Updated the listbox's maximum height to ensure it fits within the available vertical space.
  • New Features

    • Enhanced layout of the dropdown menu by disabling automatic width resizing and removing gaps between the listbox and the Select button.

…low width auto-resizing with the `Select` button; disable "offset" modifier to remove gap between the listbox and the button.
@junhaoliao junhaoliao requested a review from davemarco December 19, 2024 15:27
Copy link

coderabbitai bot commented Dec 19, 2024

Walkthrough

The pull request focuses on refining the LogLevelSelect component in the status bar, specifically addressing CSS styling and UI interaction details. The changes involve modifying the CSS file to resolve layout and positioning issues, particularly with the listbox and chip rendering. In the TypeScript component, modifiers are added to the Select component to control width resizing and gap behavior, ensuring a more precise and controlled dropdown menu presentation.

Changes

File Change Summary
src/components/StatusBar/LogLevelSelect/index.css - Added margin-right: 1px to .log-level-select class
- Set .log-level-select-render-value-box-label background to initial
- Replaced max-width: 0 with dynamic max-height in .log-level-select-listbox
src/components/StatusBar/LogLevelSelect/index.tsx - Added slotProps modifiers to Select component
- Disabled automatic width resizing
- Removed gap between listbox and select button

Sequence Diagram

sequenceDiagram
    participant User
    participant LogLevelSelect
    participant Listbox
    
    User->>LogLevelSelect: Click to open
    LogLevelSelect->>Listbox: Render without auto-width
    Listbox-->>User: Display log level options
    User->>Listbox: Select log level
    Listbox->>LogLevelSelect: Update selected value
Loading

Possibly Related PRs


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b15d9e0 and 6a9d110.

📒 Files selected for processing (2)
  • src/components/StatusBar/LogLevelSelect/index.css (1 hunks)
  • src/components/StatusBar/LogLevelSelect/index.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/components/StatusBar/LogLevelSelect/index.tsx
🧰 Additional context used
📓 Learnings (1)
src/components/StatusBar/LogLevelSelect/index.css (2)
Learnt from: junhaoliao
PR: y-scope/yscope-log-viewer#77
File: new-log-viewer/src/components/StatusBar/LogLevelSelect/index.css:6-8
Timestamp: 2024-11-10T16:46:53.300Z
Learning: In this codebase, using `!important` is acceptable when overriding styles from JoyUI components.
Learnt from: junhaoliao
PR: y-scope/yscope-log-viewer#77
File: new-log-viewer/src/components/StatusBar/LogLevelSelect/LogLevelChip.css:6-6
Timestamp: 2024-11-10T16:46:53.300Z
Learning: When overriding JoyUI's default styling, it's acceptable to use `!important` in CSS in this project.
🔇 Additional comments (1)
src/components/StatusBar/LogLevelSelect/index.css (1)

24-24: Excellent implementation of the max-height constraint!

The dynamic calculation using viewport height and CSS variables provides a robust solution that prevents the listbox from overlapping with the menu bar while maintaining flexibility for different viewport sizes.


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
Contributor

@davemarco davemarco left a comment

Choose a reason for hiding this comment

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

Functionality works as expected and fixes #150. Functionality to set max-height is ugly, but i could not think of a better solution in 20 min of testing.

@junhaoliao junhaoliao merged commit 5b368b9 into y-scope:main Jan 6, 2025
5 checks passed
@junhaoliao junhaoliao deleted the fix-log-level-select branch January 6, 2025 20:07
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.

2 participants