Feat/chat bubble#985
Open
xuebkgithub wants to merge 46 commits into
Open
Conversation
macOS 主窗口由 NSPanel 创建,CollectionBehavior 含 .stationary(), 导致面板被钉死在创建时所在屏幕,多显示器用户无法把猫咪带到当前工作的屏幕。 - 偏好设置「通用 → 应用设置」新增「跟随当前屏幕」开关,仅 macOS 显示, 默认关闭,行为保持现状 - Rust 端新增 set_multi_screen_follow command,使用 AtomicBool 共享开关状态, show/hide 路径同步读取;开启时去掉 .stationary() 让 NSPanel 可跨 Space/屏幕 - 新增 useMultiScreenFollow composable,开关启用时 800ms 轮询 cursorPosition + monitorFromPoint,按相对偏移把窗口平移到鼠标所在显示器 并裁剪到边界 - Windows / Linux 端提供同名 no-op,保持 generate_handler! 跨平台符号一致 - 5 个 locale (en-US / zh-CN / zh-TW / pt-BR / vi-VN) 全量补齐文案 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
大屏 → 小屏切换时跨屏跟随会被裁剪到小屏边界,回到大屏后 之前用户手动设定的位置就会丢失。 - 新增 monitorOffsets Map,按屏幕 (x,y,w,h) 作为 key - 每次轮询同步当前屏幕的最新偏移,捕获用户屏内拖动 - 跨屏移动时优先使用目标屏幕的历史偏移,无记录再用源屏偏移 - 关闭开关时清空 Map,避免状态残留 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Implement computeBubblePosition() function that calculates the bubble's top-left corner in physical pixels, handling edge cases: horizontal centering with screen boundaries, vertical placement (above cat by default, below if no room), and multi-display support with negative coordinates and high-DPI scaling. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collects IPC listener UnlistenFn in onMounted and calls them in onUnmounted to prevent listener leaks. Also clears pending auto-hide timer and validates hex color input in hexToRgba before parsing. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… not a WebviewWindow method)
reposition() called main.currentMonitor(), but currentMonitor is a free
function in @tauri-apps/api/window, not a method on WebviewWindow/Window —
so every reposition threw TypeError and the bubble never positioned/showed.
Find the cat's monitor by physical-bounds containment via availableMonitors()
(same pattern as useWindowState). Also make App.vue's unhandledrejection
handler log Error name/message/stack instead of JSON.stringify→'{}'.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The bubble was a flex item; width:max-content does not stop flex-shrink, so in the narrow chat window it collapsed to min-content (one CJK char per line) and setSize locked that in. Switch to a measured block wrapper (w-max max-w-80 p-3): a block with width:max-content is window-independent, so short text stays on one line and long text wraps only at the 320px cap. The wrapper's padding (measured, unlike the old margin) reserves the box-shadow space. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ffff Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…o feat/ai-chat-bubble # Conflicts: # src/pages/preference/components/general/index.vue
…gin-http CORS fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: 猫咪对话气泡 + HTTP 推送接口
这个 PR 做了什么
给桌宠猫加了一个会说话的气泡:可以在猫旁边弹出一句话,自动测量大小、定位、计时淡出。文字内容既能由 App 内部触发(如模型加载完成时打招呼),也能由外部程序通过本地 HTTP 接口推送(curl 一行就能让猫说话)。
主要内容
127.0.0.1:{端口}监听(仅本机),tiny_http实现,可选 Token 鉴权GET /sayGET /config怎么用(一眼上手)
设置页:设置 → Chat 开启「启用 HTTP 接口」即可(改端口/Token 后需重启)。手工测试脚本见
scripts/bubble-http.sh。