diff --git a/alembic/versions/0006_checklists.py b/alembic/versions/0006_checklists.py new file mode 100644 index 0000000..1a26f36 --- /dev/null +++ b/alembic/versions/0006_checklists.py @@ -0,0 +1,34 @@ +"""checklists: notes.kind + note_items + +Revision ID: 0006 +Revises: 0005 +Create Date: 2026-07-20 +""" +from alembic import op +import sqlalchemy as sa +from sqlalchemy.dialects.postgresql import UUID + +revision = "0006" +down_revision = "0005" +branch_labels = None +depends_on = None + + +def upgrade() -> None: + op.add_column("notes", sa.Column("kind", sa.Text(), nullable=False, server_default="text")) + op.create_table( + "note_items", + sa.Column("id", UUID(as_uuid=True), primary_key=True), + sa.Column("note_id", UUID(as_uuid=True), sa.ForeignKey("notes.id", ondelete="CASCADE"), nullable=False), + sa.Column("text", sa.Text(), nullable=False), + sa.Column("checked", sa.Boolean(), nullable=False, server_default=sa.false()), + sa.Column("position", sa.Integer(), nullable=False, server_default="0"), + sa.Column("created_at", sa.DateTime(timezone=True), nullable=False, server_default=sa.func.now()), + ) + op.create_index("ix_note_items_note", "note_items", ["note_id"]) + + +def downgrade() -> None: + op.drop_index("ix_note_items_note", table_name="note_items") + op.drop_table("note_items") + op.drop_column("notes", "kind") diff --git a/frontend/src/components/Icon.vue b/frontend/src/components/Icon.vue index 321df71..d2fb296 100644 --- a/frontend/src/components/Icon.vue +++ b/frontend/src/components/Icon.vue @@ -14,6 +14,7 @@ const paths: Record = { pencil: '', plus: '', check: '', + checkbox: '', }; diff --git a/frontend/src/components/NoteCard.vue b/frontend/src/components/NoteCard.vue index 8253861..a2f9b9f 100644 --- a/frontend/src/components/NoteCard.vue +++ b/frontend/src/components/NoteCard.vue @@ -3,6 +3,7 @@ import { useNotesStore } from "../stores/notes"; import { NOTE_CARD_CLASSES, type NoteColor } from "../notes/colors"; import type { Note } from "../stores/notes"; import Icon from "./Icon.vue"; +import NoteChecklist from "./NoteChecklist.vue"; defineProps<{ note: Note }>(); const emit = defineEmits<{ (e: "open", note: Note): void }>(); @@ -18,9 +19,27 @@ function cardClass(color: NoteColor): string { class="group relative mb-4 break-inside-avoid rounded-xl border p-3 shadow-sm transition hover:shadow-md" :class="cardClass(note.color)" > + + +