Skip to content

feature/mobile file attachments#21

Merged
typelets merged 2 commits intomainfrom
feature/mobile-file-attachments
Oct 12, 2025
Merged

feature/mobile file attachments#21
typelets merged 2 commits intomainfrom
feature/mobile-file-attachments

Conversation

@typelets
Copy link
Copy Markdown
Owner

Summary

Adds file upload, download, and attachment badge support to the mobile app with full end-to-end encryption.

What's New

File Management

  • Upload files with progress tracking (read → encrypt → upload → complete)
  • Download and share encrypted files
  • Delete attachments
  • Local file caching to prevent re-downloads
  • 10MB file size limit with validation

UI Features

  • Attachment count badges on note cards
  • Toggle attachment view in ViewNote and EditNote screens
  • Horizontal scrollable attachment list
  • File type icons (📄 PDF, 🖼️ images, 📊 spreadsheets, etc.)
  • File size formatting and download indicators

Backend Integration

  • Uses attachmentCount field from GET /api/notes response
  • Supports both attachmentCount and full attachments[] array
  • Compatible with existing backend file encryption endpoints

Key Files

New:

  • src/components/FileUpload.tsx - Upload component
  • src/services/fileService.ts - File operations with encryption

Modified:

  • src/services/api/types.ts - Added FileAttachment and attachmentCount
  • src/screens/NotesListScreen.tsx - Attachment badges
  • src/screens/ViewNote/index.tsx - Download and display
  • src/screens/EditNote/index.tsx - Upload UI

Dependencies Added

{
  "expo-document-picker": "~14.0.7",
  "expo-file-system": "~19.0.17",
  "expo-sharing": "~14.0.7"
}

Bug Fixes

  • Fixed infinite loop when loading attachments (added loadingRef guards)
  • Fixed React Native render error in badge condition
  • Fixed editor content loading race condition

Security

  • AES-256-GCM encryption using node-forge
  • Files encrypted before upload, decrypted after download
  • Compatible with mobile's existing encryption system

Testing

  • ✅ All file operations tested
  • ✅ No infinite loops or crashes
  • ✅ Lint and type checking pass

…ation

- Add attachmentCount field to Note type for performance optimization
- Update NotesListScreen to display attachment badges using backend count
- Fix attachment badge condition to prevent React Native render error
- Improve attachment loading in ViewNote with proper ref management
- Add stage-based upload progress tracking (read, encrypt, upload, process)
@typelets typelets self-assigned this Oct 12, 2025
@typelets typelets merged commit 2af97a0 into main Oct 12, 2025
3 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.23.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants