Skip to content

fix: 界面文案本地化收口与窗口激活策略修复(v0.8.1) - #4

Merged
blackkcold merged 9 commits into
mainfrom
feat/history-grid-text-editor
Sep 15, 2026
Merged

blackkcold merged 9 commits into
mainfrom
feat/history-grid-text-editor

Conversation

@blackkcold

Copy link
Copy Markdown
Owner

变更说明

本地化收口 + 窗口激活策略修复,并为 v0.8.1 发布补齐 lint 与版本同步。

  • 界面文案统一跟随应用内语言:新增 AppLocalizationAppLanguage.resourceIdentifier,替换界面代码中的 NSLocalizedString / String(localized:);补齐 en / zh-Hans / ja / ko 四语言键,新增 scripts/check-localization.sh 校验。
  • 关闭最后一个窗口后 Dock 图标常驻修复:激活策略降级门改为只依赖在途 present(不再被 SwiftUI 保留的 NSWindow 钉死);降级时显式 deactivate()didBecomeKey 补齐晋升 regular 的对称路径;观察面收敛为 willClose / didBecomeKey / didMiniaturize / didDeminiaturize
  • 修复 CI lint 阻断Renderer 拆行消除 line_length;历史持久化拆分为 CaptureViewModel+History.swift,使 CaptureViewModel+Capture.swift 降到 500 行以内。这两处违规随 v0.8.0 经 tag 直接发布(release.yml 不做 lint)而在开 PR 后才暴露。
  • v0.8.1 发布准备:CHANGELOG 收敛为 [0.8.1] - 2026-09-15version.txtproject.yml MARKETING_VERSION 同步为 0.8.1;README 徽章更新;ARCHITECTURE 补充本地化与激活策略生命周期说明。

变更类型

  • fix Bug 修复
  • feat 新功能
  • refactor 重构
  • perf 性能优化
  • docs 文档
  • test 测试
  • chore 构建/CI/工具
  • release 发布

检查清单

  • PR 标题符合 Conventional Commits 格式:type(scope): description
  • CHANGELOG.md 已更新(如涉及用户可见变更)
  • 对应 Package 测试通过:./scripts/test.sh
  • Lint 通过:swift-format lint --recursive . + swiftlint lint --strict
  • 涉及权限:已在下方说明权限影响
  • 涉及新依赖:未引入新依赖

权限影响

无权限变更。激活策略(accessoryregular)仅影响 Dock 图标与应用菜单,不触碰屏幕录制等 TCC 权限、entitlements、Keychain 或网络。

测试证据

swiftlint lint --strict          → 0 violations, 0 serious (187 files), exit 0
AnnotationCore tests             → 20 tests / 2 suites passed
WindowLifecycleStateTests        → 10 tests / 2 suites passed
EditorInteractionTests           → 14 tests / 3 suites passed
scripts/check-localization.sh    → passed(四语言键一致/占位符一致/引用键存在)
xcodebuild -configuration Release → BUILD SUCCEEDED

v0.8.1 的 GitHub Release(tag 驱动 CI)已发布;本 PR 将同一批变更带入 main

杨昊燃 and others added 9 commits September 15, 2026 18:12
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
新增 AppLocalization 与 AppLanguage.resourceIdentifier,为 SwiftUI 环境之外的
Foundation 文本(toast、NSAlert、NSMenu、AppKit 面板、画布绘制)按应用语言解析
.lproj;替换界面代码中的 NSLocalizedString / String(localized:)。

补齐 en / zh-Hans / ja / ko 四语言键,并新增 scripts/check-localization.sh 校验
键一致、占位符一致、无冲突重复键与源码引用键存在。

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
激活策略降级门改为只依赖在途 present:SwiftUI 关闭 Window 后仍保留 NSWindow,
register() 可能在 willClose 之后重登记,使 registeredWindowIDs 永久非空而阻塞降级。

降级时在 setActivationPolicy(.accessory) 成功后显式 deactivate(),移除 active
状态下的 Dock 图标;重算合并到单个 runloop tick 并延后执行;didBecomeKey 补齐
晋升 regular 的对称路径;观察面收敛为 willClose / didBecomeKey / didMiniaturize /
didDeminiaturize。

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
CHANGELOG 将 [Unreleased] 收敛为 [0.8.1] - 2026-09-15,并记录窗口激活策略修复;
README 下载徽章更新为 v0.8.1;version.txt 与 project.yml 的 MARKETING_VERSION
同步为 0.8.1(修正此前 0.7.0 的漂移)。

Docs/ARCHITECTURE.md 补充「本地化」与「激活策略生命周期(accessory ↔ regular)」
两节,记录窗口降级门的约束与触发面,避免后人重复踩坑;project.yml 将
AppLanguage/AppLocalization 纳入 EditorInteractionTests 测试 target。

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Renderer 的 renderNodes 调用拆行,消除 line_length(123>120);将
CaptureViewModel 的历史持久化(saveToHistory/saveToHistoryAndWait/
scheduleHistorySave)拆分为 CaptureViewModel+History.swift,使
CaptureViewModel+Capture.swift 降到 500 行以内。

这两处违规随 v0.8.0 经 tag 直接发布(release.yml 不做 lint),在开 PR
触发 ci.yml 后才暴露。

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@blackkcold
blackkcold merged commit 2a76869 into main Sep 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant