Skip to content

Replace project color dropdown with native color picker#54

Merged
JoeProgrammer88 merged 3 commits intomainfrom
copilot/add-project-color-picker
Mar 25, 2026
Merged

Replace project color dropdown with native color picker#54
JoeProgrammer88 merged 3 commits intomainfrom
copilot/add-project-color-picker

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 25, 2026

Projects were limited to 5 hardcoded color choices. This replaces the <select> with a native <input type="color"> picker, giving users full-spectrum color freedom.

Changes

  • index.html — Swap <select id="projectColor"> for <input type="color" id="projectColor" value="#3b82f6">
  • src/app.ts
    • Add normalizeColor(): maps legacy named colors (blue, red, etc.) to hex, validates output against /^#[0-9a-fA-F]{3,6}$/ to prevent CSS injection, falls back to #3b82f6
    • renderProjectCard(): apply color via style="border-top-color: <hex>" instead of CSS class
    • openProjectModal() / saveProject(): cast #projectColor as HTMLInputElement
  • css/styles.css — Add border-top: 4px solid #3b82f6 default to .project-card for cards without a stored color

Existing projects stored with named colors are transparently migrated through normalizeColor().

Screenshot

Color picker in project modal

Original prompt

This section details on the original issue you should resolve

<issue_title>Add a project color picker</issue_title>
<issue_description>Users would like to be able to choose more variety with their project colors. Instead of only having a few options, let's add a color picker</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: JoeProgrammer88 <7156063+JoeProgrammer88@users.noreply.github.com>
Agent-Logs-Url: https://github.com/SpeakingInBits/TaskManagerWeb/sessions/1760bbae-274e-43db-aa20-0b0c3ba62279
Copilot AI changed the title [WIP] Add color picker for project variety Replace project color dropdown with native color picker Mar 25, 2026
Copilot AI requested a review from JoeProgrammer88 March 25, 2026 22:20
@JoeProgrammer88 JoeProgrammer88 marked this pull request as ready for review March 25, 2026 22:21
Copy link
Copy Markdown
Member

@JoeProgrammer88 JoeProgrammer88 left a comment

Choose a reason for hiding this comment

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

The e2e tests regarding creating a project while picking a named color need to be updated

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 25, 2026

The e2e tests regarding creating a project while picking a named color need to be updated

Updated in commit 2d9fb3a. Replaced page.selectOption('#projectColor', 'green') with page.fill('#projectColor', '#10b981') (the hex equivalent of green) to match the new <input type="color"> element.

Copilot AI requested a review from JoeProgrammer88 March 25, 2026 22:25
@JoeProgrammer88 JoeProgrammer88 merged commit 3ff48af into main Mar 25, 2026
1 check passed
@JoeProgrammer88 JoeProgrammer88 deleted the copilot/add-project-color-picker branch March 25, 2026 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a project color picker

2 participants