From ff93c9d44e201ebe8ed013db51fdd3b462ff8ae4 Mon Sep 17 00:00:00 2001 From: ShaerWare Date: Sat, 14 Mar 2026 20:38:03 +0500 Subject: [PATCH] =?UTF-8?q?feat:=20mobile=20app=20=E2=80=94=20branches,=20?= =?UTF-8?q?context=20files,=20session=20management?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add branching support (view/switch/create branches), context file attachments, message deletion, session settings panel with resizable drawer. Remove FAB from chat list (sessions auto-created on first message). ## NEWS πŸ“± **МобильноС ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ стало ΡƒΠΌΠ½Π΅Π΅!** Π’Π΅ΠΏΠ΅Ρ€ΡŒ Π² мобильном Ρ‡Π°Ρ‚Π΅ доступны вСтвлСния Π΄ΠΈΠ°Π»ΠΎΠ³ΠΎΠ², ΠΏΡ€ΠΈΠΊΡ€Π΅ΠΏΠ»Π΅Π½ΠΈΠ΅ Ρ„Π°ΠΉΠ»ΠΎΠ²-контСкста ΠΈ настройки сСссии β€” ΠΊΠ°ΠΊ Π² Π°Π΄ΠΌΠΈΠ½ΠΊΠ΅. Боковая панСль с Π²Π΅Ρ‚ΠΊΠ°ΠΌΠΈ ΠΈ Ρ„Π°ΠΉΠ»Π°ΠΌΠΈ адаптируСтся ΠΏΠΎΠ΄ ΠΎΡ€ΠΈΠ΅Π½Ρ‚Π°Ρ†ΠΈΡŽ экрана. Co-Authored-By: Claude Opus 4.6 (1M context) --- mobile/src/api/chat.ts | 49 +++ mobile/src/views/ChatListView.vue | 29 -- mobile/src/views/ChatView.vue | 619 +++++++++++++++++++++++++----- 3 files changed, 567 insertions(+), 130 deletions(-) diff --git a/mobile/src/api/chat.ts b/mobile/src/api/chat.ts index 1d1fbf4..ab86e55 100644 --- a/mobile/src/api/chat.ts +++ b/mobile/src/api/chat.ts @@ -19,12 +19,26 @@ export interface TokenUsage { trimmed?: boolean; } +export interface ContextFile { + name: string; + content: string; +} + +export interface BranchNode { + id: string; + role: string; + content_preview: string; + is_active: boolean; + children: BranchNode[]; +} + export interface ChatSession { id: string; title: string; messages: ChatMessage[]; system_prompt?: string; source?: string | null; + context_files?: ContextFile[]; created: string; updated: string; token_usage?: TokenUsage; @@ -75,6 +89,41 @@ export const chatApi = { deleteSession: (id: string) => api.delete<{ status: string }>(`/admin/chat/sessions/${id}`), + updateSession: ( + id: string, + data: { + title?: string; + system_prompt?: string; + context_files?: ContextFile[]; + }, + ) => + api.put<{ session: ChatSession }>( + `/admin/chat/sessions/${id}`, + data, + ), + + deleteMessage: (sessionId: string, messageId: string) => + api.delete<{ status: string }>( + `/admin/chat/sessions/${sessionId}/messages/${messageId}`, + ), + + // Branches + getBranches: (sessionId: string) => + api.get<{ branches: BranchNode[] }>( + `/admin/chat/sessions/${sessionId}/branches`, + ), + + switchBranch: (sessionId: string, messageId: string) => + api.post<{ status: string; session: ChatSession }>( + `/admin/chat/sessions/${sessionId}/branches/switch`, + { message_id: messageId }, + ), + + newBranch: (sessionId: string) => + api.post<{ status: string; session: ChatSession }>( + `/admin/chat/sessions/${sessionId}/branches/new`, + ), + streamMessage: ( sessionId: string, content: string, diff --git a/mobile/src/views/ChatListView.vue b/mobile/src/views/ChatListView.vue index 8042e65..e591795 100644 --- a/mobile/src/views/ChatListView.vue +++ b/mobile/src/views/ChatListView.vue @@ -27,15 +27,6 @@ async function loadSessions() { } } -async function createChat() { - try { - const data = await chatApi.createSession(); - router.push(`/chat/${data.session.id}`); - } catch (e) { - error.value = e instanceof Error ? e.message : "Failed to create"; - } -} - function openChat(id: string) { router.push(`/chat/${id}`); } @@ -196,25 +187,5 @@ onMounted(loadSessions); - - diff --git a/mobile/src/views/ChatView.vue b/mobile/src/views/ChatView.vue index 11d6bc1..94867fd 100644 --- a/mobile/src/views/ChatView.vue +++ b/mobile/src/views/ChatView.vue @@ -1,7 +1,13 @@