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: the brand color setting does not take effect #4405

Merged
merged 1 commit into from
Sep 14, 2024
Merged

Conversation

anncwb
Copy link
Collaborator

@anncwb anncwb commented Sep 14, 2024

Description

fixed #4375

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

Release Notes

  • New Features

    • Introduced a new theme property in preferences for future theming capabilities.
  • Improvements

    • Enhanced dialog and sheet components with fade transition effects for better user experience.
    • Streamlined CSS variable updates for improved maintainability.
  • Bug Fixes

    • Clarified user navigation behavior after login attempts in the application.
  • Tests

    • Improved robustness of assertions in test cases for better error handling.
  • Chores

    • Minor adjustments in comments and import statements for better code clarity.

@anncwb anncwb added the bug Something isn't working label Sep 14, 2024
@anncwb anncwb requested a review from vince292007 as a code owner September 14, 2024 13:25
Copy link

changeset-bot bot commented Sep 14, 2024

⚠️ No Changeset found

Latest commit: 261e525

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 Sep 14, 2024

Walkthrough

The pull request introduces various changes across multiple files, primarily focusing on code refactoring, minor adjustments to comments, and enhancements to user interface components. Key modifications include the addition of a theme property in the preferences, improvements to the handling of CSS variables, and updates to transition effects in dialog and sheet components. Overall, the changes aim to enhance code clarity, maintainability, and user experience without altering the core functionality.

Changes

File Change Summary
packages/@core/base/shared/src/color/generator.ts Added a blank line after the colorsMap variable declaration.
packages/@core/base/shared/src/utils/__tests__/window.test.ts Minor modification in the import statement for openWindow.
packages/@core/preferences/src/update-css-variables.ts Refactored CSS variable updates using a mapping object for better maintainability.
packages/@core/ui-kit/popup-ui/src/modal/__tests__/modal-api.test.ts Removed a comment about the ModalApi location.
packages/@core/ui-kit/shadcn-ui/src/components/ui/dialog/DialogContent.vue Wrapped DialogOverlay with a Transition component for fade effects.
packages/@core/ui-kit/shadcn-ui/src/components/ui/dialog/DialogOverlay.vue Removed conditional animation classes from the main <div>.
packages/@core/ui-kit/shadcn-ui/src/components/ui/sheet/SheetContent.vue Wrapped SheetOverlay with a Transition component for fade effects.
packages/@core/ui-kit/shadcn-ui/src/components/ui/sheet/SheetOverlay.vue Removed conditional animation classes from the main <div>.
packages/stores/src/modules/lock.test.ts Removed a comment regarding resetting the Pinia store before tests.
packages/stores/src/modules/tabbar.test.ts Introduced optional chaining in assertions to enhance robustness.
packages/stores/src/modules/user.test.ts Removed a comment about resetting user information; functionality remains unchanged.
packages/utils/src/helpers/__tests__/generate-menus.test.ts Reorganized import statements to separate type imports from regular imports.
playground/src/preferences.ts Added a new theme property within the overridesPreferences object.
playground/src/views/demos/features/login-expired/index.vue Modified text to clarify user navigation after login expiration.

Assessment against linked issues

Objective Addressed Explanation
Bug: Ensure all color configurations in preferences are effective (#4375) It's unclear if the new theme property resolves the issue with other colors.

Possibly related PRs

Poem

In the garden where colors bloom,
A theme was added to chase the gloom.
With transitions smooth as a rabbit's hop,
The UI dances, never a stop.
So let us cheer for changes bright,
In code and style, all feels just right! 🐇✨

Tip

OpenAI O1 model for chat
  • We have deployed OpenAI's latest O1 model for chat.
  • OpenAI claims that this model has superior reasoning capabilities than their GPT-4o model.
  • Please share any feedback with us in the discussions post.

Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 38fe642 and 261e525.

Files selected for processing (14)
  • packages/@core/base/shared/src/color/generator.ts (1 hunks)
  • packages/@core/base/shared/src/utils/tests/window.test.ts (1 hunks)
  • packages/@core/preferences/src/update-css-variables.ts (1 hunks)
  • packages/@core/ui-kit/popup-ui/src/modal/tests/modal-api.test.ts (1 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/components/ui/dialog/DialogContent.vue (1 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/components/ui/dialog/DialogOverlay.vue (1 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/components/ui/sheet/SheetContent.vue (1 hunks)
  • packages/@core/ui-kit/shadcn-ui/src/components/ui/sheet/SheetOverlay.vue (1 hunks)
  • packages/stores/src/modules/lock.test.ts (0 hunks)
  • packages/stores/src/modules/tabbar.test.ts (5 hunks)
  • packages/stores/src/modules/user.test.ts (1 hunks)
  • packages/utils/src/helpers/tests/generate-menus.test.ts (1 hunks)
  • playground/src/preferences.ts (1 hunks)
  • playground/src/views/demos/features/login-expired/index.vue (1 hunks)
Files not reviewed due to no reviewable changes (1)
  • packages/stores/src/modules/lock.test.ts
Files skipped from review due to trivial changes (6)
  • packages/@core/base/shared/src/color/generator.ts
  • packages/@core/base/shared/src/utils/tests/window.test.ts
  • packages/@core/ui-kit/popup-ui/src/modal/tests/modal-api.test.ts
  • packages/@core/ui-kit/shadcn-ui/src/components/ui/sheet/SheetOverlay.vue
  • packages/stores/src/modules/user.test.ts
  • packages/utils/src/helpers/tests/generate-menus.test.ts
Additional comments not posted (11)
packages/@core/ui-kit/shadcn-ui/src/components/ui/dialog/DialogOverlay.vue (1)

8-8: Verify the rationale behind removing the animation classes.

The removal of conditional classes that controlled animations based on the dialog state may affect the perceived interactivity of the dialog by removing visual cues that indicate state changes. This change could potentially impact the user experience.

Please provide the rationale behind this change and consider the following:

  • Is there a specific reason for removing the animation classes?
  • Have you considered the impact on user experience due to the lack of visual feedback for state transitions?

If there are no compelling reasons to remove the animation classes, I suggest reconsidering this change to maintain visual feedback for state transitions and enhance the overall user experience.

playground/src/views/demos/features/login-expired/index.vue (1)

27-27: Documentation update looks good!

The updated text provides a clearer explanation of the application's behavior when handling login expiration scenarios. It clarifies that even after logging in through a pop-up and closing it, a refresh will still redirect the user to the login page. This additional information can be helpful for developers and users to understand the expected navigation flow.

packages/@core/ui-kit/shadcn-ui/src/components/ui/sheet/SheetContent.vue (1)

49-51: LGTM!

The addition of the Transition component with the "fade" effect enhances the visual presentation of the SheetOverlay without altering the underlying functionality. The conditional rendering based on the open and modal props maintains the existing logic while providing a smoother user experience.

packages/@core/ui-kit/shadcn-ui/src/components/ui/dialog/DialogContent.vue (1)

55-57: LGTM!

The addition of the Transition component with a fade effect enhances the visual presentation of the dialog overlay, providing a smoother transition when the dialog is opened or closed. The conditional rendering of DialogOverlay based on the open and modal props is correct, and the click event emitting the close event remains unchanged, allowing the dialog to be closed when clicking on the overlay.

These changes improve the user experience while maintaining the existing functionality.

packages/@core/preferences/src/update-css-variables.ts (1)

89-103: Excellent refactor! The changes improve code clarity and efficiency.

The introduction of the colorMappings object and the use of Object.entries() to iterate over the mapping is a more streamlined and maintainable approach compared to the previous implementation with individual checks for specific color variables.

This refactor reduces redundancy, centralizes the logic for updating CSS variables, and enhances the overall readability of the code. The change aligns well with the PR objective of resolving the issue where brand color settings in preferences.ts do not apply correctly.

Great job on this refactor!

packages/stores/src/modules/tabbar.test.ts (6)

66-66: LGTM!

Mocking the router.replace function is necessary for the test case.


70-70: LGTM!

The assertion correctly verifies that after closing all tabs, only one tab remains in the store.


163-163: LGTM!

Using optional chaining ?. improves the robustness of the assertion by handling the case when store.tabs[0] is undefined.


191-191: LGTM!

Using optional chaining ?. improves the robustness of the assertion by handling the case when store.tabs[0] is undefined.


219-219: LGTM!

Using optional chaining ?. improves the robustness of the assertion by handling the case when store.tabs[0] is undefined.


247-247: LGTM!

Using optional chaining ?. improves the robustness of the assertion by handling the case when store.tabs[0] is undefined.


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

@anncwb anncwb merged commit c3d0102 into main Sep 14, 2024
14 checks passed
@anncwb anncwb deleted the fixture/4375 branch September 14, 2024 13:35
@coderabbitai coderabbitai bot mentioned this pull request Oct 6, 2024
Closed
16 tasks
@github-actions github-actions bot locked and limited conversation to collaborators Oct 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
1 participant