Skip to content

Add a component to use the vocal agent quickly and putted this component in home, tasklist, calendr (normal and 20) - #34

Merged
Gabry848 merged 2 commits into
masterfrom
feature-quick-voice-add
May 21, 2026
Merged

Add a component to use the vocal agent quickly and putted this component in home, tasklist, calendr (normal and 20)#34
Gabry848 merged 2 commits into
masterfrom
feature-quick-voice-add

Conversation

@Gabry848

@Gabry848 Gabry848 commented May 21, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings May 21, 2026 11:12
@Gabry848
Gabry848 merged commit d44fd5e into master May 21, 2026
2 of 3 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new “QuickVoiceAdd” UI control and supporting service to quickly record and send a short voice command to the backend, then wires that control into multiple entry points (Home, Task list, Calendar, Calendar20). It also includes a small SafeAreaView adjustment and new i18n strings for the quick-add UI labels.

Changes:

  • Added QuickVoiceAdd component (pill/FAB variants) using expo-audio recording + waveform UI + success state.
  • Added sendQuickVoiceAdd service to upload audio via multipart/form-data to /chat/voice-command.
  • Integrated QuickVoiceAdd into Home, TaskList, Calendar, and Calendar20, and added i18n keys for the UI label/sent text.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/services/quickVoiceAddService.ts New service to upload recorded audio to the backend voice-command endpoint.
src/components/BotChat/QuickVoiceAdd.tsx New reusable voice quick-add recorder/sender UI component (pill/FAB).
src/navigation/screens/Home.tsx Renders QuickVoiceAdd in the Home chat area.
src/components/TaskList/TaskListContainer.tsx Replaces the single add button with a dock containing manual add + voice quick add.
src/components/TaskList/styles.ts Adds styles for the new add/voice dock and manual button.
src/components/Calendar20/FABMenu.tsx Updates Calendar20 FAB to a dock with manual add + voice quick add.
src/components/Calendar20/Calendar20View.tsx Tracks voice active state and adds a backdrop while voice UI is active; wires FAB callbacks.
src/components/Calendar/CalendarView.tsx Adds header dock actions and a modal flow to auto-start voice quick add.
src/navigation/screens/Notes.tsx Adjusts SafeAreaView edges configuration.
src/locales/en.json Adds home.quickAdd.* strings (label/sent).
src/locales/it.json Adds home.quickAdd.* strings (label/sent).
Comments suppressed due to low confidence (4)

src/components/BotChat/QuickVoiceAdd.tsx:186

  • sendRecording treats a successful response as received || recivied, which leaks the backend typo into the UI layer. After normalizing the response in sendQuickVoiceAdd, this component should only check a single field (and ideally rely on HTTP status + a well-defined success flag).
      setState('sending');
      const result = await sendQuickVoiceAdd(uri, model);
      if (!result.received && !result.recivied) {
        throw new Error(result.error || 'Audio non ricevuto dal server');
      }

src/components/BotChat/QuickVoiceAdd.tsx:283

  • The cancel button is disabled for any state other than recording (including sending). If the network request stalls, the user has no way to exit besides waiting. Consider allowing cancel during sending as well (and aborting/ignoring the in-flight request) so the UI can always recover from slow/offline conditions.
            <Pressable style={styles.cancelButton} onPress={cancelRecording} disabled={state !== 'recording'}>
              <Ionicons name="close" size={18} color={state === 'recording' ? colors.textSecondary : colors.textTertiary} />
            </Pressable>

src/components/Calendar/CalendarView.tsx:383

  • The voice-add trigger button reuses the same accessibility label/hint as the manual add button (tasks.accessibility.addTask*). Screen readers won’t be able to distinguish the actions. Consider adding dedicated i18n strings for “add task with voice” and using them here.
      <TouchableOpacity
        style={styles.voiceTriggerButton}
        onPress={() => setVoiceAddModalVisible(true)}
        activeOpacity={0.82}
        accessibilityRole="button"
        accessibilityLabel={t("tasks.accessibility.addTaskLabel")}
        accessibilityHint={t("tasks.accessibility.addTaskHint")}
      >

src/components/Calendar/CalendarView.tsx:403

  • The new voiceAddModalVisible flow introduces a modal overlay but doesn’t set accessibilityViewIsModal / accessible semantics for the modal content. Consider adding proper modal accessibility props (and focusing the control) so screen readers don’t navigate to the underlying calendar while the voice modal is open.
  const renderVoiceAddModal = () => (
    <Modal
      visible={voiceAddModalVisible}
      transparent
      animationType="fade"
      onRequestClose={() => setVoiceAddModalVisible(false)}
    >
      <View style={styles.voiceModalOverlay}>
        <Pressable
          style={StyleSheet.absoluteFill}
          onPress={() => setVoiceAddModalVisible(false)}
        />
        <View style={styles.voiceModalContent} pointerEvents="box-none">
          <QuickVoiceAdd
            model="base"

Comment on lines +4 to +8
export interface QuickVoiceAddResponse {
received: boolean;
recivied?: boolean;
processing?: boolean;
model?: 'base' | 'advanced';
Comment on lines +128 to +146
const permission = await requestRecordingPermissionsAsync();
if (!permission.granted) {
Alert.alert('Microfono non disponibile', 'Abilita il microfono per usare Quick add.');
return;
}

await setAudioModeAsync({
allowsRecording: true,
playsInSilentMode: true,
});
await recorder.prepareToRecordAsync(RecordingPresets.HIGH_QUALITY);
recorder.record();
isRecordingRef.current = true;
recordingStartRef.current = Date.now();
setState('recording');
} catch (error) {
console.error('[QuickVoiceAdd] startRecording error:', error);
Alert.alert('Errore registrazione', 'Non sono riuscito ad avviare il microfono.');
setState('idle');
Comment on lines +356 to +361
const handleVoiceAddSuccess = () => {
fetchTasks();
setTimeout(() => {
setVoiceAddModalVisible(false);
}, 1150);
};
Comment on lines +19 to +25
<TouchableOpacity
style={styles.manualFab}
onPress={onNewTask}
activeOpacity={0.82}
accessibilityRole="button"
accessibilityLabel="Aggiungi manualmente"
>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants