You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
graph LR
A["/"] --> B["TypingPage<br/>主练习页面"]
A --> C["/gallery"]
C --> D["GalleryPage<br/>词库选择"]
A --> E["/analysis"]
E --> F["AnalysisPage<br/>数据分析"]
A --> G["/error-book"]
G --> H["ErrorBook<br/>错词本"]
A --> I["/mobile"]
I --> J["MobilePage<br/>移动端提示"]
Loading
状态管理架构
采用 Jotai 原子化状态管理,分为两层:
graph TB
subgraph "全局状态 (src/store)"
A["currentDictIdAtom<br/>当前词库 ID"]
B["currentChapterAtom<br/>当前章节"]
C["pronunciationConfigAtom<br/>发音配置"]
D["keySoundsConfigAtom<br/>按键音效"]
E["isOpenDarkModeAtom<br/>暗黑模式"]
F["wordDictationConfigAtom<br/>听写模式"]
end
subgraph "页面状态 (Typing/store)"
G["TypingContext + useImmerReducer<br/>练习状态机"]
end
A --> G
B --> G
sequenceDiagram
participant U as 用户
participant T as TypingPage
participant S as Jotai Store
participant D as Dexie DB
participant A as 音频服务
U->>T: 选择词库/章节
T->>S: 更新 currentDictIdAtom
T->>T: 加载单词列表
U->>T: 开始输入
T->>T: dispatch(SET_IS_TYPING)
T->>A: 播放单词发音
U->>T: 输入字符
T->>T: 验证输入
T->>A: 播放按键音效
T->>T: 单词完成 → 下一个
T->>T: 章节完成
T->>D: 保存章节记录
T->>T: 显示结果页