24 Commits
Author SHA1 Message Date
caprain b0e094937b fix: 优化安卓端状态栏通知 2026-06-28 20:07:22 +08:00
caprain 3df38030f2 fix:安卓端首次启动没有弹出通知权限申请 2026-06-27 18:53:57 +08:00
caprain 48e6e70b65 feat:增加英文支持 2026-06-26 16:18:45 +08:00
caprain 954236c6cd feat: Android SAF 原生文件选择器 (ACTION_OPEN_DOCUMENT + takePersistableUriPermission)
Kotlin 层:
   - registerForActivityResult(OpenDocument) 拉起系统 SAF 选择器
   - takePersistableUriPermission 持久化读取权限,跨进程/跨重启永久可读
   - 通过 external fun JNI 回调 Rust(URI / name / size)

   Rust 层:
   - APP_HANDLE 全局缓存,供 JNI 回调发射 Tauri 事件
   - AndroidFile::trigger_saf_picker_jni() 主动调 Kotlin
launchSafFilePicker
   - nativeOnSafFileSelected JNI 回调 → app.emit("saf-file-selected")

   JS 层:
   - attachFileBtn → Android 优先走 invoke("open_saf_picker")
   - saf-file-selected 事件监听 → URI 直接传给 apiSendFile

   降级: SAF 不支持持久化的极端情况 → FD 缓存兜底 (双保险)
2026-06-26 00:47:22 +08:00
caprain 3180d79490 实现桌面端手动接收 2026-06-24 22:22:40 +08:00
caprain fdb24b5c56 feat: 系统通知 + 托盘图标闪烁 + 条件编译优化
系统通知(Closes #5)
- 桌面端:Windows PowerShell / Linux notify-send / macOS 原生通知
- Web 端:Notification API
- Android 端:tauri-plugin-notification 原生通知
- 通知开关:托盘菜单 CheckMenuItem + DB 持久化(仅桌面端)
- Android 通知点击导航(MainActivity.onNewIntent + localStorage)

托盘图标闪烁
- 500ms 间隔交替正常/空白图标(std::thread)
- 红点出现/消失时自动启停(updateTrayFlash)
- 左键/右键「显示窗口」跳转最新未读
- 多次点击逐个跳转未读用户(消费 pendingNotificationFromId + fallback)

Cargo 条件编译优化
- tauri-plugin-single-instance / opener 移入 desktop-only cfg
- tauri-plugin-notification 仅 macOS/Android 编译
- reqwest: Android 用 rustls-tls(避免 vendored OpenSSL 交叉编译失败)
- tokio/chrono 按需启用特性缩小体积
- 修复 TOML 表格结构导致全部依赖被吞入 cfg 区块的 bug
2026-06-20 23:10:57 +08:00
caprain 6d6894428d feat: 手动发现 + 心跳回复,支持跨 VLAN/WireGuard 自动发现
新功能:
- 手动发现:在设置面板添加目标 IP,自动发送 UDP 单播心跳
  (跨三层交换机、WireGuard 等广播不可达的场景)
- UDP 心跳自动回复:收到非回复心跳后原路回一句带标记的心跳,
  只需一方手动添加,双方自动互相发现,不再需要双边配置
- 支持桌面端和 Web 端,配置保存到数据库,立即生效无需重启
- 输入框校验 IP 格式,自动补端口号
- 保存按钮同时处理输入框中的自定义 IP

Closes https://github.com/cap153/LANChat/issues/2
2026-06-18 19:48:06 +08:00
caprain 34b02271c2 feat:鼠标右键/长按删除用户或清空聊天记录 2026-05-14 17:15:10 +08:00
captain fb250964e1 feat(android): Add file opening and media token management
- Add openFile() method to MainActivity for opening files with native apps
- Implement open_file_in_android command to trigger file opening on Android
- Add get_media_token command for obtaining media proxy tokens
- Add close_android_fd command for closing Android file descriptors
- Enhance AndroidFile::from_content_uri() with exception handling for expired permissions
- Add query_content_uri_info() to retrieve file metadata (name, size) from content URIs
- Add get_media_token_from_uri() for generating media proxy tokens
- Add close_fd() method to properly close file descriptors
- Update Cargo.toml with tokio-util dependency for IO utilities
- Add new permissions to mobile.json capabilities
- Create android-share-out.toml with three new permission definitions
- Update README with new in-progress features for Android file handling and deduplication
- Improve error handling and logging throughout Android file operations
2026-04-04 22:32:57 +08:00
captain 0c8ad5e14a 调整样式支持删除功能 2026-03-08 16:33:57 +08:00
captain 9c4b96a192 feat(chat): Add pagination support for chat history retrieval
- Add new `get_chat_history_with_offset` command with limit and offset parameters
- Add corresponding permission `allow-get-chat-history-with-offset` to capabilities
- Reduce default chat history limit from 100 to 10 messages
- Remove debug println statements from commands and database modules
- Replace println with eprintln for error logging in database operations
- Update permissions configuration to support paginated history queries
- Enable efficient loading of historical messages with configurable pagination
2026-03-07 20:30:54 +08:00
captain 30e22575b7 feat(drag-paste): Add zero-copy file transfer via drag-drop and clipboard
- Add drag-and-drop file support with zero-copy on desktop using Tauri native events
- Add clipboard file reading on desktop using clipboard-rs library for direct path access
- Implement sendFileByPath() for zero-copy file transmission from disk
- Add read_clipboard_files Rust command to extract file paths from clipboard
- Add visual feedback for drag-over state with purple dashed border and breathing animation
- Add DRAG_PASTE_FEATURE.md documenting zero-copy implementation and performance benefits
- Add WEB_USAGE_GUIDE.md explaining Web endpoint limitations and best practices
- Update Cargo.toml with clipboard-rs dependency for cross-platform clipboard support
- Update Tauri capabilities and permissions for file system access and clipboard operations
- Update UI event handlers in ui.js to support both desktop and Web file transfer modes
- Update CSS with drag-over styling and animation effects
- Update API layer to handle path-based file sending for desktop and content-based for Web
2026-03-07 16:40:38 +08:00
captain d4eedef28a refactor(android): Remove URI-based file sending command
- Remove `allow-send-file-from-uri` permission from mobile capabilities
- Remove `send_file_from_uri` command registration from main.rs
- Remove URI-based file sending permission definition from android-share.toml
- Consolidate file sending to use file descriptor approach only
2026-03-07 14:59:02 +08:00
captain 6e114b1096 feat(android): Add file sharing to other apps capability
- Add shareFile method to MainActivity for sharing files via FileProvider
- Implement share_file_to_other_app command with JNI integration for Android
- Add android-share-out.toml permission configuration for file sharing
- Update mobile.json capabilities to include allow-share-file-to-other-app
- Extend file_paths.xml with external and internal file path configurations
- Add originalUri parameter to send_file_from_fd command for URI preservation
- Update API and UI layers to support file sharing functionality
- Enable users to share received files to other applications on Android
2026-03-07 14:54:56 +08:00
captain 4126eb71bd feat(android): Add file sharing support via ShareActivity
- Add ShareActivity to handle incoming file shares from Android intent filters
- Implement JNI and NDK context dependencies for Android file descriptor handling
- Add android_fd.rs module for file descriptor operations
- Register broadcast receiver in MainActivity to detect shared files
- Add JavaScript interface to expose shared files to frontend
- Implement file URI to file descriptor conversion for efficient file transfer
- Add Android permissions for GET_TASKS and file sharing capabilities
- Update mobile.json capabilities with new file sharing and FD-based transfer permissions
- Add intent filters for SEND and SEND_MULTIPLE actions in AndroidManifest.xml
- Update frontend API and UI to support receiving and displaying shared files
- Add android-share.toml permission configuration file
2026-03-07 13:31:37 +08:00
captain 23cd88e3a2 使用Opener插件实现:桌面端点击文件消息打开所在路径 2026-03-05 21:41:51 +08:00
captain 20c436263a 安卓端流式上传 2026-03-03 12:04:29 +08:00
captain 449a386160 解决安卓端无法上传文件的问题 2026-02-17 19:48:12 +08:00
captain 2bc6359779 支持安卓 2026-02-17 18:50:31 +08:00
captain 5110765c40 支持自定义主题 2026-02-17 11:12:51 +08:00
captain aa4884e934 实现手动接收功能, 2026-02-16 11:25:47 +08:00
captain 46bf0382d2 feat: 实现文件传输和消息实时显示功能 2026-02-15 21:54:05 +08:00
captain 57e312d423 feat: 实现基于UUID的用户状态管理和离线检测 2026-02-15 18:14:22 +08:00
captain cb46007333 feat: 实现用户改名功能和Web端数据库集成 2026-02-15 16:39:53 +08:00