From f33e2afdf720da1a4dd8a3151ffb07e0f7ad06d1 Mon Sep 17 00:00:00 2001 From: koko210Serve Date: Sat, 2 May 2026 15:19:10 +0300 Subject: [PATCH] frontend: new Prompt History section HTML + CSS - Replace single
 Last Prompt with rich Prompt History viewer
- Add source filter buttons (All/Cat/Fallback), history dropdown selector
- Add metadata bar, copy-to-clipboard button, middle-truncation toggle
- Add collapsible section CSS classes for expandable subsections
---
 bot/static/css/style.css | 45 ++++++++++++++++++++++++++++++
 bot/static/index.html    | 60 ++++++++++++++++++++++++++++++----------
 2 files changed, 90 insertions(+), 15 deletions(-)

diff --git a/bot/static/css/style.css b/bot/static/css/style.css
index 395068c..a13d57c 100644
--- a/bot/static/css/style.css
+++ b/bot/static/css/style.css
@@ -441,6 +441,51 @@ h1, h3 {
   color: #ddd;
 }
 
+/* Prompt History Section */
+#prompt-history-section.collapsed #prompt-history-body {
+  display: none;
+}
+#prompt-history-toggle {
+  user-select: none;
+  transition: color 0.2s;
+}
+#prompt-history-toggle:hover {
+  color: #4CAF50;
+}
+#prompt-metadata span {
+  white-space: nowrap;
+}
+#prompt-metadata .prompt-meta-label {
+  color: #666;
+}
+#prompt-metadata .prompt-meta-value {
+  color: #ccc;
+}
+#prompt-display pre {
+  margin: 0;
+}
+.prompt-subsection-header {
+  cursor: pointer;
+  user-select: none;
+  padding: 0.3rem 0.5rem;
+  border-radius: 4px;
+  background: #2a2a2a;
+  margin: 0.5rem 0 0.25rem 0;
+  font-size: 0.82rem;
+  color: #aaa;
+  transition: background 0.15s;
+}
+.prompt-subsection-header:hover {
+  background: #333;
+  color: #ddd;
+}
+.prompt-subsection-body.collapsed {
+  display: none;
+}
+#prompt-truncate-toggle {
+  accent-color: #4CAF50;
+}
+
 /* Mood Activities Editor */
 .act-mood-row {
   margin-bottom: 0.5rem;
diff --git a/bot/static/index.html b/bot/static/index.html
index d5118ad..c2e166b 100644
--- a/bot/static/index.html
+++ b/bot/static/index.html
@@ -543,23 +543,53 @@
         
       
 
-      
-

Last Prompt

-
- -
- - +
+
+

+ ▼ Prompt History +

+ +
+
+ +
+ +
+ + + +
+ +
+ + +
+ + +
+ + +
+ + +
+

           
-
-