Skip to content

Color Picker: add color favorites#28071

Merged
0xdhrv merged 3 commits into
mainfrom
tpm/codex/color-picker-favorites
May 18, 2026
Merged

Color Picker: add color favorites#28071
0xdhrv merged 3 commits into
mainfrom
tpm/codex/color-picker-favorites

Conversation

@thomaspaulmann
Copy link
Copy Markdown
Member

@thomaspaulmann thomaspaulmann commented May 18, 2026

Addresses some suggestion on 𝕏.

Summary

  • Adds a Favorites section to the Color Picker Organize Colors command.
  • Adds actions to add/remove favorites and move favorites up or down.
  • Keeps favorited colors out of the regular History section so each color appears in only one section.
  • Preserves favorite/title metadata when a color is picked again and keeps favorite items from being trimmed out of cached history.
Raycast 2026-05-18 08 49 43

Validation

  • npm run lint
  • npm run build
  • pnpm dev:xray reached Vite ready and node-backend watch built successfully in /Users/mann/Developer/raycast-clients.

@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: color-picker Issues related to the color-picker extension platform: macOS platform: Windows labels May 18, 2026
@raycastbot
Copy link
Copy Markdown
Collaborator

raycastbot commented May 18, 2026

Thank you for your contribution! 🎉

🔔 @thomaspaulmann @otakustay @EmersonEmerson @pernielsentikaer @arronhunt @kvdo2 @LitoMore @samuelkraft @ridemountainpig @xilopaint @anwarulislam @yusifaliyevpro @elibattistoni @clins1994 you might want to have a look.

You can use this guide to learn how to check out the Pull Request locally in order to test it.

📋 Quick checkout commands
BRANCH="tpm/codex/color-picker-favorites"
FORK_URL="https://github.com/raycast/extensions.git"
EXTENSION_NAME="color-picker"
REPO_NAME="extensions"

git clone -n --depth=1 --filter=tree:0 -b $BRANCH $FORK_URL
cd $REPO_NAME
git sparse-checkout set --no-cone "extensions/$EXTENSION_NAME"
git checkout
cd "extensions/$EXTENSION_NAME"
npm install && npm run dev

We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 10-15 business days.

@raycastbot raycastbot added the OP is author The OP of the PR is the author of the extension label May 18, 2026
@thomaspaulmann thomaspaulmann marked this pull request as ready for review May 18, 2026 08:01
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 18, 2026

Greptile Summary

This PR adds a Favorites feature to the Color Picker's Organize Colors command, allowing users to pin colors into a dedicated Favorites section separate from regular history and reorder them with Move Up/Down actions.

  • history.ts: Extends addToHistory to preserve a favorited color's position and metadata on re-pick, and adds addToFavorites, removeFromFavorites, and moveFavorite operations. The trimming logic now keeps all favorite items outside the MAX_HISTORY_LENGTH cap and limits only the regular history entries.
  • organize-colors.tsx: Splits the flat color list into Favorites and History sections (both List and Grid variants), hiding sections when empty, and surfaces the new favorite/reorder actions in the Organize action panel section.
  • types.ts: Adds an optional isFavorite?: boolean field to HistoryItem.

Confidence Score: 5/5

The change is well-scoped and safe to merge; favorites are stored as a flag on existing history items and all mutation paths correctly handle the favorites-aware trimming and in-place update logic.

The core state mutations (add/remove favorite, move, re-pick update) are all handled correctly. The moveFavorite swap operates on the flat history array and the UI filter preserves relative order, so reordering works as intended. The trimming in addToHistory consistently protects favorite entries from eviction while capping non-favorites at the adjusted limit.

No files require special attention.

Important Files Changed

Filename Overview
extensions/color-picker/src/lib/history.ts Adds favorites support: in-place update of favorites on re-pick, moveFavorite swap logic, and trimming that preserves all favorites while capping regular history entries
extensions/color-picker/src/organize-colors.tsx Splits history into Favorites/History sections via new GridHistorySection and ListHistorySection components; adds Add/Remove Favorites and Move Favorite Up/Down actions
extensions/color-picker/src/lib/types.ts Adds optional isFavorite boolean field to HistoryItem type
extensions/color-picker/CHANGELOG.md Adds Favorites changelog entry with a hardcoded date instead of the {PR_MERGE_DATE} placeholder

Reviews (2): Last reviewed commit: "Color Picker: optimize history managemen..." | Re-trigger Greptile

Comment thread extensions/color-picker/src/lib/history.ts Outdated
Comment thread extensions/color-picker/src/organize-colors.tsx
Comment thread extensions/color-picker/CHANGELOG.md
@0xdhrv 0xdhrv self-assigned this May 18, 2026
@0xdhrv 0xdhrv enabled auto-merge (squash) May 18, 2026 12:34
@0xdhrv 0xdhrv merged commit 54bc81e into main May 18, 2026
10 checks passed
@0xdhrv 0xdhrv deleted the tpm/codex/color-picker-favorites branch May 18, 2026 12:34
@github-actions
Copy link
Copy Markdown
Contributor

Published to the Raycast Store:
https://raycast.com/thomas/color-picker

@raycastbot
Copy link
Copy Markdown
Collaborator

🎉 🎉 🎉

We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extension: color-picker Issues related to the color-picker extension extension fix / improvement Label for PRs with extension's fix improvements OP is author The OP of the PR is the author of the extension platform: macOS platform: Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants