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

Fixed timestamp alignment on quality page #8106

Merged
merged 7 commits into from
Jul 12, 2024
Merged

Conversation

klakhov
Copy link
Contributor

@klakhov klakhov commented Jul 2, 2024

Motivation and context

The timestamp looks incorrectly aligned + margin after the icon looks too big.

Before:
image

After:
image

How has this been tested?

Checklist

  • I submit my changes into the develop branch
  • I have created a changelog fragment
  • [ ] I have updated the documentation accordingly
  • [ ] I have added tests to cover my changes
  • [ ] I have linked related issues (see GitHub docs)
  • [ ] I have increased versions of npm packages if it is necessary
    (cvat-canvas,
    cvat-core,
    cvat-data and
    cvat-ui)

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

Summary by CodeRabbit

  • Bug Fixes

    • Aligned the quality report button and timestamp on the quality page.
  • Style

    • Updated styling for buttons and quality settings switch on the analytics page.
  • Refactor

    • Reorganized the layout of the quality report controls for improved clarity and usability using Ant Design's Row and Col components.

Copy link
Contributor

coderabbitai bot commented Jul 2, 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

The recent update refines the layout and aesthetics of the quality report controls in the CVAT application's quality page. This includes styling adjustments in the components and reorganization of the report controls with Ant Design's Row and Col components, ensuring better alignment and usability of the UI elements.

Changes

Files Change Summary
changelog.d/20240702_124739_klakhov_fix_quality_timestamp.md Added a changelog entry detailing the fix for aligning the quality report button and timestamp.
cvat-ui/src/components/analytics-page/styles.scss Adjusted style rules for button icons and settings switch; removed specific quality summary controls.
cvat-ui/src/components/analytics-page/task-quality/mean-quality.tsx Refactored MeanQuality component: reorganized layout using Ant Design's Row and Col.

Sequence Diagram(s)

No sequence diagram required as changes pertain to UI layout and styling, without altering the fundamental control flow.

Poem

In the realm of code so sleek,
A rabbit hops quick to tweak,
Aligning reports with grace,
Enhancing the CVAT interface.
With rows and columns placed so neat,
The user's task is now a treat. 🐇✨


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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.

@klakhov klakhov marked this pull request as ready for review July 2, 2024 10:02
Copy link
Contributor

@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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 84dde61 and d259e3d.

Files selected for processing (3)
  • changelog.d/20240702_124739_klakhov_fix_quality_timestamp.md (1 hunks)
  • cvat-ui/src/components/analytics-page/styles.scss (3 hunks)
  • cvat-ui/src/components/analytics-page/task-quality/mean-quality.tsx (2 hunks)
Files skipped from review due to trivial changes (1)
  • changelog.d/20240702_124739_klakhov_fix_quality_timestamp.md
Additional comments not posted (19)
cvat-ui/src/components/analytics-page/styles.scss (2)

96-97: LGTM!

The added CSS rule ensures that the margin at the end of inline elements is set to 0, which fixes the alignment issue.


132-132: LGTM!

The adjusted padding uses a variable for consistency and improves the visual alignment of the quality settings switch.

cvat-ui/src/components/analytics-page/task-quality/mean-quality.tsx (17)

8-8: LGTM!

The imported Col and Row components are necessary for the layout reorganization.


60-60: LGTM!

The added Row component improves the visual alignment of the quality report controls.


61-61: LGTM!

The added Col component inside the Row component contributes to the layout reorganization.


62-62: LGTM!

The nested Row component inside the Col component further improves the visual alignment of the quality report controls.


63-63: LGTM!

The nested Col component inside the Row component further contributes to the layout reorganization.


64-66: LGTM!

The conditional rendering ensures that the Button component is only rendered if taskReport?.id is defined.


66-75: LGTM!

The added Button component with a DownloadOutlined icon and a link provides a clear and accessible way to download the quality report.


76-76: LGTM!

The conditional rendering ensures that the Button component is only rendered if taskReport?.id is defined.


78-78: LGTM!

The nested Row component inside the Col component further improves the visual alignment of the quality report controls.


80-80: LGTM!

The Row component with the justify='end' property ensures that the content is aligned to the end.


81-81: LGTM!

The nested Col component inside the Row component further contributes to the layout reorganization.


82-84: LGTM!

The conditional rendering ensures that the timestamp is only rendered if taskReport?.id is defined.


84-86: LGTM!

The added div element with the cvat-analytics-time-hint class displays the timestamp with the appropriate styling.


86-86: LGTM!

The Text component displays the formatted timestamp using moment, improving readability.


87-87: LGTM!

The conditional rendering ensures that the timestamp is only rendered if taskReport?.id is defined.


92-92: LGTM!

The nested Col component inside the Row component further contributes to the layout reorganization.


94-97: LGTM!

The SettingOutlined icon with a click handler provides an accessible way to toggle the quality settings visibility.

@bsekachev
Copy link
Member

IMO the both ways of alignment looks a little strange. The text is flying.

My proposal is something like this. Thus, it looks similar to performance page.

image

Also added Created before timestamp.

@codecov-commenter
Copy link

codecov-commenter commented Jul 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.40%. Comparing base (ad1bcd5) to head (91fabb4).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #8106   +/-   ##
========================================
  Coverage    83.40%   83.40%           
========================================
  Files          389      389           
  Lines        41297    41297           
  Branches      3858     3858           
========================================
  Hits         34442    34442           
  Misses        6855     6855           
Components Coverage Δ
cvat-ui 79.66% <ø> (ø)
cvat-server 86.75% <ø> (ø)

@klakhov
Copy link
Contributor Author

klakhov commented Jul 10, 2024

@bsekachev
Applied

Copy link

sonarcloud bot commented Jul 10, 2024

@klakhov klakhov merged commit 54e857d into develop Jul 12, 2024
33 checks passed
@bsekachev bsekachev deleted the kl/fix-quality-timestamp branch July 15, 2024 09:32
@cvat-bot cvat-bot bot mentioned this pull request Jul 15, 2024
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.

None yet

3 participants