Repository navigation
Declutter workshop UI and restore URL navigation - #4
Merged
Merged
Conversation
Simplify bilingual lesson copy, menu cards, mission details and component shelf styling while preserving the teaching boundaries. Add restorable home/menu/lesson URLs, safe progress resume and animation cancellation, chapter return navigation and accessible welcome focus. Keep regression coverage and include six full-viewport before/after captures. Co-Authored-By: Claude Code <noreply@anthropic.com>
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.
概述
这次 PR 在保留纸质、低饱和风格和 Three.js 工作台的前提下,减少重复文案、嵌套色块和描边,让选关、读目标、找组件更直接。同时补齐体验中发现的导航问题:路线和阶段没有 URL、刷新不能恢复菜单位置、关卡缺少直观返回入口,以及首页自动焦点产生多余边框。
不是更换主题或重写玩法:58 个关卡、关卡 ID / 顺序、计算模型、手工权重、验证答案、组件库存和解锁规则保持不变。静态部署方式不变,没有引入 UI / 路由框架、后端或新依赖。
完整改动
1. 选关页与工作台视觉减负
pack-scores默认展开,其余默认折叠;同关刷新 UI / 切语言保留当前展开状态,换关重新采用该关默认值。2. 中文与英文文案同步
3. URL、刷新与浏览器前后退
使用原生 hash 和 History API 统一首页、选关页、工作台状态,不需要服务器 fallback:
#home?lesson=wire#menu?lesson=encoder-layer&track=main&group=decoder&from=game#encoder-layerpopstate和hashchange并去重;Back / Forward 和刷新恢复页面、路线、阶段定位和当前关卡。#wire等链接;#pack-ffn归一化为#add-norm。明确的关卡链接直接进入工作台;空 URL 显示首页并使用保存的当前关卡。lesson表示当前加载的电路,track/group表示正在浏览的位置,二者可以不同;from=home|game决定显式关闭菜单的目的地。4. 返回入口与首页焦点
← 章节 / 编号返回选关按钮,复用原有入口,移除旁边重复的“关卡”按钮。5. 存档兼容和过期动画处理
resume语义:已完成序章刷新 / Back / Forward 后保留当前解和完成标记,不误归档并开新局。practiceRuns标记时的恢复逻辑。localStorage key 与数据格式不变,重置 / 恢复原解功能保留。runId失效并清理动画;迟到的结果、报告和完成弹窗不会盖住新页面。6. 测试、文档与资源
docs/images/README.md记录版本、尺寸和拍摄条件;没有提交.claude/、测试日志或临时脚本。Before / After:完整截图
Before 基线: 上游
main的a049375af9ea7ecad4758d35a66cdd40a9bb7f8f。After: 本 PR 提交
92b1558311e059d2ed7ec9ae38511305700f83ee。所有图片均为 macOS / Orca 内嵌浏览器实机、简体中文、1440 × 900,scale=1,直接保存完整视口,未裁切、未拼接、未加标注。滚动容器视口外的内容没有拼成假长图;首页装饰动画可能处于不同帧。以下不使用折叠块或并排缩略图,六张图片分别完整展示,点击可查看原图。
A. 首页:去掉重复提示,修复初始焦点外圈
两版都使用
wire,按 Tab 后刷新,以相同操作复现原先的自动焦点外圈;After 默认聚焦标题,键盘 Tab 仍可聚焦按钮。Before
After
B. 选关页:减少重复文案与嵌套边框
同为从首页进入、主线第一阶段、
wire当前关卡、无通关记录。After 将衔接说明放到折叠区,同一视口可更快扫读整组关卡。Before
After
C. 编码器工作台:组件名称、任务层级与返回选关
同为
encoder-layer、无已放置模块 / 连线、默认相机和缩放、默认组件架档位。After 的原理默认折叠,目标 / 进度 / 教学范围仍可见;桌面空间变化来自布局预留调整,而非人为改变相机来美化对比。Before
After
验证结果
npm test:335 / 335 通过,0 失败、0 跳过、0 取消(约 239 秒)。git diff --check、node --check game.js、node --check shell.js、node --check level-progress.js通过。I18n.missing为空;完整演示保留原有运行 / 暂停 / 视角交互。DOM / scene 测试使用 LinkeDOM 和 renderer stub,因此截图、键盘和实际点击另在浏览器验证;自动测试不等同于真实 GPU 光栅验证。原生全屏受测试宿主限制,已验证的是既有页面内展开 fallback,不宣称完成跨浏览器原生全屏验证。
Reviewer 建议复核路径
#wire或#encoder-layer,点击顶部← 章节 / 编号返回正确的选关位置。wire接好输入到出口,运行 / 暂停后返回选关,再回工作台 / 刷新,确认接线不丢失。🤖 Generated with Claude Code