Commit Graph
136 Commits
Author SHA1 Message Date
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 991608f9b0 渲染lanclaw思考过程、工具调用 2026-06-19 17:47:31 +08:00
caprain 248cad01e3 fix: Android 端口配置不生效 & 保存配置时写入 config.json 崩溃
- lib.rs(Android 入口)读 DB 获取端口,取代硬编码 8888
- commands.rs / web_server.rs:Android 端跳过写 config.json
  避免 Read-only file system 错误
2026-06-19 12:13:21 +08:00
caprain 89ce5203b8 feat: 设置面板新增端口和数据库路径配置
- 端口(输入框):支持自定义服务端口,保存后重启生效
  桌面端:从 DB 读取端口配置;CLI 参数优先级最高
- 数据库路径(输入框 + 选择按钮):支持自定义数据库位置
  存储于 ~/.config/lanchat/config.json,避免鸡生蛋蛋生鸡
- 新增 config_file.rs:配置文件读写模块
- Android 端隐藏数据库路径配置
- 空值自动恢复默认,编辑后需重启提示
2026-06-19 11:43:06 +08:00
caprain 6d6894428d feat: 手动发现 + 心跳回复,支持跨 VLAN/WireGuard 自动发现
新功能:
- 手动发现:在设置面板添加目标 IP,自动发送 UDP 单播心跳
  (跨三层交换机、WireGuard 等广播不可达的场景)
- UDP 心跳自动回复:收到非回复心跳后原路回一句带标记的心跳,
  只需一方手动添加,双方自动互相发现,不再需要双边配置
- 支持桌面端和 Web 端,配置保存到数据库,立即生效无需重启
- 输入框校验 IP 格式,自动补端口号
- 保存按钮同时处理输入框中的自定义 IP

Closes https://github.com/cap153/LANChat/issues/2
v0.1.5
2026-06-18 19:48:06 +08:00
caprain 6e2cd6bcc8 完善文档 2026-06-17 16:22:21 +08:00
caprain 43b410db56 fix: 多选模式禁用模型选择按钮(pointer-events: none)
多选模式下模型按钮 pointer-events: none,点击落到消息本身的选择逻辑。
enterSelectMode 额外 disable 按钮,exitSelectMode 恢复(_switchingModel 中除外)。
2026-06-16 17:40:19 +08:00
caprain 2c37ba9bed feat: /model 命令 — 模型选择按钮 UI + 当前模型显示
ui.js: createMessageElement 检测 [MODEL_LIST] 渲染选择按钮,
      显示当前模型信息,点击发送 /model select 切换模型
style.css: 模型按钮暗色主题样式
web_server: (prev commit) new-message 事件补 file_path/file_size
2026-06-16 17:33:08 +08:00
caprain b822981c6b 更新计划 2026-06-16 16:24:29 +08:00
caprain 78a2d546f7 fix: new-message 事件补上 file_path/file_size,修复文件/图片首次渲染残缺
upload_file_http 中两处 app.emit('new-message') 的 payload
从未包含 file_path 和 file_size,导致接收文件/图片时:
- createMessageElement 因缺失 file_path 跳过图片渲染
- createFileIcon 因缺失 file_size 显示未知大小

桌面端之前靠轮询(1s 间隔拉完整 DB 数据后 replaceWith)
掩盖了此问题。流式更新重构了首次渲染路径后残缺状态
变得可见。

修复:两处 emit 补上 file_path 和 file_size。
2026-06-16 16:23:26 +08:00
caprain 8a51824f89 完善web端 2026-06-16 02:43:20 +08:00
caprain 64c704170f feat: Web端流式传输支持(广播频道)
- web_server: 新增 ws_broadcast 广播频道,所有 WS 连接订阅并转发
- web_server: 流式中间块/最终块/非流式消息 publish 到广播频道
- web_server: 广播接收循环容错 Lagged(滞后不退出)
- app.js: Web端 WebSocket 客户端接收流式事件
- 桌面端保留 app.emit,Web端通过 WS 广播,互不干扰
2026-06-16 02:22:36 +08:00
caprain 94baae227d feat: 流式传输支持 + 消息重复渲染修复
- web_server: WS 处理器识别 stream_id/stream_final 字段,流式块不存 DB
- ui.js: 新增 updateStreamMessage() 按 data-stream-id 更新气泡
- onReceiveMessage: is_streaming 分支用 replaceWith 替代重复创建
- addMessageToChat: replaceWith 替代 remove+appendChild 消除竞态
- 修复 UTF-8 字符边界 panic(chars().take 替代 byte slicing)
2026-06-15 22:43:59 +08:00
caprain 9c22bcb63c fix: WebSocket 的 new-message 事件缺少 id 导致安卓端不渲染
- db::save_received_text_message 改为返回 msg_id (last_insert_rowid)
- save_message_to_db 透传 msg_id
- handle_websocket 中 new-message 事件带上 id 字段,与 TCP 处理器一致
- addMessageToChat 用 replaceWith 替代 remove+appendChild 消除竞态
- onReceiveMessage 文件分支改走统一 addMessageToChat 路径
2026-06-15 21:41:30 +08:00
caprain 7b06b1dd7a fix: WebSocket 的 new-message 事件缺少 id 导致安卓端不渲染
- db::save_received_text_message 改为返回 msg_id (last_insert_rowid)
- save_message_to_db 透传 msg_id
- handle_websocket 中 new-message 事件带上 id 字段,与 TCP 处理器一致
2026-06-15 20:44:35 +08:00
夜未央,天将亮 0dc5b56b74 Add troubleshooting section to README
Added troubleshooting section with installation links for VCRUNTIME and WebView2.
2026-06-09 23:35:02 +08:00
caprain 991d19efe0 Merge branch 'main' of github.com:cap153/LANChat 2026-05-23 18:57:40 +08:00
caprain 08cd31304e fix(ui): improve event handler formatting and sync scroll button after message deletion 2026-05-23 18:56:45 +08:00
夜未央,天将亮 8985cafa84 Update README with Android feature status 2026-05-19 21:39:44 +08:00
caprain 622eb68998 删除ai生成的错误文档 2026-05-18 00:27:47 +08:00
caprain 6189534185 fix:安卓端三大金刚布局自动收缩 2026-05-18 00:20:12 +08:00
caprain c8015eb473 fix:ip变动导致发送失败 2026-05-16 12:16:26 +08:00
caprain 056402444b 完善管理用户选项 2026-05-14 18:01:02 +08:00
caprain 34b02271c2 feat:鼠标右键/长按删除用户或清空聊天记录 2026-05-14 17:15:10 +08:00
caprain 54ae7f2a5b 更新版本号 2026-05-13 23:32:57 +08:00
caprain 1a4a0c8d3a 完善文档 2026-05-13 23:21:34 +08:00
caprain 1fb5430c4d 分工明确 v0.1.4 2026-05-13 23:15:01 +08:00
caprain 9146c164da fix:windows web端数据库路径不标准 2026-05-13 22:42:43 +08:00
caprain 76bd578e56 fix:无id的僵尸气泡无法选中、多选导致变窄消息位移 2026-05-13 22:28:38 +08:00
caprain 4bff507ef6 完善排序、修复web端滚动到底部不出现红点 2026-05-13 20:26:35 +08:00
caprain d8c42db360 修复其他app分享文件崩溃 2026-05-13 19:27:01 +08:00
caprain 45c6e028f1 fix:安卓端文件补发失败 2026-05-13 19:03:26 +08:00
caprain c309be102c 完善web端消息补发 2026-05-13 18:52:30 +08:00
caprain b37df67a24 前端纯粹渲染消息 2026-05-13 17:59:14 +08:00
caprain d83a08097a fix:文件上传消息重复 2026-05-12 22:21:22 +08:00
caprain a186a6c901 fix:挂起状态样式 2026-05-12 17:25:04 +08:00
caprain 58d4a9c572 feat:离线用户消息补发 2026-05-12 12:00:21 +08:00
caprain 7a777f926a 条件编译 2026-05-12 10:08:42 +08:00
caprain 34bbe4bcb8 实现剪切板图片粘贴 2026-05-11 17:04:35 +08:00
captain 5f2bb2a30e feat(android,security): Enable cleartext traffic and WebView debugging
- Enable cleartext traffic support in Android build configuration for local development
- Add WebView debugging to capture JavaScript console output in logcat
- Expand CSP policy to allow http://127.0.0.1:* for local media proxy service
- Add comprehensive debug logging for image loading and media token handling
- Improve image preview URL construction with detailed logging for Android content URIs
- Add image load success and error callbacks for better debugging visibility
2026-04-07 11:04:34 +08:00
captain 4b6e364b20 完善文档 2026-04-05 18:23:25 +08:00
captain 94152f2155 完善文档 2026-04-05 18:18:29 +08:00
captain 8b763f7af4 添加makefile v0.1.3 2026-04-05 18:06:35 +08:00
captain 7080aef771 feat(android,file-transfer): Add instant transfer detection and improve share intent security
- Add ClipData to share intent to prevent SecurityException in system UI when accessing shared file URI
- Implement instant transfer (秒传) detection on receiver side to skip uploading when file already exists with matching size
- Add instant transfer response handling in upload command to stop transmission when receiver has complete file
- Refactor file naming negotiation logic to handle conflicts and .downloading file cleanup more robustly
- Add #[allow(unused_variables)] annotation to close_android_fd for non-Android builds
- Improve file conflict resolution with automatic renaming when size mismatch detected
- Create received file records immediately on instant transfer match and mark as accepted status
2026-04-05 17:37:13 +08:00
captain 96da76ce13 完善文档 2026-04-05 16:21:48 +08:00
captain aca1613f3b 添加赞赏码 2026-04-05 16:16:56 +08:00
captain d5630cfb15 调整分享按钮位置、打开失败降级文件类型再次尝试 2026-04-05 00:01:15 +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 28d07d809e 完善文档 2026-03-11 21:31:10 +08:00
captain cacadc7ad5 完善文档 2026-03-11 21:00:10 +08:00