feat(reader): v0.7.0 阅读舒适度与公式/查找/编辑闭环 - #6
Merged
Merged
Conversation
- 字号/栏宽缩放:⌘+/⌘-/⌘0 调字号,⌥+/⌥- 调栏宽,偏好持久化; PDF 打印用 @media print 固定字号与 max-width,不受屏幕缩放影响。 - 文内查找 ⌘F:纯 JS TreeWalker 高亮,⌘G/⇧⌘G 上下一个、esc 关闭。 - KaTeX 数学公式:markdown-it-texmath + katex 离线打进同一 IIFE, 仅随包 woff2 字体;build 阶段剥离 katex.min.css 的 woff/ttf src。 - GB18030 编码探测:FileService.decode 增加 gb18030 分支,旧中文文档不再乱码。 - 冷启动恢复上次打开文件:lastOpenedPath 失效即清空,不在 reopen 恢复。 - 在编辑器中打开默认使用自带 TextEdit;读时检测富文本标记后弹轻提示, 建议在 TextEdit 用「格式→制作纯文本」清理。 - 新增 --encoding-selftest / --rich-text-selftest 无头自检子命令, ci-selftest 补编码/富文本 fixture 循环与公式 fixture。 - 版本号 0.7.0 / build 15。
String.Encoding.gb18030 便捷常量在 swift-corelibs-foundation 上不存在 (CI 编译报 "type 'String.Encoding' has no member 'gb18030'")。改用 CFStringConvertEncodingToNSStringEncoding(CFStringEncodings.GB_18030_2000) 拿到 NSStringEncoding rawValue 去构造。
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.
变更概览
v0.7.0 合并版本,聚焦阅读舒适度、技术文档完整度与编辑-阅读闭环。
新功能
⌘+/⌘-/⌘0调字号(85%–200%),⌥+/⌥-调栏宽(600–1100px),偏好持久化。PDF 打印用@media print固定字号与max-width,屏幕缩放不影响输出。⌘F打开、⌘G/⇧⌘G上下一个、esc关闭。纯 JS TreeWalker 高亮,不碰桥接,打印中退化为普通文本。markdown-it-texmath+katex离线打进同一 IIFE(行内$...$/ 块级$$...$$),随包仅 woff2 字体;build 阶段剥离katex.min.css的 woff/ttf src 避免 404。FileService.decode增加 gb18030 分支,旧中文文档不再乱码。openFile单文件入口,失效路径清空,不在 reopen 恢复。自检与门禁
--encoding-selftest <path> <expected>、--rich-text-selftest <path> <0|1>。ci-selftest.sh增加编码/富文本 fixture 循环,主 fixture 加公式子样。ascii.md、gb18030.utf8.src(CI 内 iconv 转 GB18030)、rich-text-marker.md。0.7.0/ build15(Info.plist 唯一真源)。体积
reader/dist/app.js:2844 KB → 3123 KB(+279 KB)。katex.min.css22 KB。.app约 4.5 MB,远低于 20 MB 门禁。硬约束保持
验证
readerjob:npm ci + test + buildmac-appjob:Universal 编译 + Bundle/IIFE/图标门禁--selftest/--pdf-selftest(含公式 fixture,≥2 页)--encoding-selftest(gb18030 / utf-8)--rich-text-selftest(1 / 0)