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

style: adaptation issues in dark mode #4660

Closed
wants to merge 19 commits into from

Conversation

pingsanddoss
Copy link
Contributor

@pingsanddoss pingsanddoss commented Oct 17, 2024

Description

黑暗模式下菜单等主题的适配

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Checklist

ℹ️ Check all checkboxes - this will indicate that you have done everything in accordance with the rules in CONTRIBUTING.

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs:dev command.
  • Run the tests with pnpm test.
  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Summary by CodeRabbit

  • New Features

    • Enhanced menu functionality with improved responsiveness and visual appeal.
    • Updated styling for active and hover states in menu and tab components.
  • Bug Fixes

    • Adjusted state management for menu items to ensure proper initialization and updates.
  • Style

    • Refined hover effects, transitions, and color schemes for menu items and tabs for better visual consistency across themes.

Copy link

changeset-bot bot commented Oct 17, 2024

⚠️ No Changeset found

Latest commit: 0c1c9d8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

coderabbitai bot commented Oct 17, 2024

Walkthrough

The pull request introduces updates to three Vue components: menu.vue, normal-menu.vue, and tabs.vue. Key changes include the addition of a computed property in menu.vue for popup behavior, refinements to slot handling, and adjustments to watch functions for state management. Styling updates across components enhance visual consistency, particularly in hover and active states. The overall functionality remains intact, with no changes to public entity declarations.

Changes

File Path Change Summary
packages/@core/ui-kit/menu-ui/src/components/menu.vue Introduced isMenuPopup computed property, refined getSlot, adjusted watch functions, updated SCSS variables for styling.
packages/@core/ui-kit/menu-ui/src/components/normal-menu/normal-menu.vue Updated hover and active states to use text-primary, refined hover effects and transitions.
packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue Modified class bindings for active tabs to ensure consistent styling across themes.

Possibly related PRs

Suggested labels

documentation, bug

Suggested reviewers

  • vince292007
  • anncwb

Poem

In the menu, colors dance,
Hover states enhance the chance.
Tabs now shine both dark and light,
With every click, they feel just right.
A rabbit's joy in every line,
UI's charm, oh how it shines! 🐇✨


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

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

🧹 Outside diff range and nitpick comments (1)
packages/@core/ui-kit/menu-ui/src/components/normal-menu/normal-menu.vue (1)

89-90: Enhanced active state for menu items

The change to apply text-primary to both the name and icon of active menu items improves visual distinction and contributes to a more cohesive color scheme in dark mode.

Consider adding a transition effect to the color change for a smoother user experience. You can add the following CSS property to the .#{$namespace}-normal-menu__name and .#{$namespace}-normal-menu__icon selectors:

transition: color 0.2s ease;
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between a0fbe0b and 218dee0.

📒 Files selected for processing (3)
  • packages/@core/ui-kit/menu-ui/src/components/menu.vue (6 hunks)
  • packages/@core/ui-kit/menu-ui/src/components/normal-menu/normal-menu.vue (1 hunks)
  • packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue (2 hunks)
🧰 Additional context used
🔇 Additional comments (9)
packages/@core/ui-kit/menu-ui/src/components/normal-menu/normal-menu.vue (2)

83-83: Improved hover state for menu items

The change to apply text-primary on hover for non-active menu items enhances the visual feedback and aligns with the PR's objective of improving dark mode adaptation.


Line range hint 1-158: Summary of changes and their impact

The modifications in this file effectively address the dark mode adaptation issues mentioned in the PR objectives. The styling updates for hover and active states of menu items improve the user interface and interaction feedback. These changes contribute to a more consistent and visually appealing dark mode experience.

Key improvements:

  1. Enhanced hover state for non-active menu items
  2. Improved active state styling for both icon and text
  3. Consistent use of text-primary for interactive elements

The changes are focused and do not introduce any apparent issues or inconsistencies. They align well with the PR's goal of improving the dark mode theme adaptation.

packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue (4)

96-96: Improved dark mode adaptation for active tabs

This change enhances the visual consistency in dark mode by using a semi-transparent primary color (bg-primary/15) instead of the accent color for active tabs. This adjustment likely reduces excessive contrast and provides a more cohesive look in the dark theme, aligning well with the PR's objective of addressing dark mode adaptation issues.


99-99: Consistent styling for tab background elements

This change applies the same color adjustment (fill-primary/15) to the SVG element as was applied to the main background. This ensures visual consistency between the tab's background and its decorative elements in dark mode, contributing to a more polished and cohesive user interface.


133-133: Enhanced text visibility for active tabs in dark mode

This change improves the text color of active tabs in dark mode by using the primary color instead of the accent foreground color. This adjustment:

  1. Enhances readability by potentially increasing contrast with the background.
  2. Maintains visual consistency with the other dark mode adaptations in this PR.
  3. Contributes to a more unified and polished appearance of the tab component in dark mode.

These modifications collectively address the PR's objective of resolving dark mode adaptation issues for the menu and thematic elements.


Line range hint 96-133: Summary: Effective dark mode adaptations

The changes in this file successfully address the PR's objective of resolving dark mode adaptation issues. By consistently applying a semi-transparent primary color theme to active tab backgrounds, SVG elements, and text, these modifications:

  1. Improve visual consistency across the tab component in dark mode.
  2. Potentially enhance readability and reduce excessive contrast.
  3. Create a more cohesive and polished user interface in dark theme.

These adaptations contribute to a better overall user experience in dark mode, aligning well with the goals of the pull request.

packages/@core/ui-kit/menu-ui/src/components/menu.vue (3)

448-455: Enhance visual consistency with updated color variables

The modifications to the color variables within the .is-dark theme enhance the visual consistency of the menu in dark mode. Setting the hover and active colors to use hsl(var(--primary)) aligns the color scheme with the primary theme.


Line range hint 464-471: Improve visual consistency in light theme with updated color variables

The updates to the color variables in the .is-light theme enhance the user experience by aligning hover and active states with the primary color scheme. This ensures a cohesive visual appearance in light mode.


501-508: Align horizontal menu dark theme styling with primary color scheme

The adjustments to the color variables for the .is-dark horizontal menu ensure consistency with the primary theme colors, improving the user interface in dark mode.

packages/@core/ui-kit/menu-ui/src/components/menu.vue Outdated Show resolved Hide resolved
packages/@core/ui-kit/menu-ui/src/components/menu.vue Outdated Show resolved Hide resolved
@pingsanddoss pingsanddoss changed the title style:Adaptation issues in dark mode style: Adaptation issues in dark mode Oct 17, 2024
@pingsanddoss pingsanddoss changed the title style: Adaptation issues in dark mode style: adaptation issues in dark mode Oct 17, 2024
@vince292007
Copy link
Collaborator

vince292007 commented Oct 17, 2024

这个之前改成accent的原因是,有些皮肤是浅色的,这个改成主色会有点问题

@pingsanddoss
Copy link
Contributor Author

我感觉全是黑白的好像不是很好看,逻辑上主题色是用户自己选择的,在黑暗模式下最好也展示出主题色,希望作者可以考虑一下

@vince292007
Copy link
Collaborator

vince292007 commented Oct 17, 2024

后面看看,考虑加个配置菜单色的功能吧,跟主题色分离开

@pingsanddoss
Copy link
Contributor Author

那这个pr接受吗,我觉得可以试一下,后面有其他方案可以再改^_^

vince292007
vince292007 previously approved these changes Oct 17, 2024
@anncwb
Copy link
Collaborator

anncwb commented Oct 17, 2024

ci没有通过

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: 3

🧹 Outside diff range and nitpick comments (2)
packages/stores/src/modules/tabbar.ts (2)

315-322: Translate code comments to English for consistency

The code comments are currently written in Chinese. To maintain consistency across the codebase and facilitate collaboration among international team members, it's recommended to use English for all code comments.


429-434: Translate code comments to English for consistency

The comments in this section are in Chinese. For consistency and better collaboration, please translate code comments to English.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 06ef2ec and 4210c3e.

📒 Files selected for processing (1)
  • packages/stores/src/modules/tabbar.ts (2 hunks)
🧰 Additional context used

packages/stores/src/modules/tabbar.ts Outdated Show resolved Hide resolved
packages/stores/src/modules/tabbar.ts Outdated Show resolved Hide resolved
@pingsanddoss
Copy link
Contributor Author

再试试

@anncwb
Copy link
Collaborator

anncwb commented Oct 21, 2024

这个先暂定下,目前有些皮肤下是有问题。后面整体优化配色的时候在看下

@pingsanddoss
Copy link
Contributor Author

好的谢谢作者

@pingsanddoss pingsanddoss closed this by deleting the head repository Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants