Repository navigation
feat: 新增「沉淀到文件夹」分享入口(FolderDelivery 暴露为一等入口) - #21
Merged
freestylefly merged 6 commits intoOct 2, 2026
Merged
Conversation
FolderDelivery 的组装能力接成一等入口:KnowledgeDelivery 抽出共享组装 (聊天名.md + 附件/),folder 入口直接落入选定目录(默认 ~/Downloads)。 安静落盘没有屏幕证据,是唯一报告成功的投递——Toast 带「在访达中显示」。
分享扩展触发投递时 app 必然在后台,macOS 不渲染后台 app 的自绘窗口 (orderFrontRegardless 与强激活均实证无效);通知中心独立进程渲染, 不受前后台影响,且原生支持「在访达中显示」操作按钮。失败路径的 Toast 反馈保留不动。
This was referenced Oct 1, 2026
freestylefly
pushed a commit
that referenced
this pull request
Oct 2, 2026
投递成功即自动 obsidian://open 有两个问题:每次投递必然抢占前台 (分享扩展触发时用户注意力还在微信);打开与新文件的索引存在时序 竞争,是 #17「找不到文件」的最可能根因。改与「沉淀到文件夹」同构 的形态:默认安静,系统通知带「打开笔记」按钮(点横幅同效)。 后台投递场景自绘 Toast 结构性不显示(#21 已实证:macOS 不渲染 后台 app 的自绘窗口),系统通知是唯一同时满足「有屏幕反馈」和 「不抢前台」的形态。DeliveryNotifier 由此参数化为两个知识投递 入口共用——文件夹通知带「在访达中显示」行为不变,Obsidian 通知 带「打开笔记」,userInfo 分别携带 Finder 路径与 vault 名+相对 路径,回调侧按携带内容解码。
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 #19
动机
FolderDelivery.swift的文件夹投递能力(目录校验、暂存、重名编号、原子发布)已完整实现且有测试覆盖,但只被「沉淀到 Obsidian」入口内部调用——不用 Obsidian 的用户(或只想把聊天记录归档到「下载」、某个项目文件夹的人)没有直接的投递路径,目前只能借 Obsidian 入口指向普通目录来绕。实现
ShareAction加case folder+ 中英文 InfoPlist.strings;~/Downloads,存展开路径)+ 子文件夹设置——落盘层级与 Obsidian 入口完全同构:目标目录/微信流(或自定义子文件夹,支持多级)/聊天名.md + 附件/,同名笔记按标题合并去重,原始 ZIP 归档每批次保留;toast.show被调用、坐标定位正确、orderFrontRegardless与NSApp.activate均执行,窗口不出现(六次投递+双屏多时刻截屏判读);通知中心独立进程渲染不受前后台影响。失败路径的 Toast 反馈保留不动;.alert,拒绝则静默不发)。想请教的一个点:是否挪到设置向导(Onboarding)里一并授权更顺——首投体验就不会被授权弹窗打断?我可以在本 PR 里补这个调整,或按您偏好另开 PR。验证
swift test:152/0 全绿(含新增 ShareAction 解码、KnowledgeDelivery folder 落盘/自定义子文件夹/同名编号/obsidian 行为回归锁定、通知 userInfo 路径往返含中文空格 emoji);Scripts/check-localizations.swift、Scripts/check-release-config.sh(11 entries)通过;下载/微信流/聊天名.md + 附件/落盘 → 系统通知横幅 → 「在访达中显示」定位文件。设计说明
KnowledgeDelivery.write),两种目的地行为由构造保证同构,validateFolder语义跟随「用户配置的目录」;