';
+ exit;
+}
+
+$dashboardPage = 'feedback';
+$dashboardTitle = 'Tool Feedback';
+$dashboardLead = 'Thumbs up/down + optional notes users left on tool results. Voluntary, case-content-free — a signal for what is working per tool and engine.';
+require_once __DIR__ . '/../includes/layout_dashboard.php';
+?>
+
+
+
Overview
+
+
+
+
+
+
+
+
+
By tool
+
+
+
+
+
By engine
+
+
+
+
+
Recent notes
+
+ Latest voluntary comments (newest first). These are user-written notes, not pasted case text.
+
+
+
+
+
+
+
+
+
diff --git a/includes/layout_dashboard.php b/includes/layout_dashboard.php
index ed75b42..0e73e66 100644
--- a/includes/layout_dashboard.php
+++ b/includes/layout_dashboard.php
@@ -53,6 +53,7 @@ $dashboardNav = [
];
if (dbnToolsIsOwner()) {
$dashboardNav['llm-engines'] = ['url' => '/dashboard/llm-engines.php', 'label' => 'LLM Engines', 'sub' => 'Model routing (owner)'];
+ $dashboardNav['feedback'] = ['url' => '/dashboard/feedback.php', 'label' => 'Tool Feedback', 'sub' => 'Ratings & notes (owner)'];
}
?>
diff --git a/migrations/maindb/002_tool_feedback.sql b/migrations/maindb/002_tool_feedback.sql
new file mode 100644
index 0000000..cc40d31
--- /dev/null
+++ b/migrations/maindb/002_tool_feedback.sql
@@ -0,0 +1,26 @@
+-- 002_tool_feedback.sql
+-- Target DB: dobetternorge_maindb (the tools' operational DB, via dbnmDb()).
+-- Run manually after a mysqldump backup. Idempotent (IF NOT EXISTS).
+--
+-- Per-tool thumbs up/down + optional "what was missed or wrong" note, captured by
+-- the in-result feedback widget (assets/js/tools.js) via api/feedback.php.
+-- Metadata + voluntary comment only — NO pasted case content (process-and-forget).
+--
+-- tool : tool slug the result came from (ask|summarize|redact|timeline|...)
+-- rating : positive | negative
+-- engine : the engine string that produced the result (best-effort, client-supplied)
+-- missed_or_wrong : short optional free-text note (what the tool missed/got wrong)
+-- session_id : PHP session id (coarse de-dupe / abuse signal), not a user identity
+
+CREATE TABLE IF NOT EXISTS tool_feedback (
+ id INT UNSIGNED NOT NULL AUTO_INCREMENT,
+ session_id VARCHAR(40) DEFAULT NULL,
+ tool VARCHAR(30) NOT NULL,
+ rating ENUM('positive','negative') NOT NULL,
+ missed_or_wrong TEXT DEFAULT NULL,
+ engine VARCHAR(60) DEFAULT NULL,
+ created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (id),
+ KEY idx_tool (tool),
+ KEY idx_created (created_at)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;