diff --git a/README.md b/README.md index a391b90..852f1fe 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ Shift lives in the menu bar (macOS) and the notification area (Windows), and it **Use a tool (`Option + Shift`, or `Alt + Shift` on Windows).** Same gesture, and the wedges become tools for that file type instead of formats. While the ring is open, keep `Shift` held and press or release `Option`/`Alt` to flip between the format ring and the tool ring. -**Prefer not to drag?** In the main window, **Convert files** and **File tools** open a picker and then show the same ring for what you chose; **OCR** picks an image and reads it. Dropping a file is **aimed**: the three buttons are the only drop targets, and the button you release on is the action it runs - **Convert files** opens the format ring, **File tools** the tool ring, **OCR** reads the image. All three light up as candidates while a drag is in flight; release anywhere else on the panel and nothing runs, with a note that the drop needs a button. +**Prefer not to drag?** In the main window, **Convert files** and **File tools** open a picker and then show the same ring for what you chose; **OCR** picks an image and reads it. Dropping a file is **aimed**: the three buttons are the only drop targets, and the button you release on is the action it runs - **Convert files** opens the format ring, **File tools** the tool ring, **OCR** reads the image. All three light up as candidates while a drag is in flight, and only they react: the panel around them stays still. Release anywhere else and nothing happens at all. **OCR** refuses a file it cannot read rather than handing it to another ring. **Several files at once.** Multi-select with `⌘`/`Ctrl`-click, then drag. Every file is processed. With 2+ images or 2+ PDFs selected, a **Merge** wedge appears that combines them into a single PDF. @@ -273,7 +273,7 @@ The menu bar (macOS) and notification area (Windows) icon exposes the actions yo | Capture area | `Alt+Shift+2` | Start an area screenshot | | Capture full screen | `Alt+Shift+4` | Grab the monitor under the pointer | | Record area | `Alt+Shift+3` | Start, or stop, an area recording | -| OCR an image… | — | Pick an image and read its text locally | +| OCR | — | Pick an image and read its text locally | | Update available *x.y.z* | — | Only while an update is available; opens Settings → Updates | | Quit Shift | `Cmd/Ctrl+Q` | Exit; an in-flight recording is finalised first | @@ -293,7 +293,7 @@ Each is overridable in Settings. File actions offer a *collect everything in one ## Updates -A new macOS machine installs **`Shift-0.1.9-macOS-universal.dmg`**: builds are ad-hoc signed and not notarized, so Gatekeeper calls Shift an unidentified developer. Double-click the image, drag `Shift.app` to /Applications, then allow the first launch once (right-click → Open, or 允许 in System Settings → Privacy & Security). In-app updates download the same image without a browser, so they never prompt. Details in `docs/RELEASE.md`. +A new macOS machine installs **`Shift-0.1.10-macOS-universal.dmg`**: builds are ad-hoc signed and not notarized, so Gatekeeper calls Shift an unidentified developer. Double-click the image, drag `Shift.app` to /Applications, then allow the first launch once (right-click → Open, or 允许 in System Settings → Privacy & Security). In-app updates download the same image without a browser, so they never prompt. Details in `docs/RELEASE.md`. The update channel is this repository: a `releases` branch holding the installers plus `shift-update.json`, which names each artifact, its size and its SHA256. The feed URL is derived from the git remote at build time - Gitea, GitHub and GitLab forms are known, and `SHIFT_UPDATE_URL` overrides it - so no update service has to be deployed anywhere. @@ -374,7 +374,7 @@ pnpm mac:release scripts/build-windows-release.sh ``` -The release pipeline deliberately emits exactly two installers: `Shift-0.1.9-macOS-universal.dmg` and `Shift-Setup-0.1.9-win-x64.exe`. The macOS app is one universal Mach-O including universal drag, PDF-render and doc-render sidecars. Windows ARM64 uses the x64 installer through the update manifest's compatibility fallback. Full details are in `docs/BUILD_WINDOWS.md` and `docs/RELEASE.md`. +The release pipeline deliberately emits exactly two installers: `Shift-0.1.10-macOS-universal.dmg` and `Shift-Setup-0.1.10-win-x64.exe`. The macOS app is one universal Mach-O including universal drag, PDF-render and doc-render sidecars. Windows ARM64 uses the x64 installer through the update manifest's compatibility fallback. Full details are in `docs/BUILD_WINDOWS.md` and `docs/RELEASE.md`. **Permissions (macOS).** Screen Recording for capture, Files & Folders for the output folders you choose, Microphone when recording with audio, and Local Network for **Send to a device**. Shift checks Screen Recording before opening the overlay, so a denial surfaces an actionable error rather than a black screenshot. A denied Local Network grant is quieter: Shift still sends its beacons and still answers anyone who addresses it directly, but it receives no group traffic, so the device list simply stays empty. Ad-hoc signed builds get a new code identity on every rebuild and macOS keys these grants to that identity, so an upgrade can ask again; distribution with Developer ID keeps them stable. diff --git a/README.zh-CN.md b/README.zh-CN.md index f833f00..30bd513 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -72,7 +72,7 @@ Shift 常驻菜单栏(macOS)与通知区域(Windows),同时也有普 **使用工具(`Option + Shift`,Windows 为 `Alt + Shift`)** 操作相同,扇区会从格式换成该类型文件可用的工具。圆环打开时,保持按住 `Shift`,再按下或松开 `Option`/`Alt`,即可在格式环与工具环之间来回切换。 -**不想拖动?** 主窗口中的「文件转换」与「文件工具」会先让你挑选文件,然后对选中的文件弹出同一个圆环;「文字识别」则选取图片并识别。拖放文件必须**对准按钮**:三个按钮是唯一的落点,松开在哪个按钮上就执行那个按钮的动作——「文件转换」打开格式环,「文件工具」打开工具环,「文字识别」直接识别图片。拖拽进行中三个按钮会同时显示为候选落点;松开在面板其他位置不会执行任何操作,并提示需要拖到按钮上。右侧「最近使用」里的条目同样可以拖到这三个按钮上,用同一次拖拽复用已经处理过的文件。 +**不想拖动?** 主窗口中的「文件转换」与「文件工具」会先让你挑选文件,然后对选中的文件弹出同一个圆环;「文字识别」则选取图片并识别。拖放文件必须**对准按钮**:三个按钮是唯一的落点,松开在哪个按钮上就执行那个按钮的动作——「文件转换」打开格式环,「文件工具」打开工具环,「文字识别」直接识别图片。拖拽进行中三个按钮会同时显示为候选落点,并且只有按钮会响应,周围的面板保持静止;松开在其他位置什么都不会发生。「文字识别」遇到无法读取的格式会直接拒绝,不再转交给别的圆环。右侧「最近使用」里的条目同样可以拖到这三个按钮上,用同一次拖拽复用已经处理过的文件。 **一次处理多个文件。** 用 `⌘`/`Ctrl` 点选多个文件后一起拖动,每个文件都会被处理。选中 2 张以上图片或 2 个以上 PDF 时,会出现「合并」扇区,把它们合成一个 PDF。 @@ -275,7 +275,7 @@ Shift 会持续维护局域网内其他 Shift 实例的列表,并据此提供 | Capture area | `Alt+Shift+2` | 开始区域截图 | | Capture full screen | `Alt+Shift+4` | 截取光标所在显示器 | | Record area | `Alt+Shift+3` | 开始或停止区域录屏 | -| OCR an image… | — | 选择图片并在本机识别文字 | +| OCR | — | 选择图片并在本机识别文字 | | Update available *x.y.z* | — | 仅在有可用更新时出现;打开设置 → 软件更新 | | Quit Shift | `Cmd/Ctrl+Q` | 退出;若有正在进行的录屏会先收尾保存 | @@ -295,7 +295,7 @@ Shift 会持续维护局域网内其他 Shift 实例的列表,并据此提供 ## 软件更新 -新的 macOS 机器请安装 **`Shift-0.1.9-macOS-universal.dmg`**:本项目的构建采用 ad-hoc 签名且未做公证,Gatekeeper 会把 Shift 判为身份不明的开发者。双击挂载镜像,把 `Shift.app` 拖进「应用程序」,然后允许首次启动一次(右键 → 打开,或在「系统设置 → 隐私与安全性」中点「允许」)。软件内升级自己下载的是同一个镜像、不经浏览器,因此不会弹窗。详见 `docs/RELEASE.md`。 +新的 macOS 机器请安装 **`Shift-0.1.10-macOS-universal.dmg`**:本项目的构建采用 ad-hoc 签名且未做公证,Gatekeeper 会把 Shift 判为身份不明的开发者。双击挂载镜像,把 `Shift.app` 拖进「应用程序」,然后允许首次启动一次(右键 → 打开,或在「系统设置 → 隐私与安全性」中点「允许」)。软件内升级自己下载的是同一个镜像、不经浏览器,因此不会弹窗。详见 `docs/RELEASE.md`。 更新通道就是这个仓库:一条 `releases` 分支保存安装包以及 `shift-update.json` 清单,清单写明每个安装包的名称、体积与 SHA256。更新源地址在构建时由 git 远端推导——已适配 Gitea、GitHub、GitLab 三种形式,也可用 `SHIFT_UPDATE_URL` 覆盖——因此无需额外部署任何更新服务。 @@ -369,7 +369,7 @@ pnpm mac:release scripts/build-windows-release.sh ``` -发布链只产出两个安装包:`Shift-0.1.9-macOS-universal.dmg` 与 `Shift-Setup-0.1.9-win-x64.exe`。macOS 是单个通用 Mach-O,内含通用版的拖拽、PDF 渲染与文档渲染伴生进程;Windows ARM64 通过更新清单的兼容回退使用 x64 安装包。完整步骤见 `docs/BUILD_WINDOWS.md` 与 `docs/RELEASE.md`。 +发布链只产出两个安装包:`Shift-0.1.10-macOS-universal.dmg` 与 `Shift-Setup-0.1.10-win-x64.exe`。macOS 是单个通用 Mach-O,内含通用版的拖拽、PDF 渲染与文档渲染伴生进程;Windows ARM64 通过更新清单的兼容回退使用 x64 安装包。完整步骤见 `docs/BUILD_WINDOWS.md` 与 `docs/RELEASE.md`。 **权限(macOS)。** 截图与录屏需要「屏幕录制」,输出目录需要「文件与文件夹」授权,带声音录屏需要「麦克风」,「发送到设备」需要「本地网络」。Shift 会在打开截图遮罩前先检查屏幕录制权限,因此被拒绝时给出的是可操作的提示,而不是一张全黑的截图。「本地网络」被拒绝时比较安静:Shift 仍会发出广播、也能回应主动找它的实例,但收不到组播,设备列表于是始终为空。ad-hoc 签名每次重新构建都会得到新的代码身份,而 macOS 正是按这个身份记录上述授权,所以升级后可能重新询问;改用 Developer ID 签名即可保持稳定。 diff --git a/artifacts/README-macOS-universal.txt b/artifacts/README-macOS-universal.txt index 75f5c17..6e5b715 100644 --- a/artifacts/README-macOS-universal.txt +++ b/artifacts/README-macOS-universal.txt @@ -1,4 +1,4 @@ -Shift 0.1.9 - macOS 通用(universal) +Shift 0.1.10 - macOS 通用(universal) 本文件说明 macOS 安装包是怎么打出来的、在其它机器上会遇到什么,以及如何自己校验。 完整细节见仓库 docs/RELEASE.md 的「macOS packaging」和 docs/ENGINEERING-NOTES.md @@ -8,7 +8,7 @@ Shift 0.1.9 - macOS 通用(universal) 关于这个安装包 -------------- -Shift 的 macOS 产物只有一个:Shift-0.1.9-macOS-universal.dmg,通用二进制,Apple silicon 与 +Shift 的 macOS 产物只有一个:Shift-0.1.10-macOS-universal.dmg,通用二进制,Apple silicon 与 Intel 都能用。它既是新机器的首次安装方式,也是软件内升级的载体(更新清单里的 macos 键指向它)。清单的键必须是 .dmg,因为软件内升级的交接脚本要用 hdiutil 挂载镜像再 取出应用包;早期曾随包发布的 .pkg 在验证过 DMG 可用后就撤掉了,不为它多维护一份 @@ -23,7 +23,7 @@ Intel 都能用。它既是新机器的首次安装方式,也是软件内升 ---------------- 新机器首次安装 - 1. 下载并双击 Shift-0.1.9-macOS-universal.dmg 挂载镜像。 + 1. 下载并双击 Shift-0.1.10-macOS-universal.dmg 挂载镜像。 2. 把 Shift.app 拖进「应用程序」(或任何你有权限的位置)。 3. 首次启动会被拦:「无法打开,因为来自身份不明的开发者」。点取消,然后 右键 Shift.app → 打开,或在「系统设置 → 隐私与安全性」中点「仍要打开」。 @@ -70,7 +70,7 @@ macOS 权限 pnpm tauri build --target universal-apple-darwin --bundles app,dmg -`pnpm mac:release` 会构建、校验并复制为 artifacts/Shift-0.1.9-macOS-universal.dmg。 +`pnpm mac:release` 会构建、校验并复制为 artifacts/Shift-0.1.10-macOS-universal.dmg。 发布流程(清单、签名、推送)见仓库 docs/RELEASE.md。 若希望更新通道能校验来源,构建时把 ed25519 公钥编进去(发布流程见仓库 @@ -96,7 +96,7 @@ docs/RELEASE.md 的「Signing the channel」): 镜像完整性: - hdiutil verify Shift-0.1.9-macOS-universal.dmg + hdiutil verify Shift-0.1.10-macOS-universal.dmg 校验后仍打不开的话,请确认不是在压缩包预览窗口里运行的,并按上面的「新机器首次安装」 处理首次允许:右键 → 打开,或在「系统设置 → 隐私与安全性」中点「仍要打开」。 diff --git a/docs/ENGINEERING-NOTES.md b/docs/ENGINEERING-NOTES.md index 96cb3c6..9027b8b 100644 --- a/docs/ENGINEERING-NOTES.md +++ b/docs/ENGINEERING-NOTES.md @@ -1,6 +1,6 @@ # Shift 工程回归台账 -本文件记录 0.1.2 到 0.1.9 之间已经踩过、并且不应再次引入的工程问题,重点覆盖: +本文件记录 0.1.2 到 0.1.10 之间已经踩过、并且不应再次引入的工程问题,重点覆盖: - Drop / 局域网设备发现 - DOCX、Markdown 与图片转换 @@ -22,6 +22,7 @@ | 0.1.7 | 增加单播扫描、普通信标回应、15 秒过期和 Windows 错误处理;用户实测 Mac 与 Windows 终端的 Drop 发现恢复正常。 | | 0.1.8 | 最近文件改为收藏并移除拖回主操作按钮的交互;Windows 增加单实例保护;macOS DOCX→PDF 改用 Quick Look 源,保留页眉、页脚与装订版式。 | | 0.1.9 | 重新支持把「最近使用」拖回三个主操作按钮,并且**按钮是唯一落点**——松开在面板其他位置不执行任何操作(见「『最近使用』拖回主面板的三个按钮」);设置面板字号统一到 `--text-*` 阶梯;取消「截图后」行为选项,固定为结果卡片;修复 macOS「运行组件」把 AppKit 文档渲染器报成 Pandoc 缺失且没有安装入口的回归。 | +| 0.1.10 | 拖放反馈收束到按钮:面板自身不再做拖拽动画,松开在非按钮处彻底静默(去掉 0.1.9 的提示浮层);「文字识别」对非图片直接拒绝,不再退回格式环;托盘「识别图片文字…」改为「文字识别」。 | 历史提交可以这样定位: @@ -397,11 +398,20 @@ cargo test --lib runtime 0.1.8 曾经把这条交互关掉:一行拖出去是文件,拖回来却什么都不是,用户只能重新选一次文件。 现在拖到「文件转换 / 文件工具 / 文字识别」上就执行该按钮的动作。 -**按钮是唯一的落点。** 从 0.1.9 起,拖到面板其他位置**不执行任何操作**,只提示"请把文件拖到 -下方三个按钮之一"。此前"落在面板空白处就打开操作环"的兜底已经去掉:外部拖入和内部拖拽都遵循 -同一条规则,`dropFiles` 的 `action` 参数因此从 `DropAction | null` 收紧成 `DropAction`。拖拽 -进行中三个按钮会同时点亮为候选落点(原生拖拽用 `dragging`,内部拖拽用 `rowDragging`),否则 -用户在松开之前无从知道该瞄哪里。实现上有一条约束容易在重构时丢掉: +**按钮是唯一的落点,也是唯一会响应拖放的东西。** 这条规则分两步收紧: + +- 0.1.9 去掉了"落在面板空白处就打开操作环"的兜底,改成不执行操作、弹一条提示。 +- 0.1.10 连提示也去掉:既然不执行任何操作,解释"为什么没执行"的浮层只是在用户没有松手的位置 + 制造动静,落在面板其他位置现在是彻底静默。 + +外部拖入和内部拖拽始终遵循同一条规则,`dropFiles` 因此接受 `DropAction | null`,`null` 直接 +原样返回——它不是"未知动作",而是"没有动作",两条投递路径共用这一个判断。 + +同理,拖拽反馈只加在按钮上:进行中三个按钮同时点亮为候选落点(原生拖拽用 `dragging`,内部 +拖拽用 `rowDragging`),而 `.home-drop` 面板本身不再缩放、变色或换描边——`is-dragging` 类、 +对应的两条 CSS 规则、以及随之失效的 `transition` 都已删除,标题也不再改文案。从外部拖入和从 +列表拖起现在是同一种观感,之前只有外部拖入会让整块面板动起来。实现上有一条约束容易在重构时 +丢掉: **一次内部拖拽可能被报告两次。** 历史行使用 `dragOutPayload`,也就是 `text/uri-list` 里的 `file://` 加纯文本路径,因此它对外就是一个文件拖拽。同一次手势有两种投递路径: @@ -418,8 +428,10 @@ cargo test --lib runtime | 约束 | 原因 | | --- | --- | | `onDragEnd` 不能立即清空 `recentDrag`,要延迟 500 ms | 部分引擎在按钮抬起之后才发出原生 `drop`,提前清空会让这一次手势变成"落回面板的空拖拽"。 | -| 两条投递路径都必须把"没命中按钮"当作同一种结果处理 | 内部拖拽与外部拖入的语义必须一致;只在 DOM 路径拒绝、原生路径仍兜底开环,就会出现同一个动作两种结果。 | +| 两条投递路径都必须把"没命中按钮"当作同一种结果处理 | 内部拖拽与外部拖入的语义必须一致;只在 DOM 路径静默、原生路径仍兜底开环或弹提示,就会出现同一个动作两种结果。 | | 点亮候选按钮的开关有两个来源 | 外部拖拽靠原生 `enter` 设置的 `dragging`,内部拖拽原生事件不一定到,必须另有 `rowDragging`,否则从列表拖起时按钮毫无反应。 | +| 面板不要用 `is-dragging` 自己做拖放反馈 | 内部拖拽拿不到原生事件,只有外部拖拽会点亮面板,两种拖法观感不同;把反馈收在按钮上,两条路径共用同一套 `has-drop-target`。 | +| 「文字识别」不接受兜底 | `runOcrOn` 遇到非图片直接拒绝并提示,不再转交格式环:按钮说做什么就做什么,"拖到 OCR 却弹出转换环"会让用户以为按钮被忽略了。 | ### 回归测试 @@ -428,10 +440,11 @@ WKWebView 两条路径都要走一遍): 1. 「最近使用」某行 → 拖到「文件转换」→ 只弹出一个格式环,且文件是这一行。 2. 同一行 → 拖到「文件工具」→ 只弹出工具环。 -3. 图片行 → 拖到「文字识别」→ 打开编辑器并自动开始识别;非图片行 → 退回格式环。 -4. 同一行 → 拖到面板空白处 / 标题栏 / 列表本身 → 不开环、不执行,只提示需要拖到按钮上。 -5. 从访达拖文件到面板空白处 → 同样不执行;拖到任一按钮 → 执行该按钮的动作。 +3. 图片行 → 拖到「文字识别」→ 打开编辑器并自动开始识别;非图片行 → 不打开编辑器、不开环,只提示"文字识别仅支持图片格式"。 +4. 同一行 → 拖到面板空白处 / 标题栏 / 列表本身 → 不开环、不执行、**不出现任何提示浮层**。 +5. 从访达拖文件到面板空白处 → 同样不执行、不提示;拖到任一按钮 → 执行该按钮的动作。 6. 行拖出到访达/聊天窗口 → 仍是文件本体,没有被 Shift 自己吃掉。 +7. 两种拖法各拖一次 → 面板(`.home-drop`)在拖拽全程不缩放、不变色,标题文案不变;只有三个按钮在拖拽开始时同时亮起虚线候选态、松开后熄灭。 ## 修改这些路径时的统一回归命令 diff --git a/docs/RELEASE.md b/docs/RELEASE.md index ddd95b1..c5ecc79 100644 --- a/docs/RELEASE.md +++ b/docs/RELEASE.md @@ -12,8 +12,8 @@ An orphan branch named `releases` holds exactly one release: releases/ ├── shift-update.json ├── shift-update.sig -├── Shift-0.1.9-macOS-universal.dmg -└── Shift-Setup-0.1.9-win-x64.exe +├── Shift-0.1.10-macOS-universal.dmg +└── Shift-Setup-0.1.10-win-x64.exe ``` `shift-update.json` names the version and, per platform, the artifact file, its size in @@ -22,12 +22,12 @@ bytes and its SHA256: ```json { "schema": 1, - "version": "0.1.9", + "version": "0.1.10", "date": "2026-10-26", "notes": "", "artifacts": { - "macos": { "file": "Shift-0.1.9-macOS-universal.dmg", "sha256": "…", "size": 0 }, - "windows": { "file": "Shift-Setup-0.1.9-win-x64.exe", "sha256": "…", "size": 0 } + "macos": { "file": "Shift-0.1.10-macOS-universal.dmg", "sha256": "…", "size": 0 }, + "windows": { "file": "Shift-Setup-0.1.10-win-x64.exe", "sha256": "…", "size": 0 } } } ``` diff --git a/package.json b/package.json index e1dc9d5..6cc4938 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "shift", "private": true, - "version": "0.1.9", + "version": "0.1.10", "type": "module", "scripts": { "prepare:ocr": "bash scripts/prepare-ocr-assets.sh", diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 335bb85..23d0308 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -3899,7 +3899,7 @@ dependencies = [ [[package]] name = "shift" -version = "0.1.9" +version = "0.1.10" dependencies = [ "base64 0.22.1", "calamine", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index d8fd9f1..11c3866 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "shift" -version = "0.1.9" +version = "0.1.10" description = "A radial file utility with screenshot, recording and OCR." authors = ["Shift Contributors"] edition = "2021" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 402dbf3..ac63496 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "Shift", - "version": "0.1.9", + "version": "0.1.10", "identifier": "app.nex.shift", "build": { "beforeDevCommand": "pnpm dev",