Files
nav-carte/components/ChatNewConversation.vue
T
Jules NenyandClaude Opus 5.5 75d8440601 feat(chatbot): persistance des conversations en sessionStorage + bouton Nouvelle conversation
- composables/useChatSession.ts : historique réactif partagé (useState) et persisté sous aep-chat-<clé>, version de schéma {v:1}, 40 derniers messages, restauration au mount uniquement (SSR-safe), try/catch partout, messages transient jamais écrits
- clés : accueil (Placeholder + Sheet), agences (Placeholder réseaux + ChatbotReseaux), taff, pensees (suffixée par l'auteur)
- ChatbotPlaceholder reçoit sa clé par prop chatKey (défaut accueil)
- ChatNewConversation : bouton sobre, visible seulement s'il y a un historique

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015vcVGz8i4WpZm2dixKUiSD
2026-10-09 03:38:15 +02:00

31 lines
895 B
Vue

<template>
<button type="button" class="chat-new-conversation" @click="emit('reset')">
Nouvelle conversation
</button>
</template>
<script setup lang="ts">
// Bouton sobre « Nouvelle conversation », partagé par les chatbots.
// Le parent le rend seulement s'il y a un historique et gère la purge.
const emit = defineEmits<{ reset: [] }>()
</script>
<style scoped>
.chat-new-conversation {
align-self: flex-end;
flex-shrink: 0;
background: transparent;
border: none;
padding: 4px 6px;
border-radius: 6px;
font-size: 0.72rem;
font-family: var(--nav-font);
color: var(--nav-text-muted);
text-decoration: underline;
text-underline-offset: 2px;
cursor: pointer;
}
.chat-new-conversation:hover { color: var(--nav-text); background: var(--nav-bg-alt); }
.chat-new-conversation:focus-visible { outline: 2px solid var(--nav-primary); outline-offset: 2px; }
</style>