Deck
A modern, native, privacy-first clipboard OS for macOS
Release Notes v1.2.1
新增 / Added
- 数据库自救备份开关与手动备份
新增偏好项databaseAutoBackupEnabled并接入设置页;支持立即备份/删除入口,关闭时不再备份/恢复并清理.bak。
Added adatabaseAutoBackupEnabledpreference with Settings UI; supports manual backup/delete, and when disabled it stops backup/restore and cleans up.bak.
UserDefaultsManager.swift, SettingsView.swift, DeckSQLManager.swift
优化 / Improvements
- 历史记录分页懒加载 payload,降低滚动内存与解密开销
分页列表项默认保持轻量:仅在需要时才解密完整 payload,结合大小阈值与预览字段延迟加载。
Keeps paged history items lightweight: only decrypts full payload when needed, using size thresholds and previews to defer heavy loads.
DeckSQLManager.swift - 历史列表减少 COW 峰值(避免数组镜像)
当重排关闭/搜索/队列模式时保持orderedItems为空,避免共享缓冲区导致的 Copy-on-Write 峰值。
KeepsorderedItemsempty when reordering is off/search/queue to avoid shared buffers and Copy-on-Write spikes.
HistoryListView.swift - 上下文重排与模板保存减少拷贝并确保持久化完整数据
重排结果在单一数组中构建以避免额外拷贝;保存模板前会先 materialize 完整 payload,确保存储的是全量内容。
Builds reorder results in a single array to avoid extra copies; materializes full payload before saving templates to ensure full data is persisted.
ContextAwareService.swift, TemplateLibraryService.swift - 数据库队列 QoS 分层与后台化搜索排序
将交互查询与后台维护拆分到不同队列(交互/后台),并将 in-memory fuzzy ranking 移出主线程以减少卡顿。
Splits DB work into interactive vs background queues and moves in-memory fuzzy ranking off the main actor to reduce UI stalls.
DeckDataStore.swift, DeckSQLManager.swift - 搜索性能:候选扩展、扫描上限与可取消的 in-memory 路径
mixed 模式优先 exact 命中,无命中时再触发模糊回退;加入 LIKE 候选扩展、scanLimit上限与真正的 Task 取消;循环内增加协作取消检查。
Search now prefers exact hits in mixed mode and only falls back to fuzzy when needed; adds LIKE-based candidate expansion, ascanLimitcap, true cancellation for in-memory search, and cooperative cancellation checks in loops.
DeckDataStore.swift, SearchService.swift - CloudSync/Steganography/OCR 节能优化(不改热键行为)
CloudSync 批处理延迟加大并对低电量更保守;stego 解码仅在更可能成功时运行;OCR 增加背压/去抖、低电量跳过与超大图片尺寸上限。
Energy optimizations for CloudSync, steganography, and OCR: larger/low-power-aware batching, conditional stego decode, and OCR back-pressure/debounce with Low Power Mode skip and size caps for huge images.
CloudSyncService.swift, ClipboardService.swift, OCRService.swift - 文本/正则与缓存:降低 churn 与重复编译
引入 O(1) LRU、NSCache正则缓存与敏感内容匹配的小型 regex cache,减少频繁分配与重复编译。
Adds O(1) LRU,NSCacheregex caching, and a small regex cache for sensitive-content matching to reduce churn and repeated compilation.
SmartContentCache.swift, SmartTextService.swift, ClipboardService.swift - IO/CPU 热点优化(采样、Blob、IDE 锚点、分页等)
批量写入采样、序列化 Blob IO、OCR 热/低功耗降级、IDE 锚点 BFS 队列去 O(n)、分页改为 on-appear 触发等。
Reduces IO/CPU hotspots: batched sample saves, serialized blob IO, thermal/low-power OCR downsampling, BFS queue fix, and on-appear pagination.
DiagnosticsMemorySampler.swift, BlobStorage.swift, OCRService.swift, IDEAnchorService.swift, HistoryListView.swift - 面板与 macOS 26 视觉:原生玻璃容器与更一致的圆角
macOS 26 使用NSGlassEffectView作为主容器(.regular),并统一cornerRadius = Const.panelCornerRadius;SwiftUI 背景改为Color.clear,顶部间距改用Const.panelTopPadding,搜索框圆角使用Const.searchFieldRadius。
On macOS 26, usesNSGlassEffectView(.regular) as the main container withcornerRadius = Const.panelCornerRadius; SwiftUI background isColor.clear, top padding usesConst.panelTopPadding, and the search field radius usesConst.searchFieldRadius.
MainViewController.swift, DeckContentView.swift, TopBarView.swift, Constants.swift - 面板打开优先级:交互查询更快、后台维护更省电
将串行 DB 队列 QoS 提回.userInitiated,并在后台维护路径中强制.utility,避免交互查询被整体降级或排在维护任务之后。
Raises the serial DB queue QoS back to.userInitiatedwhile enforcing.utilityfor background maintenance, preventing interactive queries from being deprioritized.
DeckSQLManager.swift
变更 / Changes
- macOS 26 视图层级与裁切策略调整
HostingView改为放入glass.contentView;在 26+ 上对view也设置圆角与cornerCurve = .continuous做裁切;窗口阴影在 macOS 26 开启(<26 维持关闭)。
Adjusts the macOS 26 view hierarchy and clipping: embeds theHostingViewintoglass.contentView, applies rounded clipping withcornerCurve = .continuouson 26+, and enables window shadow on macOS 26 (kept disabled on <26).
MainViewController.swift, MainWindowController.swift - 常量更新:面板尺寸与圆角/间距参数
新增panelCornerRadius = 26、panelTopPadding = Const.space12 + 5、searchFieldRadius = 12;窗口高度调整为305;panelOverlay在 macOS 26 的配色变轻(但 26 上不再由DeckContentView使用)。
Updates constants: addspanelCornerRadius = 26,panelTopPadding = Const.space12 + 5,searchFieldRadius = 12; adjusts window height to305; and lightenspanelOverlaycolors on macOS 26 (though it’s no longer used byDeckContentViewon 26).
Constants.swift, DeckContentView.swift - 热键与队列行为回退为 CGEventTap
将热键监听与 paste-queue 改回此前的基于CGEventTap的行为,确保Cmd+P与队列模式恢复正常。
Reverts hotkey listening and paste-queue behavior back to the previousCGEventTap-based implementation soCmd+Pand queue mode work again.
HotKeyManager.swift, PasteQueueService.swift - 更新后清理与启动提示:按清理结果触发
启动时清理更新残留并移除/Applications下.Deck.app.old.*备份(不进废纸篓),并使用清理结果决定是否触发 8 秒设置窗口提示。
Cleans update artifacts on launch and removes.Deck.app.old.*backups in/Applications(no Trash), and uses the cleanup result to decide whether to show the 8-second Settings window prompt.
AppDelegate.swift, UpdateService.swift - 隐私设置:移除手动上传入口并优化 stego key 编辑交互
移除“手动上传/上传一次”动作,分析区仅保留开关;stego passphrase 输入改为更接近真实输入框的样式,保存/清除状态更清晰,并支持回车提交保存。
Removes the manual analytics upload action so analytics only has the toggle; restyles stego passphrase input with clearer save/clear states and Enter-to-save flow.
PrivacySettingsView.swift - stego key 掩码与长度持久化
掩码按真实长度渲染并右对齐;保存/清除时持久化长度,使 UI 一致反映当前状态。
Renders the stego key mask with the exact length and right alignment; persists the length on save/clear so the UI stays consistent.
UserDefaultsManager.swift, SteganographyKeyStore.swift, PrivacySettingsView.swift
修复 / Fixes
- DB 队列初始化与编译问题修复
将dbQueue/dbBackgroundQueue改为lazy,避免属性初始化期间触发self;清理未使用变量并修复相关编译报错。
Fixes build issues by makingdbQueue/dbBackgroundQueuelazyto avoid touchingselfduring property initialization and removing an unused variable.
DeckSQLManager.swift - 键盘 unicode 读取调用签名修复
为keyboardGetUnicodeString调用补齐maxStringLength:label,修复编译错误。
Fixes thekeyboardGetUnicodeStringcall by adding themaxStringLength:label.
CursorAssistantService.swift - SwiftUI 更新周期警告与优先级反转缓解
避免在 SwiftUI 更新期间进行状态突变,程序性文本更新被忽略;焦点/失焦变更延迟到异步调度,降低告警与潜在阻塞。
Avoids state mutations during SwiftUI updates; ignores programmatic text updates and defers focus/blur asynchronously to reduce update warnings and priority inversions.
TopBarView.swift - 主线程读取 UserDefaults 的 Actor 归属修复
将sharedKeyMaskLength标注为@MainActor,以在主线程读取DeckUserDefaults.stegoPassphraseLength。
MarkssharedKeyMaskLengthas@MainActorso it readsDeckUserDefaults.stegoPassphraseLengthon the main actor.
SteganographyKeyStore.swift
说明 / Notes
- BlobStorage 目录保持动态以支持运行时切换
BlobStorage.swift的 base directory 继续保持动态,以确保运行时切换存储位置安全;如需补丁里的 lazy cache,可新增失效钩子。
KeepsBlobStorage.swiftbase directory dynamic so runtime storage-location switches remain safe; if you want the patch’s lazy cache, add an invalidation hook.
BlobStorage.swift - Carbon 热键的取舍说明(已回退为 CGEventTap)
Carbon 方案会全局占用Cmd+Shift+V;如未来恢复 Carbon 并需要队列关闭时透传,可做条件注册或合成透传逻辑。
Carbon hotkeys reserveCmd+Shift+Vglobally; if Carbon returns and you need pass-through when queue mode is off, conditional registration or synthetic pass-through can be added.
PasteQueueService.swift - 更新后设置窗口触发条件说明
更新后窗口仍仅在内置更新器设置了deck.pendingUpdateVersion时触发,手动 DMG 更新不会触发。
The post-update window still only shows when the built-in updater setsdeck.pendingUpdateVersion; manual DMG updates won’t trigger it.
AppDelegate.swift, UpdateService.swift
兼容性与行为说明 / Compatibility & Behavior Notes
- macOS 26 的玻璃效果由 AppKit 承担
macOS 26 上DeckContentView不再在 SwiftUI 内绘制玻璃/叠加层(背景为Color.clear),玻璃与圆角裁切交由NSGlassEffectView容器处理;<26 仍使用VisualEffectBackground + panelOverlay。
On macOS 26,DeckContentViewno longer draws glass/overlay in SwiftUI (Color.clearbackground); glass and rounded clipping are handled by theNSGlassEffectViewcontainer, while <26 still usesVisualEffectBackground + panelOverlay.
DeckContentView.swift, MainViewController.swift
升级建议 / Upgrade Notes
- 建议所有用户升级到 v1.2.1
本版本聚焦滚动/分页/搜索/DB 交互性能与能耗优化,并包含 macOS 26 视觉容器调整与多处稳定性修复。
Recommended for all users: this release focuses on scroll/pagination/search/DB performance and energy improvements, includes macOS 26 container updates, and ships multiple stability fixes.