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

Open
wants to merge 17 commits into
base: main
Choose a base branch
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 updated computed properties for better state management.
    • Improved tab management with sorting logic for pinned and unpinned tabs.
  • Bug Fixes

    • Refined hover and active states for menu items to ensure better visual feedback.
  • Style

    • Updated SCSS variables for menu item appearances and transitions for improved layout and spacing.
    • Consistent styling adjustments for active tabs across different themes.

Copy link

changeset-bot bot commented Oct 17, 2024

⚠️ No Changeset found

Latest commit: ecfdb19

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 changes in this pull request involve updates to the menu.vue, normal-menu.vue, and tabs.vue components within the UI kit. Enhancements include the addition of computed properties and styling adjustments to improve responsiveness and visual consistency. The menu.vue component now includes logic for popup behavior and refined slot management, while normal-menu.vue and tabs.vue have updated styling for active and hover states. Overall, these modifications enhance user interaction and maintain a cohesive visual theme across the components.

Changes

File Path Change Summary
packages/@core/ui-kit/menu-ui/src/components/menu.vue Added computed properties for menu behavior, refined slot management, updated watch functions, modified initMenu logic, and adjusted SCSS styling variables.
packages/@core/ui-kit/menu-ui/src/components/normal-menu/normal-menu.vue Updated hover and active state styling for menu items, with refined transitions and visual feedback. No changes to props or emitted events.
packages/@core/ui-kit/tabs-ui/src/components/tabs-chrome/tabs.vue Modified class bindings for consistent active tab styling, aligning background and text colors with the primary theme across different themes.
packages/stores/src/modules/tabbar.ts Enhanced tab management logic for pinning and unpinning tabs, including sorting logic and improved comments for clarity.

Possibly related PRs

Suggested labels

chore, documentation

Suggested reviewers

  • vince292007
  • anncwb

🐰 In the meadow where menus sway,
A pop-up dance, bright colors play.
With every hover, a joy to see,
Tabs and styles in harmony!
So let us cheer for the UI's glow,
A rabbit's delight in the code we sow! 🌼


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

好的谢谢作者

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