feat: live markdown preview toggle in chat input

- Eye icon button next to file picker toggles preview on/off
- Shows rendered markdown above textarea in real-time
- Lazy-loads ReactMarkdown (no bundle impact when off)
- Preference persisted in localStorage
- i18n: EN/FR labels for show/hide preview
This commit is contained in:
Nicolas Varrot
2026-02-13 01:56:13 +00:00
parent 550a9dbba9
commit 4dfaaff2b5
3 changed files with 32 additions and 3 deletions

View File

@@ -40,6 +40,8 @@ const en = {
'chat.attachFile': 'Attach file',
'chat.send': 'Send',
'chat.stop': 'Stop',
'chat.showPreview': 'Preview markdown',
'chat.hidePreview': 'Hide preview',
'chat.scrollToBottom': 'New messages',
'chat.collapseTools': 'Collapse all tools',
'chat.expandTools': 'Expand all tools',
@@ -151,6 +153,8 @@ const fr: Record<keyof typeof en, string> = {
'chat.attachFile': 'Joindre un fichier',
'chat.send': 'Envoyer',
'chat.stop': 'Arrêter',
'chat.showPreview': 'Aperçu markdown',
'chat.hidePreview': 'Masquer l\'aperçu',
'chat.scrollToBottom': 'Nouveaux messages',
'chat.collapseTools': 'Replier tous les outils',
'chat.expandTools': 'Déplier tous les outils',