{
"tool_response": {
"type": "update",
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/View\/semantic-explorer\/suche.php",
"content": "<?php\n\ndeclare(strict_types=1);\n\n\/\/ @responsibility: View für semantische Suche mit HTMX Live-Search\n\nob_start();\n?>\n\n<nav class=\"breadcrumb\">\n <a href=\"\/\">Campus KI<\/a> » <a href=\"\/semantic-explorer\">Semantic Explorer<\/a> » Suche\n<\/nav>\n\n<h1>Semantische Suche<\/h1>\n<p>Vektor-basierte Suche in Nutzdaten (Qdrant documents Collection).<\/p>\n\n<div class=\"search-form\">\n <div class=\"form-group\">\n <div class=\"search-input-wrapper\">\n <input type=\"search\"\n id=\"search-input\"\n name=\"q\"\n value=\"<?= htmlspecialchars($query) ?>\"\n placeholder=\"Suchbegriff eingeben...\"\n class=\"search-input\"\n hx-get=\"\/semantic-explorer\/suche\"\n hx-trigger=\"keyup changed delay:300ms, search\"\n hx-target=\"#search-results\"\n hx-swap=\"innerHTML\"\n hx-include=\"#search-limit\"\n hx-indicator=\"#search-spinner\"\n hx-push-url=\"true\"\n autofocus>\n <span id=\"search-spinner\" class=\"htmx-indicator spinner\"><\/span>\n <\/div>\n <\/div>\n <div class=\"form-row\">\n <select id=\"search-limit\" name=\"limit\"\n hx-get=\"\/semantic-explorer\/suche\"\n hx-trigger=\"change\"\n hx-target=\"#search-results\"\n hx-swap=\"innerHTML\"\n hx-include=\"#search-input\"\n hx-push-url=\"true\">\n <option value=\"5\" <?= $limit === 5 ? 'selected' : '' ?>>5 Ergebnisse<\/option>\n <option value=\"10\" <?= $limit === 10 ? 'selected' : '' ?>>10 Ergebnisse<\/option>\n <option value=\"20\" <?= $limit === 20 ? 'selected' : '' ?>>20 Ergebnisse<\/option>\n <\/select>\n <\/div>\n<\/div>\n\n<div id=\"search-results\">\n <?php require __DIR__ . '\/partials\/search-results.php'; ?>\n<\/div>\n\n<p class=\"links-bar\">\n <a href=\"\/semantic-explorer\">Zurueck zum Explorer<\/a>\n<\/p>\n\n<style>\n.search-input-wrapper {\n position: relative;\n display: flex;\n align-items: center;\n}\n.search-input-wrapper .spinner {\n position: absolute;\n right: 1rem;\n}\n.spinner {\n display: inline-block;\n width: 16px;\n height: 16px;\n border: 2px solid var(--color-border, #ddd);\n border-top-color: var(--color-primary, #007bff);\n border-radius: 50%;\n animation: spin 0.8s linear infinite;\n}\n@keyframes spin {\n to { transform: rotate(360deg); }\n}\n<\/style>\n\n<?php $content = ob_get_clean(); ?>\n<?php require VIEW_PATH . '\/layout.php'; ?>\n",
"structuredPatch": [
{
"oldStart": 1,
"oldLines": 5,
"newStart": 1,
"newLines": 12,
"lines": [
"-<?php ob_start(); ?>",
"+<?php",
" ",
"+declare(strict_types=1);",
"+",
"+\/\/ @responsibility: View für semantische Suche mit HTMX Live-Search",
"+",
"+ob_start();",
"+?>",
"+",
" <nav class=\"breadcrumb\">",
" <a href=\"\/\">Campus KI<\/a> » <a href=\"\/semantic-explorer\">Semantic Explorer<\/a> » Suche",
" <\/nav>"
]
},
{
"oldStart": 7,
"oldLines": 58,
"newStart": 14,
"newLines": 72,
"lines": [
" <h1>Semantische Suche<\/h1>",
" <p>Vektor-basierte Suche in Nutzdaten (Qdrant documents Collection).<\/p>",
" ",
"-<form method=\"get\" class=\"search-form\">",
"+<div class=\"search-form\">",
" <div class=\"form-group\">",
"- <input type=\"text\" name=\"q\" value=\"<?= htmlspecialchars($query) ?>\" placeholder=\"Suchbegriff eingeben...\" class=\"search-input\" autofocus>",
"+ <div class=\"search-input-wrapper\">",
"+ <input type=\"search\"",
"+ id=\"search-input\"",
"+ name=\"q\"",
"+ value=\"<?= htmlspecialchars($query) ?>\"",
"+ placeholder=\"Suchbegriff eingeben...\"",
"+ class=\"search-input\"",
"+ hx-get=\"\/semantic-explorer\/suche\"",
"+ hx-trigger=\"keyup changed delay:300ms, search\"",
"+ hx-target=\"#search-results\"",
"+ hx-swap=\"innerHTML\"",
"+ hx-include=\"#search-limit\"",
"+ hx-indicator=\"#search-spinner\"",
"+ hx-push-url=\"true\"",
"+ autofocus>",
"+ <span id=\"search-spinner\" class=\"htmx-indicator spinner\"><\/span>",
"+ <\/div>",
" <\/div>",
" <div class=\"form-row\">",
"- <select name=\"limit\">",
"+ <select id=\"search-limit\" name=\"limit\"",
"+ hx-get=\"\/semantic-explorer\/suche\"",
"+ hx-trigger=\"change\"",
"+ hx-target=\"#search-results\"",
"+ hx-swap=\"innerHTML\"",
"+ hx-include=\"#search-input\"",
"+ hx-push-url=\"true\">",
" <option value=\"5\" <?= $limit === 5 ? 'selected' : '' ?>>5 Ergebnisse<\/option>",
" <option value=\"10\" <?= $limit === 10 ? 'selected' : '' ?>>10 Ergebnisse<\/option>",
" <option value=\"20\" <?= $limit === 20 ? 'selected' : '' ?>>20 Ergebnisse<\/option>",
" <\/select>",
"- <button type=\"submit\" class=\"btn btn--primary\">Suchen<\/button>",
" <\/div>",
"-<\/form>",
"+<\/div>",
" ",
"-<?php if ($query !== '' && !empty($results)): ?>",
"-<h2>Ergebnisse fuer \"<?= htmlspecialchars($query) ?>\"<\/h2>",
"-<p><?= count($results) ?> Treffer gefunden.<\/p>",
"+<div id=\"search-results\">",
"+ <?php require __DIR__ . '\/partials\/search-results.php'; ?>",
"+<\/div>",
" ",
"-<table data-sortable>",
"- <thead>",
"- <tr>",
"- <th data-sort=\"rank\">#<\/th>",
"- <th data-sort=\"score\">Score<\/th>",
"- <th data-sort=\"filename\">Dokument<\/th>",
"- <th data-sort=\"tokens\">Tokens<\/th>",
"- <th data-sort=\"content\">Inhalt<\/th>",
"- <\/tr>",
"- <\/thead>",
"- <tbody>",
"- <?php foreach ($results as $i => $r): ?>",
"- <tr>",
"- <td><?= $i + 1 ?><\/td>",
"- <td><span class=\"badge badge--success\"><?= number_format($r['score'] * 100, 1) ?>%<\/span><\/td>",
"- <td>",
"- <a href=\"\/semantic-explorer\/chunks\/<?= $r['id'] ?>\">#<?= $r['id'] ?><\/a>",
"- <br><small><a href=\"\/semantic-explorer\/dokumente\/<?= $r['document_id'] ?>\"><?= htmlspecialchars($r['filename']) ?><\/a><\/small>",
"- <\/td>",
"- <td><?= $r['token_count'] ?><\/td>",
"- <td><?= htmlspecialchars(substr($r['content'], 0, 150)) ?>...<\/td>",
"- <\/tr>",
"- <?php endforeach; ?>",
"- <\/tbody>",
"-<\/table>",
"-",
"-<?php elseif ($query !== ''): ?>",
"-<p>Keine Ergebnisse fuer \"<?= htmlspecialchars($query) ?>\" gefunden.<\/p>",
"-<p>Stellen Sie sicher, dass Dokumente mit Embeddings vorliegen.<\/p>",
"-<?php endif; ?>",
"-",
" <p class=\"links-bar\">",
" <a href=\"\/semantic-explorer\">Zurueck zum Explorer<\/a>",
" <\/p>",
" ",
"+<style>",
"+.search-input-wrapper {",
"+ position: relative;",
"+ display: flex;",
"+ align-items: center;",
"+}",
"+.search-input-wrapper .spinner {",
"+ position: absolute;",
"+ right: 1rem;",
"+}",
"+.spinner {",
"+ display: inline-block;",
"+ width: 16px;",
"+ height: 16px;",
"+ border: 2px solid var(--color-border, #ddd);",
"+ border-top-color: var(--color-primary, #007bff);",
"+ border-radius: 50%;",
"+ animation: spin 0.8s linear infinite;",
"+}",
"+@keyframes spin {",
"+ to { transform: rotate(360deg); }",
"+}",
"+<\/style>",
"+",
" <?php $content = ob_get_clean(); ?>",
" <?php require VIEW_PATH . '\/layout.php'; ?>"
]
}
],
"originalFile": "<?php ob_start(); ?>\n\n<nav class=\"breadcrumb\">\n <a href=\"\/\">Campus KI<\/a> » <a href=\"\/semantic-explorer\">Semantic Explorer<\/a> » Suche\n<\/nav>\n\n<h1>Semantische Suche<\/h1>\n<p>Vektor-basierte Suche in Nutzdaten (Qdrant documents Collection).<\/p>\n\n<form method=\"get\" class=\"search-form\">\n <div class=\"form-group\">\n <input type=\"text\" name=\"q\" value=\"<?= htmlspecialchars($query) ?>\" placeholder=\"Suchbegriff eingeben...\" class=\"search-input\" autofocus>\n <\/div>\n <div class=\"form-row\">\n <select name=\"limit\">\n <option value=\"5\" <?= $limit === 5 ? 'selected' : '' ?>>5 Ergebnisse<\/option>\n <option value=\"10\" <?= $limit === 10 ? 'selected' : '' ?>>10 Ergebnisse<\/option>\n <option value=\"20\" <?= $limit === 20 ? 'selected' : '' ?>>20 Ergebnisse<\/option>\n <\/select>\n <button type=\"submit\" class=\"btn btn--primary\">Suchen<\/button>\n <\/div>\n<\/form>\n\n<?php if ($query !== '' && !empty($results)): ?>\n<h2>Ergebnisse fuer \"<?= htmlspecialchars($query) ?>\"<\/h2>\n<p><?= count($results) ?> Treffer gefunden.<\/p>\n\n<table data-sortable>\n <thead>\n <tr>\n <th data-sort=\"rank\">#<\/th>\n <th data-sort=\"score\">Score<\/th>\n <th data-sort=\"filename\">Dokument<\/th>\n <th data-sort=\"tokens\">Tokens<\/th>\n <th data-sort=\"content\">Inhalt<\/th>\n <\/tr>\n <\/thead>\n <tbody>\n <?php foreach ($results as $i => $r): ?>\n <tr>\n <td><?= $i + 1 ?><\/td>\n <td><span class=\"badge badge--success\"><?= number_format($r['score'] * 100, 1) ?>%<\/span><\/td>\n <td>\n <a href=\"\/semantic-explorer\/chunks\/<?= $r['id'] ?>\">#<?= $r['id'] ?><\/a>\n <br><small><a href=\"\/semantic-explorer\/dokumente\/<?= $r['document_id'] ?>\"><?= htmlspecialchars($r['filename']) ?><\/a><\/small>\n <\/td>\n <td><?= $r['token_count'] ?><\/td>\n <td><?= htmlspecialchars(substr($r['content'], 0, 150)) ?>...<\/td>\n <\/tr>\n <?php endforeach; ?>\n <\/tbody>\n<\/table>\n\n<?php elseif ($query !== ''): ?>\n<p>Keine Ergebnisse fuer \"<?= htmlspecialchars($query) ?>\" gefunden.<\/p>\n<p>Stellen Sie sicher, dass Dokumente mit Embeddings vorliegen.<\/p>\n<?php endif; ?>\n\n<p class=\"links-bar\">\n <a href=\"\/semantic-explorer\">Zurueck zum Explorer<\/a>\n<\/p>\n\n<?php $content = ob_get_clean(); ?>\n<?php require VIEW_PATH . '\/layout.php'; ?>\n"
}
}