Repository navigation
feat: 界面文字大小五档设置——全量界面缩放+编辑器正文跟手 - #279
Merged
Merged
Conversation
taekchef
force-pushed
the
codex/text-scaling
branch
2 times, most recently
from
August 21, 2026 21:48
c788168 to
a4c9ec6
Compare
taekchef
force-pushed
the
codex/text-scaling
branch
from
August 21, 2026 22:58
86f4846 to
4e4888d
Compare
taekchef
added a commit
that referenced
this pull request
Aug 21, 2026
新增引擎事件/账本/循环/工具注册表/凭证文件/OpenAI Chat Completions 族, 以及 12 工具 Swift 实现。默认仍不接入 WorkspaceStore(#279 占用中)。 基线:12 工具契约、Pi 会话行为、tutor 映射、DeepSeek 夹具 13 条。 CLI 三闭环:--native-engine-smoke(脚本)与 --native-deepseek-smoke(真连通)。 NativeAgentSelfChecks 已落文件,挂载等待 SelfCheck main 释放。
taekchef
marked this pull request as ready for review
August 22, 2026 00:06
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.
背景(体检挂账项:字体缩放)
全仓 341 处固定字号、代码无排版 token、"八级层级"只存在于设计文档;网页编辑器 CSS 固定像素不随界面缩放。
方案
采用 App 内五档文字大小(紧凑 90% / 标准 100% / 大 115% / 特大 135% / 最大 160%),而非跟随系统 Dynamic Type——可对照自家"200% 实测"标准验收,且同一倍率可传导进 WKWebView,SwiftUI 界面与笔记正文一起变。
改动
WeiBeiTypography.TextScale五档枚举 +\.weiBeiTextScale环境键 +.weiBeiText/.weiBeiBrandFont/.weiBeiMonoFont缩放修饰符(brandFont/monoFont 原函数保留兼容)。.font(.system(size:))→.weiBeiText(...)(括号平衡解析器机械替换 + git diff 逐行核查 weight/design 零丢失);品牌/等宽字体调用同步迁移。calc(px * var(--weibei-text-scale)),新增 setTextScale 桥命令——页面加载前注入首paint值,改档实时下发,笔记正文跟手。共享核心文件占用
Sources/WeiBei/Stores/WorkspaceStore.swift:净增长 +0(九处注释措辞压缩对冲)Sources/WeiBeiCore/WorkspaceModels.swift:快照字段 1 个Package.swift/script//.github/未动验证
swift build✅;swift run WeiBeiSelfCheck✅(含新增档位持久化往返场景);swift run WeiBeiWebEditorCheck✅npm run typecheck:editor✅;npm run test:editor17/17 ✅;产物已重建携带 setTextScaleswift test本机无 Xcode,由 CI 执行:HEAD4e4888d「快速编译与核心自检」job 全绿(含数据安全测试子集、编辑器自检、Pi 终止语义自检)✅.weiBeiText自递归,现已改为委托独立 Modifier 结构体,无自递归冒烟(用户验收)
设置 →「界面文字大小」依次切五档(紧凑/标准/大/特大/最大):侧栏、课程列表、聊天、设置等界面文字应立即整体缩放;打开一篇笔记,正文应按同倍率缩放且切换跟手;切回「标准」应与升级前视觉一致;重启 App 后档位保持。
已知边界
极大档(135%/160%)下个别密集面板可能局部拥挤;布局自适应按 accessibility.md 承诺另立任务。