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(running-queries): adjust position and styling of running queries #426

Merged
merged 2 commits into from
Nov 23, 2024

Conversation

duyet
Copy link
Owner

@duyet duyet commented Nov 23, 2024

Summary by Sourcery

Bug Fixes:

  • Adjust the position and styling of elements in the running queries component to improve layout and readability.

Copy link

vercel bot commented Nov 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clickhouse-monitoring ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 23, 2024 3:55am

Copy link
Contributor

sourcery-ai bot commented Nov 23, 2024

Reviewer's Guide by Sourcery

This PR adjusts the layout and styling of running queries and chart tooltips. The changes focus on improving the visual presentation by reorganizing flex layouts and adjusting positioning of elements.

Class diagram for updated chart tooltip layout

classDiagram
    class ChartTooltip {
        - h: number
        - w: number
        - bg: string
        - color: string
        + renderTooltip(name: string, index: number, item: object): JSX.Element
    }

    class ChartConfig {
        + label: string
    }

    ChartTooltip --> ChartConfig : uses

    note for ChartTooltip "Updated flex layout and positioning for improved styling"
Loading

Class diagram for updated RunningQueries component

classDiagram
    class RunningQueries {
        - className: string
        + render(): JSX.Element
    }

    class Card {
        + className: string
    }

    class CardContent {
        + className: string
    }

    RunningQueries --> Card : uses
    Card --> CardContent : contains

    note for RunningQueries "Adjusted position and styling of elements within the component"
Loading

File-Level Changes

Change Details Files
Restructured chart tooltip layout using flex containers
  • Added flex row layout with baseline alignment and gap spacing
  • Improved spacing between tooltip elements using justify-between
  • Wrapped tooltip content in nested flex containers for better organization
components/generic-charts/area.tsx
Modified running queries display positioning and text styling
  • Changed position from top to bottom of container
  • Added black text color to the running queries link
  • Maintained existing padding and z-index values
components/overview-charts/running-queries.tsx

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov-commenter
Copy link

codecov-commenter commented Nov 23, 2024

Bundle Report

Changes will decrease total bundle size by 7.19kB (-0.11%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
clickhouse-monitoring-bundle-server-cjs 2.52MB 7.46kB (-0.3%) ⬇️
clickhouse-monitoring-bundle-client-array-push 3.71MB 270 bytes (0.01%) ⬆️

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @duyet - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Using 'text-black' directly may cause issues with dark mode - consider using a theme-aware color token instead like the existing 'text-muted-foreground'
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Review instructions: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

} as React.CSSProperties
}
/>
<div className="flex flex-row">
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: Consider extracting the repeated color indicator box and label pattern into a reusable component

This would reduce code duplication and make future maintenance easier.

const ColorIndicator = ({ color, label }: { color: string; label: string }) => (
  <div className="flex flex-row items-center gap-2">
    <div className={`h-2.5 w-2.5 shrink-0 rounded-[2px] bg-[${color}]`} />
    <span>{label}</span>
  </div>
);

@codecov-commenter
Copy link

codecov-commenter commented Nov 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.34%. Comparing base (dec896d) to head (09d62ed).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #426   +/-   ##
=======================================
  Coverage   78.34%   78.34%           
=======================================
  Files           5        5           
  Lines         157      157           
  Branches       57       58    +1     
=======================================
  Hits          123      123           
+ Misses         34       31    -3     
- Partials        0        3    +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@duyet duyet merged commit cc982b4 into main Nov 23, 2024
28 checks passed
@duyet duyet deleted the chore/ui-update branch November 23, 2024 03:59
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