fix(mobile): Assistant — question dictée pleinement visible avant envoi

Retour de recette (02/08) : la barre de saisie sur une ligne masquait le
texte transcrit dès qu'il dépassait quelques mots, empêchant la relecture
avant envoi (D5 de la maquette Assistant). Remplacée par une zone
multiligne pleine largeur (jusqu'à 160px, défilement interne au-delà) —
même patron que la description de clôture (cloture.tsx) — avec "Envoyer"
comme geste séparé et délibéré en dessous, pas accolé au champ.

Typecheck propre, 17 tests Jest, lint 5/5 paquets.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
pr-daaif
2026-08-02 13:21:38 +01:00
parent 6f74fd4206
commit 63656565f7

View File

@@ -168,61 +168,62 @@ export default function PageAssistant() {
) : ( ) : (
<View <View
style={{ style={{
flexDirection: 'row',
alignItems: 'center',
gap: 8, gap: 8,
borderWidth: 1.5, borderWidth: 1.5,
borderColor: t.bordureForte, borderColor: t.bordureForte,
borderRadius: 10, borderRadius: 10,
backgroundColor: t.surface, backgroundColor: t.surface,
paddingHorizontal: 10, padding: 10,
paddingVertical: 6,
}} }}
> >
{/* Zone pleine largeur, multiligne : la question dictée doit se
* lire EN ENTIER avant d'envoyer (trouvé en recette, 02/08
* une barre d'une ligne masquait le texte transcrit long). */}
<TextInput
ref={saisieRef}
accessibilityLabel="Poser une question"
multiline
scrollEnabled
value={transcrire.isPending ? 'Transcription' : question}
editable={!transcrire.isPending}
onChangeText={setQuestion}
maxLength={500}
placeholder="Poser une question, ou dictez avec 🎙…"
placeholderTextColor={t.encre3}
style={{
minHeight: 44,
maxHeight: 160,
color: t.encre,
fontFamily: 'Manrope_600SemiBold',
fontSize: 13.5,
textAlignVertical: 'top',
}}
/>
<View style={{ flexDirection: 'row', alignItems: 'center', gap: 8 }}>
<Pressable <Pressable
accessibilityRole="button" accessibilityRole="button"
accessibilityLabel="Dicter la question" accessibilityLabel="Dicter la question"
disabled={transcrire.isPending} disabled={transcrire.isPending}
onPress={() => void demarrerDictee()} onPress={() => void demarrerDictee()}
style={{ style={{
width: 26, width: 30,
height: 26, height: 30,
borderRadius: 13, borderRadius: 15,
backgroundColor: t.primaireDoux, backgroundColor: t.primaireDoux,
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
}} }}
> >
<Text style={{ fontSize: 13 }}>🎙</Text> <Text style={{ fontSize: 14 }}>🎙</Text>
</Pressable> </Pressable>
<TextInput <View style={{ flex: 1 }}>
ref={saisieRef} <BoutonTel
accessibilityLabel="Poser une question" libelle="Envoyer"
value={transcrire.isPending ? 'Transcription' : question} desactive={question.trim().length < 3 || ask.isPending || transcrire.isPending}
editable={!transcrire.isPending} surAppui={envoyer}
onChangeText={setQuestion}
onSubmitEditing={envoyer}
maxLength={500}
placeholder="Poser une question…"
placeholderTextColor={t.encre3}
style={{ flex: 1, color: t.encre, fontFamily: 'Manrope_600SemiBold', fontSize: 13 }}
/> />
<Pressable </View>
accessibilityRole="button" </View>
accessibilityLabel="Envoyer"
disabled={question.trim().length < 3 || ask.isPending}
onPress={envoyer}
>
<Text
style={{
color: question.trim().length < 3 || ask.isPending ? t.encre3 : t.primaire,
fontFamily: 'Manrope_800ExtraBold',
fontSize: 12.5,
}}
>
Envoyer
</Text>
</Pressable>
</View> </View>
)} )}
{transcrire.isError ? ( {transcrire.isError ? (