From 8834b2ac3601f21ffb52dec5acaca666b1351436 Mon Sep 17 00:00:00 2001 From: Nicolas Varrot Date: Wed, 11 Feb 2026 12:31:07 +0000 Subject: [PATCH] fix: filter out NO_REPLY messages from chat display NO_REPLY is an internal agent response that should not be visible to users. Messages with content exactly matching 'NO_REPLY' are now hidden from the chat view. --- FEEDBACK.md | 19 ++++++++++++------- src/components/Chat.tsx | 11 +++++++++++ 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/FEEDBACK.md b/FEEDBACK.md index 8668a9f..82edf95 100644 --- a/FEEDBACK.md +++ b/FEEDBACK.md @@ -6,10 +6,15 @@ - **Status:** done - **Completed:** 2026-02-11 — commit `d58c34f` - **Description:** Migrer le projet de "ClawChat" vers "PinchChat" - - Renommer le repo GitHub : MarlBurroW/clawchat → MarlBurroW/pinchchat - - ⚠️ Le rename de repo se fait via `gh api -X PATCH /repos/MarlBurroW/clawchat -f name=pinchchat` - - Mettre à jour tous les fichiers : README, CONTRIBUTING, package.json, title HTML, composants, etc. - - Remplacer toutes les occurrences de "ClawChat" / "clawchat" par "PinchChat" / "pinchchat" - - Mettre à jour le dossier local : `mv ~/clawchat ~/pinchchat` (et adapter le cron) - - Vérifier que le build passe après migration - - Commit + push + +## Item #2 +- **Date:** 2026-02-11 +- **Priority:** high +- **Status:** pending +- **Description:** Filtrer les messages "NO_REPLY" — ne pas afficher les messages dont le contenu est exactement "NO_REPLY" (ce sont des réponses internes de l'agent qui ne doivent pas être visibles dans le chat) + +## Item #3 +- **Date:** 2026-02-11 +- **Priority:** medium +- **Status:** pending +- **Description:** Ajouter le support i18n (internationalisation) — le projet open-source est en anglais, mais le deploy perso de Nicolas doit rester en français. Soit via une config `.env` (ex: `VITE_LOCALE=fr`), soit via un système de traduction léger. Les strings UI (placeholder input, bouton envoyer, statut connexion, etc.) doivent être configurables. diff --git a/src/components/Chat.tsx b/src/components/Chat.tsx index bba27aa..506ea29 100644 --- a/src/components/Chat.tsx +++ b/src/components/Chat.tsx @@ -13,8 +13,19 @@ interface Props { onAbort: () => void; } +function isNoReply(msg: ChatMessage): boolean { + const text = (msg.content || '').trim(); + if (text === 'NO_REPLY') return true; + // Also check text blocks for NO_REPLY-only content + const textBlocks = msg.blocks.filter(b => b.type === 'text'); + if (textBlocks.length === 1 && (textBlocks[0] as { text: string }).text.trim() === 'NO_REPLY') return true; + return false; +} + function hasVisibleContent(msg: ChatMessage): boolean { if (msg.role === 'user') return true; + // Filter out NO_REPLY messages (internal agent responses) + if (msg.role === 'assistant' && isNoReply(msg)) return false; if (msg.blocks.length === 0) return !!msg.content; // Show all assistant messages — tool-only ones render as compact inline return msg.blocks.some(b =>