From 0aad04f91a3609574e81b3bd54bd2e400938f7b2 Mon Sep 17 00:00:00 2001 From: saravanakumardb1 Date: Mon, 6 Apr 2026 10:47:38 -0700 Subject: [PATCH] fix(mobile): align PromptCategory with backend, add tone param, remove dead import MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - note-prompts.ts: fix PromptCategory ('analysis' → 'analyze', remove nonexistent 'vision'/'custom') - note-prompts.ts: add CopilotTone type and optional tone param to copilotTransform - capture.tsx: remove unused copilotTransform import (copilot requires real noteId) --- mobile/src/api/note-prompts.ts | 7 +++++-- mobile/src/app/(tabs)/capture.tsx | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/mobile/src/api/note-prompts.ts b/mobile/src/api/note-prompts.ts index 2ce5170..f7e6739 100644 --- a/mobile/src/api/note-prompts.ts +++ b/mobile/src/api/note-prompts.ts @@ -1,6 +1,6 @@ import { getApiClient } from './client'; -export type PromptCategory = 'transform' | 'extract' | 'generate' | 'analysis' | 'vision' | 'export' | 'custom'; +export type PromptCategory = 'transform' | 'extract' | 'generate' | 'analyze' | 'export'; export type PromptInputType = 'text' | 'image' | 'text+image' | 'multi-note'; export type PromptOutputType = 'new_note' | 'artifact' | 'update_note'; @@ -70,15 +70,18 @@ export async function extractFromUrl( }); } +export type CopilotTone = 'formal' | 'casual' | 'professional' | 'friendly'; + export async function copilotTransform( noteId: string, workspaceId: string, action: string, text: string, + tone?: CopilotTone, ): Promise { const res = await getApiClient().fetch<{ text: string }>( `/notes/${encodeURIComponent(noteId)}/copilot`, - { method: 'POST', body: JSON.stringify({ workspaceId, action, text }) }, + { method: 'POST', body: JSON.stringify({ workspaceId, action, text, ...(tone ? { tone } : {}) }) }, ); return res.text; } diff --git a/mobile/src/app/(tabs)/capture.tsx b/mobile/src/app/(tabs)/capture.tsx index 18fc75b..02b4f20 100644 --- a/mobile/src/app/(tabs)/capture.tsx +++ b/mobile/src/app/(tabs)/capture.tsx @@ -4,7 +4,7 @@ import * as Clipboard from 'expo-clipboard'; import type { MobileWorkspace } from '../../api/workspaces'; import { useNotesStore, type NotesState } from '../../store/notes-store'; import { useWorkspaceStore, type WorkspaceState } from '../../store/workspace-store'; -import { extractFromUrl, copilotTransform } from '../../api/note-prompts'; +import { extractFromUrl } from '../../api/note-prompts'; import { colors } from '../../theme'; type CaptureMode = 'text' | 'photo' | 'voice' | 'url' | 'scan' | 'paste';