-
Notifications
You must be signed in to change notification settings - Fork 0
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
updating colors #35
updating colors #35
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThis pull request introduces a color management strategy across various UI components by replacing hardcoded color values with dynamic CSS custom properties. The changes affect multiple files, including chart components, global CSS, navigation, and Tailwind configuration, allowing for a consistent and flexible theming approach that can be easily customized through CSS variables. Additionally, the test run status in a JSON file has been updated to reflect an interrupted state. Changes
Possibly related PRs
Suggested reviewers
Poem
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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
🧹 Nitpick comments (4)
ui/app/components/VerticalBarChart.tsx (1)
54-66
: Optimize color retrieval to reduce DOM reads.The current implementation calls
getBarColor
multiple times for the same vendor, triggering unnecessary DOM reads.Consider caching the color value:
const chartData = { labels: ["P50", "P95", "P99"], datasets: data.flatMap((item, index) => [ + const itemColor = getBarColor(item.vendor); { label: `${item.vendor} P50`, data: [item.p50, 0, 0], - backgroundColor: getBarColor(item.vendor), + backgroundColor: itemColor, stack: `${index}`, }, { label: `${item.vendor} P95`, data: [0, item.p95, 0], - backgroundColor: getBarColor(item.vendor), + backgroundColor: itemColor, stack: `${index}`, }, { label: `${item.vendor} P99`, data: [0, 0, item.p99], - backgroundColor: getBarColor(item.vendor), + backgroundColor: itemColor, stack: `${index}`, }, ]), };ui/components/ui/nav-main.tsx (1)
87-89
: Maintain consistency in color management.While FalkorDB and Neo4j colors now use Tailwind classes, the third option still uses a hardcoded hex value (#7466FF).
Consider adding this color to your Tailwind config and using it consistently:
- ? "bg-[#F5F4FF] text-FalkorDB border-FalkorDB" - : option.id === "neo4j" - ? "bg-[#F5F4FF] text-Neo4j border-Neo4j" - : "bg-[#F5F4FF] text-[#7466FF] border-[#7466FF]" + ? "bg-highlight text-FalkorDB border-FalkorDB" + : option.id === "neo4j" + ? "bg-highlight text-Neo4j border-Neo4j" + : "bg-highlight text-primary border-primary"Add to tailwind.config.js:
colors: { FalkorDB: 'var(--FalkorDB-color)', Neo4j: 'var(--Neo4j-color)', + primary: 'var(--primary-color)', + highlight: 'var(--highlight-bg)',ui/app/globals.css (2)
52-53
: Consider using HSL color format for consistency.The new color variables use hex format while existing theme colors use HSL. Consider converting the hex colors to HSL for consistency with the existing color system:
#FF804D
→12 100% 65%
#0B6190
→203 86% 30%
- --FalkorDB-color: #FF804D; - --Neo4j-color: #0B6190; + --FalkorDB-color: hsl(12 100% 65%); + --Neo4j-color: hsl(203 86% 30%);
52-53
: Consider adding dark mode variants for brand colors.The brand colors should have dark mode variants to maintain consistency with the theme system's dark mode support. Consider adding corresponding color definitions in the
.dark
selector..dark { /* existing dark mode variables */ + --FalkorDB-color: hsl(12 100% 55%); /* Darker variant */ + --Neo4j-color: hsl(203 86% 25%); /* Darker variant */ }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
ui/app/components/HorizontalBarChart.tsx
(1 hunks)ui/app/components/VerticalBarChart.tsx
(2 hunks)ui/app/globals.css
(1 hunks)ui/components/ui/nav-main.tsx
(1 hunks)ui/tailwind.config.js
(1 hunks)ui/test-results/.last-run.json
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- ui/test-results/.last-run.json
🧰 Additional context used
🪛 Biome (1.9.4)
ui/app/components/VerticalBarChart.tsx
[error] 36-36: This code is unreachable
... because this statement will return from the function beforehand
(lint/correctness/noUnreachable)
🔇 Additional comments (2)
ui/tailwind.config.js (1)
23-24
: LGTM! Well-structured color definitions.The addition of FalkorDB and Neo4j colors using CSS custom properties follows best practices for theme management in Tailwind CSS.
ui/app/globals.css (1)
52-53
: Verify color contrast ratios for accessibility.Please ensure that these brand colors meet WCAG 2.1 contrast requirements when used for text or interactive elements.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
ui/app/components/VerticalBarChart.tsx (1)
31-39
:⚠️ Potential issueFix syntax error and improve error handling in getBarColor.
The previously identified issues in the function are still present and need to be addressed:
- Remove the extra semicolon in the Neo4j case
- Add error handling for getComputedStyle
- Add type safety for document.documentElement
- Add SSR support
Please refer to the previous review comment for the detailed fix.
🧰 Tools
🪛 Biome (1.9.4)
[error] 36-36: This code is unreachable
... because this statement will return from the function beforehand
(lint/correctness/noUnreachable)
🧹 Nitpick comments (1)
ui/app/components/VerticalBarChart.tsx (1)
54-70
: Reduce code duplication in dataset configuration.The backgroundColor and borderRadius properties are repeated across multiple dataset objects. Consider extracting these common properties into a shared configuration object.
const chartData = { labels: ["P50", "P95", "P99"], + const commonDatasetConfig = (vendor: string) => ({ + backgroundColor: getBarColor(vendor), + borderRadius: 8, + }); datasets: data.flatMap((item, index) => [ { label: `${item.vendor} P50`, data: [item.p50, 0, 0], - backgroundColor: getBarColor(item.vendor), - borderRadius: 8, stack: `${index}`, + ...commonDatasetConfig(item.vendor), }, // Apply similar changes to other dataset objects
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
ui/app/components/HorizontalBarChart.tsx
(3 hunks)ui/app/components/VerticalBarChart.tsx
(3 hunks)ui/app/globals.css
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- ui/app/globals.css
- ui/app/components/HorizontalBarChart.tsx
🧰 Additional context used
🪛 Biome (1.9.4)
ui/app/components/VerticalBarChart.tsx
[error] 36-36: This code is unreachable
... because this statement will return from the function beforehand
(lint/correctness/noUnreachable)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Rust project - Build and Test (stable)
@@ -28,14 +28,14 @@ interface VerticalBarChartProps { | |||
xAxisTitle: string; | |||
} | |||
|
|||
const getBarColor = (vendor: string, defaultColor: string) => { | |||
const getBarColor = (vendor: string) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why aren't you use the const backgroundColors ?
Summary by CodeRabbit
Release Notes
New Features
Styling
Configuration
Test Results