Add card labels - #4
Merged
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds card labels - board-scoped, colored labels you can attach to cards (Trello-style).
Schema
Labelmodel (name,color,boardId) with aCard<->Labelmany-to-many (_CardLabelsjoin). Applied additively viaprisma db push(no destructive changes).Backend
app/actions/label.ts:getBoardLabels,createLabel,updateLabel,deleteLabel,toggleCardLabel- all gated by board write access (viewers can''t modify).lib/authz.tsso board + label actions share one authorization source.getBoardDatanow includes each card''s labels; the board Server Component fetches the label palette and seeds it into the store.Frontend
boardLabelsstate +addLabel/editLabel/removeLabel/toggleCardLabel, all optimistic with rollback + error toasts.Verification
prisma db push-> database in sync (Neon Postgres)Labeltable,Card.labels,Board.labelsall resolve)next buildcompiles all routes;tsc --noEmit-> exit 0Notes
Generated with Claude Code