Spaces:
Runtime error
Runtime error
Commit History
-
fix: Show API error details on 503 + add retry button
CNESST Deploy9c8be3a -
feat(ui): amélioration UX — boutons clairement identifiables + affichage optimisé
CNESST Deploy +1: Claude Opus 4.6- Header: réduit à 58px, gap réduit, padding optimisé pour mobile - Bouton Historique: redesigné avec icône + label texte "Historique", style bouton clair avec border visible et shadow - Bouton Pré-cache (📥 Hors-ligne): border 1.5px, border-radius angulaire (non-pill), shadow, hover contrasté - Mode toggle: border 1.5px, border-radius angulaire, slider visibilité améliorée (fond surface3 au lieu de border seul) - Chips suggestion: border 1.5px accent teinté, border-radius angulaire, font-weight 600, shadow visible, hover accent - Boutons Send/Mic: taille 48px (vs 46), Send shadow plus fort (0.4 opacity), Mic border 1.5px + shadow + hover accent - Boutons Feedback 👍👎: padding agrandi (5px 12px), border 1.5px, font-weight 500, shadow, hover avec lift - Bouton Copier: border 1.5px, padding 5px 12px, font-weight 600, shadow, hover accent, style "copied" amélioré - Sources toggle: background surface2 (au lieu de transparent), border 1.5px, font-weight 600 - History close btn: visible par…180179a -
feat: mode hors-ligne complet pour le chatbot CNESST
CNESST Deploy +1: Claude Opus 4.6### sw.js (cnesst-shell-v2 + cnesst-responses-v1) - Bump CACHE_NAME → cnesst-shell-v2 pour forcer la mise à jour - Nouveau cache cnesst-responses-v1 pour les réponses POST /api/chat - Stratégie network-first avec fallback cache pour /api/chat - Clé de cache normalisée (lowercase, trim, dépunctuation) basée sur la question + mode - LRU eviction: max 100 réponses (les plus anciennes supprimées en premier) - Handler de message SW: PRECACHE_QUESTIONS → pré-cache un lot de questions + réponse PRECACHE_DONE avec le compte de réponses mises en cache - Page offline HTML embarquée (OFFLINE_HTML) avec affichage de l'historique localStorage - Réponse offline marquée _offline: true / _not_cached: true ### index.html — Nouvelles fonctionnalités 1. Badge réseau 🟢/🔴 dans le header (navigator.onLine + events online/offline) - Animation pulse sur le point rouge en mode hors-ligne - Toast de notification lors des changements de statut 2. Comportement offline du chat: - Réponse depuis le ca…b70a820 -
feat: add conversation history panel with localStorage persistence
CNESST Deploy +1: Claude Opus 4.6- Add slide-in sidebar panel (left) with smooth animation and dark overlay - History button (🕐) in header to open/close the panel - LocalStorage persistence via `cnesst_conversations` key - Auto-save every user+bot exchange to active conversation - Load last active conversation on page startup - New conversation button resets chat and shows welcome hero - Search/filter field to find conversations by keywords - Date-grouped entries (Aujourd'hui, Hier, Cette semaine, etc.) - Relative timestamps (À l'instant, Il y a X min, etc.) - Delete individual conversations with trash icon button - Mobile-first: works on 375px+, touch-friendly, always-visible delete on mobile - Active conversation highlighted in blue in the panel - Welcome hero re-appears when starting a new conversation - All existing features preserved (voice, chips, copy, feedback, PWA) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>0270724 -
feat(ui): refonte design moderne — Inter font, hero welcome, micro-animations
CNESST Deploy +1: Claude Opus 4.6- Typography: Import Google Font Inter pour une meilleure lisibilité - Header: Icône stylisée avec fond gradient + ligne accent en haut, badges "14 lois" et "RAG" - Welcome card: Layout hero avec icône prominente, badges de lois (CSTC/LSST), disclaimer structuré, label "Questions fréquentes" - Chat bubbles: Gradients subtils user/bot, ombres douces, line-height amélioré - Chips: Hover avec translateY(-1px) et glow bleu, border-radius pill - Input: Focus ring avec glow accent, min-height augmenté, transitions fluides - Send/Mic buttons: Élévation au hover (translateY), box-shadow accent pour send - Feedback row: Séparateur border-top, label contextuel, selected states avec couleurs sémantiques - Sources panel: Source score en badge stylisé, background surface2 - Animations: Cubic-bezier plus naturel sur fadeSlideIn et hover transitions - Couleurs: Palette cohérente avec --surface3, --border-soft, --text-subtle, --accent-glow - Responsive: Mobile-first, header plus compact sur <480px, mo…9b00b7c -
feat: Add voice search, quick chips, copy button, and PWA support
CNESST Deploy +1: Claude Opus 4.6- Feature 1 — Voice Search: mic button using Web Speech API (fr-CA), auto-submits on final transcript, pulsing animation while listening, hidden gracefully on unsupported browsers - Feature 2 — Quick Suggestion Chips: 6 chips (Hauteur garde-corps, SIMDUT étiquetage, Protection chutes, Échafaudage, Amiante, Pompe béton) that immediately send the question; welcome card fades out on first send - Feature 3 — Share/Copy button: 📋 Copier on each bot response (hidden until hover, always visible on touch devices); uses navigator.share on mobile, clipboard API with execCommand fallback; shows toast notification - Feature 4 — PWA: manifest.json (name "Assistant CNESST", dark theme), sw.js (app shell cache, network-first for navigation, API bypass), icon-192.png + icon-512.png (safety-yellow hard hat on dark background) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>15b764f -
feat: Add 👍👎 feedback buttons to bot responses
CNESST Deploy +1: Claude Opus 4.6- Backend (app.py): - Add `message_id: str` field to ChatResponse (short UUID, 8 chars) - Add FeedbackRequest Pydantic model (message_id, question, rating) - Add POST /api/feedback endpoint — stores entries in feedback.json - Add GET /api/feedback/stats endpoint — returns up/down/total counts - Import json, uuid, datetime for new functionality - Frontend (static/index.html): - Add .feedback-row, .feedback-btn, .selected-up/down CSS classes - Add .toast CSS for brief confirmation notification - Add buildFeedbackHtml() — renders 👍/👎 buttons per message_id - Add submitFeedback() — highlights selected button, disables both, POSTs to /api/feedback, shows "Merci pour votre évaluation!" toast - Add showToast() helper with auto-dismiss after 2.5s - Update appendBotMessage() to accept messageId+question params - Pass data.message_id and user question from sendMessage() Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>6f62ade -
v3: Improved response quality, anti-deflection system, BM25+hybrid retrieval, 6790 docs
CNESST Deploy +1: Claude Opus 4.6Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>51a1743
-
Initial deployment of CNESST RAG chatbot
CNESST Deployad4ac0d