From 70da76c86b042786f693c6d9f3617a81962315b6 Mon Sep 17 00:00:00 2001 From: Agent Zero Date: Fri, 21 Aug 2026 13:58:21 +0200 Subject: [PATCH] feat(UI-Overhaul-Phase8): Kommunikation UI Verbesserungen Migration 0140: Add folder_id column to comm_conversations for folder organization Backend: - CommConversation model: add folder_id field (nullable UUID) Frontend: - Communication.tsx: Wider tree panel (ResizablePanel initialWidth=320, minWidth=240, maxWidth=450) - Phase 8.2 (AI Chat in Kommunikation) already completed in Phase 2 tsc clean, backend import OK --- .../0140_comm_conversation_folders.py | 28 +++++++++++++++++++ app/plugins/builtins/kommunikation/models.py | 1 + frontend/src/pages/Communication.tsx | 6 ++-- 3 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 alembic/versions/0140_comm_conversation_folders.py diff --git a/alembic/versions/0140_comm_conversation_folders.py b/alembic/versions/0140_comm_conversation_folders.py new file mode 100644 index 0000000..390ef69 --- /dev/null +++ b/alembic/versions/0140_comm_conversation_folders.py @@ -0,0 +1,28 @@ +"""Communication: folder_id in comm_conversations for folder organization + +Revision ID: 0140 +Revises: 0139 +Create Date: 2026-08-21 + +Adds folder_id to comm_conversations for folder-based organization. +""" + +from alembic import op +import sqlalchemy as sa +from sqlalchemy.dialects.postgresql import UUID as PGUUID + +# revision identifiers, used by Alembic. +revision = "0140" +down_revision = "0139" +branch_labels = None +depends_on = None + + +def upgrade() -> None: + op.add_column("comm_conversations", sa.Column("folder_id", PGUUID(as_uuid=True), nullable=True)) + op.create_index("ix_comm_conversations_folder", "comm_conversations", ["folder_id"]) + + +def downgrade() -> None: + op.drop_index("ix_comm_conversations_folder", table_name="comm_conversations") + op.drop_column("comm_conversations", "folder_id") diff --git a/app/plugins/builtins/kommunikation/models.py b/app/plugins/builtins/kommunikation/models.py index da2b913..ed38031 100644 --- a/app/plugins/builtins/kommunikation/models.py +++ b/app/plugins/builtins/kommunikation/models.py @@ -52,6 +52,7 @@ class CommConversation(Base, TenantMixin, OwnedMixin): last_msg_preview: Mapped[str | None] = mapped_column(Text, nullable=True) last_msg_sender_type: Mapped[str | None] = mapped_column(String(50), nullable=True) metadata_: Mapped[dict[str, Any]] = mapped_column("metadata", JSONB, default=dict, nullable=False) + folder_id: Mapped[uuid.UUID | None] = mapped_column(PGUUID(as_uuid=True), nullable=True) class CommParticipant(Base, TenantMixin, OwnedMixin): diff --git a/frontend/src/pages/Communication.tsx b/frontend/src/pages/Communication.tsx index 5ebcdc3..56111b6 100644 --- a/frontend/src/pages/Communication.tsx +++ b/frontend/src/pages/Communication.tsx @@ -831,9 +831,9 @@ export function CommunicationPage() { {/* Desktop: two-pane layout */}