From 9c674ae8901c4977f75633121b2193bd222f9804 Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Sat, 9 May 2026 11:20:42 +0200 Subject: [PATCH] Refactor SendMessage modal: update typography, improve UI spacing, and enhance error message styling. --- common/messages/de.json | 1 + common/messages/fr.json | 1 + .../messaging/send-message-button.tsx | 42 +++++++++++++------ 3 files changed, 31 insertions(+), 13 deletions(-) diff --git a/common/messages/de.json b/common/messages/de.json index cdc13c57..d85cd3bf 100644 --- a/common/messages/de.json +++ b/common/messages/de.json @@ -531,6 +531,7 @@ "send_message.title": "Beginne ein bedeutungsvolles Gespräch", "send_message.guidance": "Compass geht um Tiefe. Nimm dir einen Moment, um etwas Echtes zu schreiben.", "send_message.keywords_hint": "Füge einige von {name}s Themen in deine Nachricht ein", + "send_message.min_chars_hint": "Schreiben Sie mindestens {count} Zeichen, um die Senden-Schaltfläche freizuschalten", "send_message.more_chars": "{count} Zeichen mehr", "send_message.ready": "Bereit zu senden", "more_options_user.ban_user": "Benutzer sperren", diff --git a/common/messages/fr.json b/common/messages/fr.json index 9ceca7cb..2e093999 100644 --- a/common/messages/fr.json +++ b/common/messages/fr.json @@ -531,6 +531,7 @@ "send_message.title": "Commencez une conversation qui a du sens", "send_message.guidance": "Prenez un moment pour écrire quelque chose d'authentique.", "send_message.keywords_hint": "Insérez quelques-uns des sujets de {name} dans votre message", + "send_message.min_chars_hint": "Écrivez au moins {count} caractères pour débloquer le bouton d'envoi", "send_message.more_chars": "{count} caractères de plus", "send_message.ready": "Prêt à envoyer", "more_options_user.ban_user": "Bannir l'utilisateur", diff --git a/web/components/messaging/send-message-button.tsx b/web/components/messaging/send-message-button.tsx index d2785142..08f17823 100644 --- a/web/components/messaging/send-message-button.tsx +++ b/web/components/messaging/send-message-button.tsx @@ -178,11 +178,11 @@ export const SendMessageButton = (props: { - -

+ +

{t('send_message.title', 'Start a meaningful conversation')}

-

+

{t( 'send_message.guidance', 'Compass is about depth. Take a moment to write something genuine.', @@ -193,8 +193,8 @@ export const SendMessageButton = (props: { {firebaseUser?.emailVerified ? ( <> {!!profile.keywords?.length && ( -

-

+

+

{t( 'send_message.keywords_hint', `Insert some of {name}'s topics in your message`, @@ -208,10 +208,10 @@ export const SendMessageButton = (props: { type={'button'} onClick={() => toggleChip(k)} className={clsx( - 'text-xs px-3 py-1 rounded-full transition-colors', + 'text-xs px-3 py-1 rounded-full transition-colors border', insertedChips.includes(k) - ? 'bg-primary-200 border border-primary-300' - : 'bg-canvas-100 hover:bg-canvas-200', + ? 'bg-primary-50 border-primary-300 text-primary-700' + : 'bg-canvas-100 border-canvas-200 text-ink-500 hover:border-primary-300 hover:bg-primary-50', )} > {k} @@ -229,11 +229,19 @@ export const SendMessageButton = (props: { submitOnEnter={false} /> +

+ {t( + 'send_message.min_chars_hint', + 'Write at least {count} characters to unlock the send button', + {count: MIN_CHARS}, + )} +

+ {/* quality meter */} -
+
- + {charCount < MIN_CHARS - ? `${charCount} / ${MIN_CHARS} min` + ? `${charCount}` : t('send_message.ready', 'Ready to send')}
@@ -251,7 +259,15 @@ export const SendMessageButton = (props: { ) : ( )} - {error} + {error && ( + + {error} + + )}