nilotpaldhar2004 commited on
Commit
a4b3957
Β·
unverified Β·
1 Parent(s): a175f6f

Add clear button and clearChat function

Browse files

Added a clear button to the header and implemented the clearChat function to reset the chat.

Files changed (1) hide show
  1. static/index.html +9 -0
static/index.html CHANGED
@@ -547,6 +547,7 @@
547
  <div class="logo-icon">⚑</div>
548
  <div class="logo-text">Query<span>Mind</span></div>
549
  <div class="header-badge">
 
550
  <span id="status-dot" class="status-dot"></span>
551
  <span id="status-label" class="badge">INITIALIZING</span>
552
  </div>
@@ -865,6 +866,14 @@
865
  if (el) el.remove();
866
  }
867
 
 
 
 
 
 
 
 
 
868
  // ── Escape HTML ───────────────────────────────────────────────
869
  function escapeHtml(str) {
870
  return String(str).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;');
 
547
  <div class="logo-icon">⚑</div>
548
  <div class="logo-text">Query<span>Mind</span></div>
549
  <div class="header-badge">
550
+ <button id="clear-btn" onclick="clearChat()" style="background:none;border:1px solid var(--border2);color:var(--muted);font-size:11px;padding:4px 10px;border-radius:5px;cursor:pointer;font-family:var(--mono);letter-spacing:0.5px;transition:all 0.15s;" onmouseover="this.style.borderColor='var(--danger)';this.style.color='#ff8fa3'" onmouseout="this.style.borderColor='var(--border2)';this.style.color='var(--muted)'">CLEAR</button>
551
  <span id="status-dot" class="status-dot"></span>
552
  <span id="status-label" class="badge">INITIALIZING</span>
553
  </div>
 
866
  if (el) el.remove();
867
  }
868
 
869
+ // ── Clear Chat
870
+ function clearChat() {
871
+ chat.innerHTML = '';
872
+ emptyState.style.display = '';
873
+ chat.appendChild(emptyState);
874
+ showToast('Chat cleared', 'success');
875
+ }
876
+
877
  // ── Escape HTML ───────────────────────────────────────────────
878
  function escapeHtml(str) {
879
  return String(str).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;');