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