Skip to content

Add card labels - #4

Merged
Zaid-maker merged 1 commit into
mainfrom
feat/card-labels
Jul 19, 2026
Merged

Add card labels#4
Zaid-maker merged 1 commit into
mainfrom
feat/card-labels

Conversation

@Zaid-maker

Copy link
Copy Markdown
Owner

Summary

Adds card labels - board-scoped, colored labels you can attach to cards (Trello-style).

Schema

  • New Label model (name, color, boardId) with a Card <-> Label many-to-many (_CardLabels join). Applied additively via prisma db push (no destructive changes).
  • New boards seed four default labels: Bug / Feature / Enhancement / Urgent.

Backend

  • app/actions/label.ts: getBoardLabels, createLabel, updateLabel, deleteLabel, toggleCardLabel - all gated by board write access (viewers can''t modify).
  • Extracted the board access helpers into lib/authz.ts so board + label actions share one authorization source.
  • getBoardData now includes each card''s labels; the board Server Component fetches the label palette and seeds it into the store.

Frontend

  • Store: boardLabels state + addLabel / editLabel / removeLabel / toggleCardLabel, all optimistic with rollback + error toasts.
  • Card modal: a Labels section to toggle labels on the card, create new labels (name + color swatches), and delete labels.
  • Card face renders colored label chips.

Verification

  • prisma db push -> database in sync (Neon Postgres)
  • Read-only relation checks pass (Label table, Card.labels, Board.labels all resolve)
  • next build compiles all routes; tsc --noEmit -> exit 0

Notes

  • Existing boards (created before this feature) start with 0 labels - labels can be created on them via the modal; only newly created boards get the seeded defaults. A backfill for existing boards could be a follow-up if desired.

Generated with Claude Code

Board-scoped, colored labels that can be attached to cards.

Schema:
- New Label model (name, color, boardId) with a Card <-> Label many-to-many
  (_CardLabels). Applied additively via prisma db push.
- New boards seed four default labels (Bug/Feature/Enhancement/Urgent).

Backend:
- app/actions/label.ts: getBoardLabels, createLabel, updateLabel,
  deleteLabel, toggleCardLabel - all gated by board write access.
- Extract the board access helpers into lib/authz.ts so board and label
  actions share a single authorization source.
- getBoardData now includes card labels; board page fetches the label
  palette and seeds it into the store.

Frontend:
- Store: boardLabels state + addLabel/editLabel/removeLabel/toggleCardLabel
  with optimistic updates and rollback.
- Card modal: Labels section to toggle labels on the card, create new
  labels (name + color swatches), and delete labels.
- Card face renders colored label chips.

Verified: prisma db push synced; read-only relation checks pass;
next build compiles all routes; tsc clean.

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

vercel Bot commented Jul 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
flowee Ready Ready Preview, Comment Jul 19, 2026 8:31pm

@Zaid-maker
Zaid-maker merged commit 3e22f98 into main Jul 19, 2026
3 checks passed
@Zaid-maker
Zaid-maker deleted the feat/card-labels branch July 19, 2026 20:32
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.

1 participant