# Task 00026: Urgent Fixes - Data Loss & UI Overflow

> **Date**: 2026-02-19 00:35
> **Status**: In Progress
> **Priority**: Critical

## 1. Issues
1.  **[CRITICAL] Data Loss on Audio Upload:** 
    *   User reported that uploading an audio recording while editing *wipes out* the existing edited content and only saves the audio.
    *   **Hypothesis:** If the document doesn't exist on the server (new Daily Note) but the user has typed text locally, `handleRecordingComplete` creates a *new* document with *only* the audio, ignoring the local text. The server sync then overwrites the local state.
2.  **[UX] Mobile AI Bar Overflow:**
    *   When AI generated text is long, the "Insert" button is pushed off-screen.
    *   **Cause:** Missing scroll container or fixed footer in `MobileAIBar`.

## 2. Plan
- [ ] **Fix Data Loss (`DocumentClient.tsx`)**:
    - [ ] Ensure `handleRecordingComplete` captures the *current local content* before uploading.
    - [ ] If creating a new document, merge `localContent` + `audio`.
    - [ ] If updating, warn if local content differs from server? Or auto-save before upload?
- [ ] **Fix UI Overflow (`MobileAIBar.tsx`)**:
    - [ ] Wrap the content area in a scrollable container (`overflow-y-auto`).
    - [ ] Pin the button area to the bottom (`sticky` or `fixed`).

## 3. Progress
- [ ] Analyze `DocumentClient.tsx` state management.
- [ ] Apply fixes.
