Repository navigation
Conversation
把安装依赖从各 workflow 里拆出来,PR 合入前先拦住类型/构建错误,生产发布不再整仓 force push。 复合 action - 新增 .github/actions/setup-node-pnpm:pnpm 9 + Node 22 + frozen-lockfile - lockfileVersion 9.0 必须用 pnpm >= 9,继续用 8 会直接忽略 lockfile CI - 新增 ci.yml:仅在指向 main 的 PR 上跑 pnpm build(含 type-check) - 同一 PR 连续推送时取消旧构建,超时 10 分钟,contents: read 生产发布 - build.yml 增加 workflow_dispatch,不必再空 commit 重发 - deploy-prod 串行排队且不取消进行中的任务,避免两次 rsync 交叉 - checkout@v5,部署目标可用 SERVER_TARGET,缺省仍走 /data/typing - build 分支改为 peaceiris/actions-gh-pages orphan 发布 dist,并带上 static.json 做 SPA fallback
各打字模式的胶囊条、标点交互和快捷键以前各写各的,英文页还会把字距套到整页把工具栏挤窄。抽成 TypingToolbar 后字号间距隔离打字字体,中英文行为对齐。 共用工具栏 - 新增 TypingToolbar / TypingChip / TypingToolbarIcon,字号 14px、间距、圆角写死在组件里 - 使用界面字体,不继承 main 上的打字字体,避免英文模式胶囊被挤窄 - 限时、计时、自定义、键盘测试、英文页全部改用这套组件 - 工具栏样式从 typing.scss 迁走,App 聚焦态仍按 .y-typing-toolbar 淡出 标点开关 - 文案统一成「@ 标点」,放在工具栏最左;高亮表示当前文稿带标点 - 点击只就地切换标点/空格,不换篇、不重开计时,并拉回输入焦点 - 限时模式把该开关从设置菜单拿到工具栏,和其它模式同一位置 快捷键与提示 - Tab 换一篇(输入框内外都生效,弹窗打开或自定义文稿确认后除外) - Esc 结束本次输入;限时模式补上结束并出结果 - 底部提示共用「Tab 换一篇文稿。Esc 可随时结束输入。」 舞台 - 打字区高度 280px 拉到 420px,英文窗口一并对齐 - 开始输入后页头页脚只淡出不抽高度,避免垂直居中把打字区往下推
/words 从词/成语占位改成 Monkeytype 风格的英文词流:空格确认单词,可选标点,按标准 5 字符/词计 WPM。 词流与输入 - 文稿来自 Pride and Prejudice、Alice in Wonderland 等 Project Gutenberg 公版作品 - 按篇输出连贯词,用尽后再洗牌续篇;标点开关只重分词、不换篇 - 默认带标点;字母级着色(正确/错误/多打/漏打),光标按当前字母实测位置摆放 - 空格提交当前词,当前词为空时退格回到上一个打错的词;Tab 换一篇,Esc 结束 - 窗口 420px 约 7 行,预填 160 词并滚动保持当前行附近 结果与导航 - 英文 WPM = 正确字符 ÷ 5 ÷ 分钟;图表采样同样按 5 字符/词 - 回放按字母逐个出现,空格计入字符,避免整词蹦出或粘成一团 - 导航露出「英文打字」;声明页补充公版文稿来源
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.
背景
英文打字还是词/成语占位,和中文模式的工具栏、标点开关、快捷键也不统一;开始输入后页头页脚抽高度会把舞台往下推。另外 CI 还没拦住 PR 构建错误,生产发布会 force push 整仓。
改动
分 3 个 commit:
ci: 抽取 Node/pnpm 复合 action 并补齐 PR 构建与生产发布
.github/actions/setup-node-pnpm(pnpm 9 + Node 22 + frozen-lockfile)ci.yml:指向 main 的 PR 先跑pnpm builddist,去掉整仓 force push;deploy-prod串行排队feat(typing): 抽取共用工具栏并统一标点开关、快捷键与舞台高度
TypingToolbar/TypingChip/TypingToolbarIcon,限时、计时、自定义、键盘测试、英文页共用feat(english): 用公版文学词流重做英文打字模式
验证建议
pnpm build