feat: 增加已读历史记录能力,并支持区分已读文本,允许设置跳过是仅已读文本还是全部文本#930
feat: 增加已读历史记录能力,并支持区分已读文本,允许设置跳过是仅已读文本还是全部文本#930ChangeSuger wants to merge 5 commits intoOpenWebGAL:devfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request implements a read history system to track viewed text and introduces a skip mode to toggle between skipping only read content or all content. Key additions include a ReadHistoryManager using bitsets for efficient storage and UI updates to visually distinguish read text. Feedback focuses on addressing potential out-of-bounds errors in bitset management, preventing stack overflow issues when encoding large history data, and adding guard clauses for empty scenario names.
| const scenarioName = this.sceneManager.sceneData.currentScene.sceneName; | ||
| const index = this.sceneManager.sceneData.currentSentenceId; |
There was a problem hiding this comment.
If scenarioName is an empty string (which can happen during initialization or transition), the manager will attempt to record history for an invalid key. It's better to add a guard clause.
| const scenarioName = this.sceneManager.sceneData.currentScene.sceneName; | |
| const index = this.sceneManager.sceneData.currentSentenceId; | |
| const scenarioName = this.sceneManager.sceneData.currentScene.sceneName; | |
| if (!scenarioName) return; | |
| const index = this.sceneManager.sceneData.currentSentenceId; |
- 解决构建失败问题 - 兼容脚本变更可能导致的索引溢出问题
基于目前 WebGal 的 Scene 记录逻辑而设计的已读历史记录功能,基于 sceneName 与 currentSentenceId 进行已读信息记录以及判断。该已读历史记录功能以单个 Scene 的脚本为单元进行已读历史记录,并使用 Uint8Array 来减少存储体积。
在已读历史记录功能及基础上,实现了以下能力: