feat(editor): Add custom color picker for sticky notes#23699
feat(editor): Add custom color picker for sticky notes#23699RicardoE105 merged 4 commits inton8n-io:masterfrom
Conversation
There was a problem hiding this comment.
2 issues found across 11 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/frontend/@n8n/design-system/src/components/N8nSticky/Sticky.vue">
<violation number="1" location="packages/frontend/@n8n/design-system/src/components/N8nSticky/Sticky.vue:7">
P2: Rule violated: **Tests**
The `adjustColorLightness` function lacks unit tests despite being core functionality for computing theme-aware border colors. This function contains non-trivial RGB manipulation and percentage adjustment logic that should be tested. Consider adding tests for edge cases like:
- Positive/negative percentage adjustments
- Boundary values (pure black #000000, pure white #FFFFFF)
- Invalid inputs
- Clamping behavior (values exceeding 0-255 range)</violation>
<violation number="2" location="packages/frontend/@n8n/design-system/src/components/N8nSticky/Sticky.vue:110">
P2: The `customColor` class is applied for any string backgroundColor, but CSS variables are only set for valid hex colors. This mismatch causes undefined CSS variable references when an invalid hex color string is provided. Consider adding validation to the class condition to match the style generation logic.</violation>
</file>
Reply to cubic to teach it or ask questions. Tag @cubic-dev-ai to re-run a review.
packages/frontend/@n8n/design-system/src/components/N8nSticky/Sticky.vue
Outdated
Show resolved
Hide resolved
packages/frontend/@n8n/design-system/src/components/N8nSticky/Sticky.vue
Show resolved
Hide resolved
Allow users to select any custom color for sticky notes in addition to the 7 preset colors. Adds an 8th color button with a rainbow gradient that opens a color picker modal with hex input and recent colors history. Custom colors feature theme-aware borders that automatically adjust for optimal visibility in both light and dark modes. Key changes: - Add custom color picker modal using N8nColorPicker component - Extend sticky note color type from number to number | string - Add theme-aware border adjustment (20% darker in light mode, 80% lighter in dark mode) - Add hex color validation and lightness adjustment utilities with tests - Store up to 8 recent custom colors in localStorage - Add 20 unit tests for color utilities - Add 13 unit tests for sticky note component - Full backward compatibility with existing preset colors (1-7) 🤖 Generated with [Claude Code](https://claude.com/claude-code) ## Related Community forum posts - https://community.n8n.io/t/expand-color-palette-or-add-custom-color-picker-for-sticky-notes/166547 - https://community.n8n.io/t/more-colors-custom-colors-for-sticky-notes/52508 - https://community.n8n.io/t/sticky-note-colors-created/15343
1fd3a16 to
b90caf8
Compare
|
@Joffcom @RicardoE105 Thought you'd both get a kick out of this. Hope you're doing well! |
|
Hey @LudwigGerdes, Thank you for your contribution. We appreciate the time and effort you’ve taken to submit this pull request. Before we can proceed, please ensure the following: Regarding new nodes: If your node integrates with an AI service that you own or represent, please email nodes@n8n.io and we will be happy to discuss the best approach. About review timelines: Thank you again for contributing to n8n. |
|
Is this going to make it in? This would be a really nice feature! |
…stom-color-picker # Conflicts: # packages/frontend/@n8n/i18n/src/locales/en.json
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
@LudwigGerdes had to simplify it to get it merged. We can later iterate and add the recent colors section back again. Hope you do not mind. Very very cool contribution, you rock 🚀 |
@RicardoE105 Bro, you're the best! This is going to be 🔥 |
|
Got released with |
Co-authored-by: Ricardo Espinoza <ricardo@n8n.io>
Summary
Allow users to select any custom color for sticky notes in addition to the 7 preset colors. Adds an 8th color button with a rainbow gradient that opens a color picker modal with hex input and recent colors history. Custom colors feature theme-aware borders that automatically adjust for optimal visibility in both light and dark modes.
Key changes:
🤖 Generated with assistance from Claude Code
Example Color Palettes (Light & Dark Mode)
Example Color Picker (Light & Dark Mode)
Example Custom Color Modal (Light & Dark Mode)
Related Linear tickets, Github issues, and Community forum posts
Review / Merge checklist
release/backport(if the PR is an urgent fix that needs to be backported)