Skip to content

feat: card cover colours (Phase 1 of #155)#515

Open
nickmeinhold wants to merge 1 commit into
kanbn:mainfrom
10xdeca:feat/card-cover-colours
Open

feat: card cover colours (Phase 1 of #155)#515
nickmeinhold wants to merge 1 commit into
kanbn:mainfrom
10xdeca:feat/card-cover-colours

Conversation

@nickmeinhold

Copy link
Copy Markdown
Contributor

Card cover colours (Phase 1 of #155)

Adds an optional cover colour to cards, rendered as a bar across the top of the card on both private and public boards. Set it from the card context menu → Set cover colour (palette swatches from @kan/shared), or clear back to none.

This is the lightweight, palette-based first phase of the theme-customisation request in #155 — no upload infrastructure needed. It deliberately complements @knom's #513 (board backgrounds): different field, different surface, no overlap. (Coordination on the issue: #155 (comment))

What's in it

  • db: nullable card.coverColourCode (varchar(7)) + generated migration
  • api: coverColourCode threaded through card.update input → repo → cardDetail/boardDetailCard output schemas → board query selection
  • web: cover bar on Card; new CardContextCoverColourModal (palette + clear) wired into the card context menu; optimistic update via the existing invalidateCard pattern

Design notes

  • Stores the palette hex (#0d9488…) for consistency with how labels store colourCode.
  • Bidirectional-safe: null clears, undefined leaves untouched (mirrors the existing dueDate handling in card.update).
  • Validation (/^#[0-9a-fA-F]{6}$/) lives at the router boundary.

Verification

  • @kan/db, @kan/api typecheck clean; @kan/web introduces zero new type errors vs main (diffed against baseline).
  • Not yet runtime-verified by me against a live instance — opening as draft for exactly that reason. Happy to add a screenshot / screen-recording and any UX adjustments. Feedback on the picker UX welcome.

Closes part of #155 (Phase 1; cover images and board-level options tracked separately).

Adds an optional cover colour to cards, shown as a bar across the top of
the card on both private and public boards. Set it via the card context
menu ("Set cover colour") using the shared @kan/shared palette, or clear
it back to none.

Phase 1 of the theme-customisation request (kanbn#155): lightweight, palette
based, no upload infrastructure. Complements kanbn#513 (board backgrounds) —
different field, no overlap.

- db: add nullable card.coverColourCode (varchar 7) + migration
- api: thread coverColourCode through card.update input + repo + board/
  card output schemas + board query selection
- web: render cover bar on Card; new CardContextCoverColourModal with
  palette swatches + clear; wire into the card context menu

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@nickmeinhold

Copy link
Copy Markdown
Contributor Author

Verified locally against a running instance (Next dev + Postgres):

  • Render path: cards with a coverColourCode show the colour bar across the top on the board (seeded a teal card directly in the DB → rendered correctly).
  • Setter path: right-click card → Set cover colour → picked Orange from the palette → the card.update mutation persisted #ea580c and the bar re-rendered immediately.
  • Picker is the palette-swatch UX from @kan/shared (clear/none option + the 8 shared colours).

Screenshots to follow. Will flip out of draft once they're attached.

@knom

knom commented Jun 5, 2026

Copy link
Copy Markdown

Hey @nickmeinhold,
I love the work you're doing here!

Why not move to the general of concept of a settings menu and a popup dialog.
Like I also did for board, same would make sense for card!

A central place for item related configuration like also color..

What's your thoughts on that?

@nickmeinhold

Copy link
Copy Markdown
Contributor Author

Screenshots from the local verification run:

kan-515-cards-with-cover-colours kan-515-cover-colour-picker

@nickmeinhold nickmeinhold marked this pull request as ready for review June 6, 2026 01:04
@nickmeinhold

Copy link
Copy Markdown
Contributor Author

Thanks @knom, really appreciate the enthusiasm, and I think you're onto something for the longer term.

Before either of us invests more, I think this is worth a maintainer steer so we build to the project's convention.

Cards already have two config surfaces today: the per-action context-menu items (Manage members, Add / edit label, Set due date), each opening a focused modal, plus the full card detail view where description, labels, members and due date are edited. So unlike boards (which had no config hub, which is exactly why your board settings dialog made sense there), cards already have a "central place".

That makes the cover-colour placement a genuine convention question:

  • A: keep it as a focused context action alongside the existing card-context items (what feat: card cover colours (Phase 1 of #155) #515 does now)
  • B: a unified card settings dialog mirroring board settings, with colour as one section
  • C: fold card visual settings into the existing card detail view rather than a new dialog

@hjball, do you have a preference for how card-level configuration should be organised? Happy to shape #515 to match whatever direction you want, and it'd keep knom's #513 and this PR consistent with each other.

@nickmeinhold

Copy link
Copy Markdown
Contributor Author

And @knom, separately from all the design back-and-forth: it's genuinely great to be collaborating on this with you. Two complementary PRs landing side by side, feedback flowing both ways, this is open source at its best. Looking forward to seeing where it goes.

@knom

knom commented Jun 13, 2026

Copy link
Copy Markdown

Same here!
This is fun 😉

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.

2 participants