)]}'
{
  "commit": "737570847f2c6b0a27266aa00662308f19f4de60",
  "tree": "c4bc73898f0d8be2723efd00866f4e53eb279532",
  "parents": [
    "5f778949e023268d0bd39cb7f102952e575e9602"
  ],
  "author": {
    "name": "Philip Zeyliger",
    "email": "philip@bold.dev",
    "time": "Sat Jun 07 00:06:27 2025 +0000"
  },
  "committer": {
    "name": "Philip Zeyliger",
    "email": "philip@bold.dev",
    "time": "Sat Jun 07 04:12:57 2025 +0000"
  },
  "message": "webui: add image paste functionality to mobile chat input\n\nAdd comprehensive file paste support to mobile input matching desktop\nfunctionality with upload progress indicators and error handling.\n\nProblem Analysis:\nMobile webui lacked image paste functionality available on desktop,\npreventing users from easily sharing screenshots, images, and files\nvia clipboard paste. This created workflow friction for mobile users\nwho needed to upload images for code assistance, debugging, or\ndocumentation purposes.\n\nImplementation Changes:\n\n1. Clipboard Paste Handler:\n   - Added paste event listener for detecting clipboard files\n   - Integrated with existing upload infrastructure via fetch API\n   - Cursor position preservation for inline file insertion\n   - Prevented default paste behavior for file content\n\n2. File Upload Infrastructure:\n   - Reused desktop upload patterns with FormData and ./upload endpoint\n   - Added loading placeholder with emoji indicator during upload\n   - Implemented error handling with user-friendly error messages\n   - File path insertion in [bracket] format matching desktop behavior\n\n3. Upload Progress Management:\n   - Added upload counter to track multiple concurrent uploads\n   - Upload progress indicator with file count display\n   - Disabled send button during active uploads to prevent premature sending\n   - Visual feedback with hourglass icon and tooltip messages\n\n4. Mobile-Optimized UI:\n   - Positioned upload progress indicator above input field\n   - Touch-friendly styling with appropriate spacing\n   - Responsive design for various mobile screen sizes\n   - Integrated seamlessly with existing mobile input styling\n\n5. Lifecycle Management:\n   - Proper event listener setup and cleanup\n   - Component disconnection cleanup to prevent memory leaks\n   - Textarea reference management for event binding\n   - Focus restoration after upload completion\n\nTechnical Details:\n- Uses ClipboardEvent.clipboardData.files for file detection\n- FormData upload with POST to ./upload endpoint matching desktop\n- Upload state management with progress counter and visual indicators\n- Cursor position tracking via selectionStart for inline insertion\n- Error handling with try/catch and user feedback\n\nBenefits:\n- Consistent file upload experience across desktop and mobile\n- Improved mobile workflow for image sharing and file uploads\n- Visual feedback during upload process prevents user confusion\n- Proper error handling with informative messages\n- Seamless integration with existing mobile chat functionality\n\nTesting:\n- Verified paste event detection works on mobile browsers\n- Confirmed upload progress indicators display correctly\n- Tested error handling with network failures\n- Validated file path insertion and cursor positioning\n\nThis enhancement brings mobile webui file paste functionality to feature\nparity with desktop while maintaining mobile-specific optimizations.\n\nCo-Authored-By: sketch \u003chello@sketch.dev\u003e\nChange-ID: s495601fcaa89f012k\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "cb55c645eaf96a1daf326e2a9692764add74f531",
      "old_mode": 33188,
      "old_path": "webui/src/web-components/mobile-chat-input.ts",
      "new_id": "76c25310cb569767e5247c44cca83895a41df433",
      "new_mode": 33188,
      "new_path": "webui/src/web-components/mobile-chat-input.ts"
    }
  ]
}
