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.
This commit is contained in:
19
FEEDBACK.md
19
FEEDBACK.md
@@ -6,10 +6,15 @@
|
|||||||
- **Status:** done
|
- **Status:** done
|
||||||
- **Completed:** 2026-02-11 — commit `d58c34f`
|
- **Completed:** 2026-02-11 — commit `d58c34f`
|
||||||
- **Description:** Migrer le projet de "ClawChat" vers "PinchChat"
|
- **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`
|
## Item #2
|
||||||
- Mettre à jour tous les fichiers : README, CONTRIBUTING, package.json, title HTML, composants, etc.
|
- **Date:** 2026-02-11
|
||||||
- Remplacer toutes les occurrences de "ClawChat" / "clawchat" par "PinchChat" / "pinchchat"
|
- **Priority:** high
|
||||||
- Mettre à jour le dossier local : `mv ~/clawchat ~/pinchchat` (et adapter le cron)
|
- **Status:** pending
|
||||||
- Vérifier que le build passe après migration
|
- **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)
|
||||||
- Commit + push
|
|
||||||
|
## 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.
|
||||||
|
|||||||
@@ -13,8 +13,19 @@ interface Props {
|
|||||||
onAbort: () => void;
|
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 {
|
function hasVisibleContent(msg: ChatMessage): boolean {
|
||||||
if (msg.role === 'user') return true;
|
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;
|
if (msg.blocks.length === 0) return !!msg.content;
|
||||||
// Show all assistant messages — tool-only ones render as compact inline
|
// Show all assistant messages — tool-only ones render as compact inline
|
||||||
return msg.blocks.some(b =>
|
return msg.blocks.some(b =>
|
||||||
|
|||||||
Reference in New Issue
Block a user