Repository navigation
feat: 沉淀到 Obsidian 改安静默认,系统通知带「打开笔记」 - #26
Merged
freestylefly merged 8 commits intoOct 2, 2026
Merged
Conversation
FolderDelivery 的组装能力接成一等入口:KnowledgeDelivery 抽出共享组装 (聊天名.md + 附件/),folder 入口直接落入选定目录(默认 ~/Downloads)。 安静落盘没有屏幕证据,是唯一报告成功的投递——Toast 带「在访达中显示」。
分享扩展触发投递时 app 必然在后台,macOS 不渲染后台 app 的自绘窗口 (orderFrontRegardless 与强激活均实证无效);通知中心独立进程渲染, 不受前后台影响,且原生支持「在访达中显示」操作按钮。失败路径的 Toast 反馈保留不动。
投递成功即自动 obsidian://open 有两个问题:每次投递必然抢占前台 (分享扩展触发时用户注意力还在微信);打开与新文件的索引存在时序 竞争,是 freestylefly#17「找不到文件」的最可能根因。改与「沉淀到文件夹」同构 的形态:默认安静,系统通知带「打开笔记」按钮(点横幅同效)。 后台投递场景自绘 Toast 结构性不显示(freestylefly#21 已实证:macOS 不渲染 后台 app 的自绘窗口),系统通知是唯一同时满足「有屏幕反馈」和 「不抢前台」的形态。DeliveryNotifier 由此参数化为两个知识投递 入口共用——文件夹通知带「在访达中显示」行为不变,Obsidian 通知 带「打开笔记」,userInfo 分别携带 Finder 路径与 vault 名+相对 路径,回调侧按携带内容解码。
zhangweijian97
marked this pull request as draft
October 2, 2026 02:03
zhangweijian97
marked this pull request as ready for review
October 2, 2026 02:50
Contributor
Author
|
真机验收通过(2026-10-02,Apple Silicon):
(验证过程中系统专注模式会静默通知横幅,属系统层行为,与本改动无关。) |
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.
Closes #25
改了什么
「沉淀到 Obsidian」投递成功后不再自动唤起 Obsidian,改发系统通知,带「打开笔记」按钮(点横幅本体同效)。
ActionRunner.deliverToObsidian:移除投递成功后的自动obsidian://open,落盘记录后交DeliveryNotifier发通知;DeliveryNotifier:从「文件夹投递专用」参数化为两个知识投递入口共用——文件夹通知带「在访达中显示」行为不变,Obsidian 通知带「打开笔记」,各自独立的通知 category;userInfo 分别携带 Finder 绝对路径 / vault 名 + vault 相对路径,回调侧按通知实际携带的内容解码(外来或缺失数据一律解码为空,不做半件事);为什么
见 #25:自动唤起每次投递都抢占前台;打开与新文件索引的时序竞争是 #17「找不到文件」的最可能根因。安静 + 通知按钮让想看的人一键到,投递本身不打断人。
为什么必须是系统通知:分享扩展触发投递时 app 必然在后台,macOS 不渲染后台 app 的自绘窗口(#21 六轮实证);通知中心独立进程渲染,不受前后台影响,且原生支持操作按钮——后台投递场景下自绘 Toast 结构性走不通,系统通知是唯一同时满足「有屏幕反馈」和「不抢前台」的形态。
测试
swift test:152 tests, 0 failures(与 feat: 新增「沉淀到文件夹」分享入口(FolderDelivery 暴露为一等入口) #21 分支基线同数,本 PR 不改核心测试面);DeliveryNotifier独立测试(文件头配方单独编译运行):6 tests, 0 failures——新增 Obsidian userInfo 往返(CJK/空格/emoji 文件名)、保留字符(?#&)的obsidian://URL 构建、半套 userInfo 解码为空、双 category/action 标识互不混淆;swift Scripts/check-localizations.swift:passed(新增「打开笔记」双语声明);Scripts/check-release-config.sh:passed。真机链路
本机已按
make-app.sh+install-dev-build.sh构建部署并注册分享扩展;「投递→不唤起→通知出现→点『打开笔记』打开正确文件」的端到端验收随本 PR 附截图后补。