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 colours for sidebar links in dark mode #3325

Merged
merged 3 commits into from
Nov 14, 2024

Conversation

NdekoCode
Copy link
Contributor

@NdekoCode NdekoCode commented Nov 12, 2024

Fix colours for sidebar links in dark mode

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my 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

Previous screenshots

Please add here videos or images of previous status

image (13)

Current screenshots

Please add here videos or images of previous status

Screen.Recording.2024-11-12.at.07.56.56.mov

Summary by CodeRabbit

  • New Features

    • Enhanced active menu and submenu item visibility with dark mode styles.
    • Implemented translatable titles in the Tasks Data Table for improved localization.
  • Style

    • Updated styling for active states in both light and dark themes.
    • Improved visibility of the search input in dark mode.
    • Adjusted border and text color classes for better aesthetics.
  • Bug Fixes

    • Minor adjustments made to class names for better consistency and appearance.

Copy link
Contributor

coderabbitai bot commented Nov 12, 2024

Walkthrough

The pull request introduces styling enhancements for active states in the NavMain and TasksDataTable components, specifically for dark mode. The NavMain component now features updated class names for active menu and submenu items to improve visibility in dark mode. Similarly, the TasksDataTable component incorporates translation functionality and minor styling adjustments for dark mode. The underlying logic and structure of both components remain unchanged.

Changes

File Path Change Summary
apps/web/components/nav-main.tsx Updated class names for active menu and submenu items to include dark mode styles (dark:text-gray-50, dark:bg-sidebar-accent).
apps/web/components/pages/team/tasks/tasks-data-table.tsx Added useTranslations for dynamic title translation and adjusted styling for dark mode (e.g., dark:bg-gray-400).

Possibly related issues

Possibly related PRs

Suggested labels

WEB

Suggested reviewers

  • evereq
  • Cedric921

Poem

In the dark, the menus glow,
With colors bright, they steal the show.
Tasks now sing in a vibrant hue,
Thanks to changes, fresh and new!
A rabbit hops with joy and cheer,
For every task is now more clear! 🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 eslint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

apps/web/components/nav-main.tsx

Oops! Something went wrong! :(

ESLint: 8.46.0

ESLint couldn't find the config "next/core-web-vitals" to extend from. Please check that the name of the config is correct.

The config "next/core-web-vitals" was referenced from the config file in "/apps/web/.eslintrc.json".

If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 5b15740 and 4e7c10b.

📒 Files selected for processing (1)
  • apps/web/components/nav-main.tsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/web/components/nav-main.tsx

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.

@NdekoCode NdekoCode linked an issue Nov 12, 2024 that may be closed by this pull request
@NdekoCode NdekoCode changed the title fix(web): Fix colours for sidebar links in dark mode Fix colours for sidebar links in dark mode Nov 12, 2024
@NdekoCode NdekoCode marked this pull request as ready for review November 12, 2024 06:12
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: 2

🧹 Outside diff range and nitpick comments (2)
apps/web/components/nav-main.tsx (1)

83-85: LGTM! Consider adding hover state transition.

The dark mode implementation for active menu items looks good. The color choices provide good contrast and visibility.

Consider adding dark:hover:text-gray-50 for consistency with the hover state:

- ? 'font-medium bg-[#eaeef4] dark:text-gray-50 dark:bg-sidebar-accent'
+ ? 'font-medium bg-[#eaeef4] dark:text-gray-50 dark:hover:text-gray-50 dark:bg-sidebar-accent'
apps/web/components/pages/team/tasks/tasks-data-table.tsx (1)

47-48: Consider removing the important flag (!) from the focus styles.

While the dark mode styling updates look good, using the important flag (!border) in CSS classes is generally discouraged as it can lead to specificity issues. Consider restructuring the CSS to achieve the same effect without the important flag.

-className="max-w-sm pl-10 bg-transparent border-none dark:focus-visible:!border-[#c8c8c8] transition-all duration-200  placeholder:font-normal"
+className="max-w-sm pl-10 bg-transparent border-none dark:focus-visible:border-[#c8c8c8] transition-all duration-200 placeholder:font-normal [&:focus-visible]:border-[#c8c8c8]"

Also applies to: 55-55

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 1a1d0c6 and 5b15740.

📒 Files selected for processing (2)
  • apps/web/components/nav-main.tsx (3 hunks)
  • apps/web/components/pages/team/tasks/tasks-data-table.tsx (3 hunks)
🔇 Additional comments (3)
apps/web/components/nav-main.tsx (2)

161-161: LGTM! Consistent with parent menu styling.

The dark mode implementation for submenu items maintains visual consistency with parent menu items.


Line range hint 83-161: Verify dark mode color tokens and related components.

Let's ensure the dark mode implementation is complete across related components.

✅ Verification successful

Dark mode implementation is properly configured with CSS variables

The verification shows that the sidebar-accent color token is correctly defined in the Tailwind configuration using CSS variables (hsl(var(--sidebar-accent))). This is a proper implementation that supports both light and dark modes through CSS variable switching, rather than requiring explicit dark mode classes everywhere.

The dark mode classes in the component under review are consistent with this theming approach, where they're used to provide fallback styling while the CSS variables handle the main theming logic.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for other sidebar components that might need dark mode updates
echo "Checking for related sidebar components..."
rg -l "sidebar|dark:" apps/web/components/

# Verify the sidebar-accent color token is properly defined
echo "Checking for sidebar-accent color token definition..."
rg "sidebar-accent" "apps/web/**/*.{css,scss,ts,tsx,js,jsx}"

Length of output: 5794


Script:

#!/bin/bash
# Let's check the tailwind config and theme files for the sidebar-accent color definition
echo "Checking tailwind and theme configurations..."
fd -e js -e ts -e json "tailwind|theme" apps/web/

# Once we find the config files, let's examine their content
echo "Checking color token definitions..."
rg -A 5 "colors|sidebar" apps/web/tailwind.config.js apps/web/theme.config.js 2>/dev/null || true

# Let's also check the specific dark mode implementation in sidebar.tsx
echo "Checking sidebar component implementation..."
rg "dark:" apps/web/components/ui/sidebar.tsx 2>/dev/null || true

Length of output: 1879

apps/web/components/pages/team/tasks/tasks-data-table.tsx (1)

10-10: LGTM: Clean import addition for internationalization.

The addition of the useTranslations import aligns with the project's internationalization strategy.

apps/web/components/nav-main.tsx Outdated Show resolved Hide resolved
Copy link
Contributor Author

@NdekoCode NdekoCode left a comment

Choose a reason for hiding this comment

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

Reviewed

@evereq evereq merged commit 3d71b2e into develop Nov 14, 2024
13 checks passed
@evereq evereq deleted the fix/3324-colours-for-sidebar-links-in-dark-mode branch November 14, 2024 21:37
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.

[Bug] Fix colours for sidebar links in dark mode
3 participants