{
"event": "PreToolUse",
"tool_name": "mcp__mcp-docs__docs_update",
"tool_input": {
"id": 140,
"title": "Chat UI Redesign: 3-Spalten-Layout (KORRIGIERT)",
"content": "# Chat UI Redesign: 3-Spalten-Layout\n\n## Task #424 - KORRIGIERTER Implementierungsplan\n\n**Version:** 2.0 (nach kritischem Review)\n**Datum:** 2025-12-27\n\n---\n\n## Architektur-Entscheidungen\n\n### Wiederverwendung bestehender Infrastruktur\n\n| Komponente | Status | Aktion |\n|------------|--------|--------|\n| `ManageConfigUseCase` | ✓ Existiert | Wiederverwenden |\n| `ContentConfigRepository` | ✓ Existiert | Wiederverwenden |\n| `ConfigController` (Web) | ✓ Existiert | Nicht ändern |\n| `Controller\\Api\\ConfigController` | ✗ Fehlt | NEU erstellen |\n\n### Korrigierte Prinzipien\n\n| Prinzip | Alter Plan | Korrektur |\n|---------|------------|-----------|\n| **SRP** | ChatController erweitern | Neuer Api\\ConfigController |\n| **DRY** | Doppelte Dropdowns | Settings-Bereich entfernen |\n| **MVC** | Version-Logik im Controller | UseCase nutzen |\n| **ISP** | Interface unvollständig | Interface erweitern |\n| **YAGNI** | History-Browser | Nur Save = neue Version |\n| **WCAG** | Fehlende ARIA | Vollständige A11y |\n\n---\n\n## Dateien und Änderungen\n\n### 1. NEUER Controller: `src\/Controller\/Api\/ConfigController.php`\n\n```php\n<?php\n\ndeclare(strict_types=1);\n\nnamespace Controller\\Api;\n\n\/\/ @responsibility: JSON-API für Config-Operationen (Chat-Integration)\n\nuse Framework\\Controller;\nuse UseCases\\Config\\ManageConfigUseCase;\n\nclass ConfigController extends Controller\n{\n public function __construct(\n private ManageConfigUseCase $configUseCase\n ) {\n }\n\n \/**\n * GET \/api\/v1\/config\/{id}\n * Lädt Config mit Content für Anzeige\n *\/\n public function show(string $id): void\n {\n $config = $this->configUseCase->getById((int) $id);\n \n if ($config === null) {\n $this->json(['error' => 'Config nicht gefunden'], 404);\n return;\n }\n\n $this->json([\n 'id' => $config->id,\n 'name' => $config->name,\n 'type' => $config->type,\n 'content' => $config->content,\n 'version' => $config->version,\n ]);\n }\n\n \/**\n * POST \/api\/v1\/config\/{id}\n * Speichert neue Version (auto-increment)\n *\/\n public function update(string $id): void\n {\n $this->requireCsrf();\n\n $config = $this->configUseCase->getById((int) $id);\n if ($config === null) {\n $this->json(['error' => 'Config nicht gefunden'], 404);\n return;\n }\n\n $newContent = $_POST['content'] ?? '';\n \n \/\/ Auto-increment Version\n $currentVersion = $config->version ?? '1.0';\n $versionParts = explode('.', $currentVersion);\n $newVersion = $versionParts[0] . '.' . ((int) ($versionParts[1] ?? 0) + 1);\n\n $result = $this->configUseCase->update(\n id: (int) $id,\n name: $config->name,\n slug: $config->slug,\n description: $config->description,\n content: $newContent,\n newVersion: $newVersion,\n changeDescription: 'Chat UI Update',\n status: $config->status,\n parentId: $config->parentId\n );\n\n if (!$result->success) {\n $this->json(['error' => $result->message], 400);\n return;\n }\n\n $this->json([\n 'success' => true,\n 'version' => $newVersion,\n 'message' => \"Version {$newVersion} gespeichert\",\n ]);\n }\n}\n```\n\n**Zeilen:** ~70\n**Dependencies:** 1 (ManageConfigUseCase)\n**SRP:** ✓ Nur Config-API\n\n---\n\n### 2. Routes: `routes\/api.php`\n\n**Hinzufügen:**\n\n```php\n\/\/ Config API (für Chat-Integration)\nuse Controller\\Api\\ConfigController;\n\n$router->get('\/api\/v1\/config\/{id}', [ConfigController::class, 'show']);\n$router->post('\/api\/v1\/config\/{id}', [ConfigController::class, 'update']);\n```\n\n---\n\n### 3. Interface erweitern: `src\/Domain\/Repository\/ContentConfigRepositoryInterface.php`\n\n```php\n<?php\n\ndeclare(strict_types=1);\n\nnamespace Domain\\Repository;\n\n\/\/ @responsibility: Interface for content configuration repository\n\ninterface ContentConfigRepositoryInterface\n{\n \/\/ ... bestehende Methoden ...\n\n \/**\n * Save version to history before update.\n *\/\n public function saveHistory(\n int $configId,\n string $content,\n string $version,\n string $changedBy,\n string $changeDescription\n ): void;\n\n \/**\n * Get version history for a config.\n *\n * @return array<int, array<string, mixed>>\n *\/\n public function getHistory(int $configId, int $limit = 10): array;\n}\n```\n\n---\n\n### 4. View: `src\/View\/chat\/index.php`\n\n**ENTFERNEN aus `.chat-settings--advanced`:**\n- `select[name=\"author_profile_id\"]`\n- `select[name=\"system_prompt_id\"]`\n- `select[name=\"structure_id\"]`\n\n**NEU einfügen nach `<aside class=\"chat-sidebar\">...<\/aside>`:**\n\n```php\n<!-- Config Panel -->\n<aside class=\"chat-config\" id=\"configPanel\">\n <div class=\"chat-config__header\">\n <span>Konfiguration<\/span>\n <\/div>\n\n <!-- System Prompt -->\n <div class=\"chat-config__section\" data-config-type=\"system_prompt\">\n <label for=\"configSystemPrompt\" class=\"chat-config__label\">System Prompt<\/label>\n <div class=\"chat-config__row\">\n <select name=\"system_prompt_id\" id=\"configSystemPrompt\" class=\"chat-config__select\"\n aria-describedby=\"systemPromptDesc\">\n <?php foreach ($systemPrompts ?? [] as $prompt): ?>\n <option value=\"<?= $prompt['id'] ?>\"\n data-content=\"<?= htmlspecialchars($prompt['content'] ?? '{}') ?>\"\n <?= $currentPromptId === (int) $prompt['id'] ? 'selected' : '' ?>>\n <?= htmlspecialchars($prompt['name']) ?>\n <\/option>\n <?php endforeach; ?>\n <\/select>\n <button type=\"button\" \n class=\"chat-config__toggle\"\n aria-expanded=\"false\"\n aria-controls=\"systemPromptEdit\"\n aria-label=\"System Prompt bearbeiten\">\n <span aria-hidden=\"true\">▸<\/span>\n <\/button>\n <\/div>\n <div class=\"chat-config__edit\" id=\"systemPromptEdit\" hidden>\n <label for=\"systemPromptText\" class=\"visually-hidden\">System Prompt Inhalt<\/label>\n <textarea id=\"systemPromptText\" \n class=\"chat-config__textarea\"\n rows=\"8\"\n aria-describedby=\"systemPromptDesc\"><\/textarea>\n <p id=\"systemPromptDesc\" class=\"chat-config__hint\">\n JSON-Format. Speichern erstellt neue Version.\n <\/p>\n <button type=\"button\" class=\"chat-config__save\" data-config-id=\"\">\n Speichern\n <\/button>\n <\/div>\n <\/div>\n\n <!-- Ausgabestruktur -->\n <div class=\"chat-config__section\" data-config-type=\"structure\">\n <label for=\"configStructure\" class=\"chat-config__label\">Ausgabestruktur<\/label>\n <div class=\"chat-config__row\">\n <select name=\"structure_id\" id=\"configStructure\" class=\"chat-config__select\">\n <option value=\"0\">Frei (kein Format)<\/option>\n <?php foreach ($outputStructures ?? [] as $structure): ?>\n <option value=\"<?= $structure['id'] ?>\"\n data-content=\"<?= htmlspecialchars($structure['content'] ?? '{}') ?>\">\n <?= htmlspecialchars($structure['name']) ?>\n <\/option>\n <?php endforeach; ?>\n <\/select>\n <button type=\"button\"\n class=\"chat-config__toggle\"\n aria-expanded=\"false\"\n aria-controls=\"structureEdit\"\n aria-label=\"Struktur bearbeiten\">\n <span aria-hidden=\"true\">▸<\/span>\n <\/button>\n <\/div>\n <div class=\"chat-config__edit\" id=\"structureEdit\" hidden>\n <label for=\"structureText\" class=\"visually-hidden\">Struktur Inhalt<\/label>\n <textarea id=\"structureText\"\n class=\"chat-config__textarea\"\n rows=\"8\"><\/textarea>\n <button type=\"button\" class=\"chat-config__save\" data-config-id=\"\">\n Speichern\n <\/button>\n <\/div>\n <\/div>\n\n <!-- Autor-Profil -->\n <div class=\"chat-config__section\" data-config-type=\"author_profile\">\n <label for=\"configAuthor\" class=\"chat-config__label\">Autor-Profil<\/label>\n <div class=\"chat-config__row\">\n <select name=\"author_profile_id\" id=\"configAuthor\" class=\"chat-config__select\">\n <option value=\"0\">Kein Profil<\/option>\n <?php foreach ($authorProfiles ?? [] as $profile): ?>\n <option value=\"<?= $profile['id'] ?>\"\n data-content=\"<?= htmlspecialchars($profile['content'] ?? '{}') ?>\"\n <?= $currentProfileId === (int) $profile['id'] ? 'selected' : '' ?>>\n <?= htmlspecialchars($profile['name']) ?>\n <\/option>\n <?php endforeach; ?>\n <\/select>\n <button type=\"button\"\n class=\"chat-config__toggle\"\n aria-expanded=\"false\"\n aria-controls=\"authorEdit\"\n aria-label=\"Profil bearbeiten\">\n <span aria-hidden=\"true\">▸<\/span>\n <\/button>\n <\/div>\n <div class=\"chat-config__edit\" id=\"authorEdit\" hidden>\n <label for=\"authorText\" class=\"visually-hidden\">Profil Inhalt<\/label>\n <textarea id=\"authorText\"\n class=\"chat-config__textarea\"\n rows=\"8\"><\/textarea>\n <button type=\"button\" class=\"chat-config__save\" data-config-id=\"\">\n Speichern\n <\/button>\n <\/div>\n <\/div>\n<\/aside>\n```\n\n---\n\n### 5. CSS: `public\/css\/chat-redesign.css`\n\n**Hinzufügen:**\n\n```css\n\/* ========================================\n CONFIG PANEL (3-Spalten-Layout)\n =========================... [TRUNCATED-8044e87fd9813b6a]"
}
}
{
"tool_response": [
{
"type": "text",
"text": "{\n \"success\": true,\n \"doc\": {\n \"id\": 140,\n \"parent_id\": null,\n \"slug\": \"chat-ui-redesign-3-spalten\",\n \"path\": \"\/chat-ui-redesign-3-spalten\",\n \"title\": \"Chat UI Redesign: 3-Spalten-Layout (KORRIGIERT)\",\n \"description\": \"Vollständiger Implementierungsplan für Task #424: 3-Spalten-Layout mit Config-Panel\",\n \"content\": \"# Chat UI Redesign: 3-Spalten-Layout\\n\\n## Task #424 - KORRIGIERTER Implementierungsplan\\n\\n**Version:** 2.0 (nach kritischem Review)\\n**Datum:** 2025-12-27\\n\\n---\\n\\n## Architektur-Entscheidungen\\n\\n### Wiederverwendung bestehender Infrastruktur\\n\\n| Komponente | Status | Aktion |\\n|------------|--------|--------|\\n| `ManageConfigUseCase` | ✓ Existiert | Wiederverwenden |\\n| `ContentConfigRepository` | ✓ Existiert | Wiederverwenden |\\n| `ConfigController` (Web) | ✓ Existiert | Nicht ändern |\\n| `Controller\\\\Api\\\\ConfigController` | ✗ Fehlt | NEU erstellen |\\n\\n### Korrigierte Prinzipien\\n\\n| Prinzip | Alter Plan | Korrektur |\\n|---------|------------|-----------|\\n| **SRP** | ChatController erweitern | Neuer Api\\\\ConfigController |\\n| **DRY** | Doppelte Dropdowns | Settings-Bereich entfernen |\\n| **MVC** | Version-Logik im Controller | UseCase nutzen |\\n| **ISP** | Interface unvollständig | Interface erweitern |\\n| **YAGNI** | History-Browser | Nur Save = neue Version |\\n| **WCAG** | Fehlende ARIA | Vollständige A11y |\\n\\n---\\n\\n## Dateien und Änderungen\\n\\n### 1. NEUER Controller: `src\/Controller\/Api\/ConfigController.php`\\n\\n```php\\n<?php\\n\\ndeclare(strict_types=1);\\n\\nnamespace Controller\\\\Api;\\n\\n\/\/ @responsibility: JSON-API für Config-Operationen (Chat-Integration)\\n\\nuse Framework\\\\Controller;\\nuse UseCases\\\\Config\\\\ManageConfigUseCase;\\n\\nclass ConfigController extends Controller\\n{\\n public function __construct(\\n private ManageConfigUseCase $configUseCase\\n ) {\\n }\\n\\n \/**\\n * GET \/api\/v1\/config\/{id}\\n * Lädt Config mit Content für Anzeige\\n *\/\\n public function show(string $id): void\\n {\\n $config = $this->configUseCase->getById((int) $id);\\n \\n if ($config === null) {\\n $this->json(['error' => 'Config nicht gefunden'], 404);\\n return;\\n }\\n\\n $this->json([\\n 'id' => $config->id,\\n 'name' => $config->name,\\n 'type' => $config->type,\\n 'content' => $config->content,\\n 'version' => $config->version,\\n ]);\\n }\\n\\n \/**\\n * POST \/api\/v1\/config\/{id}\\n * Speichert neue Version (auto-increment)\\n *\/\\n public function update(string $id): void\\n {\\n $this->requireCsrf();\\n\\n $config = $this->configUseCase->getById((int) $id);\\n if ($config === null) {\\n $this->json(['error' => 'Config nicht gefunden'], 404);\\n return;\\n }\\n\\n $newContent = $_POST['content'] ?? '';\\n \\n \/\/ Auto-increment Version\\n $currentVersion = $config->version ?? '1.0';\\n $versionParts = explode('.', $currentVersion);\\n $newVersion = $versionParts[0] . '.' . ((int) ($versionParts[1] ?? 0) + 1);\\n\\n $result = $this->configUseCase->update(\\n id: (int) $id,\\n name: $config->name,\\n slug: $config->slug,\\n description: $config->description,\\n content: $newContent,\\n newVersion: $newVersion,\\n changeDescription: 'Chat UI Update',\\n status: $config->status,\\n parentId: $config->parentId\\n );\\n\\n if (!$result->success) {\\n $this->json(['error' => $result->message], 400);\\n return;\\n }\\n\\n $this->json([\\n 'success' => true,\\n 'version' => $newVersion,\\n 'message' => \\\"Version {$newVersion} gespeichert\\\",\\n ]);\\n }\\n}\\n```\\n\\n**Zeilen:** ~70\\n**Dependencies:** 1 (ManageConfigUseCase)\\n**SRP:** ✓ Nur Config-API\\n\\n---\\n\\n### 2. Routes: `routes\/api.php`\\n\\n**Hinzufügen:**\\n\\n```php\\n\/\/ Config API (für Chat-Integration)\\nuse Controller\\\\Api\\\\ConfigController;\\n\\n$router->get('\/api\/v1\/config\/{id}', [ConfigController::class, 'show']);\\n$router->post('\/api\/v1\/config\/{id}', [ConfigController::class, 'update']);\\n```\\n\\n---\\n\\n### 3. Interface erweitern: `src\/Domain\/Repository\/ContentConfigRepositoryInterface.php`\\n\\n```php\\n<?php\\n\\ndeclare(strict_types=1);\\n\\nnamespace Domain\\\\Repository;\\n\\n\/\/ @responsibility: Interface for content configuration repository\\n\\ninterface ContentConfigRepositoryInterface\\n{\\n \/\/ ... bestehende Methoden ...\\n\\n \/**\\n * Save version to history before update.\\n *\/\\n public function saveHistory(\\n int $configId,\\n string $content,\\n string $version,\\n string $changedBy,\\n string $changeDescription\\n ): void;\\n\\n \/**\\n * Get version history for a config.\\n *\\n * @return array<int, array<string, mixed>>\\n *\/\\n public function getHistory(int $configId, int $limit = 10): array;\\n}\\n```\\n\\n---\\n\\n### 4. View: `src\/View\/chat\/index.php`\\n\\n**ENTFERNEN aus `.chat-settings--advanced`:**\\n- `select[name=\\\"author_profile_id\\\"]`\\n- `select[name=\\\"system_prompt_id\\\"]`\\n- `select[name=\\\"structure_id\\\"]`\\n\\n**NEU einfügen nach `<aside class=\\\"chat-sidebar\\\">...<\/aside>`:**\\n\\n```php\\n<!-- Config Panel -->\\n<aside class=\\\"chat-config\\\" id=\\\"configPanel\\\">\\n <div class=\\\"chat-config__header\\\">\\n <span>Konfiguration<\/span>\\n <\/div>\\n\\n <!-- System Prompt -->\\n <div class=\\\"chat-config__section\\\" data-config-type=\\\"system_prompt\\\">\\n <label for=\\\"configSystemPrompt\\\" class=\\\"chat-config__label\\\">System Prompt<\/label>\\n <div class=\\\"chat-config__row\\\">\\n <select name=\\\"system_prompt_id\\\" id=\\\"configSystemPrompt\\\" class=\\\"chat-config__select\\\"\\n aria-describedby=\\\"systemPromptDesc\\\">\\n <?php foreach ($systemPrompts ?? [] as $prompt): ?>\\n <option value=\\\"<?= $prompt['id'] ?>\\\"\\n data-content=\\\"<?= htmlspecialchars($prompt['content'] ?? '{}') ?>\\\"\\n <?= $currentPromptId === (int) $prompt['id'] ? 'selected' : '' ?>>\\n <?= htmlspecialchars($prompt['name']) ?>\\n <\/option>\\n <?php endforeach; ?>\\n <\/select>\\n <button type=\\\"button\\\" \\n class=\\\"chat-config__toggle\\\"\\n aria-expanded=\\\"false\\\"\\n aria-controls=\\\"systemPromptEdit\\\"\\n aria-label=\\\"System Prompt bearbeiten\\\">\\n <span aria-hidden=\\\"true\\\">▸<\/span>\\n <\/button>\\n <\/div>\\n <div class=\\\"chat-config__edit\\\" id=\\\"systemPromptEdit\\\" hidden>\\n <label for=\\\"systemPromptText\\\" class=\\\"visually-hidden\\\">System Prompt Inhalt<\/label>\\n <textarea id=\\\"systemPromptText\\\" \\n class=\\\"chat-config__textarea\\\"\\n rows=\\\"8\\\"\\n aria-describedby=\\\"systemPromptDesc\\\"><\/textarea>\\n <p id=\\\"systemPromptDesc\\\" class=\\\"chat-config__hint\\\">\\n JSON-Format. Speichern erstellt neue Version.\\n <\/p>\\n <button type=\\\"button\\\" class=\\\"chat-config__save\\\" data-config-id=\\\"\\\">\\n Speichern\\n <\/button>\\n <\/div>\\n <\/div>\\n\\n <!-- Ausgabestruktur -->\\n <div class=\\\"chat-config__section\\\" data-config-type=\\\"structure\\\">\\n <label for=\\\"configStructure\\\" class=\\\"chat-config__label\\\">Ausgabestruktur<\/label>\\n <div class=\\\"chat-config__row\\\">\\n <select name=\\\"structure_id\\\" id=\\\"configStructure\\\" class=\\\"chat-config__select\\\">\\n <option value=\\\"0\\\">Frei (kein Format)<\/option>\\n <?php foreach ($outputStructures ?? [] as $structure): ?>\\n <option value=\\\"<?= $structure['id'] ?>\\\"\\n data-content=\\\"<?= htmlspecialchars($structure['content'] ?? '{}') ?>\\\">\\n <?= htmlspecialchars($structure['name']) ?>\\n <\/option>\\n <?php endforeach; ?>\\n <\/select>\\n <button type=\\\"button\\\"\\n class=\\\"chat-config__toggle\\\"\\n aria-expanded=\\\"false\\\"\\n aria-controls=\\\"structureEdit\\\"\\n aria-label=\\\"Struktur bearbeiten\\\">\\n <span aria-hidden=\\\"true\\\">▸<\/span>\\n <\/button>\\n <\/div>\\n <div class=\\\"chat-config__edit\\\" id=\\\"structureEdit\\\" hidden>\\n <label for=\\\"structureText\\\" class=\\\"visually-hidden\\\">Struktur Inhalt<\/label>\\n <textarea id=\\\"structureText\\\"\\n class=\\\"chat-config__textarea\\\"\\n rows=\\\"8\\\"><\/textarea>\\n <button type=\\\"button\\\" class=\\\"chat-config__save\\\" data-config-id=\\\"\\\">\\n Speichern\\n <\/button>\\n <\/div>\\n <\/div>\\n\\n <!-- Autor-Profil -->\\n <div class=\\\"chat-config__section\\\" data-config-type=\\\"author_profile\\\">\\n <label for=\\\"configAuthor\\\" class=\\\"chat-config__label\\\">Autor-Profil<\/label>\\n <div class=\\\"chat-config__row\\\">\\n <select name=\\\"author_profile_id\\\" id=\\\"configAuthor\\\" class=\\\"chat-config__select\\\">\\n <option value=\\\"0\\\">Kein Profil<\/option>\\n <?php foreach ($authorProfiles ?? [] as $profile): ?>\\n <option value=\\\"<?= $profile['id'] ?>\\\"\\n data-content=\\\"<?= htmlspecialchars($profile['content'] ?? '{}') ?>\\\"\\n <?= $currentProfileId === (int) $profile['id'] ? 'selected' : '' ?>>\\n <?= htmlspecialchars($profile['name']) ?>\\n <\/option>\\n <?php endforeach; ?>\\n <\/select>\\n <button type=\\\"button\\\"\\n class=\\\"chat-config__toggle\\\"\\n aria-expanded=\\\"false\\\"\\n ... [TRUNCATED-8239babe12b77545]"
}
]
}