mirror of
https://github.com/siop-spelev/siop2.git
synced 2026-08-08 12:41:54 +00:00
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:
@@ -168,61 +168,62 @@ export default function PageAssistant() {
|
||||
) : (
|
||||
<View
|
||||
style={{
|
||||
flexDirection: 'row',
|
||||
alignItems: 'center',
|
||||
gap: 8,
|
||||
borderWidth: 1.5,
|
||||
borderColor: t.bordureForte,
|
||||
borderRadius: 10,
|
||||
backgroundColor: t.surface,
|
||||
paddingHorizontal: 10,
|
||||
paddingVertical: 6,
|
||||
padding: 10,
|
||||
}}
|
||||
>
|
||||
{/* 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
|
||||
accessibilityRole="button"
|
||||
accessibilityLabel="Dicter la question"
|
||||
disabled={transcrire.isPending}
|
||||
onPress={() => void demarrerDictee()}
|
||||
style={{
|
||||
width: 26,
|
||||
height: 26,
|
||||
borderRadius: 13,
|
||||
width: 30,
|
||||
height: 30,
|
||||
borderRadius: 15,
|
||||
backgroundColor: t.primaireDoux,
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
}}
|
||||
>
|
||||
<Text style={{ fontSize: 13 }}>🎙</Text>
|
||||
<Text style={{ fontSize: 14 }}>🎙</Text>
|
||||
</Pressable>
|
||||
<TextInput
|
||||
ref={saisieRef}
|
||||
accessibilityLabel="Poser une question"
|
||||
value={transcrire.isPending ? 'Transcription…' : question}
|
||||
editable={!transcrire.isPending}
|
||||
onChangeText={setQuestion}
|
||||
onSubmitEditing={envoyer}
|
||||
maxLength={500}
|
||||
placeholder="Poser une question…"
|
||||
placeholderTextColor={t.encre3}
|
||||
style={{ flex: 1, color: t.encre, fontFamily: 'Manrope_600SemiBold', fontSize: 13 }}
|
||||
<View style={{ flex: 1 }}>
|
||||
<BoutonTel
|
||||
libelle="Envoyer"
|
||||
desactive={question.trim().length < 3 || ask.isPending || transcrire.isPending}
|
||||
surAppui={envoyer}
|
||||
/>
|
||||
<Pressable
|
||||
accessibilityRole="button"
|
||||
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>
|
||||
</View>
|
||||
)}
|
||||
{transcrire.isError ? (
|
||||
|
||||
Reference in New Issue
Block a user