Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
这个 PR 优化了用户引导功能,将原本单一的"排序/最后更新/操作"引导步骤拆分为三个独立的步骤,并添加了引导模式状态管理,在引导模式且无脚本时显示演示数据。
主要变更:
- 新增引导模式(guideMode)状态管理,用于控制演示数据的显示
- 拆分引导步骤,将操作指引细化为"排序"、"最后更新"和"操作"三个独立步骤
- 在脚本列表中添加 CSS 类名以支持新的引导目标定位
- 更新所有语言的翻译文件以适配新的引导步骤
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/pages/store/AppContext.tsx | 添加 guideMode 状态和 setGuideMode 方法到 App 上下文 |
| src/pages/options/routes/ScriptList/ScriptTable.tsx | 为表格和列添加 CSS 类名以支持引导功能 |
| src/pages/options/routes/ScriptList/ScriptCard.tsx | 添加引导模式演示数据逻辑,并为卡片元素添加 CSS 类名 |
| src/pages/components/layout/SiderGuide.tsx | 重构引导步骤,拆分为独立的排序、更新和操作步骤,并调整导航索引 |
| src/locales/*/translation.json | 更新多语言翻译,拆分引导步骤描述并添加"loading"翻译 |
Comments suppressed due to low confidence (2)
src/pages/components/layout/SiderGuide.tsx:30
- 首次使用时自动打开引导,但未调用
setGuideMode(true)。这会导致在自动触发引导时,引导模式状态不一致,演示数据不会显示。应该在第 30 行后添加setGuideMode(true),与手动调用open()方法保持一致。
localStorage.setItem("firstUse", "false");
// 隐身模式不打开引导
if (!chrome.extension.inIncognitoContext) {
setRun(true);
src/pages/options/routes/ScriptList/ScriptCard.tsx:396
sortableIds仍然使用原始的scriptList而不是list(包含演示数据的列表)。这会导致在引导模式下,拖拽功能无法正确处理演示数据项。应该改为list.map((s) => ({ id: s.uuid })),并将依赖项改为[list]。
const sortableIds = useMemo(() => scriptList.map((s) => ({ id: s.uuid })), [scriptList]);
Comment on lines
+373
to
+383
| { | ||
| uuid: "demo-uuid-1234", | ||
| name: "Demo Script", | ||
| namespace: "demo", | ||
| sort: 0, | ||
| createtime: Date.now(), | ||
| checktime: Date.now(), | ||
| metadata: {}, | ||
| type: SCRIPT_TYPE_NORMAL, | ||
| favorite: [{ match: "Example", icon: "", website: "https://example.com" }], | ||
| } as ScriptLoading, |
There was a problem hiding this comment.
演示数据缺少必需的 status 和 runStatus 字段。根据 Script 接口定义,这两个字段是必需的(非可选)。缺少这些字段可能导致 EnableSwitch 组件无法正常工作,因为它依赖 item.status 属性。建议添加:status: SCRIPT_STATUS_ENABLE 和 runStatus: SCRIPT_RUN_STATUS_COMPLETE。
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
cyfung1031
pushed a commit
to cyfung1031/scriptcat
that referenced
this pull request
Nov 2, 2025
* wip: 卡片视图引导 * 卡片模式引导 * 翻译 * Update src/locales/en-US/translation.json Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.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.
概述 Descriptions
调整新手指引,支持卡片模式
变更内容 Changes
截图 Screenshots