rohitsar567 Claude Opus 4.7 (1M context) commited on
Commit
a774b91
·
1 Parent(s): 36ef017

fix(voice): KI-039 — single Clear-chat button (full reset)

Browse files

User feedback on the two-button setup ("Clear chat" + "Start fresh"):
"these 2 options adds confusion. let there just be one. to clear the
chat fully." Then a clarifier on the LLM-burden tradeoff, then explicit
direction: "Clearing chat should also clear profile."

Resolved by collapsing to ONE button:
• Label: "Clear chat"
• Action: handleClearChat(true) — wipes visible messages, calls
POST /api/session/reset with drop_profile=true, clears
localStorage chat + session id, adopts the fresh server-issued
session id.
• No confirm dialog — user wants one-click simplicity.
• Rose hover tint to signal the destructive intent without forcing a
dialog.
• Tooltip: "Wipe this conversation — clears chat history, profile,
and starts a fresh session".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Files changed (1) hide show
  1. frontend/src/app/page.tsx +7 -16
frontend/src/app/page.tsx CHANGED
@@ -691,27 +691,18 @@ export default function Page() {
691
  <EmptyState onSuggest={(q) => send(q)} coverage={coverage} t={t} />
692
  ) : (
693
  <>
694
- {/* KI-020 chat-clear controls; only visible once there's a conversation */}
 
 
 
695
  <div className="flex items-center justify-end gap-2 mb-2 text-[11px]">
696
  <button
697
- onClick={() => handleClearChat(false)}
698
- disabled={busy}
699
- className="px-2 py-1 rounded-md border border-[var(--border)] text-[var(--muted-foreground)] hover:text-[var(--foreground)] hover:border-[var(--primary)] disabled:opacity-40 transition"
700
- title="Clear visible chat — bot keeps what it already knows about you"
701
- >
702
- Clear chat
703
- </button>
704
- <button
705
- onClick={() => {
706
- if (confirm("Start fresh? This forgets your profile (age, dependents, etc.) and starts a brand-new session.")) {
707
- handleClearChat(true);
708
- }
709
- }}
710
  disabled={busy}
711
  className="px-2 py-1 rounded-md border border-[var(--border)] text-[var(--muted-foreground)] hover:text-rose-600 hover:border-rose-400 disabled:opacity-40 transition"
712
- title="Wipe profile + start a fresh session"
713
  >
714
- Start fresh
715
  </button>
716
  </div>
717
  <div ref={scrollRef} className="flex-1 overflow-y-auto scrollbar-thin space-y-4 mb-4 pr-1">
 
691
  <EmptyState onSuggest={(q) => send(q)} coverage={coverage} t={t} />
692
  ) : (
693
  <>
694
+ {/* KI-020 / KI-039 single Clear-chat control. One click wipes
695
+ the visible chat AND clears server-side profile AND issues a
696
+ fresh session id. Two-button variant was confusing per user
697
+ feedback. */}
698
  <div className="flex items-center justify-end gap-2 mb-2 text-[11px]">
699
  <button
700
+ onClick={() => handleClearChat(true)}
 
 
 
 
 
 
 
 
 
 
 
 
701
  disabled={busy}
702
  className="px-2 py-1 rounded-md border border-[var(--border)] text-[var(--muted-foreground)] hover:text-rose-600 hover:border-rose-400 disabled:opacity-40 transition"
703
+ title="Wipe this conversation — clears chat history, profile, and starts a fresh session"
704
  >
705
+ Clear chat
706
  </button>
707
  </div>
708
  <div ref={scrollRef} className="flex-1 overflow-y-auto scrollbar-thin space-y-4 mb-4 pr-1">